ricos-content
Advanced tools
Comparing version 7.19.3 to 7.20.0
@@ -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 __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:"7.19.3",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 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)}};var _extends_1=function(fn,module){return fn(module={exports:{}},module.exports),module.exports}((function(module){function _extends(){return module.exports=_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}module.exports=_extends})),imagesTypes=["wix-draft-plugin-image","IMAGE"],invalidInlineTypes=[].concat(imagesTypes,["wix-draft-plugin-gallery","wix-draft-plugin-html","wix-draft-plugin-video","wix-draft-plugin-giphy","wix-draft-plugin-file-upload"]),inlinePluginsRemover=function(_temp){var _ref2$imagesOnly=(void 0===_temp?{}:_temp).imagesOnly,imagesOnly=void 0!==_ref2$imagesOnly&&_ref2$imagesOnly;return function(contentState){var newBlocks=contentState.blocks.map((function(block){var _block$entityRanges=block.entityRanges,entityRanges=void 0===_block$entityRanges?[]:_block$entityRanges,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)),_extends_1({},block,{entityRanges:filteredRanges})}));return _extends_1({},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,processedState=applyStrategies(function(config){var disableInlineImages=config.disableInlineImages,removeInvalidInlinePlugins=config.removeInvalidInlinePlugins;return[{version:"<3.4.7",processors:[linkify$1]},disableInlineImages&&{version:"<8.0.0",processors:[inlinePluginsRemover({imagesOnly:!0})]},removeInvalidInlinePlugins&&{processors:[inlinePluginsRemover()]}].filter((function(x){return x}))}(config),contentState,contentStateVersion,config),blocks=processedState.blocks,entityMap=processedState.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}};var _a$1,_b,_c,objectWithoutPropertiesLoose=function(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target},isUndefined=function(val){return void 0===val},isDefined=function(val){return!isUndefined(val)},dataNormalizers=((_a$1={}).LINK=function(componentData,_ref2){var anchorTarget=_ref2.anchorTarget,relValue=_ref2.relValue,targetBlank=componentData.targetBlank,nofollow=componentData.nofollow,rest=objectWithoutPropertiesLoose(componentData,["targetBlank","nofollow"]);return function(_ref){var targetBlank=_ref.targetBlank,nofollow=_ref.nofollow,target=_ref.target,rel=_ref.rel;return isUndefined(targetBlank)&&isUndefined(nofollow)&&isDefined(target)&&isDefined(rel)}(componentData)?componentData:_extends_1({},rest,{target:targetBlank?"_blank":anchorTarget||"_self",rel:nofollow?"nofollow":relValue||"noopener"})},_a$1[IMAGE_TYPE]=function(componentData){var width=componentData.width,_componentData$config=componentData.config,config=void 0===_componentData$config?{}:_componentData$config,rest=objectWithoutPropertiesLoose(componentData,["width","config"]);return"inline"===config.size&&width&&!config.width?_extends_1({},rest,{config:_extends_1({},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=function(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}(_a,["anchor"]);newEntity.data=__assign(__assign({},newEntity.data),{config:__assign(__assign({},rest),{link:{anchor:anchor}})})}};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.SOUND_CLOUD_TYPE="wix-draft-plugin-sound-cloud",exports.SPOILER_TYPE="wix-rich-content-plugin-spoiler",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.getUrlMatches=getUrlMatches,exports.hasProtocol=function(url){return/^[a-z]+:/i.test(url)},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 __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:"7.20.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 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)}};var _extends_1=function(fn,module){return fn(module={exports:{}},module.exports),module.exports}((function(module){function _extends(){return module.exports=_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}module.exports=_extends})),imagesTypes=["wix-draft-plugin-image","IMAGE"],invalidInlineTypes=[].concat(imagesTypes,["wix-draft-plugin-gallery","wix-draft-plugin-html","wix-draft-plugin-video","wix-draft-plugin-giphy","wix-draft-plugin-file-upload"]),inlinePluginsRemover=function(_temp){var _ref2$imagesOnly=(void 0===_temp?{}:_temp).imagesOnly,imagesOnly=void 0!==_ref2$imagesOnly&&_ref2$imagesOnly;return function(contentState){var newBlocks=contentState.blocks.map((function(block){var _block$entityRanges=block.entityRanges,entityRanges=void 0===_block$entityRanges?[]:_block$entityRanges,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)),_extends_1({},block,{entityRanges:filteredRanges})}));return _extends_1({},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,processedState=applyStrategies(function(config){var disableInlineImages=config.disableInlineImages,removeInvalidInlinePlugins=config.removeInvalidInlinePlugins;return[{version:"<3.4.7",processors:[linkify$1]},disableInlineImages&&{version:"<8.0.0",processors:[inlinePluginsRemover({imagesOnly:!0})]},removeInvalidInlinePlugins&&{processors:[inlinePluginsRemover()]}].filter((function(x){return x}))}(config),contentState,contentStateVersion,config),blocks=processedState.blocks,entityMap=processedState.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}};var _a$1,_b,_c,objectWithoutPropertiesLoose=function(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target},isUndefined=function(val){return void 0===val},isDefined=function(val){return!isUndefined(val)},dataNormalizers=((_a$1={}).LINK=function(componentData,_ref2){var anchorTarget=_ref2.anchorTarget,relValue=_ref2.relValue,targetBlank=componentData.targetBlank,nofollow=componentData.nofollow,rest=objectWithoutPropertiesLoose(componentData,["targetBlank","nofollow"]);return function(_ref){var targetBlank=_ref.targetBlank,nofollow=_ref.nofollow,target=_ref.target,rel=_ref.rel;return isUndefined(targetBlank)&&isUndefined(nofollow)&&isDefined(target)&&isDefined(rel)}(componentData)?componentData:_extends_1({},rest,{target:targetBlank?"_blank":anchorTarget||"_self",rel:nofollow?"nofollow":relValue||"noopener"})},_a$1[IMAGE_TYPE]=function(componentData){var width=componentData.width,_componentData$config=componentData.config,config=void 0===_componentData$config?{}:_componentData$config,rest=objectWithoutPropertiesLoose(componentData,["width","config"]);return"inline"===config.size&&width&&!config.width?_extends_1({},rest,{config:_extends_1({},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=function(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}(_a,["anchor"]);newEntity.data=__assign(__assign({},newEntity.data),{config:__assign(__assign({},rest),{link:{anchor:anchor}})})}};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.SOUND_CLOUD_TYPE="wix-draft-plugin-sound-cloud",exports.SPOILER_TYPE="wix-rich-content-plugin-spoiler",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.getUrlMatches=getUrlMatches,exports.hasProtocol=function(url){return/^[a-z]+:/i.test(url)},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 __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:"7.19.3",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",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",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 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)}};var _extends_1=function(fn,module){return fn(module={exports:{}},module.exports),module.exports}((function(module){function _extends(){return module.exports=_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}module.exports=_extends})),imagesTypes=["wix-draft-plugin-image","IMAGE"],invalidInlineTypes=[].concat(imagesTypes,["wix-draft-plugin-gallery","wix-draft-plugin-html","wix-draft-plugin-video","wix-draft-plugin-giphy","wix-draft-plugin-file-upload"]),inlinePluginsRemover=function(_temp){var _ref2$imagesOnly=(void 0===_temp?{}:_temp).imagesOnly,imagesOnly=void 0!==_ref2$imagesOnly&&_ref2$imagesOnly;return function(contentState){var newBlocks=contentState.blocks.map((function(block){var _block$entityRanges=block.entityRanges,entityRanges=void 0===_block$entityRanges?[]:_block$entityRanges,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)),_extends_1({},block,{entityRanges:filteredRanges})}));return _extends_1({},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,processedState=applyStrategies(function(config){var disableInlineImages=config.disableInlineImages,removeInvalidInlinePlugins=config.removeInvalidInlinePlugins;return[{version:"<3.4.7",processors:[linkify$1]},disableInlineImages&&{version:"<8.0.0",processors:[inlinePluginsRemover({imagesOnly:!0})]},removeInvalidInlinePlugins&&{processors:[inlinePluginsRemover()]}].filter((function(x){return x}))}(config),contentState,contentStateVersion,config),blocks=processedState.blocks,entityMap=processedState.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}};var _a$1,_b,_c,objectWithoutPropertiesLoose=function(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target},isUndefined=function(val){return void 0===val},isDefined=function(val){return!isUndefined(val)},dataNormalizers=((_a$1={}).LINK=function(componentData,_ref2){var anchorTarget=_ref2.anchorTarget,relValue=_ref2.relValue,targetBlank=componentData.targetBlank,nofollow=componentData.nofollow,rest=objectWithoutPropertiesLoose(componentData,["targetBlank","nofollow"]);return function(_ref){var targetBlank=_ref.targetBlank,nofollow=_ref.nofollow,target=_ref.target,rel=_ref.rel;return isUndefined(targetBlank)&&isUndefined(nofollow)&&isDefined(target)&&isDefined(rel)}(componentData)?componentData:_extends_1({},rest,{target:targetBlank?"_blank":anchorTarget||"_self",rel:nofollow?"nofollow":relValue||"noopener"})},_a$1[IMAGE_TYPE]=function(componentData){var width=componentData.width,_componentData$config=componentData.config,config=void 0===_componentData$config?{}:_componentData$config,rest=objectWithoutPropertiesLoose(componentData,["width","config"]);return"inline"===config.size&&width&&!config.width?_extends_1({},rest,{config:_extends_1({},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=function(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}(_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}};export{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,SOUND_CLOUD_TYPE,SPOILER_TYPE,TEXT_COLOR_TYPE,TEXT_HIGHLIGHT_TYPE,UNDO_REDO_TYPE,UNSTYLED,VERTICAL_EMBED_TYPE,VIDEO_TYPE,VIDEO_TYPE_LEGACY,Version,getUrlMatches,hasProtocol,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 __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:"7.20.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"]),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",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",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 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)}};var _extends_1=function(fn,module){return fn(module={exports:{}},module.exports),module.exports}((function(module){function _extends(){return module.exports=_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}module.exports=_extends})),imagesTypes=["wix-draft-plugin-image","IMAGE"],invalidInlineTypes=[].concat(imagesTypes,["wix-draft-plugin-gallery","wix-draft-plugin-html","wix-draft-plugin-video","wix-draft-plugin-giphy","wix-draft-plugin-file-upload"]),inlinePluginsRemover=function(_temp){var _ref2$imagesOnly=(void 0===_temp?{}:_temp).imagesOnly,imagesOnly=void 0!==_ref2$imagesOnly&&_ref2$imagesOnly;return function(contentState){var newBlocks=contentState.blocks.map((function(block){var _block$entityRanges=block.entityRanges,entityRanges=void 0===_block$entityRanges?[]:_block$entityRanges,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)),_extends_1({},block,{entityRanges:filteredRanges})}));return _extends_1({},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,processedState=applyStrategies(function(config){var disableInlineImages=config.disableInlineImages,removeInvalidInlinePlugins=config.removeInvalidInlinePlugins;return[{version:"<3.4.7",processors:[linkify$1]},disableInlineImages&&{version:"<8.0.0",processors:[inlinePluginsRemover({imagesOnly:!0})]},removeInvalidInlinePlugins&&{processors:[inlinePluginsRemover()]}].filter((function(x){return x}))}(config),contentState,contentStateVersion,config),blocks=processedState.blocks,entityMap=processedState.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}};var _a$1,_b,_c,objectWithoutPropertiesLoose=function(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target},isUndefined=function(val){return void 0===val},isDefined=function(val){return!isUndefined(val)},dataNormalizers=((_a$1={}).LINK=function(componentData,_ref2){var anchorTarget=_ref2.anchorTarget,relValue=_ref2.relValue,targetBlank=componentData.targetBlank,nofollow=componentData.nofollow,rest=objectWithoutPropertiesLoose(componentData,["targetBlank","nofollow"]);return function(_ref){var targetBlank=_ref.targetBlank,nofollow=_ref.nofollow,target=_ref.target,rel=_ref.rel;return isUndefined(targetBlank)&&isUndefined(nofollow)&&isDefined(target)&&isDefined(rel)}(componentData)?componentData:_extends_1({},rest,{target:targetBlank?"_blank":anchorTarget||"_self",rel:nofollow?"nofollow":relValue||"noopener"})},_a$1[IMAGE_TYPE]=function(componentData){var width=componentData.width,_componentData$config=componentData.config,config=void 0===_componentData$config?{}:_componentData$config,rest=objectWithoutPropertiesLoose(componentData,["width","config"]);return"inline"===config.size&&width&&!config.width?_extends_1({},rest,{config:_extends_1({},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=function(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}(_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}};export{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,SOUND_CLOUD_TYPE,SPOILER_TYPE,TEXT_COLOR_TYPE,TEXT_HIGHLIGHT_TYPE,UNDO_REDO_TYPE,UNSTYLED,VERTICAL_EMBED_TYPE,VIDEO_TYPE,VIDEO_TYPE_LEGACY,Version,getUrlMatches,hasProtocol,isValidExactUrl,isValidUrl,normalizeInitialState,normalizeUrl,startsWithHttps}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "ricos-content", | ||
"version": "7.19.3", | ||
"version": "7.20.0", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Oded Soffrin", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package