Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ricos-content

Package Overview
Dependencies
Maintainers
1
Versions
936
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ricos-content - npm Package Compare versions

Comparing version 8.4.8 to 8.5.0

2

dist/cjs/index.js

@@ -15,3 +15,3 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lodash=require("lodash"),__assign=function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var _a,toVersion=function(versionString){return versionString.split(".").map((function(literal){var numeric=parseInt(literal,10);return lodash.isNaN(numeric)?0:numeric})).slice(0,3)},compareVersions=function(left,right){var leftVersion=toVersion(left),rightVersion=toVersion(right);return leftVersion.map((function(left,idx){return Math.sign(left-rightVersion[idx])})).find((function(num){return 0!==num}))||0},evaluations={"<":function(left,right){return compareVersions(left,right)<0},">":function(left,right){return compareVersions(left,right)>0},"=":function(left,right){return 0===compareVersions(left,right)},"<=":function(left,right){return compareVersions(left,right)<=0},">=":function(left,right){return compareVersions(left,right)>=0}},Version={lessThan:function(left,right){return compareVersions(left,right)<0},greaterThan:function(left,right){return compareVersions(left,right)>0},equal:function(left,right){return 0===compareVersions(left,right)},compare:compareVersions,currentVersion:"8.4.8",evaluate:function(tested,semver){var _a=/([<>=]{0,2})(.*)/gm.exec(semver),operator=_a[1],version=_a[2];return evaluations[operator||"="](tested,version)}},HEADER_BLOCK=Object.freeze({ONE:"header-one",TWO:"header-two",THREE:"header-three",FOUR:"header-four",FIVE:"header-five",SIX:"header-six"}),BLOCK_TYPES=Object.freeze(["header-one","header-two","header-three","header-four","header-five","header-six","unordered-list-item","ordered-list-item","blockquote","atomic","code-block","unstyled"]),GALLERY_TYPE="wix-draft-plugin-gallery",IMAGE_TYPE="wix-draft-plugin-image",INLINE_HEADER_ONE="inline-header-one",INLINE_HEADER_TWO="inline-header-two",INLINE_HEADER_THREE="inline-header-three",INLINE_HEADER_FOUR="inline-header-four",INLINE_HEADER_FIVE="inline-header-five",INLINE_HEADER_SIX="inline-header-six",INLINE_HEADERS=[INLINE_HEADER_THREE,INLINE_HEADER_TWO,INLINE_HEADER_ONE],INLINE_HEADER_TO_BLOCK=((_a={})[INLINE_HEADER_ONE]=HEADER_BLOCK.ONE,_a[INLINE_HEADER_TWO]=HEADER_BLOCK.TWO,_a[INLINE_HEADER_THREE]=HEADER_BLOCK.THREE,_a[INLINE_HEADER_FOUR]=HEADER_BLOCK.FOUR,_a[INLINE_HEADER_FIVE]=HEADER_BLOCK.FIVE,_a[INLINE_HEADER_SIX]=HEADER_BLOCK.SIX,_a),removeInlineHeaderRanges=function(block){var inlineHeaderRanges=getInlineHeaderRanges(block.inlineStyleRanges||[]);return lodash.isEmpty(inlineHeaderRanges)?block:__assign(__assign({},block),{type:getBlockType(block.type,block.text,inlineHeaderRanges),inlineStyleRanges:omitInlineHeaderRanges(block.inlineStyleRanges||[])})},isInlineHeaderRange=function(range){return lodash.includes(INLINE_HEADERS,range.style)},omitInlineHeaderRanges=function(ranges){return ranges.filter(lodash.negate(isInlineHeaderRange))},getInlineHeaderRanges=function(ranges){return ranges.filter(isInlineHeaderRange)},getBlockType=function(type,text,inlineHeaderRanges){return"unstyled"===type&&shouldConvertToHeaderBlock(text,inlineHeaderRanges)?getBlockHeaderType(inlineHeaderRanges):type},shouldConvertToHeaderBlock=function(text,inlineStyleRanges){return 0===lodash.sortBy(inlineStyleRanges,"offset").map((function(range){return[range.offset,range.offset+range.length]})).reduce((function(ranges,range){var lastRange=lodash.last(ranges);return lastRange&&isOverlapping(lastRange,range)?__spreadArrays(lodash.initial(ranges),[mergeOverlappingRanges(lastRange,range)]):__spreadArrays(ranges,[range])}),[]).reverse().reduce((function(text,range){return""+text.slice(0,range[0])+text.slice(range[1])}),text).replace(/\s/g,"").length},isInRange=function(number,range){return range[0]<=number&&number<=range[1]},isOverlapping=function(rangeA,rangeB){return rangeA&&rangeB&&(isInRange(rangeB[0],rangeA)||isInRange(rangeB[1],rangeA))},mergeOverlappingRanges=function(rangeA,rangeB){return[Math.min(rangeA[0],rangeB[0]),Math.max(rangeA[1],rangeB[1])]},getBlockHeaderType=function(inlineHeaderRanges){var smallestInlineHeader=lodash.intersection(INLINE_HEADERS,inlineHeaderRanges.map((function(range){return range.style})))[0];return INLINE_HEADER_TO_BLOCK[smallestInlineHeader]},addInlineStyleRanges=function(block){return __assign(__assign({},block),{inlineStyleRanges:block.inlineStyleRanges||[]})},regex=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,regex$1=/[\0-\x1F\x7F-\x9F]/,regex$2=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,regex$3=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;function assign(obj){var sources=Array.prototype.slice.call(arguments,1);return sources.forEach((function(source){source&&Object.keys(source).forEach((function(key){obj[key]=source[key]}))})),obj}function _class(obj){return Object.prototype.toString.call(obj)}function isFunction(obj){return"[object Function]"===_class(obj)}function escapeRE(str){return str.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var defaultOptions={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var defaultSchemas={"http:":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.http||(self.re.http=new RegExp("^\\/\\/"+self.re.src_auth+self.re.src_host_port_strict+self.re.src_path,"i")),self.re.http.test(tail)?tail.match(self.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.no_http||(self.re.no_http=new RegExp("^"+self.re.src_auth+"(?:localhost|(?:(?:"+self.re.src_domain+")\\.)+"+self.re.src_domain_root+")"+self.re.src_port+self.re.src_host_terminator+self.re.src_path,"i")),self.re.no_http.test(tail)?pos>=3&&":"===text[pos-3]||pos>=3&&"/"===text[pos-3]?0:tail.match(self.re.no_http)[0].length:0}},"mailto:":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.mailto||(self.re.mailto=new RegExp("^"+self.re.src_email_name+"@"+self.re.src_host_strict,"i")),self.re.mailto.test(tail)?tail.match(self.re.mailto)[0].length:0}}},tlds_default="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function compile(self){var re$1=self.re=function(opts){var re={};re.src_Any=regex.source,re.src_Cc=regex$1.source,re.src_Z=regex$2.source,re.src_P=regex$3.source,re.src_ZPCc=[re.src_Z,re.src_P,re.src_Cc].join("|"),re.src_ZCc=[re.src_Z,re.src_Cc].join("|");return re.src_pseudo_letter="(?:(?![><|]|"+re.src_ZPCc+")"+re.src_Any+")",re.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",re.src_auth="(?:(?:(?!"+re.src_ZCc+"|[@/\\[\\]()]).)+@)?",re.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",re.src_host_terminator="(?=$|[><|]|"+re.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+re.src_ZPCc+"))",re.src_path="(?:[/?#](?:(?!"+re.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+re.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+re.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+re.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+re.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+re.src_ZCc+"|[']).)+\\'|\\'(?="+re.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+re.src_ZCc+"|[.]).|"+(opts&&opts["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+re.src_ZCc+").|\\!(?!"+re.src_ZCc+"|[!]).|\\?(?!"+re.src_ZCc+"|[?]).)+|\\/)?",re.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',re.src_xn="xn--[a-z0-9\\-]{1,59}",re.src_domain_root="(?:"+re.src_xn+"|"+re.src_pseudo_letter+"{1,63})",re.src_domain="(?:"+re.src_xn+"|(?:"+re.src_pseudo_letter+")|(?:"+re.src_pseudo_letter+"(?:-|"+re.src_pseudo_letter+"){0,61}"+re.src_pseudo_letter+"))",re.src_host="(?:(?:(?:(?:"+re.src_domain+")\\.)*"+re.src_domain+"))",re.tpl_host_fuzzy="(?:"+re.src_ip4+"|(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%)))",re.tpl_host_no_ip_fuzzy="(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%))",re.src_host_strict=re.src_host+re.src_host_terminator,re.tpl_host_fuzzy_strict=re.tpl_host_fuzzy+re.src_host_terminator,re.src_host_port_strict=re.src_host+re.src_port+re.src_host_terminator,re.tpl_host_port_fuzzy_strict=re.tpl_host_fuzzy+re.src_port+re.src_host_terminator,re.tpl_host_port_no_ip_fuzzy_strict=re.tpl_host_no_ip_fuzzy+re.src_port+re.src_host_terminator,re.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+re.src_ZPCc+"|>|$))",re.tpl_email_fuzzy='(^|[><|]|"|\\(|'+re.src_ZCc+")("+re.src_email_name+"@"+re.tpl_host_fuzzy_strict+")",re.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+re.src_ZPCc+"))((?![$+<=>^`||])"+re.tpl_host_port_fuzzy_strict+re.src_path+")",re.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+re.src_ZPCc+"))((?![$+<=>^`||])"+re.tpl_host_port_no_ip_fuzzy_strict+re.src_path+")",re}(self.__opts__),tlds=self.__tlds__.slice();function untpl(tpl){return tpl.replace("%TLDS%",re$1.src_tlds)}self.onCompile(),self.__tlds_replaced__||tlds.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),tlds.push(re$1.src_xn),re$1.src_tlds=tlds.join("|"),re$1.email_fuzzy=RegExp(untpl(re$1.tpl_email_fuzzy),"i"),re$1.link_fuzzy=RegExp(untpl(re$1.tpl_link_fuzzy),"i"),re$1.link_no_ip_fuzzy=RegExp(untpl(re$1.tpl_link_no_ip_fuzzy),"i"),re$1.host_fuzzy_test=RegExp(untpl(re$1.tpl_host_fuzzy_test),"i");var aliases=[];function schemaError(name,val){throw new Error('(LinkifyIt) Invalid schema "'+name+'": '+val)}self.__compiled__={},Object.keys(self.__schemas__).forEach((function(name){var val=self.__schemas__[name];if(null!==val){var compiled={validate:null,link:null};if(self.__compiled__[name]=compiled,"[object Object]"===_class(val))return!function(obj){return"[object RegExp]"===_class(obj)}(val.validate)?isFunction(val.validate)?compiled.validate=val.validate:schemaError(name,val):compiled.validate=function(re){return function(text,pos){var tail=text.slice(pos);return re.test(tail)?tail.match(re)[0].length:0}}(val.validate),void(isFunction(val.normalize)?compiled.normalize=val.normalize:val.normalize?schemaError(name,val):compiled.normalize=function(match,self){self.normalize(match)});!function(obj){return"[object String]"===_class(obj)}(val)?schemaError(name,val):aliases.push(name)}})),aliases.forEach((function(alias){self.__compiled__[self.__schemas__[alias]]&&(self.__compiled__[alias].validate=self.__compiled__[self.__schemas__[alias]].validate,self.__compiled__[alias].normalize=self.__compiled__[self.__schemas__[alias]].normalize)})),self.__compiled__[""]={validate:null,normalize:function(match,self){self.normalize(match)}};var slist=Object.keys(self.__compiled__).filter((function(name){return name.length>0&&self.__compiled__[name]})).map(escapeRE).join("|");self.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+re$1.src_ZPCc+"))("+slist+")","i"),self.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+re$1.src_ZPCc+"))("+slist+")","ig"),self.re.pretest=RegExp("("+self.re.schema_test.source+")|("+self.re.host_fuzzy_test.source+")|@","i"),function(self){self.__index__=-1,self.__text_cache__=""}(self)}function Match(self,shift){var start=self.__index__,end=self.__last_index__,text=self.__text_cache__.slice(start,end);this.schema=self.__schema__.toLowerCase(),this.index=start+shift,this.lastIndex=end+shift,this.raw=text,this.text=text,this.url=text}function createMatch(self,shift){var match=new Match(self,shift);return self.__compiled__[match.schema].normalize(match,self),match}function LinkifyIt(schemas,options){if(!(this instanceof LinkifyIt))return new LinkifyIt(schemas,options);var obj;options||(obj=schemas,Object.keys(obj||{}).reduce((function(acc,k){return acc||defaultOptions.hasOwnProperty(k)}),!1)&&(options=schemas,schemas={})),this.__opts__=assign({},defaultOptions,options),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=assign({},defaultSchemas,schemas),this.__compiled__={},this.__tlds__=tlds_default,this.__tlds_replaced__=!1,this.re={},compile(this)}LinkifyIt.prototype.add=function(schema,definition){return this.__schemas__[schema]=definition,compile(this),this},LinkifyIt.prototype.set=function(options){return this.__opts__=assign(this.__opts__,options),this},LinkifyIt.prototype.test=function(text){if(this.__text_cache__=text,this.__index__=-1,!text.length)return!1;var m,ml,me,len,shift,next,re,tld_pos;if(this.re.schema_test.test(text))for((re=this.re.schema_search).lastIndex=0;null!==(m=re.exec(text));)if(len=this.testSchemaAt(text,m[2],re.lastIndex)){this.__schema__=m[2],this.__index__=m.index+m[1].length,this.__last_index__=m.index+m[0].length+len;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(tld_pos=text.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||tld_pos<this.__index__)&&null!==(ml=text.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(shift=ml.index+ml[1].length,(this.__index__<0||shift<this.__index__)&&(this.__schema__="",this.__index__=shift,this.__last_index__=ml.index+ml[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&text.indexOf("@")>=0&&null!==(me=text.match(this.re.email_fuzzy))&&(shift=me.index+me[1].length,next=me.index+me[0].length,(this.__index__<0||shift<this.__index__||shift===this.__index__&&next>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=shift,this.__last_index__=next)),this.__index__>=0},LinkifyIt.prototype.pretest=function(text){return this.re.pretest.test(text)},LinkifyIt.prototype.testSchemaAt=function(text,schema,pos){return this.__compiled__[schema.toLowerCase()]?this.__compiled__[schema.toLowerCase()].validate(text,pos,this):0},LinkifyIt.prototype.match=function(text){var shift=0,result=[];this.__index__>=0&&this.__text_cache__===text&&(result.push(createMatch(this,shift)),shift=this.__last_index__);for(var tail=shift?text.slice(shift):text;this.test(tail);)result.push(createMatch(this,shift)),tail=tail.slice(this.__last_index__),shift+=this.__last_index__;return result.length?result:null},LinkifyIt.prototype.tlds=function(list,keepOld){return list=Array.isArray(list)?list:[list],keepOld?(this.__tlds__=this.__tlds__.concat(list).sort().filter((function(el,idx,arr){return el!==arr[idx-1]})).reverse(),compile(this),this):(this.__tlds__=list.slice(),this.__tlds_replaced__=!0,compile(this),this)},LinkifyIt.prototype.normalize=function(match){match.schema||(match.url="http://"+match.url),"mailto:"!==match.schema||/^mailto:/i.test(match.url)||(match.url="mailto:"+match.url)},LinkifyIt.prototype.onCompile=function(){};var _a$1,_b,_c,linkify=LinkifyIt(),UrlPattern=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),getUrlMatches=function(text){return linkify.match(text)||[]},linkify$1=function(contentState,_a){var anchorTarget=_a.anchorTarget,relValue=_a.relValue,lastKey=Object.keys(contentState.entityMap).length>0?Math.max.apply(Math,Object.keys(contentState.entityMap).map((function(key){return parseInt(key,10)})))+1:0;return contentState.blocks.reduce((function(state,block){var text=block.text,linkEntries=getUrlMatches(text).filter((function(_a){var url=_a.text,start=_a.index,end=_a.lastIndex,alreadyHasEntity=hasEntityInRange(block,start,end),longEnough=url.length>=6;return!alreadyHasEntity&&longEnough})).map((function(_a,idx){var url=_a.text,start=_a.index,end=_a.lastIndex;return createEntity(lastKey+=idx,url,start,end,anchorTarget,relValue)}));return{blocks:__spreadArrays(state.blocks,[__assign(__assign({},block),{entityRanges:__spreadArrays(block.entityRanges,linkEntries.map((function(_a){return _a.entityRange})))})]),entityMap:__assign({},linkEntries.reduce((function(entityMap,_a){var mapEntry=_a.mapEntry;return __assign(__assign({},entityMap),mapEntry)}),state.entityMap))}}),{blocks:[],entityMap:__assign({},contentState.entityMap)})},hasEntityInRange=function(block,start,end){return block.entityRanges.some((function(_a){var offset=_a.offset,length=_a.length;return start<offset+length&&end>=offset}))},createEntity=function(entityKey,url,start,end,anchorTarget,relValue){var _a;return{entityRange:{offset:start,length:end-start,key:entityKey},mapEntry:((_a={})[entityKey]={type:"LINK",mutability:"MUTABLE",data:{url:url,target:anchorTarget||"_blank",rel:relValue||"noopener"}},_a)}},imagesTypes=["wix-draft-plugin-image","IMAGE"],invalidInlineTypes=__spreadArrays(imagesTypes,["wix-draft-plugin-gallery","wix-draft-plugin-html","wix-draft-plugin-video","wix-draft-plugin-giphy","wix-draft-plugin-file-upload"]),inlinePluginsRemover=function(_a){var _b=(void 0===_a?{}:_a).imagesOnly,imagesOnly=void 0!==_b&&_b;return function(contentState){var newBlocks=contentState.blocks.map((function(block){var _a=block.entityRanges,entityRanges=void 0===_a?[]:_a,filteredRanges=entityRanges;return"atomic"===block.type||(filteredRanges=function(entityRanges,entityMap,entitiesToRemove){return entityRanges.filter((function(entityRange){var key=entityRange.key,entityType=(entityMap[key]||{}).type;return-1===entitiesToRemove.indexOf(entityType)}))}(entityRanges,contentState.entityMap,imagesOnly?imagesTypes:invalidInlineTypes)),__assign(__assign({},block),{entityRanges:filteredRanges})}));return __assign(__assign({},contentState),{blocks:newBlocks})}},blockProcessingStrategies={atomic:[{processors:[function(block){return"atomic"===block.type?__assign(__assign({},block),{text:" "}):block}]}],unstyled:[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"ordered-list-item":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"unordered-list-item":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"code-block":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-one":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-two":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-three":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-four":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-five":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-six":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],blockquote:[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}]},entityRangeProcessingStrategies={LINK:[{version:"<3.4.7",processors:[function(block,range){var inlineStyleRange={offset:range.offset,length:range.length,style:"UNDERLINE"},inlineStyleRanges=lodash.uniqWith(__spreadArrays(block.inlineStyleRanges||[],[inlineStyleRange]),lodash.isEqual);return __assign(__assign({},block),{inlineStyleRanges:inlineStyleRanges})}]}]},isVersionCompatible=function(strategy,contentStateVersion){return!strategy.version||Version.evaluate(contentStateVersion,strategy.version)},applyStrategies=function(strategies,processed,version){for(var args=[],_i=3;_i<arguments.length;_i++)args[_i-3]=arguments[_i];if(!strategies)return processed;var processedUnit=processed;return strategies.filter((function(strategy){return isVersionCompatible(strategy,version)})).forEach((function(strategy){strategy.processors.reduce((function(unit,processor){return processedUnit=processor.apply(void 0,__spreadArrays([unit],args))}),processed)})),processedUnit},processContentState=function(contentState,config){var _a=contentState.VERSION,contentStateVersion=void 0===_a?"0.0.0":_a,_b=applyStrategies(function(config){var disableInlineImages=config.disableInlineImages,removeInvalidInlinePlugins=config.removeInvalidInlinePlugins,strategies=[{version:"<3.4.7",processors:[linkify$1]}];return disableInlineImages&&strategies.push({version:"<8.0.0",processors:[inlinePluginsRemover({imagesOnly:!0})]}),removeInvalidInlinePlugins&&strategies.push({version:"<8.0.0",processors:[inlinePluginsRemover()]}),strategies}(config),contentState,contentStateVersion,config),blocks=_b.blocks,entityMap=_b.entityMap;return{blocks:blocks.map((function(block){var processedBlock=block;return(processedBlock=applyStrategies(blockProcessingStrategies[block.type],block,contentStateVersion,entityMap,config)).entityRanges&&processedBlock.entityRanges.forEach((function(range){var entityType=entityMap&&entityMap[range.key+""]&&entityMap[range.key+""].type;entityType&&(processedBlock=applyStrategies(entityRangeProcessingStrategies[entityType],processedBlock,contentStateVersion,range,entityMap,config))})),processedBlock})),entityMap:entityMap,VERSION:Version.lessThan(contentStateVersion,Version.currentVersion)?Version.currentVersion:contentStateVersion}},isUndefined=function(val){return void 0===val},isDefined=function(val){return!isUndefined(val)},dataNormalizers=((_a$1={}).LINK=function(componentData,_a){var anchorTarget=_a.anchorTarget,relValue=_a.relValue,targetBlank=componentData.targetBlank,nofollow=componentData.nofollow,rest=__rest(componentData,["targetBlank","nofollow"]);return function(_a){var targetBlank=_a.targetBlank,nofollow=_a.nofollow,target=_a.target,rel=_a.rel;return isUndefined(targetBlank)&&isUndefined(nofollow)&&isDefined(target)&&isDefined(rel)}(componentData)?componentData:__assign(__assign({},rest),{target:targetBlank?"_blank":anchorTarget||"_self",rel:nofollow?"nofollow":relValue||"noopener"})},_a$1[IMAGE_TYPE]=function(componentData){var width=componentData.width,_a=componentData.config,config=void 0===_a?{}:_a,rest=__rest(componentData,["width","config"]);return"inline"===config.size&&width&&!config.width?__assign(__assign({},rest),{config:__assign(__assign({},config),{width:width})}):componentData},_a$1[GALLERY_TYPE]=function(componentData,config,stateVersion){if(Version.lessThan(stateVersion,"6")){var items=componentData.items.map((function(item){var metadata=item.metadata,altText=metadata.title;return altText&&(metadata.altText=altText),delete metadata.title,item}));componentData.items=items}return componentData},_a$1),normalizeComponentData=function(type,componentData,config,version){return dataNormalizers[type](componentData,config,version)},normalizeComponentConfig=function(componentData){if(componentData.config)return componentData;var config={},alignment=componentData.alignment,size=componentData.size,src=componentData.src,oembed=componentData.oembed;alignment?(delete componentData.alignment,config.alignment=alignment,config.size="small"):size?(delete componentData.size,"smallCenter"===size?(config.size="small",config.alignment="center"):"fullWidth"===size&&(config.size="fullWidth",config.alignment="center")):(config.size=src&&src.width&&src.width<=740?"original":"content",config.alignment="center");var patch={config:config};return oembed&&(delete componentData.url,delete componentData.oembed,patch.src=oembed.video_url,patch.metadata={oembed:oembed}),__assign(__assign({},componentData),patch)},entityTypeMap={configNormalization:(_b={},_b.IMAGE=IMAGE_TYPE,_b["VIDEO-EMBED"]="wix-draft-plugin-video",_b),dataNormalization:(_c={},_c.LINK="LINK",_c[IMAGE_TYPE]=IMAGE_TYPE,_c[GALLERY_TYPE]=GALLERY_TYPE,_c)},shouldNormalizeEntity=function(entity,normalizationMap){return Object.keys(normalizationMap).includes(entity.type)&&entity.data},normalizeEntityMap=function(entityMap,config,stateVersion){var normalizeType=function(key,obj){return obj[key]||key};return lodash.mapValues(entityMap,(function(entity){var newEntity=entity;return!function(entity){return shouldNormalizeEntity(entity,entityTypeMap.configNormalization)}(entity)?function(entity){return shouldNormalizeEntity(entity,entityTypeMap.dataNormalization)}(entity)&&(newEntity=__assign(__assign({},entity),{type:normalizeType(entity.type,entityTypeMap.dataNormalization),data:normalizeComponentData(entity.type,entity.data,config,stateVersion)})):newEntity=__assign(__assign({},entity),{type:normalizeType(entity.type,entityTypeMap.configNormalization),data:normalizeComponentConfig(entity.data)}),convertAnchorToLinkToUndoOneAppFix(newEntity),newEntity}))},convertAnchorToLinkToUndoOneAppFix=function(newEntity){if("ANCHOR"===newEntity.type)newEntity.type="LINK";else if(function(entity){var _a,_b,_c,_d;return"wix-draft-plugin-image"===entity.type&&!!(null===(_b=null===(_a=entity.data)||void 0===_a?void 0:_a.config)||void 0===_b?void 0:_b.anchor)&&!(null===(_d=null===(_c=entity.data)||void 0===_c?void 0:_c.config)||void 0===_d?void 0:_d.link)}(newEntity)){var _a=newEntity.data.config,anchor=_a.anchor,rest=__rest(_a,["anchor"]);newEntity.data=__assign(__assign({},newEntity.data),{config:__assign(__assign({},rest),{link:{anchor:anchor}})})}};exports.ACCORDION_TYPE="wix-rich-content-plugin-accordion",exports.ACTION_BUTTON_TYPE="wix-draft-plugin-action-button",exports.BLOCKQUOTE="blockquote",exports.BLOCK_TYPES=BLOCK_TYPES,exports.CODE_BLOCK_TYPE="code-block",exports.DIVIDER_TYPE="wix-draft-plugin-divider",exports.EMOJI_TYPE="wix-draft-plugin-emoji",exports.EXTERNAL_LINK_TYPE="wix-draft-plugin-external-link",exports.EXTERNAL_MENTIONS_TYPE="wix-draft-plugin-external-mentions",exports.FILE_UPLOAD_TYPE="wix-draft-plugin-file-upload",exports.GALLERY_TYPE=GALLERY_TYPE,exports.GIPHY_TYPE="wix-draft-plugin-giphy",exports.HASHTAG_TYPE="wix-draft-plugin-hashtag",exports.HEADERS_MARKDOWN_TYPE="wix-draft-plugin-headers-markdown",exports.HEADER_BLOCK=HEADER_BLOCK,exports.HEADINGS_DROPDOWN_TYPE="wix-rich-content-plugin-headings",exports.HTML_TYPE="wix-draft-plugin-html",exports.IMAGE_TYPE=IMAGE_TYPE,exports.IMAGE_TYPE_LEGACY="IMAGE",exports.INDENT_TYPE="wix-rich-content-plugin-indent",exports.LINE_SPACING_TYPE="line-spacing",exports.LINK_BUTTON_TYPE="wix-draft-plugin-link-button",exports.LINK_PREVIEW_TYPE="wix-draft-plugin-link-preview",exports.LINK_TYPE="LINK",exports.MAP_TYPE="wix-draft-plugin-map",exports.MENTION_TYPE="mention",exports.POLL_TYPE="wix-draft-plugin-poll",exports.PREVIEW="PREVIEW",exports.SOUND_CLOUD_TYPE="wix-draft-plugin-sound-cloud",exports.SPOILER_TYPE="wix-rich-content-plugin-spoiler",exports.TABLE_TYPE="table",exports.TEXT_COLOR_TYPE="wix-rich-content-text-color",exports.TEXT_HIGHLIGHT_TYPE="wix-rich-content-text-highlight",exports.UNDO_REDO_TYPE="wix-rich-content-undo-redo",exports.UNSTYLED="unstyled",exports.VERTICAL_EMBED_TYPE="wix-draft-plugin-vertical-embed",exports.VIDEO_TYPE="wix-draft-plugin-video",exports.VIDEO_TYPE_LEGACY="VIDEO-EMBED",exports.Version=Version,exports.createContent=function(text,type){return void 0===type&&(type="unstyled"),{blocks:[{key:"d79aa",text:text,type:type,depth:0,inlineStyleRanges:[],entityRanges:[],data:{}}],entityMap:{},VERSION:"8.4.8"}},exports.getUrlMatches=getUrlMatches,exports.hasProtocol=function(url){return/^[a-z]+:/i.test(url)},exports.isContentStateEmpty=function(contentState){var blocks=contentState.blocks;if(0===blocks.length)return!0;if(blocks.length>1)return!1;var firstBlock=blocks[0],text=firstBlock.text,type=firstBlock.type,depth=firstBlock.depth;return""===text&&"unstyled"===type&&0===depth},exports.isValidExactUrl=function(str){return!!UrlPattern.test(str)},exports.isValidUrl=function(url){return"#"!==url[0]&&linkify.test(url)},exports.normalizeInitialState=function(content,config){void 0===config&&(config={});var _a=processContentState(lodash.cloneDeep(content),config),blocks=_a.blocks,entityMap=_a.entityMap,VERSION=_a.VERSION;return{blocks:blocks,entityMap:normalizeEntityMap(entityMap,config,content.VERSION||"0.0.0"),VERSION:VERSION}},exports.normalizeUrl=function(url){return(linkify.match(url)||[{}])[0].url},exports.startsWithHttps=function(url){return/^https:/.test(url)};
***************************************************************************** */function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var _a,toVersion=function(versionString){return versionString.split(".").map((function(literal){var numeric=parseInt(literal,10);return lodash.isNaN(numeric)?0:numeric})).slice(0,3)},compareVersions=function(left,right){var leftVersion=toVersion(left),rightVersion=toVersion(right);return leftVersion.map((function(left,idx){return Math.sign(left-rightVersion[idx])})).find((function(num){return 0!==num}))||0},evaluations={"<":function(left,right){return compareVersions(left,right)<0},">":function(left,right){return compareVersions(left,right)>0},"=":function(left,right){return 0===compareVersions(left,right)},"<=":function(left,right){return compareVersions(left,right)<=0},">=":function(left,right){return compareVersions(left,right)>=0}},Version={lessThan:function(left,right){return compareVersions(left,right)<0},greaterThan:function(left,right){return compareVersions(left,right)>0},equal:function(left,right){return 0===compareVersions(left,right)},compare:compareVersions,currentVersion:"8.5.0",evaluate:function(tested,semver){var _a=/([<>=]{0,2})(.*)/gm.exec(semver),operator=_a[1],version=_a[2];return evaluations[operator||"="](tested,version)}},HEADER_BLOCK=Object.freeze({ONE:"header-one",TWO:"header-two",THREE:"header-three",FOUR:"header-four",FIVE:"header-five",SIX:"header-six"}),BLOCK_TYPES=Object.freeze(["header-one","header-two","header-three","header-four","header-five","header-six","unordered-list-item","ordered-list-item","blockquote","atomic","code-block","unstyled"]),GALLERY_TYPE="wix-draft-plugin-gallery",IMAGE_TYPE="wix-draft-plugin-image",INLINE_HEADER_ONE="inline-header-one",INLINE_HEADER_TWO="inline-header-two",INLINE_HEADER_THREE="inline-header-three",INLINE_HEADER_FOUR="inline-header-four",INLINE_HEADER_FIVE="inline-header-five",INLINE_HEADER_SIX="inline-header-six",INLINE_HEADERS=[INLINE_HEADER_THREE,INLINE_HEADER_TWO,INLINE_HEADER_ONE],INLINE_HEADER_TO_BLOCK=((_a={})[INLINE_HEADER_ONE]=HEADER_BLOCK.ONE,_a[INLINE_HEADER_TWO]=HEADER_BLOCK.TWO,_a[INLINE_HEADER_THREE]=HEADER_BLOCK.THREE,_a[INLINE_HEADER_FOUR]=HEADER_BLOCK.FOUR,_a[INLINE_HEADER_FIVE]=HEADER_BLOCK.FIVE,_a[INLINE_HEADER_SIX]=HEADER_BLOCK.SIX,_a),removeInlineHeaderRanges=function(block){var inlineHeaderRanges=getInlineHeaderRanges(block.inlineStyleRanges||[]);return lodash.isEmpty(inlineHeaderRanges)?block:__assign(__assign({},block),{type:getBlockType(block.type,block.text,inlineHeaderRanges),inlineStyleRanges:omitInlineHeaderRanges(block.inlineStyleRanges||[])})},isInlineHeaderRange=function(range){return lodash.includes(INLINE_HEADERS,range.style)},omitInlineHeaderRanges=function(ranges){return ranges.filter(lodash.negate(isInlineHeaderRange))},getInlineHeaderRanges=function(ranges){return ranges.filter(isInlineHeaderRange)},getBlockType=function(type,text,inlineHeaderRanges){return"unstyled"===type&&shouldConvertToHeaderBlock(text,inlineHeaderRanges)?getBlockHeaderType(inlineHeaderRanges):type},shouldConvertToHeaderBlock=function(text,inlineStyleRanges){return 0===lodash.sortBy(inlineStyleRanges,"offset").map((function(range){return[range.offset,range.offset+range.length]})).reduce((function(ranges,range){var lastRange=lodash.last(ranges);return lastRange&&isOverlapping(lastRange,range)?__spreadArrays(lodash.initial(ranges),[mergeOverlappingRanges(lastRange,range)]):__spreadArrays(ranges,[range])}),[]).reverse().reduce((function(text,range){return""+text.slice(0,range[0])+text.slice(range[1])}),text).replace(/\s/g,"").length},isInRange=function(number,range){return range[0]<=number&&number<=range[1]},isOverlapping=function(rangeA,rangeB){return rangeA&&rangeB&&(isInRange(rangeB[0],rangeA)||isInRange(rangeB[1],rangeA))},mergeOverlappingRanges=function(rangeA,rangeB){return[Math.min(rangeA[0],rangeB[0]),Math.max(rangeA[1],rangeB[1])]},getBlockHeaderType=function(inlineHeaderRanges){var smallestInlineHeader=lodash.intersection(INLINE_HEADERS,inlineHeaderRanges.map((function(range){return range.style})))[0];return INLINE_HEADER_TO_BLOCK[smallestInlineHeader]},addInlineStyleRanges=function(block){return __assign(__assign({},block),{inlineStyleRanges:block.inlineStyleRanges||[]})},regex=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,regex$1=/[\0-\x1F\x7F-\x9F]/,regex$2=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,regex$3=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;function assign(obj){var sources=Array.prototype.slice.call(arguments,1);return sources.forEach((function(source){source&&Object.keys(source).forEach((function(key){obj[key]=source[key]}))})),obj}function _class(obj){return Object.prototype.toString.call(obj)}function isFunction(obj){return"[object Function]"===_class(obj)}function escapeRE(str){return str.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var defaultOptions={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var defaultSchemas={"http:":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.http||(self.re.http=new RegExp("^\\/\\/"+self.re.src_auth+self.re.src_host_port_strict+self.re.src_path,"i")),self.re.http.test(tail)?tail.match(self.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.no_http||(self.re.no_http=new RegExp("^"+self.re.src_auth+"(?:localhost|(?:(?:"+self.re.src_domain+")\\.)+"+self.re.src_domain_root+")"+self.re.src_port+self.re.src_host_terminator+self.re.src_path,"i")),self.re.no_http.test(tail)?pos>=3&&":"===text[pos-3]||pos>=3&&"/"===text[pos-3]?0:tail.match(self.re.no_http)[0].length:0}},"mailto:":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.mailto||(self.re.mailto=new RegExp("^"+self.re.src_email_name+"@"+self.re.src_host_strict,"i")),self.re.mailto.test(tail)?tail.match(self.re.mailto)[0].length:0}}},tlds_default="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function compile(self){var re$1=self.re=function(opts){var re={};re.src_Any=regex.source,re.src_Cc=regex$1.source,re.src_Z=regex$2.source,re.src_P=regex$3.source,re.src_ZPCc=[re.src_Z,re.src_P,re.src_Cc].join("|"),re.src_ZCc=[re.src_Z,re.src_Cc].join("|");return re.src_pseudo_letter="(?:(?![><|]|"+re.src_ZPCc+")"+re.src_Any+")",re.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",re.src_auth="(?:(?:(?!"+re.src_ZCc+"|[@/\\[\\]()]).)+@)?",re.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",re.src_host_terminator="(?=$|[><|]|"+re.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+re.src_ZPCc+"))",re.src_path="(?:[/?#](?:(?!"+re.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+re.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+re.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+re.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+re.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+re.src_ZCc+"|[']).)+\\'|\\'(?="+re.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+re.src_ZCc+"|[.]).|"+(opts&&opts["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+re.src_ZCc+").|\\!(?!"+re.src_ZCc+"|[!]).|\\?(?!"+re.src_ZCc+"|[?]).)+|\\/)?",re.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',re.src_xn="xn--[a-z0-9\\-]{1,59}",re.src_domain_root="(?:"+re.src_xn+"|"+re.src_pseudo_letter+"{1,63})",re.src_domain="(?:"+re.src_xn+"|(?:"+re.src_pseudo_letter+")|(?:"+re.src_pseudo_letter+"(?:-|"+re.src_pseudo_letter+"){0,61}"+re.src_pseudo_letter+"))",re.src_host="(?:(?:(?:(?:"+re.src_domain+")\\.)*"+re.src_domain+"))",re.tpl_host_fuzzy="(?:"+re.src_ip4+"|(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%)))",re.tpl_host_no_ip_fuzzy="(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%))",re.src_host_strict=re.src_host+re.src_host_terminator,re.tpl_host_fuzzy_strict=re.tpl_host_fuzzy+re.src_host_terminator,re.src_host_port_strict=re.src_host+re.src_port+re.src_host_terminator,re.tpl_host_port_fuzzy_strict=re.tpl_host_fuzzy+re.src_port+re.src_host_terminator,re.tpl_host_port_no_ip_fuzzy_strict=re.tpl_host_no_ip_fuzzy+re.src_port+re.src_host_terminator,re.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+re.src_ZPCc+"|>|$))",re.tpl_email_fuzzy='(^|[><|]|"|\\(|'+re.src_ZCc+")("+re.src_email_name+"@"+re.tpl_host_fuzzy_strict+")",re.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+re.src_ZPCc+"))((?![$+<=>^`||])"+re.tpl_host_port_fuzzy_strict+re.src_path+")",re.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+re.src_ZPCc+"))((?![$+<=>^`||])"+re.tpl_host_port_no_ip_fuzzy_strict+re.src_path+")",re}(self.__opts__),tlds=self.__tlds__.slice();function untpl(tpl){return tpl.replace("%TLDS%",re$1.src_tlds)}self.onCompile(),self.__tlds_replaced__||tlds.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),tlds.push(re$1.src_xn),re$1.src_tlds=tlds.join("|"),re$1.email_fuzzy=RegExp(untpl(re$1.tpl_email_fuzzy),"i"),re$1.link_fuzzy=RegExp(untpl(re$1.tpl_link_fuzzy),"i"),re$1.link_no_ip_fuzzy=RegExp(untpl(re$1.tpl_link_no_ip_fuzzy),"i"),re$1.host_fuzzy_test=RegExp(untpl(re$1.tpl_host_fuzzy_test),"i");var aliases=[];function schemaError(name,val){throw new Error('(LinkifyIt) Invalid schema "'+name+'": '+val)}self.__compiled__={},Object.keys(self.__schemas__).forEach((function(name){var val=self.__schemas__[name];if(null!==val){var compiled={validate:null,link:null};if(self.__compiled__[name]=compiled,"[object Object]"===_class(val))return!function(obj){return"[object RegExp]"===_class(obj)}(val.validate)?isFunction(val.validate)?compiled.validate=val.validate:schemaError(name,val):compiled.validate=function(re){return function(text,pos){var tail=text.slice(pos);return re.test(tail)?tail.match(re)[0].length:0}}(val.validate),void(isFunction(val.normalize)?compiled.normalize=val.normalize:val.normalize?schemaError(name,val):compiled.normalize=function(match,self){self.normalize(match)});!function(obj){return"[object String]"===_class(obj)}(val)?schemaError(name,val):aliases.push(name)}})),aliases.forEach((function(alias){self.__compiled__[self.__schemas__[alias]]&&(self.__compiled__[alias].validate=self.__compiled__[self.__schemas__[alias]].validate,self.__compiled__[alias].normalize=self.__compiled__[self.__schemas__[alias]].normalize)})),self.__compiled__[""]={validate:null,normalize:function(match,self){self.normalize(match)}};var slist=Object.keys(self.__compiled__).filter((function(name){return name.length>0&&self.__compiled__[name]})).map(escapeRE).join("|");self.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+re$1.src_ZPCc+"))("+slist+")","i"),self.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+re$1.src_ZPCc+"))("+slist+")","ig"),self.re.pretest=RegExp("("+self.re.schema_test.source+")|("+self.re.host_fuzzy_test.source+")|@","i"),function(self){self.__index__=-1,self.__text_cache__=""}(self)}function Match(self,shift){var start=self.__index__,end=self.__last_index__,text=self.__text_cache__.slice(start,end);this.schema=self.__schema__.toLowerCase(),this.index=start+shift,this.lastIndex=end+shift,this.raw=text,this.text=text,this.url=text}function createMatch(self,shift){var match=new Match(self,shift);return self.__compiled__[match.schema].normalize(match,self),match}function LinkifyIt(schemas,options){if(!(this instanceof LinkifyIt))return new LinkifyIt(schemas,options);var obj;options||(obj=schemas,Object.keys(obj||{}).reduce((function(acc,k){return acc||defaultOptions.hasOwnProperty(k)}),!1)&&(options=schemas,schemas={})),this.__opts__=assign({},defaultOptions,options),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=assign({},defaultSchemas,schemas),this.__compiled__={},this.__tlds__=tlds_default,this.__tlds_replaced__=!1,this.re={},compile(this)}LinkifyIt.prototype.add=function(schema,definition){return this.__schemas__[schema]=definition,compile(this),this},LinkifyIt.prototype.set=function(options){return this.__opts__=assign(this.__opts__,options),this},LinkifyIt.prototype.test=function(text){if(this.__text_cache__=text,this.__index__=-1,!text.length)return!1;var m,ml,me,len,shift,next,re,tld_pos;if(this.re.schema_test.test(text))for((re=this.re.schema_search).lastIndex=0;null!==(m=re.exec(text));)if(len=this.testSchemaAt(text,m[2],re.lastIndex)){this.__schema__=m[2],this.__index__=m.index+m[1].length,this.__last_index__=m.index+m[0].length+len;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(tld_pos=text.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||tld_pos<this.__index__)&&null!==(ml=text.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(shift=ml.index+ml[1].length,(this.__index__<0||shift<this.__index__)&&(this.__schema__="",this.__index__=shift,this.__last_index__=ml.index+ml[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&text.indexOf("@")>=0&&null!==(me=text.match(this.re.email_fuzzy))&&(shift=me.index+me[1].length,next=me.index+me[0].length,(this.__index__<0||shift<this.__index__||shift===this.__index__&&next>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=shift,this.__last_index__=next)),this.__index__>=0},LinkifyIt.prototype.pretest=function(text){return this.re.pretest.test(text)},LinkifyIt.prototype.testSchemaAt=function(text,schema,pos){return this.__compiled__[schema.toLowerCase()]?this.__compiled__[schema.toLowerCase()].validate(text,pos,this):0},LinkifyIt.prototype.match=function(text){var shift=0,result=[];this.__index__>=0&&this.__text_cache__===text&&(result.push(createMatch(this,shift)),shift=this.__last_index__);for(var tail=shift?text.slice(shift):text;this.test(tail);)result.push(createMatch(this,shift)),tail=tail.slice(this.__last_index__),shift+=this.__last_index__;return result.length?result:null},LinkifyIt.prototype.tlds=function(list,keepOld){return list=Array.isArray(list)?list:[list],keepOld?(this.__tlds__=this.__tlds__.concat(list).sort().filter((function(el,idx,arr){return el!==arr[idx-1]})).reverse(),compile(this),this):(this.__tlds__=list.slice(),this.__tlds_replaced__=!0,compile(this),this)},LinkifyIt.prototype.normalize=function(match){match.schema||(match.url="http://"+match.url),"mailto:"!==match.schema||/^mailto:/i.test(match.url)||(match.url="mailto:"+match.url)},LinkifyIt.prototype.onCompile=function(){};var _a$1,_b,_c,linkify=LinkifyIt(),UrlPattern=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),getUrlMatches=function(text){return linkify.match(text)||[]},linkify$1=function(contentState,_a){var anchorTarget=_a.anchorTarget,relValue=_a.relValue,lastKey=Object.keys(contentState.entityMap).length>0?Math.max.apply(Math,Object.keys(contentState.entityMap).map((function(key){return parseInt(key,10)})))+1:0;return contentState.blocks.reduce((function(state,block){var text=block.text,linkEntries=getUrlMatches(text).filter((function(_a){var url=_a.text,start=_a.index,end=_a.lastIndex,alreadyHasEntity=hasEntityInRange(block,start,end),longEnough=url.length>=6;return!alreadyHasEntity&&longEnough})).map((function(_a,idx){var url=_a.text,start=_a.index,end=_a.lastIndex;return createEntity(lastKey+=idx,url,start,end,anchorTarget,relValue)}));return{blocks:__spreadArrays(state.blocks,[__assign(__assign({},block),{entityRanges:__spreadArrays(block.entityRanges,linkEntries.map((function(_a){return _a.entityRange})))})]),entityMap:__assign({},linkEntries.reduce((function(entityMap,_a){var mapEntry=_a.mapEntry;return __assign(__assign({},entityMap),mapEntry)}),state.entityMap))}}),{blocks:[],entityMap:__assign({},contentState.entityMap)})},hasEntityInRange=function(block,start,end){return block.entityRanges.some((function(_a){var offset=_a.offset,length=_a.length;return start<offset+length&&end>=offset}))},createEntity=function(entityKey,url,start,end,anchorTarget,relValue){var _a;return{entityRange:{offset:start,length:end-start,key:entityKey},mapEntry:((_a={})[entityKey]={type:"LINK",mutability:"MUTABLE",data:{url:url,target:anchorTarget||"_blank",rel:relValue||"noopener"}},_a)}},imagesTypes=["wix-draft-plugin-image","IMAGE"],invalidInlineTypes=__spreadArrays(imagesTypes,["wix-draft-plugin-gallery","wix-draft-plugin-html","wix-draft-plugin-video","wix-draft-plugin-giphy","wix-draft-plugin-file-upload"]),inlinePluginsRemover=function(_a){var _b=(void 0===_a?{}:_a).imagesOnly,imagesOnly=void 0!==_b&&_b;return function(contentState){var newBlocks=contentState.blocks.map((function(block){var _a=block.entityRanges,entityRanges=void 0===_a?[]:_a,filteredRanges=entityRanges;return"atomic"===block.type||(filteredRanges=function(entityRanges,entityMap,entitiesToRemove){return entityRanges.filter((function(entityRange){var key=entityRange.key,entityType=(entityMap[key]||{}).type;return-1===entitiesToRemove.indexOf(entityType)}))}(entityRanges,contentState.entityMap,imagesOnly?imagesTypes:invalidInlineTypes)),__assign(__assign({},block),{entityRanges:filteredRanges})}));return __assign(__assign({},contentState),{blocks:newBlocks})}},blockProcessingStrategies={atomic:[{processors:[function(block){return"atomic"===block.type?__assign(__assign({},block),{text:" "}):block}]}],unstyled:[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"ordered-list-item":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"unordered-list-item":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"code-block":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-one":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-two":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-three":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-four":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-five":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-six":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],blockquote:[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}]},entityRangeProcessingStrategies={LINK:[{version:"<3.4.7",processors:[function(block,range){var inlineStyleRange={offset:range.offset,length:range.length,style:"UNDERLINE"},inlineStyleRanges=lodash.uniqWith(__spreadArrays(block.inlineStyleRanges||[],[inlineStyleRange]),lodash.isEqual);return __assign(__assign({},block),{inlineStyleRanges:inlineStyleRanges})}]}]},isVersionCompatible=function(strategy,contentStateVersion){return!strategy.version||Version.evaluate(contentStateVersion,strategy.version)},applyStrategies=function(strategies,processed,version){for(var args=[],_i=3;_i<arguments.length;_i++)args[_i-3]=arguments[_i];if(!strategies)return processed;var processedUnit=processed;return strategies.filter((function(strategy){return isVersionCompatible(strategy,version)})).forEach((function(strategy){strategy.processors.reduce((function(unit,processor){return processedUnit=processor.apply(void 0,__spreadArrays([unit],args))}),processed)})),processedUnit},processContentState=function(contentState,config){var _a=contentState.VERSION,contentStateVersion=void 0===_a?"0.0.0":_a,_b=applyStrategies(function(config){var disableInlineImages=config.disableInlineImages,removeInvalidInlinePlugins=config.removeInvalidInlinePlugins,strategies=[{version:"<3.4.7",processors:[linkify$1]}];return disableInlineImages&&strategies.push({version:"<8.0.0",processors:[inlinePluginsRemover({imagesOnly:!0})]}),removeInvalidInlinePlugins&&strategies.push({version:"<8.0.0",processors:[inlinePluginsRemover()]}),strategies}(config),contentState,contentStateVersion,config),blocks=_b.blocks,entityMap=_b.entityMap;return{blocks:blocks.map((function(block){var processedBlock=block;return(processedBlock=applyStrategies(blockProcessingStrategies[block.type],block,contentStateVersion,entityMap,config)).entityRanges&&processedBlock.entityRanges.forEach((function(range){var entityType=entityMap&&entityMap[range.key+""]&&entityMap[range.key+""].type;entityType&&(processedBlock=applyStrategies(entityRangeProcessingStrategies[entityType],processedBlock,contentStateVersion,range,entityMap,config))})),processedBlock})),entityMap:entityMap,VERSION:Version.lessThan(contentStateVersion,Version.currentVersion)?Version.currentVersion:contentStateVersion}},isUndefined=function(val){return void 0===val},isDefined=function(val){return!isUndefined(val)},dataNormalizers=((_a$1={}).LINK=function(componentData,_a){var anchorTarget=_a.anchorTarget,relValue=_a.relValue,targetBlank=componentData.targetBlank,nofollow=componentData.nofollow,rest=__rest(componentData,["targetBlank","nofollow"]);return function(_a){var targetBlank=_a.targetBlank,nofollow=_a.nofollow,target=_a.target,rel=_a.rel;return isUndefined(targetBlank)&&isUndefined(nofollow)&&isDefined(target)&&isDefined(rel)}(componentData)?componentData:__assign(__assign({},rest),{target:targetBlank?"_blank":anchorTarget||"_self",rel:nofollow?"nofollow":relValue||"noopener"})},_a$1[IMAGE_TYPE]=function(componentData){var width=componentData.width,_a=componentData.config,config=void 0===_a?{}:_a,rest=__rest(componentData,["width","config"]);return"inline"===config.size&&width&&!config.width?__assign(__assign({},rest),{config:__assign(__assign({},config),{width:width})}):componentData},_a$1[GALLERY_TYPE]=function(componentData,config,stateVersion){if(Version.lessThan(stateVersion,"6")){var items=componentData.items.map((function(item){var metadata=item.metadata,altText=metadata.title;return altText&&(metadata.altText=altText),delete metadata.title,item}));componentData.items=items}return componentData},_a$1),normalizeComponentData=function(type,componentData,config,version){return dataNormalizers[type](componentData,config,version)},normalizeComponentConfig=function(componentData){if(componentData.config)return componentData;var config={},alignment=componentData.alignment,size=componentData.size,src=componentData.src,oembed=componentData.oembed;alignment?(delete componentData.alignment,config.alignment=alignment,config.size="small"):size?(delete componentData.size,"smallCenter"===size?(config.size="small",config.alignment="center"):"fullWidth"===size&&(config.size="fullWidth",config.alignment="center")):(config.size=src&&src.width&&src.width<=740?"original":"content",config.alignment="center");var patch={config:config};return oembed&&(delete componentData.url,delete componentData.oembed,patch.src=oembed.video_url,patch.metadata={oembed:oembed}),__assign(__assign({},componentData),patch)},entityTypeMap={configNormalization:(_b={},_b.IMAGE=IMAGE_TYPE,_b["VIDEO-EMBED"]="wix-draft-plugin-video",_b),dataNormalization:(_c={},_c.LINK="LINK",_c[IMAGE_TYPE]=IMAGE_TYPE,_c[GALLERY_TYPE]=GALLERY_TYPE,_c)},shouldNormalizeEntity=function(entity,normalizationMap){return Object.keys(normalizationMap).includes(entity.type)&&entity.data},normalizeEntityMap=function(entityMap,config,stateVersion){var normalizeType=function(key,obj){return obj[key]||key};return lodash.mapValues(entityMap,(function(entity){var newEntity=entity;return!function(entity){return shouldNormalizeEntity(entity,entityTypeMap.configNormalization)}(entity)?function(entity){return shouldNormalizeEntity(entity,entityTypeMap.dataNormalization)}(entity)&&(newEntity=__assign(__assign({},entity),{type:normalizeType(entity.type,entityTypeMap.dataNormalization),data:normalizeComponentData(entity.type,entity.data,config,stateVersion)})):newEntity=__assign(__assign({},entity),{type:normalizeType(entity.type,entityTypeMap.configNormalization),data:normalizeComponentConfig(entity.data)}),convertAnchorToLinkToUndoOneAppFix(newEntity),newEntity}))},convertAnchorToLinkToUndoOneAppFix=function(newEntity){if("ANCHOR"===newEntity.type)newEntity.type="LINK";else if(function(entity){var _a,_b,_c,_d;return"wix-draft-plugin-image"===entity.type&&!!(null===(_b=null===(_a=entity.data)||void 0===_a?void 0:_a.config)||void 0===_b?void 0:_b.anchor)&&!(null===(_d=null===(_c=entity.data)||void 0===_c?void 0:_c.config)||void 0===_d?void 0:_d.link)}(newEntity)){var _a=newEntity.data.config,anchor=_a.anchor,rest=__rest(_a,["anchor"]);newEntity.data=__assign(__assign({},newEntity.data),{config:__assign(__assign({},rest),{link:{anchor:anchor}})})}};exports.ACCORDION_TYPE="wix-rich-content-plugin-accordion",exports.ACTION_BUTTON_TYPE="wix-draft-plugin-action-button",exports.BLOCKQUOTE="blockquote",exports.BLOCK_TYPES=BLOCK_TYPES,exports.CODE_BLOCK_TYPE="code-block",exports.DEFAULT_HEADINGS=["h2","h3","h4","h5","h6"],exports.DEFAULT_TITLE_HEADINGS=["h2","h3"],exports.DIVIDER_TYPE="wix-draft-plugin-divider",exports.EMOJI_TYPE="wix-draft-plugin-emoji",exports.EXTERNAL_LINK_TYPE="wix-draft-plugin-external-link",exports.EXTERNAL_MENTIONS_TYPE="wix-draft-plugin-external-mentions",exports.FILE_UPLOAD_TYPE="wix-draft-plugin-file-upload",exports.GALLERY_TYPE=GALLERY_TYPE,exports.GIPHY_TYPE="wix-draft-plugin-giphy",exports.HASHTAG_TYPE="wix-draft-plugin-hashtag",exports.HEADERS_MARKDOWN_TYPE="wix-draft-plugin-headers-markdown",exports.HEADER_BLOCK=HEADER_BLOCK,exports.HEADINGS_DROPDOWN_TYPE="wix-rich-content-plugin-headings",exports.HTML_TYPE="wix-draft-plugin-html",exports.IMAGE_TYPE=IMAGE_TYPE,exports.IMAGE_TYPE_LEGACY="IMAGE",exports.INDENT_TYPE="wix-rich-content-plugin-indent",exports.LINE_SPACING_TYPE="line-spacing",exports.LINK_BUTTON_TYPE="wix-draft-plugin-link-button",exports.LINK_PREVIEW_TYPE="wix-draft-plugin-link-preview",exports.LINK_TYPE="LINK",exports.MAP_TYPE="wix-draft-plugin-map",exports.MENTION_TYPE="mention",exports.POLL_TYPE="wix-draft-plugin-poll",exports.PREVIEW="PREVIEW",exports.SOUND_CLOUD_TYPE="wix-draft-plugin-sound-cloud",exports.SPOILER_TYPE="wix-rich-content-plugin-spoiler",exports.TABLE_TYPE="table",exports.TEXT_COLOR_TYPE="wix-rich-content-text-color",exports.TEXT_HIGHLIGHT_TYPE="wix-rich-content-text-highlight",exports.UNDO_REDO_TYPE="wix-rich-content-undo-redo",exports.UNSTYLED="unstyled",exports.VERTICAL_EMBED_TYPE="wix-draft-plugin-vertical-embed",exports.VIDEO_TYPE="wix-draft-plugin-video",exports.VIDEO_TYPE_LEGACY="VIDEO-EMBED",exports.Version=Version,exports.createContent=function(text,type){return void 0===type&&(type="unstyled"),{blocks:[{key:"d79aa",text:text,type:type,depth:0,inlineStyleRanges:[],entityRanges:[],data:{}}],entityMap:{},VERSION:"8.5.0"}},exports.getUrlMatches=getUrlMatches,exports.hasProtocol=function(url){return/^[a-z]+:/i.test(url)},exports.isContentStateEmpty=function(contentState){var blocks=contentState.blocks;if(0===blocks.length)return!0;if(blocks.length>1)return!1;var firstBlock=blocks[0],text=firstBlock.text,type=firstBlock.type,depth=firstBlock.depth;return""===text&&"unstyled"===type&&0===depth},exports.isValidExactUrl=function(str){return!!UrlPattern.test(str)},exports.isValidUrl=function(url){return"#"!==url[0]&&linkify.test(url)},exports.normalizeInitialState=function(content,config){void 0===config&&(config={});var _a=processContentState(lodash.cloneDeep(content),config),blocks=_a.blocks,entityMap=_a.entityMap,VERSION=_a.VERSION;return{blocks:blocks,entityMap:normalizeEntityMap(entityMap,config,content.VERSION||"0.0.0"),VERSION:VERSION}},exports.normalizeUrl=function(url){return(linkify.match(url)||[{}])[0].url},exports.startsWithHttps=function(url){return/^https:/.test(url)};
//# sourceMappingURL=index.js.map

@@ -15,3 +15,3 @@ import{isNaN,isEmpty,sortBy,last,initial,negate,includes,intersection,uniqWith,isEqual,cloneDeep,mapValues}from"lodash";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var __assign=function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var _a,toVersion=function(versionString){return versionString.split(".").map((function(literal){var numeric=parseInt(literal,10);return isNaN(numeric)?0:numeric})).slice(0,3)},compareVersions=function(left,right){var leftVersion=toVersion(left),rightVersion=toVersion(right);return leftVersion.map((function(left,idx){return Math.sign(left-rightVersion[idx])})).find((function(num){return 0!==num}))||0},evaluations={"<":function(left,right){return compareVersions(left,right)<0},">":function(left,right){return compareVersions(left,right)>0},"=":function(left,right){return 0===compareVersions(left,right)},"<=":function(left,right){return compareVersions(left,right)<=0},">=":function(left,right){return compareVersions(left,right)>=0}},Version={lessThan:function(left,right){return compareVersions(left,right)<0},greaterThan:function(left,right){return compareVersions(left,right)>0},equal:function(left,right){return 0===compareVersions(left,right)},compare:compareVersions,currentVersion:"8.4.8",evaluate:function(tested,semver){var _a=/([<>=]{0,2})(.*)/gm.exec(semver),operator=_a[1],version=_a[2];return evaluations[operator||"="](tested,version)}},HEADER_BLOCK=Object.freeze({ONE:"header-one",TWO:"header-two",THREE:"header-three",FOUR:"header-four",FIVE:"header-five",SIX:"header-six"}),BLOCK_TYPES=Object.freeze(["header-one","header-two","header-three","header-four","header-five","header-six","unordered-list-item","ordered-list-item","blockquote","atomic","code-block","unstyled"]),UNSTYLED="unstyled",BLOCKQUOTE="blockquote",LINK_BUTTON_TYPE="wix-draft-plugin-link-button",ACTION_BUTTON_TYPE="wix-draft-plugin-action-button",CODE_BLOCK_TYPE="code-block",DIVIDER_TYPE="wix-draft-plugin-divider",EMOJI_TYPE="wix-draft-plugin-emoji",FILE_UPLOAD_TYPE="wix-draft-plugin-file-upload",GALLERY_TYPE="wix-draft-plugin-gallery",GIPHY_TYPE="wix-draft-plugin-giphy",HASHTAG_TYPE="wix-draft-plugin-hashtag",HEADERS_MARKDOWN_TYPE="wix-draft-plugin-headers-markdown",HTML_TYPE="wix-draft-plugin-html",IMAGE_TYPE="wix-draft-plugin-image",IMAGE_TYPE_LEGACY="IMAGE",INDENT_TYPE="wix-rich-content-plugin-indent",LINE_SPACING_TYPE="line-spacing",HEADINGS_DROPDOWN_TYPE="wix-rich-content-plugin-headings",SPOILER_TYPE="wix-rich-content-plugin-spoiler",ACCORDION_TYPE="wix-rich-content-plugin-accordion",EXTERNAL_LINK_TYPE="wix-draft-plugin-external-link",LINK_TYPE="LINK",LINK_PREVIEW_TYPE="wix-draft-plugin-link-preview",MAP_TYPE="wix-draft-plugin-map",EXTERNAL_MENTIONS_TYPE="wix-draft-plugin-external-mentions",MENTION_TYPE="mention",SOUND_CLOUD_TYPE="wix-draft-plugin-sound-cloud",TEXT_COLOR_TYPE="wix-rich-content-text-color",TEXT_HIGHLIGHT_TYPE="wix-rich-content-text-highlight",UNDO_REDO_TYPE="wix-rich-content-undo-redo",VERTICAL_EMBED_TYPE="wix-draft-plugin-vertical-embed",VIDEO_TYPE="wix-draft-plugin-video",VIDEO_TYPE_LEGACY="VIDEO-EMBED",POLL_TYPE="wix-draft-plugin-poll",TABLE_TYPE="table",PREVIEW="PREVIEW",INLINE_HEADER_ONE="inline-header-one",INLINE_HEADER_TWO="inline-header-two",INLINE_HEADER_THREE="inline-header-three",INLINE_HEADER_FOUR="inline-header-four",INLINE_HEADER_FIVE="inline-header-five",INLINE_HEADER_SIX="inline-header-six",INLINE_HEADERS=[INLINE_HEADER_THREE,INLINE_HEADER_TWO,INLINE_HEADER_ONE],INLINE_HEADER_TO_BLOCK=((_a={})[INLINE_HEADER_ONE]=HEADER_BLOCK.ONE,_a[INLINE_HEADER_TWO]=HEADER_BLOCK.TWO,_a[INLINE_HEADER_THREE]=HEADER_BLOCK.THREE,_a[INLINE_HEADER_FOUR]=HEADER_BLOCK.FOUR,_a[INLINE_HEADER_FIVE]=HEADER_BLOCK.FIVE,_a[INLINE_HEADER_SIX]=HEADER_BLOCK.SIX,_a),removeInlineHeaderRanges=function(block){var inlineHeaderRanges=getInlineHeaderRanges(block.inlineStyleRanges||[]);return isEmpty(inlineHeaderRanges)?block:__assign(__assign({},block),{type:getBlockType(block.type,block.text,inlineHeaderRanges),inlineStyleRanges:omitInlineHeaderRanges(block.inlineStyleRanges||[])})},isInlineHeaderRange=function(range){return includes(INLINE_HEADERS,range.style)},omitInlineHeaderRanges=function(ranges){return ranges.filter(negate(isInlineHeaderRange))},getInlineHeaderRanges=function(ranges){return ranges.filter(isInlineHeaderRange)},getBlockType=function(type,text,inlineHeaderRanges){return"unstyled"===type&&shouldConvertToHeaderBlock(text,inlineHeaderRanges)?getBlockHeaderType(inlineHeaderRanges):type},shouldConvertToHeaderBlock=function(text,inlineStyleRanges){return 0===sortBy(inlineStyleRanges,"offset").map((function(range){return[range.offset,range.offset+range.length]})).reduce((function(ranges,range){var lastRange=last(ranges);return lastRange&&isOverlapping(lastRange,range)?__spreadArrays(initial(ranges),[mergeOverlappingRanges(lastRange,range)]):__spreadArrays(ranges,[range])}),[]).reverse().reduce((function(text,range){return""+text.slice(0,range[0])+text.slice(range[1])}),text).replace(/\s/g,"").length},isInRange=function(number,range){return range[0]<=number&&number<=range[1]},isOverlapping=function(rangeA,rangeB){return rangeA&&rangeB&&(isInRange(rangeB[0],rangeA)||isInRange(rangeB[1],rangeA))},mergeOverlappingRanges=function(rangeA,rangeB){return[Math.min(rangeA[0],rangeB[0]),Math.max(rangeA[1],rangeB[1])]},getBlockHeaderType=function(inlineHeaderRanges){var smallestInlineHeader=intersection(INLINE_HEADERS,inlineHeaderRanges.map((function(range){return range.style})))[0];return INLINE_HEADER_TO_BLOCK[smallestInlineHeader]},addInlineStyleRanges=function(block){return __assign(__assign({},block),{inlineStyleRanges:block.inlineStyleRanges||[]})},regex=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,regex$1=/[\0-\x1F\x7F-\x9F]/,regex$2=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,regex$3=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;function assign(obj){var sources=Array.prototype.slice.call(arguments,1);return sources.forEach((function(source){source&&Object.keys(source).forEach((function(key){obj[key]=source[key]}))})),obj}function _class(obj){return Object.prototype.toString.call(obj)}function isFunction(obj){return"[object Function]"===_class(obj)}function escapeRE(str){return str.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var defaultOptions={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var defaultSchemas={"http:":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.http||(self.re.http=new RegExp("^\\/\\/"+self.re.src_auth+self.re.src_host_port_strict+self.re.src_path,"i")),self.re.http.test(tail)?tail.match(self.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.no_http||(self.re.no_http=new RegExp("^"+self.re.src_auth+"(?:localhost|(?:(?:"+self.re.src_domain+")\\.)+"+self.re.src_domain_root+")"+self.re.src_port+self.re.src_host_terminator+self.re.src_path,"i")),self.re.no_http.test(tail)?pos>=3&&":"===text[pos-3]||pos>=3&&"/"===text[pos-3]?0:tail.match(self.re.no_http)[0].length:0}},"mailto:":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.mailto||(self.re.mailto=new RegExp("^"+self.re.src_email_name+"@"+self.re.src_host_strict,"i")),self.re.mailto.test(tail)?tail.match(self.re.mailto)[0].length:0}}},tlds_default="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function compile(self){var re$1=self.re=function(opts){var re={};re.src_Any=regex.source,re.src_Cc=regex$1.source,re.src_Z=regex$2.source,re.src_P=regex$3.source,re.src_ZPCc=[re.src_Z,re.src_P,re.src_Cc].join("|"),re.src_ZCc=[re.src_Z,re.src_Cc].join("|");return re.src_pseudo_letter="(?:(?![><|]|"+re.src_ZPCc+")"+re.src_Any+")",re.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",re.src_auth="(?:(?:(?!"+re.src_ZCc+"|[@/\\[\\]()]).)+@)?",re.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",re.src_host_terminator="(?=$|[><|]|"+re.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+re.src_ZPCc+"))",re.src_path="(?:[/?#](?:(?!"+re.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+re.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+re.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+re.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+re.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+re.src_ZCc+"|[']).)+\\'|\\'(?="+re.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+re.src_ZCc+"|[.]).|"+(opts&&opts["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+re.src_ZCc+").|\\!(?!"+re.src_ZCc+"|[!]).|\\?(?!"+re.src_ZCc+"|[?]).)+|\\/)?",re.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',re.src_xn="xn--[a-z0-9\\-]{1,59}",re.src_domain_root="(?:"+re.src_xn+"|"+re.src_pseudo_letter+"{1,63})",re.src_domain="(?:"+re.src_xn+"|(?:"+re.src_pseudo_letter+")|(?:"+re.src_pseudo_letter+"(?:-|"+re.src_pseudo_letter+"){0,61}"+re.src_pseudo_letter+"))",re.src_host="(?:(?:(?:(?:"+re.src_domain+")\\.)*"+re.src_domain+"))",re.tpl_host_fuzzy="(?:"+re.src_ip4+"|(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%)))",re.tpl_host_no_ip_fuzzy="(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%))",re.src_host_strict=re.src_host+re.src_host_terminator,re.tpl_host_fuzzy_strict=re.tpl_host_fuzzy+re.src_host_terminator,re.src_host_port_strict=re.src_host+re.src_port+re.src_host_terminator,re.tpl_host_port_fuzzy_strict=re.tpl_host_fuzzy+re.src_port+re.src_host_terminator,re.tpl_host_port_no_ip_fuzzy_strict=re.tpl_host_no_ip_fuzzy+re.src_port+re.src_host_terminator,re.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+re.src_ZPCc+"|>|$))",re.tpl_email_fuzzy='(^|[><|]|"|\\(|'+re.src_ZCc+")("+re.src_email_name+"@"+re.tpl_host_fuzzy_strict+")",re.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+re.src_ZPCc+"))((?![$+<=>^`||])"+re.tpl_host_port_fuzzy_strict+re.src_path+")",re.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+re.src_ZPCc+"))((?![$+<=>^`||])"+re.tpl_host_port_no_ip_fuzzy_strict+re.src_path+")",re}(self.__opts__),tlds=self.__tlds__.slice();function untpl(tpl){return tpl.replace("%TLDS%",re$1.src_tlds)}self.onCompile(),self.__tlds_replaced__||tlds.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),tlds.push(re$1.src_xn),re$1.src_tlds=tlds.join("|"),re$1.email_fuzzy=RegExp(untpl(re$1.tpl_email_fuzzy),"i"),re$1.link_fuzzy=RegExp(untpl(re$1.tpl_link_fuzzy),"i"),re$1.link_no_ip_fuzzy=RegExp(untpl(re$1.tpl_link_no_ip_fuzzy),"i"),re$1.host_fuzzy_test=RegExp(untpl(re$1.tpl_host_fuzzy_test),"i");var aliases=[];function schemaError(name,val){throw new Error('(LinkifyIt) Invalid schema "'+name+'": '+val)}self.__compiled__={},Object.keys(self.__schemas__).forEach((function(name){var val=self.__schemas__[name];if(null!==val){var compiled={validate:null,link:null};if(self.__compiled__[name]=compiled,"[object Object]"===_class(val))return!function(obj){return"[object RegExp]"===_class(obj)}(val.validate)?isFunction(val.validate)?compiled.validate=val.validate:schemaError(name,val):compiled.validate=function(re){return function(text,pos){var tail=text.slice(pos);return re.test(tail)?tail.match(re)[0].length:0}}(val.validate),void(isFunction(val.normalize)?compiled.normalize=val.normalize:val.normalize?schemaError(name,val):compiled.normalize=function(match,self){self.normalize(match)});!function(obj){return"[object String]"===_class(obj)}(val)?schemaError(name,val):aliases.push(name)}})),aliases.forEach((function(alias){self.__compiled__[self.__schemas__[alias]]&&(self.__compiled__[alias].validate=self.__compiled__[self.__schemas__[alias]].validate,self.__compiled__[alias].normalize=self.__compiled__[self.__schemas__[alias]].normalize)})),self.__compiled__[""]={validate:null,normalize:function(match,self){self.normalize(match)}};var slist=Object.keys(self.__compiled__).filter((function(name){return name.length>0&&self.__compiled__[name]})).map(escapeRE).join("|");self.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+re$1.src_ZPCc+"))("+slist+")","i"),self.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+re$1.src_ZPCc+"))("+slist+")","ig"),self.re.pretest=RegExp("("+self.re.schema_test.source+")|("+self.re.host_fuzzy_test.source+")|@","i"),function(self){self.__index__=-1,self.__text_cache__=""}(self)}function Match(self,shift){var start=self.__index__,end=self.__last_index__,text=self.__text_cache__.slice(start,end);this.schema=self.__schema__.toLowerCase(),this.index=start+shift,this.lastIndex=end+shift,this.raw=text,this.text=text,this.url=text}function createMatch(self,shift){var match=new Match(self,shift);return self.__compiled__[match.schema].normalize(match,self),match}function LinkifyIt(schemas,options){if(!(this instanceof LinkifyIt))return new LinkifyIt(schemas,options);var obj;options||(obj=schemas,Object.keys(obj||{}).reduce((function(acc,k){return acc||defaultOptions.hasOwnProperty(k)}),!1)&&(options=schemas,schemas={})),this.__opts__=assign({},defaultOptions,options),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=assign({},defaultSchemas,schemas),this.__compiled__={},this.__tlds__=tlds_default,this.__tlds_replaced__=!1,this.re={},compile(this)}LinkifyIt.prototype.add=function(schema,definition){return this.__schemas__[schema]=definition,compile(this),this},LinkifyIt.prototype.set=function(options){return this.__opts__=assign(this.__opts__,options),this},LinkifyIt.prototype.test=function(text){if(this.__text_cache__=text,this.__index__=-1,!text.length)return!1;var m,ml,me,len,shift,next,re,tld_pos;if(this.re.schema_test.test(text))for((re=this.re.schema_search).lastIndex=0;null!==(m=re.exec(text));)if(len=this.testSchemaAt(text,m[2],re.lastIndex)){this.__schema__=m[2],this.__index__=m.index+m[1].length,this.__last_index__=m.index+m[0].length+len;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(tld_pos=text.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||tld_pos<this.__index__)&&null!==(ml=text.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(shift=ml.index+ml[1].length,(this.__index__<0||shift<this.__index__)&&(this.__schema__="",this.__index__=shift,this.__last_index__=ml.index+ml[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&text.indexOf("@")>=0&&null!==(me=text.match(this.re.email_fuzzy))&&(shift=me.index+me[1].length,next=me.index+me[0].length,(this.__index__<0||shift<this.__index__||shift===this.__index__&&next>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=shift,this.__last_index__=next)),this.__index__>=0},LinkifyIt.prototype.pretest=function(text){return this.re.pretest.test(text)},LinkifyIt.prototype.testSchemaAt=function(text,schema,pos){return this.__compiled__[schema.toLowerCase()]?this.__compiled__[schema.toLowerCase()].validate(text,pos,this):0},LinkifyIt.prototype.match=function(text){var shift=0,result=[];this.__index__>=0&&this.__text_cache__===text&&(result.push(createMatch(this,shift)),shift=this.__last_index__);for(var tail=shift?text.slice(shift):text;this.test(tail);)result.push(createMatch(this,shift)),tail=tail.slice(this.__last_index__),shift+=this.__last_index__;return result.length?result:null},LinkifyIt.prototype.tlds=function(list,keepOld){return list=Array.isArray(list)?list:[list],keepOld?(this.__tlds__=this.__tlds__.concat(list).sort().filter((function(el,idx,arr){return el!==arr[idx-1]})).reverse(),compile(this),this):(this.__tlds__=list.slice(),this.__tlds_replaced__=!0,compile(this),this)},LinkifyIt.prototype.normalize=function(match){match.schema||(match.url="http://"+match.url),"mailto:"!==match.schema||/^mailto:/i.test(match.url)||(match.url="mailto:"+match.url)},LinkifyIt.prototype.onCompile=function(){};var _a$1,_b,_c,linkify=LinkifyIt(),UrlPattern=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),isValidExactUrl=function(str){return!!UrlPattern.test(str)},isValidUrl=function(url){return"#"!==url[0]&&linkify.test(url)},getUrlMatches=function(text){return linkify.match(text)||[]},normalizeUrl=function(url){return(linkify.match(url)||[{}])[0].url},startsWithHttps=function(url){return/^https:/.test(url)},hasProtocol=function(url){return/^[a-z]+:/i.test(url)},linkify$1=function(contentState,_a){var anchorTarget=_a.anchorTarget,relValue=_a.relValue,lastKey=Object.keys(contentState.entityMap).length>0?Math.max.apply(Math,Object.keys(contentState.entityMap).map((function(key){return parseInt(key,10)})))+1:0;return contentState.blocks.reduce((function(state,block){var text=block.text,linkEntries=getUrlMatches(text).filter((function(_a){var url=_a.text,start=_a.index,end=_a.lastIndex,alreadyHasEntity=hasEntityInRange(block,start,end),longEnough=url.length>=6;return!alreadyHasEntity&&longEnough})).map((function(_a,idx){var url=_a.text,start=_a.index,end=_a.lastIndex;return createEntity(lastKey+=idx,url,start,end,anchorTarget,relValue)}));return{blocks:__spreadArrays(state.blocks,[__assign(__assign({},block),{entityRanges:__spreadArrays(block.entityRanges,linkEntries.map((function(_a){return _a.entityRange})))})]),entityMap:__assign({},linkEntries.reduce((function(entityMap,_a){var mapEntry=_a.mapEntry;return __assign(__assign({},entityMap),mapEntry)}),state.entityMap))}}),{blocks:[],entityMap:__assign({},contentState.entityMap)})},hasEntityInRange=function(block,start,end){return block.entityRanges.some((function(_a){var offset=_a.offset,length=_a.length;return start<offset+length&&end>=offset}))},createEntity=function(entityKey,url,start,end,anchorTarget,relValue){var _a;return{entityRange:{offset:start,length:end-start,key:entityKey},mapEntry:((_a={})[entityKey]={type:"LINK",mutability:"MUTABLE",data:{url:url,target:anchorTarget||"_blank",rel:relValue||"noopener"}},_a)}},imagesTypes=["wix-draft-plugin-image","IMAGE"],invalidInlineTypes=__spreadArrays(imagesTypes,["wix-draft-plugin-gallery","wix-draft-plugin-html","wix-draft-plugin-video","wix-draft-plugin-giphy","wix-draft-plugin-file-upload"]),inlinePluginsRemover=function(_a){var _b=(void 0===_a?{}:_a).imagesOnly,imagesOnly=void 0!==_b&&_b;return function(contentState){var newBlocks=contentState.blocks.map((function(block){var _a=block.entityRanges,entityRanges=void 0===_a?[]:_a,filteredRanges=entityRanges;return"atomic"===block.type||(filteredRanges=function(entityRanges,entityMap,entitiesToRemove){return entityRanges.filter((function(entityRange){var key=entityRange.key,entityType=(entityMap[key]||{}).type;return-1===entitiesToRemove.indexOf(entityType)}))}(entityRanges,contentState.entityMap,imagesOnly?imagesTypes:invalidInlineTypes)),__assign(__assign({},block),{entityRanges:filteredRanges})}));return __assign(__assign({},contentState),{blocks:newBlocks})}},blockProcessingStrategies={atomic:[{processors:[function(block){return"atomic"===block.type?__assign(__assign({},block),{text:" "}):block}]}],unstyled:[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"ordered-list-item":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"unordered-list-item":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"code-block":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-one":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-two":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-three":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-four":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-five":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-six":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],blockquote:[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}]},entityRangeProcessingStrategies={LINK:[{version:"<3.4.7",processors:[function(block,range){var inlineStyleRange={offset:range.offset,length:range.length,style:"UNDERLINE"},inlineStyleRanges=uniqWith(__spreadArrays(block.inlineStyleRanges||[],[inlineStyleRange]),isEqual);return __assign(__assign({},block),{inlineStyleRanges:inlineStyleRanges})}]}]},isVersionCompatible=function(strategy,contentStateVersion){return!strategy.version||Version.evaluate(contentStateVersion,strategy.version)},applyStrategies=function(strategies,processed,version){for(var args=[],_i=3;_i<arguments.length;_i++)args[_i-3]=arguments[_i];if(!strategies)return processed;var processedUnit=processed;return strategies.filter((function(strategy){return isVersionCompatible(strategy,version)})).forEach((function(strategy){strategy.processors.reduce((function(unit,processor){return processedUnit=processor.apply(void 0,__spreadArrays([unit],args))}),processed)})),processedUnit},processContentState=function(contentState,config){var _a=contentState.VERSION,contentStateVersion=void 0===_a?"0.0.0":_a,_b=applyStrategies(function(config){var disableInlineImages=config.disableInlineImages,removeInvalidInlinePlugins=config.removeInvalidInlinePlugins,strategies=[{version:"<3.4.7",processors:[linkify$1]}];return disableInlineImages&&strategies.push({version:"<8.0.0",processors:[inlinePluginsRemover({imagesOnly:!0})]}),removeInvalidInlinePlugins&&strategies.push({version:"<8.0.0",processors:[inlinePluginsRemover()]}),strategies}(config),contentState,contentStateVersion,config),blocks=_b.blocks,entityMap=_b.entityMap;return{blocks:blocks.map((function(block){var processedBlock=block;return(processedBlock=applyStrategies(blockProcessingStrategies[block.type],block,contentStateVersion,entityMap,config)).entityRanges&&processedBlock.entityRanges.forEach((function(range){var entityType=entityMap&&entityMap[range.key+""]&&entityMap[range.key+""].type;entityType&&(processedBlock=applyStrategies(entityRangeProcessingStrategies[entityType],processedBlock,contentStateVersion,range,entityMap,config))})),processedBlock})),entityMap:entityMap,VERSION:Version.lessThan(contentStateVersion,Version.currentVersion)?Version.currentVersion:contentStateVersion}},isUndefined=function(val){return void 0===val},isDefined=function(val){return!isUndefined(val)},dataNormalizers=((_a$1={}).LINK=function(componentData,_a){var anchorTarget=_a.anchorTarget,relValue=_a.relValue,targetBlank=componentData.targetBlank,nofollow=componentData.nofollow,rest=__rest(componentData,["targetBlank","nofollow"]);return function(_a){var targetBlank=_a.targetBlank,nofollow=_a.nofollow,target=_a.target,rel=_a.rel;return isUndefined(targetBlank)&&isUndefined(nofollow)&&isDefined(target)&&isDefined(rel)}(componentData)?componentData:__assign(__assign({},rest),{target:targetBlank?"_blank":anchorTarget||"_self",rel:nofollow?"nofollow":relValue||"noopener"})},_a$1[IMAGE_TYPE]=function(componentData){var width=componentData.width,_a=componentData.config,config=void 0===_a?{}:_a,rest=__rest(componentData,["width","config"]);return"inline"===config.size&&width&&!config.width?__assign(__assign({},rest),{config:__assign(__assign({},config),{width:width})}):componentData},_a$1[GALLERY_TYPE]=function(componentData,config,stateVersion){if(Version.lessThan(stateVersion,"6")){var items=componentData.items.map((function(item){var metadata=item.metadata,altText=metadata.title;return altText&&(metadata.altText=altText),delete metadata.title,item}));componentData.items=items}return componentData},_a$1),normalizeComponentData=function(type,componentData,config,version){return dataNormalizers[type](componentData,config,version)},normalizeComponentConfig=function(componentData){if(componentData.config)return componentData;var config={},alignment=componentData.alignment,size=componentData.size,src=componentData.src,oembed=componentData.oembed;alignment?(delete componentData.alignment,config.alignment=alignment,config.size="small"):size?(delete componentData.size,"smallCenter"===size?(config.size="small",config.alignment="center"):"fullWidth"===size&&(config.size="fullWidth",config.alignment="center")):(config.size=src&&src.width&&src.width<=740?"original":"content",config.alignment="center");var patch={config:config};return oembed&&(delete componentData.url,delete componentData.oembed,patch.src=oembed.video_url,patch.metadata={oembed:oembed}),__assign(__assign({},componentData),patch)},entityTypeMap={configNormalization:(_b={},_b.IMAGE=IMAGE_TYPE,_b["VIDEO-EMBED"]="wix-draft-plugin-video",_b),dataNormalization:(_c={},_c.LINK="LINK",_c[IMAGE_TYPE]=IMAGE_TYPE,_c[GALLERY_TYPE]=GALLERY_TYPE,_c)},shouldNormalizeEntity=function(entity,normalizationMap){return Object.keys(normalizationMap).includes(entity.type)&&entity.data},normalizeEntityMap=function(entityMap,config,stateVersion){var normalizeType=function(key,obj){return obj[key]||key};return mapValues(entityMap,(function(entity){var newEntity=entity;return!function(entity){return shouldNormalizeEntity(entity,entityTypeMap.configNormalization)}(entity)?function(entity){return shouldNormalizeEntity(entity,entityTypeMap.dataNormalization)}(entity)&&(newEntity=__assign(__assign({},entity),{type:normalizeType(entity.type,entityTypeMap.dataNormalization),data:normalizeComponentData(entity.type,entity.data,config,stateVersion)})):newEntity=__assign(__assign({},entity),{type:normalizeType(entity.type,entityTypeMap.configNormalization),data:normalizeComponentConfig(entity.data)}),convertAnchorToLinkToUndoOneAppFix(newEntity),newEntity}))},convertAnchorToLinkToUndoOneAppFix=function(newEntity){if("ANCHOR"===newEntity.type)newEntity.type="LINK";else if(function(entity){var _a,_b,_c,_d;return"wix-draft-plugin-image"===entity.type&&!!(null===(_b=null===(_a=entity.data)||void 0===_a?void 0:_a.config)||void 0===_b?void 0:_b.anchor)&&!(null===(_d=null===(_c=entity.data)||void 0===_c?void 0:_c.config)||void 0===_d?void 0:_d.link)}(newEntity)){var _a=newEntity.data.config,anchor=_a.anchor,rest=__rest(_a,["anchor"]);newEntity.data=__assign(__assign({},newEntity.data),{config:__assign(__assign({},rest),{link:{anchor:anchor}})})}},normalizeInitialState=function(content,config){void 0===config&&(config={});var _a=processContentState(cloneDeep(content),config),blocks=_a.blocks,entityMap=_a.entityMap,VERSION=_a.VERSION;return{blocks:blocks,entityMap:normalizeEntityMap(entityMap,config,content.VERSION||"0.0.0"),VERSION:VERSION}},isContentStateEmpty=function(contentState){var blocks=contentState.blocks;if(0===blocks.length)return!0;if(blocks.length>1)return!1;var firstBlock=blocks[0],text=firstBlock.text,type=firstBlock.type,depth=firstBlock.depth;return""===text&&"unstyled"===type&&0===depth},createContent=function(text,type){return void 0===type&&(type="unstyled"),{blocks:[{key:"d79aa",text:text,type:type,depth:0,inlineStyleRanges:[],entityRanges:[],data:{}}],entityMap:{},VERSION:"8.4.8"}};export{ACCORDION_TYPE,ACTION_BUTTON_TYPE,BLOCKQUOTE,BLOCK_TYPES,CODE_BLOCK_TYPE,DIVIDER_TYPE,EMOJI_TYPE,EXTERNAL_LINK_TYPE,EXTERNAL_MENTIONS_TYPE,FILE_UPLOAD_TYPE,GALLERY_TYPE,GIPHY_TYPE,HASHTAG_TYPE,HEADERS_MARKDOWN_TYPE,HEADER_BLOCK,HEADINGS_DROPDOWN_TYPE,HTML_TYPE,IMAGE_TYPE,IMAGE_TYPE_LEGACY,INDENT_TYPE,LINE_SPACING_TYPE,LINK_BUTTON_TYPE,LINK_PREVIEW_TYPE,LINK_TYPE,MAP_TYPE,MENTION_TYPE,POLL_TYPE,PREVIEW,SOUND_CLOUD_TYPE,SPOILER_TYPE,TABLE_TYPE,TEXT_COLOR_TYPE,TEXT_HIGHLIGHT_TYPE,UNDO_REDO_TYPE,UNSTYLED,VERTICAL_EMBED_TYPE,VIDEO_TYPE,VIDEO_TYPE_LEGACY,Version,createContent,getUrlMatches,hasProtocol,isContentStateEmpty,isValidExactUrl,isValidUrl,normalizeInitialState,normalizeUrl,startsWithHttps};
***************************************************************************** */var __assign=function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t}function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var _a,toVersion=function(versionString){return versionString.split(".").map((function(literal){var numeric=parseInt(literal,10);return isNaN(numeric)?0:numeric})).slice(0,3)},compareVersions=function(left,right){var leftVersion=toVersion(left),rightVersion=toVersion(right);return leftVersion.map((function(left,idx){return Math.sign(left-rightVersion[idx])})).find((function(num){return 0!==num}))||0},evaluations={"<":function(left,right){return compareVersions(left,right)<0},">":function(left,right){return compareVersions(left,right)>0},"=":function(left,right){return 0===compareVersions(left,right)},"<=":function(left,right){return compareVersions(left,right)<=0},">=":function(left,right){return compareVersions(left,right)>=0}},Version={lessThan:function(left,right){return compareVersions(left,right)<0},greaterThan:function(left,right){return compareVersions(left,right)>0},equal:function(left,right){return 0===compareVersions(left,right)},compare:compareVersions,currentVersion:"8.5.0",evaluate:function(tested,semver){var _a=/([<>=]{0,2})(.*)/gm.exec(semver),operator=_a[1],version=_a[2];return evaluations[operator||"="](tested,version)}},HEADER_BLOCK=Object.freeze({ONE:"header-one",TWO:"header-two",THREE:"header-three",FOUR:"header-four",FIVE:"header-five",SIX:"header-six"}),DEFAULT_TITLE_HEADINGS=["h2","h3"],DEFAULT_HEADINGS=["h2","h3","h4","h5","h6"],BLOCK_TYPES=Object.freeze(["header-one","header-two","header-three","header-four","header-five","header-six","unordered-list-item","ordered-list-item","blockquote","atomic","code-block","unstyled"]),UNSTYLED="unstyled",BLOCKQUOTE="blockquote",LINK_BUTTON_TYPE="wix-draft-plugin-link-button",ACTION_BUTTON_TYPE="wix-draft-plugin-action-button",CODE_BLOCK_TYPE="code-block",DIVIDER_TYPE="wix-draft-plugin-divider",EMOJI_TYPE="wix-draft-plugin-emoji",FILE_UPLOAD_TYPE="wix-draft-plugin-file-upload",GALLERY_TYPE="wix-draft-plugin-gallery",GIPHY_TYPE="wix-draft-plugin-giphy",HASHTAG_TYPE="wix-draft-plugin-hashtag",HEADERS_MARKDOWN_TYPE="wix-draft-plugin-headers-markdown",HTML_TYPE="wix-draft-plugin-html",IMAGE_TYPE="wix-draft-plugin-image",IMAGE_TYPE_LEGACY="IMAGE",INDENT_TYPE="wix-rich-content-plugin-indent",LINE_SPACING_TYPE="line-spacing",HEADINGS_DROPDOWN_TYPE="wix-rich-content-plugin-headings",SPOILER_TYPE="wix-rich-content-plugin-spoiler",ACCORDION_TYPE="wix-rich-content-plugin-accordion",EXTERNAL_LINK_TYPE="wix-draft-plugin-external-link",LINK_TYPE="LINK",LINK_PREVIEW_TYPE="wix-draft-plugin-link-preview",MAP_TYPE="wix-draft-plugin-map",EXTERNAL_MENTIONS_TYPE="wix-draft-plugin-external-mentions",MENTION_TYPE="mention",SOUND_CLOUD_TYPE="wix-draft-plugin-sound-cloud",TEXT_COLOR_TYPE="wix-rich-content-text-color",TEXT_HIGHLIGHT_TYPE="wix-rich-content-text-highlight",UNDO_REDO_TYPE="wix-rich-content-undo-redo",VERTICAL_EMBED_TYPE="wix-draft-plugin-vertical-embed",VIDEO_TYPE="wix-draft-plugin-video",VIDEO_TYPE_LEGACY="VIDEO-EMBED",POLL_TYPE="wix-draft-plugin-poll",TABLE_TYPE="table",PREVIEW="PREVIEW",INLINE_HEADER_ONE="inline-header-one",INLINE_HEADER_TWO="inline-header-two",INLINE_HEADER_THREE="inline-header-three",INLINE_HEADER_FOUR="inline-header-four",INLINE_HEADER_FIVE="inline-header-five",INLINE_HEADER_SIX="inline-header-six",INLINE_HEADERS=[INLINE_HEADER_THREE,INLINE_HEADER_TWO,INLINE_HEADER_ONE],INLINE_HEADER_TO_BLOCK=((_a={})[INLINE_HEADER_ONE]=HEADER_BLOCK.ONE,_a[INLINE_HEADER_TWO]=HEADER_BLOCK.TWO,_a[INLINE_HEADER_THREE]=HEADER_BLOCK.THREE,_a[INLINE_HEADER_FOUR]=HEADER_BLOCK.FOUR,_a[INLINE_HEADER_FIVE]=HEADER_BLOCK.FIVE,_a[INLINE_HEADER_SIX]=HEADER_BLOCK.SIX,_a),removeInlineHeaderRanges=function(block){var inlineHeaderRanges=getInlineHeaderRanges(block.inlineStyleRanges||[]);return isEmpty(inlineHeaderRanges)?block:__assign(__assign({},block),{type:getBlockType(block.type,block.text,inlineHeaderRanges),inlineStyleRanges:omitInlineHeaderRanges(block.inlineStyleRanges||[])})},isInlineHeaderRange=function(range){return includes(INLINE_HEADERS,range.style)},omitInlineHeaderRanges=function(ranges){return ranges.filter(negate(isInlineHeaderRange))},getInlineHeaderRanges=function(ranges){return ranges.filter(isInlineHeaderRange)},getBlockType=function(type,text,inlineHeaderRanges){return"unstyled"===type&&shouldConvertToHeaderBlock(text,inlineHeaderRanges)?getBlockHeaderType(inlineHeaderRanges):type},shouldConvertToHeaderBlock=function(text,inlineStyleRanges){return 0===sortBy(inlineStyleRanges,"offset").map((function(range){return[range.offset,range.offset+range.length]})).reduce((function(ranges,range){var lastRange=last(ranges);return lastRange&&isOverlapping(lastRange,range)?__spreadArrays(initial(ranges),[mergeOverlappingRanges(lastRange,range)]):__spreadArrays(ranges,[range])}),[]).reverse().reduce((function(text,range){return""+text.slice(0,range[0])+text.slice(range[1])}),text).replace(/\s/g,"").length},isInRange=function(number,range){return range[0]<=number&&number<=range[1]},isOverlapping=function(rangeA,rangeB){return rangeA&&rangeB&&(isInRange(rangeB[0],rangeA)||isInRange(rangeB[1],rangeA))},mergeOverlappingRanges=function(rangeA,rangeB){return[Math.min(rangeA[0],rangeB[0]),Math.max(rangeA[1],rangeB[1])]},getBlockHeaderType=function(inlineHeaderRanges){var smallestInlineHeader=intersection(INLINE_HEADERS,inlineHeaderRanges.map((function(range){return range.style})))[0];return INLINE_HEADER_TO_BLOCK[smallestInlineHeader]},addInlineStyleRanges=function(block){return __assign(__assign({},block),{inlineStyleRanges:block.inlineStyleRanges||[]})},regex=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,regex$1=/[\0-\x1F\x7F-\x9F]/,regex$2=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,regex$3=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;function assign(obj){var sources=Array.prototype.slice.call(arguments,1);return sources.forEach((function(source){source&&Object.keys(source).forEach((function(key){obj[key]=source[key]}))})),obj}function _class(obj){return Object.prototype.toString.call(obj)}function isFunction(obj){return"[object Function]"===_class(obj)}function escapeRE(str){return str.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var defaultOptions={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var defaultSchemas={"http:":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.http||(self.re.http=new RegExp("^\\/\\/"+self.re.src_auth+self.re.src_host_port_strict+self.re.src_path,"i")),self.re.http.test(tail)?tail.match(self.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.no_http||(self.re.no_http=new RegExp("^"+self.re.src_auth+"(?:localhost|(?:(?:"+self.re.src_domain+")\\.)+"+self.re.src_domain_root+")"+self.re.src_port+self.re.src_host_terminator+self.re.src_path,"i")),self.re.no_http.test(tail)?pos>=3&&":"===text[pos-3]||pos>=3&&"/"===text[pos-3]?0:tail.match(self.re.no_http)[0].length:0}},"mailto:":{validate:function(text,pos,self){var tail=text.slice(pos);return self.re.mailto||(self.re.mailto=new RegExp("^"+self.re.src_email_name+"@"+self.re.src_host_strict,"i")),self.re.mailto.test(tail)?tail.match(self.re.mailto)[0].length:0}}},tlds_default="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function compile(self){var re$1=self.re=function(opts){var re={};re.src_Any=regex.source,re.src_Cc=regex$1.source,re.src_Z=regex$2.source,re.src_P=regex$3.source,re.src_ZPCc=[re.src_Z,re.src_P,re.src_Cc].join("|"),re.src_ZCc=[re.src_Z,re.src_Cc].join("|");return re.src_pseudo_letter="(?:(?![><|]|"+re.src_ZPCc+")"+re.src_Any+")",re.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",re.src_auth="(?:(?:(?!"+re.src_ZCc+"|[@/\\[\\]()]).)+@)?",re.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",re.src_host_terminator="(?=$|[><|]|"+re.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+re.src_ZPCc+"))",re.src_path="(?:[/?#](?:(?!"+re.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+re.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+re.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+re.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+re.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+re.src_ZCc+"|[']).)+\\'|\\'(?="+re.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+re.src_ZCc+"|[.]).|"+(opts&&opts["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+re.src_ZCc+").|\\!(?!"+re.src_ZCc+"|[!]).|\\?(?!"+re.src_ZCc+"|[?]).)+|\\/)?",re.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',re.src_xn="xn--[a-z0-9\\-]{1,59}",re.src_domain_root="(?:"+re.src_xn+"|"+re.src_pseudo_letter+"{1,63})",re.src_domain="(?:"+re.src_xn+"|(?:"+re.src_pseudo_letter+")|(?:"+re.src_pseudo_letter+"(?:-|"+re.src_pseudo_letter+"){0,61}"+re.src_pseudo_letter+"))",re.src_host="(?:(?:(?:(?:"+re.src_domain+")\\.)*"+re.src_domain+"))",re.tpl_host_fuzzy="(?:"+re.src_ip4+"|(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%)))",re.tpl_host_no_ip_fuzzy="(?:(?:(?:"+re.src_domain+")\\.)+(?:%TLDS%))",re.src_host_strict=re.src_host+re.src_host_terminator,re.tpl_host_fuzzy_strict=re.tpl_host_fuzzy+re.src_host_terminator,re.src_host_port_strict=re.src_host+re.src_port+re.src_host_terminator,re.tpl_host_port_fuzzy_strict=re.tpl_host_fuzzy+re.src_port+re.src_host_terminator,re.tpl_host_port_no_ip_fuzzy_strict=re.tpl_host_no_ip_fuzzy+re.src_port+re.src_host_terminator,re.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+re.src_ZPCc+"|>|$))",re.tpl_email_fuzzy='(^|[><|]|"|\\(|'+re.src_ZCc+")("+re.src_email_name+"@"+re.tpl_host_fuzzy_strict+")",re.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+re.src_ZPCc+"))((?![$+<=>^`||])"+re.tpl_host_port_fuzzy_strict+re.src_path+")",re.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+re.src_ZPCc+"))((?![$+<=>^`||])"+re.tpl_host_port_no_ip_fuzzy_strict+re.src_path+")",re}(self.__opts__),tlds=self.__tlds__.slice();function untpl(tpl){return tpl.replace("%TLDS%",re$1.src_tlds)}self.onCompile(),self.__tlds_replaced__||tlds.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),tlds.push(re$1.src_xn),re$1.src_tlds=tlds.join("|"),re$1.email_fuzzy=RegExp(untpl(re$1.tpl_email_fuzzy),"i"),re$1.link_fuzzy=RegExp(untpl(re$1.tpl_link_fuzzy),"i"),re$1.link_no_ip_fuzzy=RegExp(untpl(re$1.tpl_link_no_ip_fuzzy),"i"),re$1.host_fuzzy_test=RegExp(untpl(re$1.tpl_host_fuzzy_test),"i");var aliases=[];function schemaError(name,val){throw new Error('(LinkifyIt) Invalid schema "'+name+'": '+val)}self.__compiled__={},Object.keys(self.__schemas__).forEach((function(name){var val=self.__schemas__[name];if(null!==val){var compiled={validate:null,link:null};if(self.__compiled__[name]=compiled,"[object Object]"===_class(val))return!function(obj){return"[object RegExp]"===_class(obj)}(val.validate)?isFunction(val.validate)?compiled.validate=val.validate:schemaError(name,val):compiled.validate=function(re){return function(text,pos){var tail=text.slice(pos);return re.test(tail)?tail.match(re)[0].length:0}}(val.validate),void(isFunction(val.normalize)?compiled.normalize=val.normalize:val.normalize?schemaError(name,val):compiled.normalize=function(match,self){self.normalize(match)});!function(obj){return"[object String]"===_class(obj)}(val)?schemaError(name,val):aliases.push(name)}})),aliases.forEach((function(alias){self.__compiled__[self.__schemas__[alias]]&&(self.__compiled__[alias].validate=self.__compiled__[self.__schemas__[alias]].validate,self.__compiled__[alias].normalize=self.__compiled__[self.__schemas__[alias]].normalize)})),self.__compiled__[""]={validate:null,normalize:function(match,self){self.normalize(match)}};var slist=Object.keys(self.__compiled__).filter((function(name){return name.length>0&&self.__compiled__[name]})).map(escapeRE).join("|");self.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+re$1.src_ZPCc+"))("+slist+")","i"),self.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+re$1.src_ZPCc+"))("+slist+")","ig"),self.re.pretest=RegExp("("+self.re.schema_test.source+")|("+self.re.host_fuzzy_test.source+")|@","i"),function(self){self.__index__=-1,self.__text_cache__=""}(self)}function Match(self,shift){var start=self.__index__,end=self.__last_index__,text=self.__text_cache__.slice(start,end);this.schema=self.__schema__.toLowerCase(),this.index=start+shift,this.lastIndex=end+shift,this.raw=text,this.text=text,this.url=text}function createMatch(self,shift){var match=new Match(self,shift);return self.__compiled__[match.schema].normalize(match,self),match}function LinkifyIt(schemas,options){if(!(this instanceof LinkifyIt))return new LinkifyIt(schemas,options);var obj;options||(obj=schemas,Object.keys(obj||{}).reduce((function(acc,k){return acc||defaultOptions.hasOwnProperty(k)}),!1)&&(options=schemas,schemas={})),this.__opts__=assign({},defaultOptions,options),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=assign({},defaultSchemas,schemas),this.__compiled__={},this.__tlds__=tlds_default,this.__tlds_replaced__=!1,this.re={},compile(this)}LinkifyIt.prototype.add=function(schema,definition){return this.__schemas__[schema]=definition,compile(this),this},LinkifyIt.prototype.set=function(options){return this.__opts__=assign(this.__opts__,options),this},LinkifyIt.prototype.test=function(text){if(this.__text_cache__=text,this.__index__=-1,!text.length)return!1;var m,ml,me,len,shift,next,re,tld_pos;if(this.re.schema_test.test(text))for((re=this.re.schema_search).lastIndex=0;null!==(m=re.exec(text));)if(len=this.testSchemaAt(text,m[2],re.lastIndex)){this.__schema__=m[2],this.__index__=m.index+m[1].length,this.__last_index__=m.index+m[0].length+len;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(tld_pos=text.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||tld_pos<this.__index__)&&null!==(ml=text.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(shift=ml.index+ml[1].length,(this.__index__<0||shift<this.__index__)&&(this.__schema__="",this.__index__=shift,this.__last_index__=ml.index+ml[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&text.indexOf("@")>=0&&null!==(me=text.match(this.re.email_fuzzy))&&(shift=me.index+me[1].length,next=me.index+me[0].length,(this.__index__<0||shift<this.__index__||shift===this.__index__&&next>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=shift,this.__last_index__=next)),this.__index__>=0},LinkifyIt.prototype.pretest=function(text){return this.re.pretest.test(text)},LinkifyIt.prototype.testSchemaAt=function(text,schema,pos){return this.__compiled__[schema.toLowerCase()]?this.__compiled__[schema.toLowerCase()].validate(text,pos,this):0},LinkifyIt.prototype.match=function(text){var shift=0,result=[];this.__index__>=0&&this.__text_cache__===text&&(result.push(createMatch(this,shift)),shift=this.__last_index__);for(var tail=shift?text.slice(shift):text;this.test(tail);)result.push(createMatch(this,shift)),tail=tail.slice(this.__last_index__),shift+=this.__last_index__;return result.length?result:null},LinkifyIt.prototype.tlds=function(list,keepOld){return list=Array.isArray(list)?list:[list],keepOld?(this.__tlds__=this.__tlds__.concat(list).sort().filter((function(el,idx,arr){return el!==arr[idx-1]})).reverse(),compile(this),this):(this.__tlds__=list.slice(),this.__tlds_replaced__=!0,compile(this),this)},LinkifyIt.prototype.normalize=function(match){match.schema||(match.url="http://"+match.url),"mailto:"!==match.schema||/^mailto:/i.test(match.url)||(match.url="mailto:"+match.url)},LinkifyIt.prototype.onCompile=function(){};var _a$1,_b,_c,linkify=LinkifyIt(),UrlPattern=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i"),isValidExactUrl=function(str){return!!UrlPattern.test(str)},isValidUrl=function(url){return"#"!==url[0]&&linkify.test(url)},getUrlMatches=function(text){return linkify.match(text)||[]},normalizeUrl=function(url){return(linkify.match(url)||[{}])[0].url},startsWithHttps=function(url){return/^https:/.test(url)},hasProtocol=function(url){return/^[a-z]+:/i.test(url)},linkify$1=function(contentState,_a){var anchorTarget=_a.anchorTarget,relValue=_a.relValue,lastKey=Object.keys(contentState.entityMap).length>0?Math.max.apply(Math,Object.keys(contentState.entityMap).map((function(key){return parseInt(key,10)})))+1:0;return contentState.blocks.reduce((function(state,block){var text=block.text,linkEntries=getUrlMatches(text).filter((function(_a){var url=_a.text,start=_a.index,end=_a.lastIndex,alreadyHasEntity=hasEntityInRange(block,start,end),longEnough=url.length>=6;return!alreadyHasEntity&&longEnough})).map((function(_a,idx){var url=_a.text,start=_a.index,end=_a.lastIndex;return createEntity(lastKey+=idx,url,start,end,anchorTarget,relValue)}));return{blocks:__spreadArrays(state.blocks,[__assign(__assign({},block),{entityRanges:__spreadArrays(block.entityRanges,linkEntries.map((function(_a){return _a.entityRange})))})]),entityMap:__assign({},linkEntries.reduce((function(entityMap,_a){var mapEntry=_a.mapEntry;return __assign(__assign({},entityMap),mapEntry)}),state.entityMap))}}),{blocks:[],entityMap:__assign({},contentState.entityMap)})},hasEntityInRange=function(block,start,end){return block.entityRanges.some((function(_a){var offset=_a.offset,length=_a.length;return start<offset+length&&end>=offset}))},createEntity=function(entityKey,url,start,end,anchorTarget,relValue){var _a;return{entityRange:{offset:start,length:end-start,key:entityKey},mapEntry:((_a={})[entityKey]={type:"LINK",mutability:"MUTABLE",data:{url:url,target:anchorTarget||"_blank",rel:relValue||"noopener"}},_a)}},imagesTypes=["wix-draft-plugin-image","IMAGE"],invalidInlineTypes=__spreadArrays(imagesTypes,["wix-draft-plugin-gallery","wix-draft-plugin-html","wix-draft-plugin-video","wix-draft-plugin-giphy","wix-draft-plugin-file-upload"]),inlinePluginsRemover=function(_a){var _b=(void 0===_a?{}:_a).imagesOnly,imagesOnly=void 0!==_b&&_b;return function(contentState){var newBlocks=contentState.blocks.map((function(block){var _a=block.entityRanges,entityRanges=void 0===_a?[]:_a,filteredRanges=entityRanges;return"atomic"===block.type||(filteredRanges=function(entityRanges,entityMap,entitiesToRemove){return entityRanges.filter((function(entityRange){var key=entityRange.key,entityType=(entityMap[key]||{}).type;return-1===entitiesToRemove.indexOf(entityType)}))}(entityRanges,contentState.entityMap,imagesOnly?imagesTypes:invalidInlineTypes)),__assign(__assign({},block),{entityRanges:filteredRanges})}));return __assign(__assign({},contentState),{blocks:newBlocks})}},blockProcessingStrategies={atomic:[{processors:[function(block){return"atomic"===block.type?__assign(__assign({},block),{text:" "}):block}]}],unstyled:[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"ordered-list-item":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"unordered-list-item":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"code-block":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-one":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-two":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-three":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-four":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-five":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],"header-six":[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}],blockquote:[{processors:[removeInlineHeaderRanges,addInlineStyleRanges]}]},entityRangeProcessingStrategies={LINK:[{version:"<3.4.7",processors:[function(block,range){var inlineStyleRange={offset:range.offset,length:range.length,style:"UNDERLINE"},inlineStyleRanges=uniqWith(__spreadArrays(block.inlineStyleRanges||[],[inlineStyleRange]),isEqual);return __assign(__assign({},block),{inlineStyleRanges:inlineStyleRanges})}]}]},isVersionCompatible=function(strategy,contentStateVersion){return!strategy.version||Version.evaluate(contentStateVersion,strategy.version)},applyStrategies=function(strategies,processed,version){for(var args=[],_i=3;_i<arguments.length;_i++)args[_i-3]=arguments[_i];if(!strategies)return processed;var processedUnit=processed;return strategies.filter((function(strategy){return isVersionCompatible(strategy,version)})).forEach((function(strategy){strategy.processors.reduce((function(unit,processor){return processedUnit=processor.apply(void 0,__spreadArrays([unit],args))}),processed)})),processedUnit},processContentState=function(contentState,config){var _a=contentState.VERSION,contentStateVersion=void 0===_a?"0.0.0":_a,_b=applyStrategies(function(config){var disableInlineImages=config.disableInlineImages,removeInvalidInlinePlugins=config.removeInvalidInlinePlugins,strategies=[{version:"<3.4.7",processors:[linkify$1]}];return disableInlineImages&&strategies.push({version:"<8.0.0",processors:[inlinePluginsRemover({imagesOnly:!0})]}),removeInvalidInlinePlugins&&strategies.push({version:"<8.0.0",processors:[inlinePluginsRemover()]}),strategies}(config),contentState,contentStateVersion,config),blocks=_b.blocks,entityMap=_b.entityMap;return{blocks:blocks.map((function(block){var processedBlock=block;return(processedBlock=applyStrategies(blockProcessingStrategies[block.type],block,contentStateVersion,entityMap,config)).entityRanges&&processedBlock.entityRanges.forEach((function(range){var entityType=entityMap&&entityMap[range.key+""]&&entityMap[range.key+""].type;entityType&&(processedBlock=applyStrategies(entityRangeProcessingStrategies[entityType],processedBlock,contentStateVersion,range,entityMap,config))})),processedBlock})),entityMap:entityMap,VERSION:Version.lessThan(contentStateVersion,Version.currentVersion)?Version.currentVersion:contentStateVersion}},isUndefined=function(val){return void 0===val},isDefined=function(val){return!isUndefined(val)},dataNormalizers=((_a$1={}).LINK=function(componentData,_a){var anchorTarget=_a.anchorTarget,relValue=_a.relValue,targetBlank=componentData.targetBlank,nofollow=componentData.nofollow,rest=__rest(componentData,["targetBlank","nofollow"]);return function(_a){var targetBlank=_a.targetBlank,nofollow=_a.nofollow,target=_a.target,rel=_a.rel;return isUndefined(targetBlank)&&isUndefined(nofollow)&&isDefined(target)&&isDefined(rel)}(componentData)?componentData:__assign(__assign({},rest),{target:targetBlank?"_blank":anchorTarget||"_self",rel:nofollow?"nofollow":relValue||"noopener"})},_a$1[IMAGE_TYPE]=function(componentData){var width=componentData.width,_a=componentData.config,config=void 0===_a?{}:_a,rest=__rest(componentData,["width","config"]);return"inline"===config.size&&width&&!config.width?__assign(__assign({},rest),{config:__assign(__assign({},config),{width:width})}):componentData},_a$1[GALLERY_TYPE]=function(componentData,config,stateVersion){if(Version.lessThan(stateVersion,"6")){var items=componentData.items.map((function(item){var metadata=item.metadata,altText=metadata.title;return altText&&(metadata.altText=altText),delete metadata.title,item}));componentData.items=items}return componentData},_a$1),normalizeComponentData=function(type,componentData,config,version){return dataNormalizers[type](componentData,config,version)},normalizeComponentConfig=function(componentData){if(componentData.config)return componentData;var config={},alignment=componentData.alignment,size=componentData.size,src=componentData.src,oembed=componentData.oembed;alignment?(delete componentData.alignment,config.alignment=alignment,config.size="small"):size?(delete componentData.size,"smallCenter"===size?(config.size="small",config.alignment="center"):"fullWidth"===size&&(config.size="fullWidth",config.alignment="center")):(config.size=src&&src.width&&src.width<=740?"original":"content",config.alignment="center");var patch={config:config};return oembed&&(delete componentData.url,delete componentData.oembed,patch.src=oembed.video_url,patch.metadata={oembed:oembed}),__assign(__assign({},componentData),patch)},entityTypeMap={configNormalization:(_b={},_b.IMAGE=IMAGE_TYPE,_b["VIDEO-EMBED"]="wix-draft-plugin-video",_b),dataNormalization:(_c={},_c.LINK="LINK",_c[IMAGE_TYPE]=IMAGE_TYPE,_c[GALLERY_TYPE]=GALLERY_TYPE,_c)},shouldNormalizeEntity=function(entity,normalizationMap){return Object.keys(normalizationMap).includes(entity.type)&&entity.data},normalizeEntityMap=function(entityMap,config,stateVersion){var normalizeType=function(key,obj){return obj[key]||key};return mapValues(entityMap,(function(entity){var newEntity=entity;return!function(entity){return shouldNormalizeEntity(entity,entityTypeMap.configNormalization)}(entity)?function(entity){return shouldNormalizeEntity(entity,entityTypeMap.dataNormalization)}(entity)&&(newEntity=__assign(__assign({},entity),{type:normalizeType(entity.type,entityTypeMap.dataNormalization),data:normalizeComponentData(entity.type,entity.data,config,stateVersion)})):newEntity=__assign(__assign({},entity),{type:normalizeType(entity.type,entityTypeMap.configNormalization),data:normalizeComponentConfig(entity.data)}),convertAnchorToLinkToUndoOneAppFix(newEntity),newEntity}))},convertAnchorToLinkToUndoOneAppFix=function(newEntity){if("ANCHOR"===newEntity.type)newEntity.type="LINK";else if(function(entity){var _a,_b,_c,_d;return"wix-draft-plugin-image"===entity.type&&!!(null===(_b=null===(_a=entity.data)||void 0===_a?void 0:_a.config)||void 0===_b?void 0:_b.anchor)&&!(null===(_d=null===(_c=entity.data)||void 0===_c?void 0:_c.config)||void 0===_d?void 0:_d.link)}(newEntity)){var _a=newEntity.data.config,anchor=_a.anchor,rest=__rest(_a,["anchor"]);newEntity.data=__assign(__assign({},newEntity.data),{config:__assign(__assign({},rest),{link:{anchor:anchor}})})}},normalizeInitialState=function(content,config){void 0===config&&(config={});var _a=processContentState(cloneDeep(content),config),blocks=_a.blocks,entityMap=_a.entityMap,VERSION=_a.VERSION;return{blocks:blocks,entityMap:normalizeEntityMap(entityMap,config,content.VERSION||"0.0.0"),VERSION:VERSION}},isContentStateEmpty=function(contentState){var blocks=contentState.blocks;if(0===blocks.length)return!0;if(blocks.length>1)return!1;var firstBlock=blocks[0],text=firstBlock.text,type=firstBlock.type,depth=firstBlock.depth;return""===text&&"unstyled"===type&&0===depth},createContent=function(text,type){return void 0===type&&(type="unstyled"),{blocks:[{key:"d79aa",text:text,type:type,depth:0,inlineStyleRanges:[],entityRanges:[],data:{}}],entityMap:{},VERSION:"8.5.0"}};export{ACCORDION_TYPE,ACTION_BUTTON_TYPE,BLOCKQUOTE,BLOCK_TYPES,CODE_BLOCK_TYPE,DEFAULT_HEADINGS,DEFAULT_TITLE_HEADINGS,DIVIDER_TYPE,EMOJI_TYPE,EXTERNAL_LINK_TYPE,EXTERNAL_MENTIONS_TYPE,FILE_UPLOAD_TYPE,GALLERY_TYPE,GIPHY_TYPE,HASHTAG_TYPE,HEADERS_MARKDOWN_TYPE,HEADER_BLOCK,HEADINGS_DROPDOWN_TYPE,HTML_TYPE,IMAGE_TYPE,IMAGE_TYPE_LEGACY,INDENT_TYPE,LINE_SPACING_TYPE,LINK_BUTTON_TYPE,LINK_PREVIEW_TYPE,LINK_TYPE,MAP_TYPE,MENTION_TYPE,POLL_TYPE,PREVIEW,SOUND_CLOUD_TYPE,SPOILER_TYPE,TABLE_TYPE,TEXT_COLOR_TYPE,TEXT_HIGHLIGHT_TYPE,UNDO_REDO_TYPE,UNSTYLED,VERTICAL_EMBED_TYPE,VIDEO_TYPE,VIDEO_TYPE_LEGACY,Version,createContent,getUrlMatches,hasProtocol,isContentStateEmpty,isValidExactUrl,isValidUrl,normalizeInitialState,normalizeUrl,startsWithHttps};
//# sourceMappingURL=index.js.map

@@ -15,2 +15,2 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lodash=require("lodash"),__assign=function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var Version_currentVersion="8.4.8",METHOD_BLOCK_MAP=Object.freeze({h1:"header-one",h2:"header-two",h3:"header-three",h4:"header-four",h5:"header-five",h6:"header-six",quote:"blockquote"}),METHOD_GROUPED_BLOCK_MAP=Object.freeze({plain:"unstyled",code:"code-block",ol:"ordered-list-item",ul:"unordered-list-item"}),METHOD_PLUGIN_DATA_MAP=Object.freeze({image:{type:"wix-draft-plugin-image",mutability:"IMMUTABLE",data:{config:{alignment:"center",size:"content",showTitle:!1,showDescription:!1}}},video:{type:"wix-draft-plugin-video",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},gallery:{type:"wix-draft-plugin-gallery",mutability:"IMMUTABLE",data:{config:{alignment:"center",size:"content",layout:"small",spacing:0},styles:{galleryLayout:2,gallerySizeType:"px",gallerySizePx:300,galleryMargin:0,oneRow:!1,cubeRatio:1,galleryThumbnailsAlignment:"bottom",isVertical:!0,numberOfImagesPerRow:3,imageMargin:20,thumbnailSpacings:0,cubeType:"fill",enableInfiniteScroll:!0,titlePlacement:"SHOW_ON_HOVER",allowHover:!1,itemClick:"link",fullscreen:!1,showArrows:!1,gridStyle:1,loveButton:!1,allowSocial:!1,allowDownload:!1,mobileSwipeAnimation:"NO_EFFECT",thumbnailSize:120,gotStyleParams:!0,cubeImages:!0,groupSize:1,groupTypes:"1",hasThumbnails:!1,enableScroll:!0,isGrid:!0,isSlider:!1,isColumns:!1,isSlideshow:!1,cropOnlyFill:!1,smartCrop:!1,imageResize:!1,galleryImageRatio:2,galleryType:"Columns",minItemSize:50,videoPlay:"auto"}}},soundCloud:{type:"wix-draft-plugin-sound-cloud",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},giphy:{type:"wix-draft-plugin-giphy",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},map:{type:"wix-draft-plugin-map",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center",width:400,height:400}}},file:{type:"wix-draft-plugin-file-upload",mutability:"IMMUTABLE",data:{config:{alignment:"left",size:"small"}}},divider:{type:"wix-draft-plugin-divider",mutability:"IMMUTABLE",data:{type:"single",config:{size:"large",alignment:"center",textWrap:"nowrap"}}},link:{type:"LINK",mutability:"IMMUTABLE",data:{config:{}}},linkPreview:{type:"wix-draft-plugin-link-preview",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}}}),INTERACTIONS=Object.freeze({READ_MORE:"READ_MORE",IMAGE_COUNTER:"IMAGE_COUNTER",SEE_FULL_CONTENT:"SEE_FULL_CONTENT"}),galleryTypeConverters={giphy:function(item){return{mediaUrl:item.mp4,metadata:{type:"video",videoUrl:item.mp4,videoId:item.url,poster:item.url,source:"giphy",width:item.width||600,height:item.height||480}}},video:function(item){var isCustom=item.isCustom,_a=isCustom?item.url:item,_b=_a.width,width=void 0===_b?600:_b,_c=_a.height,height=void 0===_c?480:_c,url=isCustom?item.url.pathname:item.url;return{url:url,mediaUrl:url,metadata:{type:"video",poster:item.url,videoId:url,width:width,height:height}}},image:function(item){return{itemId:item.id||item.url,metadata:{width:item.width,height:item.height}}}},toGalleryItems=function(items){return items.map((function(item,index){return __assign({itemId:item.id||"item-"+index,url:item.url},galleryTypeConverters[item.type](item))}))},defaultMerger=function(mediaInfo,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),mediaInfo)})},videoMerger=function(_a,entity){var url=_a.url,isCustom=_a.isCustom;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{src:url,isCustomVideo:!!isCustom})})},mergers={"wix-draft-plugin-image":function(_a,entity){var url=_a.url,width=_a.width,height=_a.height,metadata=_a.metadata,link=_a.link,_b=_a.source,source=void 0===_b?null:_b;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{config:__assign(__assign({},entity.data.config),{link:link}),metadata:metadata,src:__assign({width:width,height:height},"static"===source?{url:url,source:source}:{file_name:url})})})},"wix-draft-plugin-gallery":function(items,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{items:toGalleryItems(items)})})},"wix-draft-plugin-giphy":function(_a,entity){var width=_a.width,height=_a.height,url=_a.url,thumbnail=_a.thumbnail;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{gif:{width:width,height:height,originalUrl:url,stillUrl:thumbnail}})})},"wix-draft-plugin-video":videoMerger,"wix-draft-plugin-sound-cloud":videoMerger,"wix-draft-plugin-file-upload":function(_a,entity){var fileType=_a.fileType,name=_a.name,url=_a.url;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{type:fileType,name:name,url:url})})},"wix-draft-plugin-map":function(mapSettings,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{mapSettings:mapSettings})})},"wix-draft-plugin-divider":defaultMerger,mention:defaultMerger,LINK:defaultMerger,"wix-draft-plugin-link-preview":function(_a,entity){var url=_a.url;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{config:__assign(__assign({},entity.data.config),{link:__assign(__assign({},entity.data.config.link),{url:url})})})})},"wix-draft-plugin-headers-markdown":defaultMerger,"wix-draft-plugin-link-button":defaultMerger,"wix-draft-plugin-action-button":defaultMerger,"wix-draft-plugin-poll":defaultMerger,"wix-draft-plugin-html":defaultMerger},DEFAULT_BLOCK_CONFIG={data:{},inlineStyleRanges:[],entityRanges:[],depth:0},createBlock=function(type,text,config){return __assign({key:Math.random().toString(36).substr(2,5),type:type,text:text},__assign(__assign({},DEFAULT_BLOCK_CONFIG),config||{}))},addEntity=function(_a){var _b,mediaInfo,entity,contentState=_a.contentState,data=_a.data,config=_a.config,mergedEntity=(mediaInfo=data,mergers[(entity=config).type](mediaInfo,entity));return __assign(__assign({},contentState),{entityMap:__assign(__assign({},contentState.entityMap),(_b={},_b[Object.keys(contentState.entityMap).length]=mergedEntity,_b))})},addPlugin=function(_a){var contentState=_a.contentState,data=_a.data,config=_a.config,contentStateWithBlock=function(_a){var contentState=_a.contentState,text=_a.text,type=_a.type,config=_a.config;return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks,[createBlock(type,text,config)])})}({contentState:contentState,text:" ",type:"atomic",config:{entityRanges:[{offset:0,length:1,key:Object.keys(contentState.entityMap).length}]}});return addEntity({contentState:contentStateWithBlock,data:data,config:config})},interactionDataMerger=function(_a){var _b,_c,contentState=_a.contentState,_d=_a.settings,settings=void 0===_d?{}:_d,_e=_a.blockFilter,blockFilter=void 0===_e?function(){}:_e,type=_a.type,_f=_a.schema,schema=void 0===_f?[]:_f;if(!contentState.blocks||0===contentState.blocks.length)return contentState;var lastBlock=contentState.blocks.slice(-1)[0];if(blockFilter(lastBlock))return contentState;var invalidSettings=Object.keys(settings).filter((function(key){return!schema.includes(key)}));if(invalidSettings.length>0&&console.error("Warning: invalid "+type+" interaction settings found",invalidSettings),"atomic"!==lastBlock.type){var modifiedBlock=__assign(__assign({},lastBlock),{data:__assign(__assign({},lastBlock.data),{interactions:__spreadArrays((null===(_c=null==lastBlock?void 0:lastBlock.data)||void 0===_c?void 0:_c.interactions)||[],[{type:type,settings:settings}])})});return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks.slice(0,contentState.blocks.length-1),[modifiedBlock])})}var lastBlockEntityKey=lastBlock.entityRanges.length>0&&lastBlock.entityRanges[0].key;if(!1!==lastBlockEntityKey){var lastBlockEntity=contentState.entityMap[lastBlockEntityKey],modifiedEntity=__assign(__assign({},lastBlockEntity),{data:__assign(__assign({},lastBlockEntity&&lastBlockEntity.data),{interactions:__spreadArrays(lastBlockEntity&&lastBlockEntity.data.interactions||[],[{type:type,settings:settings}])})});return __assign(__assign({},contentState),{entityMap:__assign(__assign({},contentState.entityMap),(_b={},_b[lastBlockEntityKey]=modifiedEntity,_b))})}return contentState},DEFAULT_STATE={blocks:[],entityMap:{},VERSION:Version_currentVersion},ContentStateBuilder=function(){function ContentStateBuilder(initialState){this.contentState=__assign(__assign({},DEFAULT_STATE),initialState||{})}return ContentStateBuilder.prototype.get=function(){return this.contentState},ContentStateBuilder}();Object.keys(__assign(__assign({},METHOD_BLOCK_MAP),METHOD_GROUPED_BLOCK_MAP)).forEach((function(method){ContentStateBuilder.prototype[method]=function(textBlocksWithEntities){var content,textContentArray=(content=textBlocksWithEntities,lodash.isArray(content)?content:[content]);return this.contentState=textContentArray.reduce((function(state,_a){return function(_a){var contentState=_a.contentState,block=_a.block,entities=_a.entities;return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks,[block]),entityMap:__assign(__assign({},contentState.entityMap),entities)})}({contentState:state,block:_a.block,entities:_a.entities})}),this.contentState),this}})),Object.entries(METHOD_PLUGIN_DATA_MAP).forEach((function(_a){var method=_a[0],defaultEntityData=_a[1];ContentStateBuilder.prototype[method]=function(_a){var mediaInfo=_a.mediaInfo,_b=_a.config,config=void 0===_b?{}:_b,_c=_a.overrides,overrides=void 0===_c?{}:_c;return this.contentState=addPlugin({contentState:this.contentState,data:mediaInfo,config:__assign(__assign({},defaultEntityData),{data:__assign(__assign(__assign({},defaultEntityData.data),{config:__assign(__assign({},defaultEntityData.data.config),config)}),overrides)})}),this}})),Object.entries({readMore:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(block){return"atomic"===block.type},type:INTERACTIONS.READ_MORE,schema:["label","onClick","expandMode","lines","text","showToggle"]}),builder},seeFullPost:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(){return!1},type:INTERACTIONS.SEE_FULL_CONTENT,schema:["label","labelStyles","overlayStyles","onClick"]}),builder},imageCounter:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(block){return"atomic"!==block.type},type:INTERACTIONS.IMAGE_COUNTER,schema:["counter","formatLabel","onClick","style"]}),builder}}).forEach((function(_a){var key=_a[0],method=_a[1];ContentStateBuilder.prototype[key]=function(settings){return method(this,settings)}}));var defaultEntityConverter=function(){return[]},videoConverter=function(entity){return[{type:"video",url:entity.data.src,isCustom:entity.data.isCustomVideo}]},linkConverter=function(entity){return[{type:"link",url:entity.data.url}]},converters={"wix-draft-plugin-image":function(entity){return[{width:entity.data.src.width,height:entity.data.src.height,url:entity.data.src.file_name,type:"image",metadata:entity.data.metadata,link:entity.data.config.link}]},"wix-draft-plugin-gallery":function(entity){return entity.data.items.map((function(_a){var metadata=_a.metadata,url=_a.url,itemId=_a.itemId;return{url:url,height:metadata.height,width:metadata.width,id:itemId,type:"image",isGalleryItem:!0}}))},"wix-draft-plugin-divider":defaultEntityConverter,"wix-draft-plugin-video":videoConverter,"wix-draft-plugin-sound-cloud":videoConverter,"wix-draft-plugin-giphy":function(entity){return[{type:"giphy",url:entity.data.gif.originalUrl,mp4:entity.data.gif.downsizedSmallMp4,thumbnail:entity.data.gif.stillUrl,width:entity.data.gif.width,height:entity.data.gif.height,source:"static"}]},"wix-draft-plugin-file-upload":function(entity){return[{name:entity.data.name,type:"file",fileType:entity.data.type,url:entity.data.url}]},"wix-draft-plugin-map":function(entity){return[{type:"map",mapSettings:entity.data.mapSettings}]},mention:defaultEntityConverter,"wix-draft-plugin-headers-markdown":defaultEntityConverter,"wix-draft-plugin-link-button":defaultEntityConverter,"wix-draft-plugin-action-button":defaultEntityConverter,"wix-draft-plugin-poll":defaultEntityConverter,LINK:linkConverter,LINK_PREVIEW:linkConverter,"wix-draft-plugin-html":defaultEntityConverter},extractTextBlocksWithEntities=function(_a,blockFilter){var blocks=_a.blocks,entityMap=_a.entityMap;return blocks.filter(blockFilter).reduce((function(texts,block){var entities=block.entityRanges.reduce((function(map,range){return map["_"+range.key]=entityMap[range.key],map}),{});return __spreadArrays(texts,[{block:__assign(__assign({},block),{entityRanges:block.entityRanges.map((function(range){return __assign(__assign({},range),{key:"_"+range.key})}))}),entities:entities}])}),[])},extractTextBlockArray=function(raw,blockTypeFilter){return extractTextBlocksWithEntities(raw,(function(_a){var type=_a.type,text=_a.text;return blockTypeFilter(type)&&text.length>0}))},createTextFragments=function(raw){return(_a=raw,blockTypeFilter=function(type){return"atomic"!==type},blocks=_a.blocks,entityMap=_a.entityMap,current=0,next=0,batches=lodash.groupBy(blocks,(function(block){var isValid=blockTypeFilter(block.type);return isValid?current===next&&next++:current<next&&current++,isValid&&current})),Object.entries(batches).filter((function(value){return"false"!==value[0]})).map((function(batch){return extractTextBlocksWithEntities({blocks:batch[1],entityMap:entityMap},(function(_a){var type=_a.type,text=_a.text;return blockTypeFilter(type)&&text.length>0}))})).filter((function(batch){return batch.length>0}))).filter((function(batch){return batch.length})).map((function(batch){var textCombined=batch.map((function(entry){return entry.block.text})).join("\n"),copyBlocks=lodash.cloneDeep(batch),offset=0;copyBlocks.forEach((function(entry){entry.block.inlineStyleRanges.map((function(style){return style.offset+=offset})),entry.block.entityRanges.map((function(entity){return entity.offset+=offset})),offset+=entry.block.text.length+"\n".length}));var inlineStyleRanges=copyBlocks.flatMap((function(entry){return entry.block.inlineStyleRanges})),entityRanges=copyBlocks.flatMap((function(entry){return entry.block.entityRanges})),entities=copyBlocks.map((function(block){return block.entities})).reduce((function(acc,curr){return __assign(__assign({},acc),curr)}));return lodash.merge(lodash.cloneDeep(batch[0]),{block:{text:textCombined,inlineStyleRanges:inlineStyleRanges,entityRanges:entityRanges},entities:entities})}));var _a,blockTypeFilter,blocks,entityMap,current,next,batches},extractMedia=function(_a){var entityMap=_a.entityMap;return Object.values(entityMap).reduce((function(media,entity){return __spreadArrays(media,function(entity){return converters[entity.type]?converters[entity.type](entity):[]}(entity))}),[])},getContentStateMetadata=function(raw){var entityMap,mediaEntities=extractMedia(raw),galleryItems=mediaEntities.filter((function(_a){return _a.isGalleryItem})),singleMediaItems=mediaEntities.filter((function(_a){var type=_a.type,isGalleryItem=_a.isGalleryItem;return function(type){return type&&["image","video","giphy"].includes(type)}(type)&&!isGalleryItem})),media={singleMediaItems:singleMediaItems,galleryItems:galleryItems,totalCount:galleryItems.length+singleMediaItems.length},blocks=Object.entries(METHOD_BLOCK_MAP).reduce((function(prev,_a){var _b,func=_a[0],blockType=_a[1];return __assign(__assign({},prev),((_b={})[func]=extractTextBlockArray(raw,(function(type){return type===blockType})),_b))}),{}),groupedBlocks=Object.entries(METHOD_GROUPED_BLOCK_MAP).reduce((function(prev,_a){var _b,func=_a[0],blockType=_a[1];return __assign(__assign({},prev),((_b={})[func]=function(_a,blockType){return _a.blocks.reduce((function(result,block,idx){if(block.type===blockType){var list=-1===result.lastItemIndex?__spreadArrays(result.list,[[]]):result.list;return list[list.length-1]=__spreadArrays(list[list.length-1],[block]),{list:list,lastItemIndex:idx}}return{list:result.list,lastItemIndex:-1}}),{list:[],lastItemIndex:-1}).list.filter((function(arr){return arr.length>0}))}(raw,blockType).map((function(blocks){return extractTextBlockArray({blocks:blocks,entityMap:raw.entityMap},(function(type){return type===blockType}))})).filter((function(arr){return arr.length>0})),_b))}),{}),nonMediaPluginsCount=(entityMap=raw.entityMap,Object.values(entityMap).length-media.totalCount),nonSeparatorPlugins=mediaEntities.filter((function(_a){var type=_a.type;return["link","hashtag","mention"].includes(type)}));return __assign(__assign({allText:extractTextBlockArray(raw,(function(type){return"atomic"!==type})),textFragments:createTextFragments(raw),media:media,images:mediaEntities.filter((function(_a){return"image"===_a.type})),videos:mediaEntities.filter((function(_a){return"video"===_a.type})),files:mediaEntities.filter((function(_a){return"file"===_a.type})),maps:mediaEntities.filter((function(_a){return"map"===_a.type})),links:mediaEntities.filter((function(_a){return"link"===_a.type})),nonMediaPluginsCount:nonMediaPluginsCount,collapsablePluginsCount:nonMediaPluginsCount-nonSeparatorPlugins.length},blocks),groupedBlocks)},ContentStateTransformation=function(){function ContentStateTransformation(_a){var _if=_a._if,_then=_a._then,initialPreviewState=_a.initialPreviewState;this.rules=[],this.rule({_if:_if,_then:_then}),this.previewState=initialPreviewState}return ContentStateTransformation.prototype.rule=function(_a){var _if=_a._if,_then=_a._then;if(!lodash.isFunction(_if)||!lodash.isFunction(_then))throw new TypeError("invalid rule added: `_if` and `_then` should be functions ");return this.rules.push({_if:_if,_then:_then}),this},ContentStateTransformation.prototype.apply=function(contentState){var previewStateBuilder=new ContentStateBuilder(this.previewState),metadata=getContentStateMetadata(contentState);return this.rules.reduce((function(builder,rule){return rule._if(metadata)?rule._then(metadata,builder):builder}),previewStateBuilder).get()},ContentStateTransformation.prototype.toObject=function(){return this.rules.map((function(rule){return{_if:rule._if.toString(),_then:rule._then.toString()}}))},ContentStateTransformation}();exports.ContentStateTransformation=ContentStateTransformation,exports.INTERACTIONS=INTERACTIONS;
***************************************************************************** */function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var Version_currentVersion="8.5.0",METHOD_BLOCK_MAP=Object.freeze({h1:"header-one",h2:"header-two",h3:"header-three",h4:"header-four",h5:"header-five",h6:"header-six",quote:"blockquote"}),METHOD_GROUPED_BLOCK_MAP=Object.freeze({plain:"unstyled",code:"code-block",ol:"ordered-list-item",ul:"unordered-list-item"}),METHOD_PLUGIN_DATA_MAP=Object.freeze({image:{type:"wix-draft-plugin-image",mutability:"IMMUTABLE",data:{config:{alignment:"center",size:"content",showTitle:!1,showDescription:!1}}},video:{type:"wix-draft-plugin-video",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},gallery:{type:"wix-draft-plugin-gallery",mutability:"IMMUTABLE",data:{config:{alignment:"center",size:"content",layout:"small",spacing:0},styles:{galleryLayout:2,gallerySizeType:"px",gallerySizePx:300,galleryMargin:0,oneRow:!1,cubeRatio:1,galleryThumbnailsAlignment:"bottom",isVertical:!0,numberOfImagesPerRow:3,imageMargin:20,thumbnailSpacings:0,cubeType:"fill",enableInfiniteScroll:!0,titlePlacement:"SHOW_ON_HOVER",allowHover:!1,itemClick:"link",fullscreen:!1,showArrows:!1,gridStyle:1,loveButton:!1,allowSocial:!1,allowDownload:!1,mobileSwipeAnimation:"NO_EFFECT",thumbnailSize:120,gotStyleParams:!0,cubeImages:!0,groupSize:1,groupTypes:"1",hasThumbnails:!1,enableScroll:!0,isGrid:!0,isSlider:!1,isColumns:!1,isSlideshow:!1,cropOnlyFill:!1,smartCrop:!1,imageResize:!1,galleryImageRatio:2,galleryType:"Columns",minItemSize:50,videoPlay:"auto"}}},soundCloud:{type:"wix-draft-plugin-sound-cloud",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},giphy:{type:"wix-draft-plugin-giphy",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},map:{type:"wix-draft-plugin-map",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center",width:400,height:400}}},file:{type:"wix-draft-plugin-file-upload",mutability:"IMMUTABLE",data:{config:{alignment:"left",size:"small"}}},divider:{type:"wix-draft-plugin-divider",mutability:"IMMUTABLE",data:{type:"single",config:{size:"large",alignment:"center",textWrap:"nowrap"}}},link:{type:"LINK",mutability:"IMMUTABLE",data:{config:{}}},linkPreview:{type:"wix-draft-plugin-link-preview",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}}}),INTERACTIONS=Object.freeze({READ_MORE:"READ_MORE",IMAGE_COUNTER:"IMAGE_COUNTER",SEE_FULL_CONTENT:"SEE_FULL_CONTENT"}),galleryTypeConverters={giphy:function(item){return{mediaUrl:item.mp4,metadata:{type:"video",videoUrl:item.mp4,videoId:item.url,poster:item.url,source:"giphy",width:item.width||600,height:item.height||480}}},video:function(item){var isCustom=item.isCustom,_a=isCustom?item.url:item,_b=_a.width,width=void 0===_b?600:_b,_c=_a.height,height=void 0===_c?480:_c,url=isCustom?item.url.pathname:item.url;return{url:url,mediaUrl:url,metadata:{type:"video",poster:item.url,videoId:url,width:width,height:height}}},image:function(item){return{itemId:item.id||item.url,metadata:{width:item.width,height:item.height}}}},toGalleryItems=function(items){return items.map((function(item,index){return __assign({itemId:item.id||"item-"+index,url:item.url},galleryTypeConverters[item.type](item))}))},defaultMerger=function(mediaInfo,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),mediaInfo)})},videoMerger=function(_a,entity){var url=_a.url,isCustom=_a.isCustom;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{src:url,isCustomVideo:!!isCustom})})},mergers={"wix-draft-plugin-image":function(_a,entity){var url=_a.url,width=_a.width,height=_a.height,metadata=_a.metadata,link=_a.link,_b=_a.source,source=void 0===_b?null:_b;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{config:__assign(__assign({},entity.data.config),{link:link}),metadata:metadata,src:__assign({width:width,height:height},"static"===source?{url:url,source:source}:{file_name:url})})})},"wix-draft-plugin-gallery":function(items,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{items:toGalleryItems(items)})})},"wix-draft-plugin-giphy":function(_a,entity){var width=_a.width,height=_a.height,url=_a.url,thumbnail=_a.thumbnail;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{gif:{width:width,height:height,originalUrl:url,stillUrl:thumbnail}})})},"wix-draft-plugin-video":videoMerger,"wix-draft-plugin-sound-cloud":videoMerger,"wix-draft-plugin-file-upload":function(_a,entity){var fileType=_a.fileType,name=_a.name,url=_a.url;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{type:fileType,name:name,url:url})})},"wix-draft-plugin-map":function(mapSettings,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{mapSettings:mapSettings})})},"wix-draft-plugin-divider":defaultMerger,mention:defaultMerger,LINK:defaultMerger,"wix-draft-plugin-link-preview":function(_a,entity){var url=_a.url;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{config:__assign(__assign({},entity.data.config),{link:__assign(__assign({},entity.data.config.link),{url:url})})})})},"wix-draft-plugin-headers-markdown":defaultMerger,"wix-draft-plugin-link-button":defaultMerger,"wix-draft-plugin-action-button":defaultMerger,"wix-draft-plugin-poll":defaultMerger,"wix-draft-plugin-html":defaultMerger},DEFAULT_BLOCK_CONFIG={data:{},inlineStyleRanges:[],entityRanges:[],depth:0},createBlock=function(type,text,config){return __assign({key:Math.random().toString(36).substr(2,5),type:type,text:text},__assign(__assign({},DEFAULT_BLOCK_CONFIG),config||{}))},addEntity=function(_a){var _b,mediaInfo,entity,contentState=_a.contentState,data=_a.data,config=_a.config,mergedEntity=(mediaInfo=data,mergers[(entity=config).type](mediaInfo,entity));return __assign(__assign({},contentState),{entityMap:__assign(__assign({},contentState.entityMap),(_b={},_b[Object.keys(contentState.entityMap).length]=mergedEntity,_b))})},addPlugin=function(_a){var contentState=_a.contentState,data=_a.data,config=_a.config,contentStateWithBlock=function(_a){var contentState=_a.contentState,text=_a.text,type=_a.type,config=_a.config;return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks,[createBlock(type,text,config)])})}({contentState:contentState,text:" ",type:"atomic",config:{entityRanges:[{offset:0,length:1,key:Object.keys(contentState.entityMap).length}]}});return addEntity({contentState:contentStateWithBlock,data:data,config:config})},interactionDataMerger=function(_a){var _b,_c,contentState=_a.contentState,_d=_a.settings,settings=void 0===_d?{}:_d,_e=_a.blockFilter,blockFilter=void 0===_e?function(){}:_e,type=_a.type,_f=_a.schema,schema=void 0===_f?[]:_f;if(!contentState.blocks||0===contentState.blocks.length)return contentState;var lastBlock=contentState.blocks.slice(-1)[0];if(blockFilter(lastBlock))return contentState;var invalidSettings=Object.keys(settings).filter((function(key){return!schema.includes(key)}));if(invalidSettings.length>0&&console.error("Warning: invalid "+type+" interaction settings found",invalidSettings),"atomic"!==lastBlock.type){var modifiedBlock=__assign(__assign({},lastBlock),{data:__assign(__assign({},lastBlock.data),{interactions:__spreadArrays((null===(_c=null==lastBlock?void 0:lastBlock.data)||void 0===_c?void 0:_c.interactions)||[],[{type:type,settings:settings}])})});return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks.slice(0,contentState.blocks.length-1),[modifiedBlock])})}var lastBlockEntityKey=lastBlock.entityRanges.length>0&&lastBlock.entityRanges[0].key;if(!1!==lastBlockEntityKey){var lastBlockEntity=contentState.entityMap[lastBlockEntityKey],modifiedEntity=__assign(__assign({},lastBlockEntity),{data:__assign(__assign({},lastBlockEntity&&lastBlockEntity.data),{interactions:__spreadArrays(lastBlockEntity&&lastBlockEntity.data.interactions||[],[{type:type,settings:settings}])})});return __assign(__assign({},contentState),{entityMap:__assign(__assign({},contentState.entityMap),(_b={},_b[lastBlockEntityKey]=modifiedEntity,_b))})}return contentState},DEFAULT_STATE={blocks:[],entityMap:{},VERSION:Version_currentVersion},ContentStateBuilder=function(){function ContentStateBuilder(initialState){this.contentState=__assign(__assign({},DEFAULT_STATE),initialState||{})}return ContentStateBuilder.prototype.get=function(){return this.contentState},ContentStateBuilder}();Object.keys(__assign(__assign({},METHOD_BLOCK_MAP),METHOD_GROUPED_BLOCK_MAP)).forEach((function(method){ContentStateBuilder.prototype[method]=function(textBlocksWithEntities){var content,textContentArray=(content=textBlocksWithEntities,lodash.isArray(content)?content:[content]);return this.contentState=textContentArray.reduce((function(state,_a){return function(_a){var contentState=_a.contentState,block=_a.block,entities=_a.entities;return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks,[block]),entityMap:__assign(__assign({},contentState.entityMap),entities)})}({contentState:state,block:_a.block,entities:_a.entities})}),this.contentState),this}})),Object.entries(METHOD_PLUGIN_DATA_MAP).forEach((function(_a){var method=_a[0],defaultEntityData=_a[1];ContentStateBuilder.prototype[method]=function(_a){var mediaInfo=_a.mediaInfo,_b=_a.config,config=void 0===_b?{}:_b,_c=_a.overrides,overrides=void 0===_c?{}:_c;return this.contentState=addPlugin({contentState:this.contentState,data:mediaInfo,config:__assign(__assign({},defaultEntityData),{data:__assign(__assign(__assign({},defaultEntityData.data),{config:__assign(__assign({},defaultEntityData.data.config),config)}),overrides)})}),this}})),Object.entries({readMore:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(block){return"atomic"===block.type},type:INTERACTIONS.READ_MORE,schema:["label","onClick","expandMode","lines","text","showToggle"]}),builder},seeFullPost:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(){return!1},type:INTERACTIONS.SEE_FULL_CONTENT,schema:["label","labelStyles","overlayStyles","onClick"]}),builder},imageCounter:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(block){return"atomic"!==block.type},type:INTERACTIONS.IMAGE_COUNTER,schema:["counter","formatLabel","onClick","style"]}),builder}}).forEach((function(_a){var key=_a[0],method=_a[1];ContentStateBuilder.prototype[key]=function(settings){return method(this,settings)}}));var defaultEntityConverter=function(){return[]},videoConverter=function(entity){return[{type:"video",url:entity.data.src,isCustom:entity.data.isCustomVideo}]},linkConverter=function(entity){return[{type:"link",url:entity.data.url}]},converters={"wix-draft-plugin-image":function(entity){return[{width:entity.data.src.width,height:entity.data.src.height,url:entity.data.src.file_name,type:"image",metadata:entity.data.metadata,link:entity.data.config.link}]},"wix-draft-plugin-gallery":function(entity){return entity.data.items.map((function(_a){var metadata=_a.metadata,url=_a.url,itemId=_a.itemId;return{url:url,height:metadata.height,width:metadata.width,id:itemId,type:"image",isGalleryItem:!0}}))},"wix-draft-plugin-divider":defaultEntityConverter,"wix-draft-plugin-video":videoConverter,"wix-draft-plugin-sound-cloud":videoConverter,"wix-draft-plugin-giphy":function(entity){return[{type:"giphy",url:entity.data.gif.originalUrl,mp4:entity.data.gif.downsizedSmallMp4,thumbnail:entity.data.gif.stillUrl,width:entity.data.gif.width,height:entity.data.gif.height,source:"static"}]},"wix-draft-plugin-file-upload":function(entity){return[{name:entity.data.name,type:"file",fileType:entity.data.type,url:entity.data.url}]},"wix-draft-plugin-map":function(entity){return[{type:"map",mapSettings:entity.data.mapSettings}]},mention:defaultEntityConverter,"wix-draft-plugin-headers-markdown":defaultEntityConverter,"wix-draft-plugin-link-button":defaultEntityConverter,"wix-draft-plugin-action-button":defaultEntityConverter,"wix-draft-plugin-poll":defaultEntityConverter,LINK:linkConverter,LINK_PREVIEW:linkConverter,"wix-draft-plugin-html":defaultEntityConverter},extractTextBlocksWithEntities=function(_a,blockFilter){var blocks=_a.blocks,entityMap=_a.entityMap;return blocks.filter(blockFilter).reduce((function(texts,block){var entities=block.entityRanges.reduce((function(map,range){return map["_"+range.key]=entityMap[range.key],map}),{});return __spreadArrays(texts,[{block:__assign(__assign({},block),{entityRanges:block.entityRanges.map((function(range){return __assign(__assign({},range),{key:"_"+range.key})}))}),entities:entities}])}),[])},extractTextBlockArray=function(raw,blockTypeFilter){return extractTextBlocksWithEntities(raw,(function(_a){var type=_a.type,text=_a.text;return blockTypeFilter(type)&&text.length>0}))},createTextFragments=function(raw){return(_a=raw,blockTypeFilter=function(type){return"atomic"!==type},blocks=_a.blocks,entityMap=_a.entityMap,current=0,next=0,batches=lodash.groupBy(blocks,(function(block){var isValid=blockTypeFilter(block.type);return isValid?current===next&&next++:current<next&&current++,isValid&&current})),Object.entries(batches).filter((function(value){return"false"!==value[0]})).map((function(batch){return extractTextBlocksWithEntities({blocks:batch[1],entityMap:entityMap},(function(_a){var type=_a.type,text=_a.text;return blockTypeFilter(type)&&text.length>0}))})).filter((function(batch){return batch.length>0}))).filter((function(batch){return batch.length})).map((function(batch){var textCombined=batch.map((function(entry){return entry.block.text})).join("\n"),copyBlocks=lodash.cloneDeep(batch),offset=0;copyBlocks.forEach((function(entry){entry.block.inlineStyleRanges.map((function(style){return style.offset+=offset})),entry.block.entityRanges.map((function(entity){return entity.offset+=offset})),offset+=entry.block.text.length+"\n".length}));var inlineStyleRanges=copyBlocks.flatMap((function(entry){return entry.block.inlineStyleRanges})),entityRanges=copyBlocks.flatMap((function(entry){return entry.block.entityRanges})),entities=copyBlocks.map((function(block){return block.entities})).reduce((function(acc,curr){return __assign(__assign({},acc),curr)}));return lodash.merge(lodash.cloneDeep(batch[0]),{block:{text:textCombined,inlineStyleRanges:inlineStyleRanges,entityRanges:entityRanges},entities:entities})}));var _a,blockTypeFilter,blocks,entityMap,current,next,batches},extractMedia=function(_a){var entityMap=_a.entityMap;return Object.values(entityMap).reduce((function(media,entity){return __spreadArrays(media,function(entity){return converters[entity.type]?converters[entity.type](entity):[]}(entity))}),[])},getContentStateMetadata=function(raw){var entityMap,mediaEntities=extractMedia(raw),galleryItems=mediaEntities.filter((function(_a){return _a.isGalleryItem})),singleMediaItems=mediaEntities.filter((function(_a){var type=_a.type,isGalleryItem=_a.isGalleryItem;return function(type){return type&&["image","video","giphy"].includes(type)}(type)&&!isGalleryItem})),media={singleMediaItems:singleMediaItems,galleryItems:galleryItems,totalCount:galleryItems.length+singleMediaItems.length},blocks=Object.entries(METHOD_BLOCK_MAP).reduce((function(prev,_a){var _b,func=_a[0],blockType=_a[1];return __assign(__assign({},prev),((_b={})[func]=extractTextBlockArray(raw,(function(type){return type===blockType})),_b))}),{}),groupedBlocks=Object.entries(METHOD_GROUPED_BLOCK_MAP).reduce((function(prev,_a){var _b,func=_a[0],blockType=_a[1];return __assign(__assign({},prev),((_b={})[func]=function(_a,blockType){return _a.blocks.reduce((function(result,block,idx){if(block.type===blockType){var list=-1===result.lastItemIndex?__spreadArrays(result.list,[[]]):result.list;return list[list.length-1]=__spreadArrays(list[list.length-1],[block]),{list:list,lastItemIndex:idx}}return{list:result.list,lastItemIndex:-1}}),{list:[],lastItemIndex:-1}).list.filter((function(arr){return arr.length>0}))}(raw,blockType).map((function(blocks){return extractTextBlockArray({blocks:blocks,entityMap:raw.entityMap},(function(type){return type===blockType}))})).filter((function(arr){return arr.length>0})),_b))}),{}),nonMediaPluginsCount=(entityMap=raw.entityMap,Object.values(entityMap).length-media.totalCount),nonSeparatorPlugins=mediaEntities.filter((function(_a){var type=_a.type;return["link","hashtag","mention"].includes(type)}));return __assign(__assign({allText:extractTextBlockArray(raw,(function(type){return"atomic"!==type})),textFragments:createTextFragments(raw),media:media,images:mediaEntities.filter((function(_a){return"image"===_a.type})),videos:mediaEntities.filter((function(_a){return"video"===_a.type})),files:mediaEntities.filter((function(_a){return"file"===_a.type})),maps:mediaEntities.filter((function(_a){return"map"===_a.type})),links:mediaEntities.filter((function(_a){return"link"===_a.type})),nonMediaPluginsCount:nonMediaPluginsCount,collapsablePluginsCount:nonMediaPluginsCount-nonSeparatorPlugins.length},blocks),groupedBlocks)},ContentStateTransformation=function(){function ContentStateTransformation(_a){var _if=_a._if,_then=_a._then,initialPreviewState=_a.initialPreviewState;this.rules=[],this.rule({_if:_if,_then:_then}),this.previewState=initialPreviewState}return ContentStateTransformation.prototype.rule=function(_a){var _if=_a._if,_then=_a._then;if(!lodash.isFunction(_if)||!lodash.isFunction(_then))throw new TypeError("invalid rule added: `_if` and `_then` should be functions ");return this.rules.push({_if:_if,_then:_then}),this},ContentStateTransformation.prototype.apply=function(contentState){var previewStateBuilder=new ContentStateBuilder(this.previewState),metadata=getContentStateMetadata(contentState);return this.rules.reduce((function(builder,rule){return rule._if(metadata)?rule._then(metadata,builder):builder}),previewStateBuilder).get()},ContentStateTransformation.prototype.toObject=function(){return this.rules.map((function(rule){return{_if:rule._if.toString(),_then:rule._then.toString()}}))},ContentStateTransformation}();exports.ContentStateTransformation=ContentStateTransformation,exports.INTERACTIONS=INTERACTIONS;

@@ -15,2 +15,2 @@ import{isNaN,isArray,cloneDeep,merge,groupBy,isFunction}from"lodash";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var __assign=function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var Version_currentVersion="8.4.8",METHOD_BLOCK_MAP=Object.freeze({h1:"header-one",h2:"header-two",h3:"header-three",h4:"header-four",h5:"header-five",h6:"header-six",quote:"blockquote"}),METHOD_GROUPED_BLOCK_MAP=Object.freeze({plain:"unstyled",code:"code-block",ol:"ordered-list-item",ul:"unordered-list-item"}),METHOD_PLUGIN_DATA_MAP=Object.freeze({image:{type:"wix-draft-plugin-image",mutability:"IMMUTABLE",data:{config:{alignment:"center",size:"content",showTitle:!1,showDescription:!1}}},video:{type:"wix-draft-plugin-video",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},gallery:{type:"wix-draft-plugin-gallery",mutability:"IMMUTABLE",data:{config:{alignment:"center",size:"content",layout:"small",spacing:0},styles:{galleryLayout:2,gallerySizeType:"px",gallerySizePx:300,galleryMargin:0,oneRow:!1,cubeRatio:1,galleryThumbnailsAlignment:"bottom",isVertical:!0,numberOfImagesPerRow:3,imageMargin:20,thumbnailSpacings:0,cubeType:"fill",enableInfiniteScroll:!0,titlePlacement:"SHOW_ON_HOVER",allowHover:!1,itemClick:"link",fullscreen:!1,showArrows:!1,gridStyle:1,loveButton:!1,allowSocial:!1,allowDownload:!1,mobileSwipeAnimation:"NO_EFFECT",thumbnailSize:120,gotStyleParams:!0,cubeImages:!0,groupSize:1,groupTypes:"1",hasThumbnails:!1,enableScroll:!0,isGrid:!0,isSlider:!1,isColumns:!1,isSlideshow:!1,cropOnlyFill:!1,smartCrop:!1,imageResize:!1,galleryImageRatio:2,galleryType:"Columns",minItemSize:50,videoPlay:"auto"}}},soundCloud:{type:"wix-draft-plugin-sound-cloud",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},giphy:{type:"wix-draft-plugin-giphy",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},map:{type:"wix-draft-plugin-map",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center",width:400,height:400}}},file:{type:"wix-draft-plugin-file-upload",mutability:"IMMUTABLE",data:{config:{alignment:"left",size:"small"}}},divider:{type:"wix-draft-plugin-divider",mutability:"IMMUTABLE",data:{type:"single",config:{size:"large",alignment:"center",textWrap:"nowrap"}}},link:{type:"LINK",mutability:"IMMUTABLE",data:{config:{}}},linkPreview:{type:"wix-draft-plugin-link-preview",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}}}),INTERACTIONS=Object.freeze({READ_MORE:"READ_MORE",IMAGE_COUNTER:"IMAGE_COUNTER",SEE_FULL_CONTENT:"SEE_FULL_CONTENT"}),galleryTypeConverters={giphy:function(item){return{mediaUrl:item.mp4,metadata:{type:"video",videoUrl:item.mp4,videoId:item.url,poster:item.url,source:"giphy",width:item.width||600,height:item.height||480}}},video:function(item){var isCustom=item.isCustom,_a=isCustom?item.url:item,_b=_a.width,width=void 0===_b?600:_b,_c=_a.height,height=void 0===_c?480:_c,url=isCustom?item.url.pathname:item.url;return{url:url,mediaUrl:url,metadata:{type:"video",poster:item.url,videoId:url,width:width,height:height}}},image:function(item){return{itemId:item.id||item.url,metadata:{width:item.width,height:item.height}}}},toGalleryItems=function(items){return items.map((function(item,index){return __assign({itemId:item.id||"item-"+index,url:item.url},galleryTypeConverters[item.type](item))}))},defaultMerger=function(mediaInfo,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),mediaInfo)})},videoMerger=function(_a,entity){var url=_a.url,isCustom=_a.isCustom;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{src:url,isCustomVideo:!!isCustom})})},mergers={"wix-draft-plugin-image":function(_a,entity){var url=_a.url,width=_a.width,height=_a.height,metadata=_a.metadata,link=_a.link,_b=_a.source,source=void 0===_b?null:_b;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{config:__assign(__assign({},entity.data.config),{link:link}),metadata:metadata,src:__assign({width:width,height:height},"static"===source?{url:url,source:source}:{file_name:url})})})},"wix-draft-plugin-gallery":function(items,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{items:toGalleryItems(items)})})},"wix-draft-plugin-giphy":function(_a,entity){var width=_a.width,height=_a.height,url=_a.url,thumbnail=_a.thumbnail;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{gif:{width:width,height:height,originalUrl:url,stillUrl:thumbnail}})})},"wix-draft-plugin-video":videoMerger,"wix-draft-plugin-sound-cloud":videoMerger,"wix-draft-plugin-file-upload":function(_a,entity){var fileType=_a.fileType,name=_a.name,url=_a.url;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{type:fileType,name:name,url:url})})},"wix-draft-plugin-map":function(mapSettings,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{mapSettings:mapSettings})})},"wix-draft-plugin-divider":defaultMerger,mention:defaultMerger,LINK:defaultMerger,"wix-draft-plugin-link-preview":function(_a,entity){var url=_a.url;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{config:__assign(__assign({},entity.data.config),{link:__assign(__assign({},entity.data.config.link),{url:url})})})})},"wix-draft-plugin-headers-markdown":defaultMerger,"wix-draft-plugin-link-button":defaultMerger,"wix-draft-plugin-action-button":defaultMerger,"wix-draft-plugin-poll":defaultMerger,"wix-draft-plugin-html":defaultMerger},DEFAULT_BLOCK_CONFIG={data:{},inlineStyleRanges:[],entityRanges:[],depth:0},createBlock=function(type,text,config){return __assign({key:Math.random().toString(36).substr(2,5),type:type,text:text},__assign(__assign({},DEFAULT_BLOCK_CONFIG),config||{}))},addEntity=function(_a){var _b,mediaInfo,entity,contentState=_a.contentState,data=_a.data,config=_a.config,mergedEntity=(mediaInfo=data,mergers[(entity=config).type](mediaInfo,entity));return __assign(__assign({},contentState),{entityMap:__assign(__assign({},contentState.entityMap),(_b={},_b[Object.keys(contentState.entityMap).length]=mergedEntity,_b))})},addPlugin=function(_a){var contentState=_a.contentState,data=_a.data,config=_a.config,contentStateWithBlock=function(_a){var contentState=_a.contentState,text=_a.text,type=_a.type,config=_a.config;return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks,[createBlock(type,text,config)])})}({contentState:contentState,text:" ",type:"atomic",config:{entityRanges:[{offset:0,length:1,key:Object.keys(contentState.entityMap).length}]}});return addEntity({contentState:contentStateWithBlock,data:data,config:config})},interactionDataMerger=function(_a){var _b,_c,contentState=_a.contentState,_d=_a.settings,settings=void 0===_d?{}:_d,_e=_a.blockFilter,blockFilter=void 0===_e?function(){}:_e,type=_a.type,_f=_a.schema,schema=void 0===_f?[]:_f;if(!contentState.blocks||0===contentState.blocks.length)return contentState;var lastBlock=contentState.blocks.slice(-1)[0];if(blockFilter(lastBlock))return contentState;var invalidSettings=Object.keys(settings).filter((function(key){return!schema.includes(key)}));if(invalidSettings.length>0&&console.error("Warning: invalid "+type+" interaction settings found",invalidSettings),"atomic"!==lastBlock.type){var modifiedBlock=__assign(__assign({},lastBlock),{data:__assign(__assign({},lastBlock.data),{interactions:__spreadArrays((null===(_c=null==lastBlock?void 0:lastBlock.data)||void 0===_c?void 0:_c.interactions)||[],[{type:type,settings:settings}])})});return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks.slice(0,contentState.blocks.length-1),[modifiedBlock])})}var lastBlockEntityKey=lastBlock.entityRanges.length>0&&lastBlock.entityRanges[0].key;if(!1!==lastBlockEntityKey){var lastBlockEntity=contentState.entityMap[lastBlockEntityKey],modifiedEntity=__assign(__assign({},lastBlockEntity),{data:__assign(__assign({},lastBlockEntity&&lastBlockEntity.data),{interactions:__spreadArrays(lastBlockEntity&&lastBlockEntity.data.interactions||[],[{type:type,settings:settings}])})});return __assign(__assign({},contentState),{entityMap:__assign(__assign({},contentState.entityMap),(_b={},_b[lastBlockEntityKey]=modifiedEntity,_b))})}return contentState},DEFAULT_STATE={blocks:[],entityMap:{},VERSION:Version_currentVersion},ContentStateBuilder=function(){function ContentStateBuilder(initialState){this.contentState=__assign(__assign({},DEFAULT_STATE),initialState||{})}return ContentStateBuilder.prototype.get=function(){return this.contentState},ContentStateBuilder}();Object.keys(__assign(__assign({},METHOD_BLOCK_MAP),METHOD_GROUPED_BLOCK_MAP)).forEach((function(method){ContentStateBuilder.prototype[method]=function(textBlocksWithEntities){var content,textContentArray=isArray(content=textBlocksWithEntities)?content:[content];return this.contentState=textContentArray.reduce((function(state,_a){return function(_a){var contentState=_a.contentState,block=_a.block,entities=_a.entities;return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks,[block]),entityMap:__assign(__assign({},contentState.entityMap),entities)})}({contentState:state,block:_a.block,entities:_a.entities})}),this.contentState),this}})),Object.entries(METHOD_PLUGIN_DATA_MAP).forEach((function(_a){var method=_a[0],defaultEntityData=_a[1];ContentStateBuilder.prototype[method]=function(_a){var mediaInfo=_a.mediaInfo,_b=_a.config,config=void 0===_b?{}:_b,_c=_a.overrides,overrides=void 0===_c?{}:_c;return this.contentState=addPlugin({contentState:this.contentState,data:mediaInfo,config:__assign(__assign({},defaultEntityData),{data:__assign(__assign(__assign({},defaultEntityData.data),{config:__assign(__assign({},defaultEntityData.data.config),config)}),overrides)})}),this}})),Object.entries({readMore:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(block){return"atomic"===block.type},type:INTERACTIONS.READ_MORE,schema:["label","onClick","expandMode","lines","text","showToggle"]}),builder},seeFullPost:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(){return!1},type:INTERACTIONS.SEE_FULL_CONTENT,schema:["label","labelStyles","overlayStyles","onClick"]}),builder},imageCounter:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(block){return"atomic"!==block.type},type:INTERACTIONS.IMAGE_COUNTER,schema:["counter","formatLabel","onClick","style"]}),builder}}).forEach((function(_a){var key=_a[0],method=_a[1];ContentStateBuilder.prototype[key]=function(settings){return method(this,settings)}}));var defaultEntityConverter=function(){return[]},videoConverter=function(entity){return[{type:"video",url:entity.data.src,isCustom:entity.data.isCustomVideo}]},linkConverter=function(entity){return[{type:"link",url:entity.data.url}]},converters={"wix-draft-plugin-image":function(entity){return[{width:entity.data.src.width,height:entity.data.src.height,url:entity.data.src.file_name,type:"image",metadata:entity.data.metadata,link:entity.data.config.link}]},"wix-draft-plugin-gallery":function(entity){return entity.data.items.map((function(_a){var metadata=_a.metadata,url=_a.url,itemId=_a.itemId;return{url:url,height:metadata.height,width:metadata.width,id:itemId,type:"image",isGalleryItem:!0}}))},"wix-draft-plugin-divider":defaultEntityConverter,"wix-draft-plugin-video":videoConverter,"wix-draft-plugin-sound-cloud":videoConverter,"wix-draft-plugin-giphy":function(entity){return[{type:"giphy",url:entity.data.gif.originalUrl,mp4:entity.data.gif.downsizedSmallMp4,thumbnail:entity.data.gif.stillUrl,width:entity.data.gif.width,height:entity.data.gif.height,source:"static"}]},"wix-draft-plugin-file-upload":function(entity){return[{name:entity.data.name,type:"file",fileType:entity.data.type,url:entity.data.url}]},"wix-draft-plugin-map":function(entity){return[{type:"map",mapSettings:entity.data.mapSettings}]},mention:defaultEntityConverter,"wix-draft-plugin-headers-markdown":defaultEntityConverter,"wix-draft-plugin-link-button":defaultEntityConverter,"wix-draft-plugin-action-button":defaultEntityConverter,"wix-draft-plugin-poll":defaultEntityConverter,LINK:linkConverter,LINK_PREVIEW:linkConverter,"wix-draft-plugin-html":defaultEntityConverter},extractTextBlocksWithEntities=function(_a,blockFilter){var blocks=_a.blocks,entityMap=_a.entityMap;return blocks.filter(blockFilter).reduce((function(texts,block){var entities=block.entityRanges.reduce((function(map,range){return map["_"+range.key]=entityMap[range.key],map}),{});return __spreadArrays(texts,[{block:__assign(__assign({},block),{entityRanges:block.entityRanges.map((function(range){return __assign(__assign({},range),{key:"_"+range.key})}))}),entities:entities}])}),[])},extractTextBlockArray=function(raw,blockTypeFilter){return extractTextBlocksWithEntities(raw,(function(_a){var type=_a.type,text=_a.text;return blockTypeFilter(type)&&text.length>0}))},createTextFragments=function(raw){return(_a=raw,blockTypeFilter=function(type){return"atomic"!==type},blocks=_a.blocks,entityMap=_a.entityMap,current=0,next=0,batches=groupBy(blocks,(function(block){var isValid=blockTypeFilter(block.type);return isValid?current===next&&next++:current<next&&current++,isValid&&current})),Object.entries(batches).filter((function(value){return"false"!==value[0]})).map((function(batch){return extractTextBlocksWithEntities({blocks:batch[1],entityMap:entityMap},(function(_a){var type=_a.type,text=_a.text;return blockTypeFilter(type)&&text.length>0}))})).filter((function(batch){return batch.length>0}))).filter((function(batch){return batch.length})).map((function(batch){var textCombined=batch.map((function(entry){return entry.block.text})).join("\n"),copyBlocks=cloneDeep(batch),offset=0;copyBlocks.forEach((function(entry){entry.block.inlineStyleRanges.map((function(style){return style.offset+=offset})),entry.block.entityRanges.map((function(entity){return entity.offset+=offset})),offset+=entry.block.text.length+"\n".length}));var inlineStyleRanges=copyBlocks.flatMap((function(entry){return entry.block.inlineStyleRanges})),entityRanges=copyBlocks.flatMap((function(entry){return entry.block.entityRanges})),entities=copyBlocks.map((function(block){return block.entities})).reduce((function(acc,curr){return __assign(__assign({},acc),curr)}));return merge(cloneDeep(batch[0]),{block:{text:textCombined,inlineStyleRanges:inlineStyleRanges,entityRanges:entityRanges},entities:entities})}));var _a,blockTypeFilter,blocks,entityMap,current,next,batches},extractMedia=function(_a){var entityMap=_a.entityMap;return Object.values(entityMap).reduce((function(media,entity){return __spreadArrays(media,function(entity){return converters[entity.type]?converters[entity.type](entity):[]}(entity))}),[])},getContentStateMetadata=function(raw){var entityMap,mediaEntities=extractMedia(raw),galleryItems=mediaEntities.filter((function(_a){return _a.isGalleryItem})),singleMediaItems=mediaEntities.filter((function(_a){var type=_a.type,isGalleryItem=_a.isGalleryItem;return function(type){return type&&["image","video","giphy"].includes(type)}(type)&&!isGalleryItem})),media={singleMediaItems:singleMediaItems,galleryItems:galleryItems,totalCount:galleryItems.length+singleMediaItems.length},blocks=Object.entries(METHOD_BLOCK_MAP).reduce((function(prev,_a){var _b,func=_a[0],blockType=_a[1];return __assign(__assign({},prev),((_b={})[func]=extractTextBlockArray(raw,(function(type){return type===blockType})),_b))}),{}),groupedBlocks=Object.entries(METHOD_GROUPED_BLOCK_MAP).reduce((function(prev,_a){var _b,func=_a[0],blockType=_a[1];return __assign(__assign({},prev),((_b={})[func]=function(_a,blockType){return _a.blocks.reduce((function(result,block,idx){if(block.type===blockType){var list=-1===result.lastItemIndex?__spreadArrays(result.list,[[]]):result.list;return list[list.length-1]=__spreadArrays(list[list.length-1],[block]),{list:list,lastItemIndex:idx}}return{list:result.list,lastItemIndex:-1}}),{list:[],lastItemIndex:-1}).list.filter((function(arr){return arr.length>0}))}(raw,blockType).map((function(blocks){return extractTextBlockArray({blocks:blocks,entityMap:raw.entityMap},(function(type){return type===blockType}))})).filter((function(arr){return arr.length>0})),_b))}),{}),nonMediaPluginsCount=(entityMap=raw.entityMap,Object.values(entityMap).length-media.totalCount),nonSeparatorPlugins=mediaEntities.filter((function(_a){var type=_a.type;return["link","hashtag","mention"].includes(type)}));return __assign(__assign({allText:extractTextBlockArray(raw,(function(type){return"atomic"!==type})),textFragments:createTextFragments(raw),media:media,images:mediaEntities.filter((function(_a){return"image"===_a.type})),videos:mediaEntities.filter((function(_a){return"video"===_a.type})),files:mediaEntities.filter((function(_a){return"file"===_a.type})),maps:mediaEntities.filter((function(_a){return"map"===_a.type})),links:mediaEntities.filter((function(_a){return"link"===_a.type})),nonMediaPluginsCount:nonMediaPluginsCount,collapsablePluginsCount:nonMediaPluginsCount-nonSeparatorPlugins.length},blocks),groupedBlocks)},ContentStateTransformation=function(){function ContentStateTransformation(_a){var _if=_a._if,_then=_a._then,initialPreviewState=_a.initialPreviewState;this.rules=[],this.rule({_if:_if,_then:_then}),this.previewState=initialPreviewState}return ContentStateTransformation.prototype.rule=function(_a){var _if=_a._if,_then=_a._then;if(!isFunction(_if)||!isFunction(_then))throw new TypeError("invalid rule added: `_if` and `_then` should be functions ");return this.rules.push({_if:_if,_then:_then}),this},ContentStateTransformation.prototype.apply=function(contentState){var previewStateBuilder=new ContentStateBuilder(this.previewState),metadata=getContentStateMetadata(contentState);return this.rules.reduce((function(builder,rule){return rule._if(metadata)?rule._then(metadata,builder):builder}),previewStateBuilder).get()},ContentStateTransformation.prototype.toObject=function(){return this.rules.map((function(rule){return{_if:rule._if.toString(),_then:rule._then.toString()}}))},ContentStateTransformation}();export{ContentStateTransformation,INTERACTIONS};
***************************************************************************** */var __assign=function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var Version_currentVersion="8.5.0",METHOD_BLOCK_MAP=Object.freeze({h1:"header-one",h2:"header-two",h3:"header-three",h4:"header-four",h5:"header-five",h6:"header-six",quote:"blockquote"}),METHOD_GROUPED_BLOCK_MAP=Object.freeze({plain:"unstyled",code:"code-block",ol:"ordered-list-item",ul:"unordered-list-item"}),METHOD_PLUGIN_DATA_MAP=Object.freeze({image:{type:"wix-draft-plugin-image",mutability:"IMMUTABLE",data:{config:{alignment:"center",size:"content",showTitle:!1,showDescription:!1}}},video:{type:"wix-draft-plugin-video",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},gallery:{type:"wix-draft-plugin-gallery",mutability:"IMMUTABLE",data:{config:{alignment:"center",size:"content",layout:"small",spacing:0},styles:{galleryLayout:2,gallerySizeType:"px",gallerySizePx:300,galleryMargin:0,oneRow:!1,cubeRatio:1,galleryThumbnailsAlignment:"bottom",isVertical:!0,numberOfImagesPerRow:3,imageMargin:20,thumbnailSpacings:0,cubeType:"fill",enableInfiniteScroll:!0,titlePlacement:"SHOW_ON_HOVER",allowHover:!1,itemClick:"link",fullscreen:!1,showArrows:!1,gridStyle:1,loveButton:!1,allowSocial:!1,allowDownload:!1,mobileSwipeAnimation:"NO_EFFECT",thumbnailSize:120,gotStyleParams:!0,cubeImages:!0,groupSize:1,groupTypes:"1",hasThumbnails:!1,enableScroll:!0,isGrid:!0,isSlider:!1,isColumns:!1,isSlideshow:!1,cropOnlyFill:!1,smartCrop:!1,imageResize:!1,galleryImageRatio:2,galleryType:"Columns",minItemSize:50,videoPlay:"auto"}}},soundCloud:{type:"wix-draft-plugin-sound-cloud",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},giphy:{type:"wix-draft-plugin-giphy",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}},map:{type:"wix-draft-plugin-map",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center",width:400,height:400}}},file:{type:"wix-draft-plugin-file-upload",mutability:"IMMUTABLE",data:{config:{alignment:"left",size:"small"}}},divider:{type:"wix-draft-plugin-divider",mutability:"IMMUTABLE",data:{type:"single",config:{size:"large",alignment:"center",textWrap:"nowrap"}}},link:{type:"LINK",mutability:"IMMUTABLE",data:{config:{}}},linkPreview:{type:"wix-draft-plugin-link-preview",mutability:"IMMUTABLE",data:{config:{size:"content",alignment:"center"}}}}),INTERACTIONS=Object.freeze({READ_MORE:"READ_MORE",IMAGE_COUNTER:"IMAGE_COUNTER",SEE_FULL_CONTENT:"SEE_FULL_CONTENT"}),galleryTypeConverters={giphy:function(item){return{mediaUrl:item.mp4,metadata:{type:"video",videoUrl:item.mp4,videoId:item.url,poster:item.url,source:"giphy",width:item.width||600,height:item.height||480}}},video:function(item){var isCustom=item.isCustom,_a=isCustom?item.url:item,_b=_a.width,width=void 0===_b?600:_b,_c=_a.height,height=void 0===_c?480:_c,url=isCustom?item.url.pathname:item.url;return{url:url,mediaUrl:url,metadata:{type:"video",poster:item.url,videoId:url,width:width,height:height}}},image:function(item){return{itemId:item.id||item.url,metadata:{width:item.width,height:item.height}}}},toGalleryItems=function(items){return items.map((function(item,index){return __assign({itemId:item.id||"item-"+index,url:item.url},galleryTypeConverters[item.type](item))}))},defaultMerger=function(mediaInfo,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),mediaInfo)})},videoMerger=function(_a,entity){var url=_a.url,isCustom=_a.isCustom;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{src:url,isCustomVideo:!!isCustom})})},mergers={"wix-draft-plugin-image":function(_a,entity){var url=_a.url,width=_a.width,height=_a.height,metadata=_a.metadata,link=_a.link,_b=_a.source,source=void 0===_b?null:_b;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{config:__assign(__assign({},entity.data.config),{link:link}),metadata:metadata,src:__assign({width:width,height:height},"static"===source?{url:url,source:source}:{file_name:url})})})},"wix-draft-plugin-gallery":function(items,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{items:toGalleryItems(items)})})},"wix-draft-plugin-giphy":function(_a,entity){var width=_a.width,height=_a.height,url=_a.url,thumbnail=_a.thumbnail;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{gif:{width:width,height:height,originalUrl:url,stillUrl:thumbnail}})})},"wix-draft-plugin-video":videoMerger,"wix-draft-plugin-sound-cloud":videoMerger,"wix-draft-plugin-file-upload":function(_a,entity){var fileType=_a.fileType,name=_a.name,url=_a.url;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{type:fileType,name:name,url:url})})},"wix-draft-plugin-map":function(mapSettings,entity){return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{mapSettings:mapSettings})})},"wix-draft-plugin-divider":defaultMerger,mention:defaultMerger,LINK:defaultMerger,"wix-draft-plugin-link-preview":function(_a,entity){var url=_a.url;return __assign(__assign({},entity),{data:__assign(__assign({},entity.data),{config:__assign(__assign({},entity.data.config),{link:__assign(__assign({},entity.data.config.link),{url:url})})})})},"wix-draft-plugin-headers-markdown":defaultMerger,"wix-draft-plugin-link-button":defaultMerger,"wix-draft-plugin-action-button":defaultMerger,"wix-draft-plugin-poll":defaultMerger,"wix-draft-plugin-html":defaultMerger},DEFAULT_BLOCK_CONFIG={data:{},inlineStyleRanges:[],entityRanges:[],depth:0},createBlock=function(type,text,config){return __assign({key:Math.random().toString(36).substr(2,5),type:type,text:text},__assign(__assign({},DEFAULT_BLOCK_CONFIG),config||{}))},addEntity=function(_a){var _b,mediaInfo,entity,contentState=_a.contentState,data=_a.data,config=_a.config,mergedEntity=(mediaInfo=data,mergers[(entity=config).type](mediaInfo,entity));return __assign(__assign({},contentState),{entityMap:__assign(__assign({},contentState.entityMap),(_b={},_b[Object.keys(contentState.entityMap).length]=mergedEntity,_b))})},addPlugin=function(_a){var contentState=_a.contentState,data=_a.data,config=_a.config,contentStateWithBlock=function(_a){var contentState=_a.contentState,text=_a.text,type=_a.type,config=_a.config;return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks,[createBlock(type,text,config)])})}({contentState:contentState,text:" ",type:"atomic",config:{entityRanges:[{offset:0,length:1,key:Object.keys(contentState.entityMap).length}]}});return addEntity({contentState:contentStateWithBlock,data:data,config:config})},interactionDataMerger=function(_a){var _b,_c,contentState=_a.contentState,_d=_a.settings,settings=void 0===_d?{}:_d,_e=_a.blockFilter,blockFilter=void 0===_e?function(){}:_e,type=_a.type,_f=_a.schema,schema=void 0===_f?[]:_f;if(!contentState.blocks||0===contentState.blocks.length)return contentState;var lastBlock=contentState.blocks.slice(-1)[0];if(blockFilter(lastBlock))return contentState;var invalidSettings=Object.keys(settings).filter((function(key){return!schema.includes(key)}));if(invalidSettings.length>0&&console.error("Warning: invalid "+type+" interaction settings found",invalidSettings),"atomic"!==lastBlock.type){var modifiedBlock=__assign(__assign({},lastBlock),{data:__assign(__assign({},lastBlock.data),{interactions:__spreadArrays((null===(_c=null==lastBlock?void 0:lastBlock.data)||void 0===_c?void 0:_c.interactions)||[],[{type:type,settings:settings}])})});return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks.slice(0,contentState.blocks.length-1),[modifiedBlock])})}var lastBlockEntityKey=lastBlock.entityRanges.length>0&&lastBlock.entityRanges[0].key;if(!1!==lastBlockEntityKey){var lastBlockEntity=contentState.entityMap[lastBlockEntityKey],modifiedEntity=__assign(__assign({},lastBlockEntity),{data:__assign(__assign({},lastBlockEntity&&lastBlockEntity.data),{interactions:__spreadArrays(lastBlockEntity&&lastBlockEntity.data.interactions||[],[{type:type,settings:settings}])})});return __assign(__assign({},contentState),{entityMap:__assign(__assign({},contentState.entityMap),(_b={},_b[lastBlockEntityKey]=modifiedEntity,_b))})}return contentState},DEFAULT_STATE={blocks:[],entityMap:{},VERSION:Version_currentVersion},ContentStateBuilder=function(){function ContentStateBuilder(initialState){this.contentState=__assign(__assign({},DEFAULT_STATE),initialState||{})}return ContentStateBuilder.prototype.get=function(){return this.contentState},ContentStateBuilder}();Object.keys(__assign(__assign({},METHOD_BLOCK_MAP),METHOD_GROUPED_BLOCK_MAP)).forEach((function(method){ContentStateBuilder.prototype[method]=function(textBlocksWithEntities){var content,textContentArray=isArray(content=textBlocksWithEntities)?content:[content];return this.contentState=textContentArray.reduce((function(state,_a){return function(_a){var contentState=_a.contentState,block=_a.block,entities=_a.entities;return __assign(__assign({},contentState),{blocks:__spreadArrays(contentState.blocks,[block]),entityMap:__assign(__assign({},contentState.entityMap),entities)})}({contentState:state,block:_a.block,entities:_a.entities})}),this.contentState),this}})),Object.entries(METHOD_PLUGIN_DATA_MAP).forEach((function(_a){var method=_a[0],defaultEntityData=_a[1];ContentStateBuilder.prototype[method]=function(_a){var mediaInfo=_a.mediaInfo,_b=_a.config,config=void 0===_b?{}:_b,_c=_a.overrides,overrides=void 0===_c?{}:_c;return this.contentState=addPlugin({contentState:this.contentState,data:mediaInfo,config:__assign(__assign({},defaultEntityData),{data:__assign(__assign(__assign({},defaultEntityData.data),{config:__assign(__assign({},defaultEntityData.data.config),config)}),overrides)})}),this}})),Object.entries({readMore:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(block){return"atomic"===block.type},type:INTERACTIONS.READ_MORE,schema:["label","onClick","expandMode","lines","text","showToggle"]}),builder},seeFullPost:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(){return!1},type:INTERACTIONS.SEE_FULL_CONTENT,schema:["label","labelStyles","overlayStyles","onClick"]}),builder},imageCounter:function(builder,settings){return void 0===settings&&(settings={}),builder.contentState=interactionDataMerger({contentState:builder.contentState,settings:settings,blockFilter:function(block){return"atomic"!==block.type},type:INTERACTIONS.IMAGE_COUNTER,schema:["counter","formatLabel","onClick","style"]}),builder}}).forEach((function(_a){var key=_a[0],method=_a[1];ContentStateBuilder.prototype[key]=function(settings){return method(this,settings)}}));var defaultEntityConverter=function(){return[]},videoConverter=function(entity){return[{type:"video",url:entity.data.src,isCustom:entity.data.isCustomVideo}]},linkConverter=function(entity){return[{type:"link",url:entity.data.url}]},converters={"wix-draft-plugin-image":function(entity){return[{width:entity.data.src.width,height:entity.data.src.height,url:entity.data.src.file_name,type:"image",metadata:entity.data.metadata,link:entity.data.config.link}]},"wix-draft-plugin-gallery":function(entity){return entity.data.items.map((function(_a){var metadata=_a.metadata,url=_a.url,itemId=_a.itemId;return{url:url,height:metadata.height,width:metadata.width,id:itemId,type:"image",isGalleryItem:!0}}))},"wix-draft-plugin-divider":defaultEntityConverter,"wix-draft-plugin-video":videoConverter,"wix-draft-plugin-sound-cloud":videoConverter,"wix-draft-plugin-giphy":function(entity){return[{type:"giphy",url:entity.data.gif.originalUrl,mp4:entity.data.gif.downsizedSmallMp4,thumbnail:entity.data.gif.stillUrl,width:entity.data.gif.width,height:entity.data.gif.height,source:"static"}]},"wix-draft-plugin-file-upload":function(entity){return[{name:entity.data.name,type:"file",fileType:entity.data.type,url:entity.data.url}]},"wix-draft-plugin-map":function(entity){return[{type:"map",mapSettings:entity.data.mapSettings}]},mention:defaultEntityConverter,"wix-draft-plugin-headers-markdown":defaultEntityConverter,"wix-draft-plugin-link-button":defaultEntityConverter,"wix-draft-plugin-action-button":defaultEntityConverter,"wix-draft-plugin-poll":defaultEntityConverter,LINK:linkConverter,LINK_PREVIEW:linkConverter,"wix-draft-plugin-html":defaultEntityConverter},extractTextBlocksWithEntities=function(_a,blockFilter){var blocks=_a.blocks,entityMap=_a.entityMap;return blocks.filter(blockFilter).reduce((function(texts,block){var entities=block.entityRanges.reduce((function(map,range){return map["_"+range.key]=entityMap[range.key],map}),{});return __spreadArrays(texts,[{block:__assign(__assign({},block),{entityRanges:block.entityRanges.map((function(range){return __assign(__assign({},range),{key:"_"+range.key})}))}),entities:entities}])}),[])},extractTextBlockArray=function(raw,blockTypeFilter){return extractTextBlocksWithEntities(raw,(function(_a){var type=_a.type,text=_a.text;return blockTypeFilter(type)&&text.length>0}))},createTextFragments=function(raw){return(_a=raw,blockTypeFilter=function(type){return"atomic"!==type},blocks=_a.blocks,entityMap=_a.entityMap,current=0,next=0,batches=groupBy(blocks,(function(block){var isValid=blockTypeFilter(block.type);return isValid?current===next&&next++:current<next&&current++,isValid&&current})),Object.entries(batches).filter((function(value){return"false"!==value[0]})).map((function(batch){return extractTextBlocksWithEntities({blocks:batch[1],entityMap:entityMap},(function(_a){var type=_a.type,text=_a.text;return blockTypeFilter(type)&&text.length>0}))})).filter((function(batch){return batch.length>0}))).filter((function(batch){return batch.length})).map((function(batch){var textCombined=batch.map((function(entry){return entry.block.text})).join("\n"),copyBlocks=cloneDeep(batch),offset=0;copyBlocks.forEach((function(entry){entry.block.inlineStyleRanges.map((function(style){return style.offset+=offset})),entry.block.entityRanges.map((function(entity){return entity.offset+=offset})),offset+=entry.block.text.length+"\n".length}));var inlineStyleRanges=copyBlocks.flatMap((function(entry){return entry.block.inlineStyleRanges})),entityRanges=copyBlocks.flatMap((function(entry){return entry.block.entityRanges})),entities=copyBlocks.map((function(block){return block.entities})).reduce((function(acc,curr){return __assign(__assign({},acc),curr)}));return merge(cloneDeep(batch[0]),{block:{text:textCombined,inlineStyleRanges:inlineStyleRanges,entityRanges:entityRanges},entities:entities})}));var _a,blockTypeFilter,blocks,entityMap,current,next,batches},extractMedia=function(_a){var entityMap=_a.entityMap;return Object.values(entityMap).reduce((function(media,entity){return __spreadArrays(media,function(entity){return converters[entity.type]?converters[entity.type](entity):[]}(entity))}),[])},getContentStateMetadata=function(raw){var entityMap,mediaEntities=extractMedia(raw),galleryItems=mediaEntities.filter((function(_a){return _a.isGalleryItem})),singleMediaItems=mediaEntities.filter((function(_a){var type=_a.type,isGalleryItem=_a.isGalleryItem;return function(type){return type&&["image","video","giphy"].includes(type)}(type)&&!isGalleryItem})),media={singleMediaItems:singleMediaItems,galleryItems:galleryItems,totalCount:galleryItems.length+singleMediaItems.length},blocks=Object.entries(METHOD_BLOCK_MAP).reduce((function(prev,_a){var _b,func=_a[0],blockType=_a[1];return __assign(__assign({},prev),((_b={})[func]=extractTextBlockArray(raw,(function(type){return type===blockType})),_b))}),{}),groupedBlocks=Object.entries(METHOD_GROUPED_BLOCK_MAP).reduce((function(prev,_a){var _b,func=_a[0],blockType=_a[1];return __assign(__assign({},prev),((_b={})[func]=function(_a,blockType){return _a.blocks.reduce((function(result,block,idx){if(block.type===blockType){var list=-1===result.lastItemIndex?__spreadArrays(result.list,[[]]):result.list;return list[list.length-1]=__spreadArrays(list[list.length-1],[block]),{list:list,lastItemIndex:idx}}return{list:result.list,lastItemIndex:-1}}),{list:[],lastItemIndex:-1}).list.filter((function(arr){return arr.length>0}))}(raw,blockType).map((function(blocks){return extractTextBlockArray({blocks:blocks,entityMap:raw.entityMap},(function(type){return type===blockType}))})).filter((function(arr){return arr.length>0})),_b))}),{}),nonMediaPluginsCount=(entityMap=raw.entityMap,Object.values(entityMap).length-media.totalCount),nonSeparatorPlugins=mediaEntities.filter((function(_a){var type=_a.type;return["link","hashtag","mention"].includes(type)}));return __assign(__assign({allText:extractTextBlockArray(raw,(function(type){return"atomic"!==type})),textFragments:createTextFragments(raw),media:media,images:mediaEntities.filter((function(_a){return"image"===_a.type})),videos:mediaEntities.filter((function(_a){return"video"===_a.type})),files:mediaEntities.filter((function(_a){return"file"===_a.type})),maps:mediaEntities.filter((function(_a){return"map"===_a.type})),links:mediaEntities.filter((function(_a){return"link"===_a.type})),nonMediaPluginsCount:nonMediaPluginsCount,collapsablePluginsCount:nonMediaPluginsCount-nonSeparatorPlugins.length},blocks),groupedBlocks)},ContentStateTransformation=function(){function ContentStateTransformation(_a){var _if=_a._if,_then=_a._then,initialPreviewState=_a.initialPreviewState;this.rules=[],this.rule({_if:_if,_then:_then}),this.previewState=initialPreviewState}return ContentStateTransformation.prototype.rule=function(_a){var _if=_a._if,_then=_a._then;if(!isFunction(_if)||!isFunction(_then))throw new TypeError("invalid rule added: `_if` and `_then` should be functions ");return this.rules.push({_if:_if,_then:_then}),this},ContentStateTransformation.prototype.apply=function(contentState){var previewStateBuilder=new ContentStateBuilder(this.previewState),metadata=getContentStateMetadata(contentState);return this.rules.reduce((function(builder,rule){return rule._if(metadata)?rule._then(metadata,builder):builder}),previewStateBuilder).get()},ContentStateTransformation.prototype.toObject=function(){return this.rules.map((function(rule){return{_if:rule._if.toString(),_then:rule._then.toString()}}))},ContentStateTransformation}();export{ContentStateTransformation,INTERACTIONS};

@@ -9,2 +9,4 @@ export declare const HEADER_BLOCK: Readonly<{

}>;
export declare const DEFAULT_TITLE_HEADINGS: string[];
export declare const DEFAULT_HEADINGS: string[];
export declare const BLOCK_TYPES: readonly string[];

@@ -11,0 +13,0 @@ export declare const UNSTYLED = "unstyled";

{
"name": "ricos-content",
"version": "8.4.8",
"version": "8.5.0",
"author": {

@@ -5,0 +5,0 @@ "name": "Oded Soffrin",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc