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

wix-rich-content-viewer

Package Overview
Dependencies
Maintainers
11
Versions
1160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wix-rich-content-viewer - npm Package Compare versions

Comparing version 9.5.19 to 9.5.20-alpha

dist/es/getPluginViewers-8aaab95f.js

2

dist/cjs/index.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),englishResources=require("wix-rich-content-common/dist/statics/viewer/locale/messages_en.json"),wixRichContentCommon=require("wix-rich-content-common"),classNames=require("classnames"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require$$0=require("punycode"),lodash=require("lodash"),deprecateHelpers=require("wix-rich-content-common/libs/deprecateHelpers");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(k){if("default"!==k){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}})),n.default=e,Object.freeze(n)}var _extends__default=_interopDefaultLegacy(_extends),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),englishResources__default=_interopDefaultLegacy(englishResources),classNames__default=_interopDefaultLegacy(classNames),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),require$$0__default=_interopDefaultLegacy(require$$0),draftDefaultStyles_renderedInTable="n4Axb";function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}function createCommonjsModule(fn){var module={exports:{}};return fn(module,module.exports),module.exports}var arrayEqual=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(arr1,arr2){if(arr1.length!==arr2.length)return!1;for(var i=0;i<arr1.length;i++)if(arr1[i]!==arr2[i])return!1;return!0};exports.default=_default})),ContentNode_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_arrayEqual=(obj=arrayEqual)&&obj.__esModule?obj:{default:obj};function _toArray(arr){return function(arr){if(Array.isArray(arr))return arr}(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var ContentNode=function(){function ContentNode(props){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ContentNode),this.content=props.content||[],this.start=void 0!==props.start?props.start:null,this.end=void 0!==props.end?props.end:null,this.entity=void 0!==props.entity?props.entity:null,this.decorator=void 0!==props.decorator?props.decorator:null,this.decoratorProps=props.decoratorProps||null,this.decoratedText=void 0!==props.decoratedText?props.decoratedText:null,this.contentState=props.contentState,this.style=props.style||null,this.styles=props.styles||null,this.block=props.block||{}}var Constructor,protoProps,staticProps;return Constructor=ContentNode,protoProps=[{key:"getCurrentContent",value:function(){return this.content[this.content.length-1]}},{key:"addToCurrentContent",value:function(string){this.content[this.content.length-1]=this.content[this.content.length-1]+string}},{key:"handleFlatPush",value:function(string,stack){var current=this.getCurrentContent();if(current instanceof ContentNode&&(0,_arrayEqual.default)(stack,current.styles))current.addToCurrentContent(string);else{var newNode=new ContentNode({styles:_toConsumableArray(stack),content:[string]});this.content.push(newNode)}}},{key:"pushContent",value:function(string){var stack=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],flat=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!stack||stack.length<1)return"string"==typeof string&&"string"==typeof this.getCurrentContent()?this.addToCurrentContent(string):this.content.push(string),this;if(flat)return this.handleFlatPush(string,stack),this;var _stack=_toArray(stack),head=_stack[0],rest=_stack.slice(1),current=this.getCurrentContent();if(current instanceof ContentNode&&current.style===head)current.pushContent(string,rest,flat);else{var newNode=new ContentNode({style:head});newNode.pushContent(string,rest,flat),this.content.push(newNode)}return this}}],protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),ContentNode}(),_default=ContentNode;exports.default=_default})),RawParser_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _punycode=_interopRequireDefault(require$$0__default.default),_ContentNode=_interopRequireDefault(ContentNode_1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}var getString=function(array,from,to){return _punycode.default.ucs2.encode(array.slice(from,to))};function addIndexes(indexes,ranges){return ranges.forEach((function(range){indexes.push(range.offset),indexes.push(range.offset+range.length)})),indexes}var RawParser=function(){function RawParser(_ref){var _ref$flat=_ref.flat,flat=void 0!==_ref$flat&&_ref$flat;!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RawParser),this.flat=flat}var Constructor,protoProps,staticProps;return Constructor=RawParser,protoProps=[{key:"relevantStyles",value:function(offset){return this.ranges.filter((function(range){return offset>=range.offset&&offset<range.offset+range.length})).map((function(style){return style.style}))}},{key:"nodeIterator",value:function(node,start,end){var _this=this,indexes=this.relevantIndexes.slice(this.relevantIndexes.indexOf(start),this.relevantIndexes.indexOf(end));return indexes.forEach((function(index,key){var characterStyles=_this.relevantStyles(index),distance=indexes[key+1]?indexes[key+1]-index:1,text=getString(_this.textArray,index,index+distance);node.pushContent(text,characterStyles,_this.flat),!indexes[key+1]&&index<end&&node.pushContent(getString(_this.textArray,index+1,end),_this.relevantStyles(end-1),_this.flat)})),node}},{key:"parse",value:function(block){var _this2=this,text=block.text,ranges=block.inlineStyleRanges,entityRanges=block.entityRanges,_block$decoratorRange=block.decoratorRanges,decoratorRanges=void 0===_block$decoratorRange?[]:_block$decoratorRange;this.textArray=_punycode.default.ucs2.decode(text),this.ranges=ranges,this.iterator=0,this.relevantIndexes=function(text,inlineRanges){var entityRanges=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],decoratorRanges=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],relevantIndexes=[];return relevantIndexes=addIndexes(relevantIndexes,inlineRanges),relevantIndexes=addIndexes(relevantIndexes,entityRanges),(relevantIndexes=addIndexes(relevantIndexes,decoratorRanges)).push(0),relevantIndexes.push(text.length),relevantIndexes.filter((function(value,index,self){return self.indexOf(value)===index})).sort((function(aa,bb){return aa-bb}))}(text,ranges,entityRanges,decoratorRanges);var nodes=function(entityRanges){var decoratorRanges=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],textArray=arguments.length>2?arguments[2]:void 0,block=arguments.length>3?arguments[3]:void 0,lastIndex=0,mergedRanges=[].concat(_toConsumableArray(entityRanges),_toConsumableArray(decoratorRanges)).sort((function(a,b){return a.offset-b.offset})),nodes=[];return mergedRanges.length<1?(nodes.push(new _ContentNode.default({block:block,start:0,end:textArray.length})),nodes):(mergedRanges.forEach((function(range){range.offset>lastIndex&&nodes.push(new _ContentNode.default({block:block,start:lastIndex,end:range.offset})),nodes.push(new _ContentNode.default({block:block,entity:range.key,decorator:range.component,decoratorProps:range.decoratorProps,decoratedText:range.component?getString(textArray,range.offset,range.offset+range.length):void 0,start:range.offset,end:range.offset+range.length,contentState:range.contentState})),lastIndex=range.offset+range.length})),lastIndex<textArray.length&&nodes.push(new _ContentNode.default({block:block,start:lastIndex,end:textArray.length})),nodes)}(entityRanges,decoratorRanges,this.textArray,block),parsedNodes=nodes.map((function(node){return _this2.nodeIterator(node,node.start,node.end)}));return new _ContentNode.default({block:block,content:parsedNodes})}}],protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),RawParser}();exports.default=RawParser})),createStyleRenderer_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(wrapper,stylesMap){return function(children,styleArray,params){var style=function(styleArray,stylesMap){return styleArray.map((function(style){return stylesMap[style]})).reduce((function(prev,next){var mergedStyles={};if(void 0!==next){var key="text-decoration"in next?"text-decoration":"textDecoration";next[key]!==prev[key]&&(mergedStyles[key]=[prev[key],next[key]].join(" ").trim())}return Object.assign(prev,next,mergedStyles)}),{})}(styleArray,stylesMap);return wrapper(Object.assign({},{children:children},params,{style:style}))}};exports.default=_default})),createBlockRenderer_1=createCommonjsModule((function(module,exports){function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var getKey=function(_ref,key){var keys=_ref.keys;return key||(keys?keys.join(","):void 0)},getBlock=function(element,wrapper,withDepth){return function(children,properties,key){var props=Object.assign({},properties);return withDepth||delete props.depth,wrapper.apply(void 0,[element,Object.assign({},props,{key:getKey(props,key)})].concat(_toConsumableArray(children)))}},_default=function(callback,blockMap){var renderer={};return Object.keys(blockMap).forEach((function(item){var block=blockMap[item];block.wrapper?renderer[item]=function(children,props,key){return function(callback,block,_ref2){var children=_ref2.children,props=_ref2.props,key=_ref2.key,wrapperBlockFn=getBlock(block.wrapper,callback),blockFn=getBlock(block.element,callback,!0);return wrapperBlockFn(children.map((function(child,ii){return blockFn(child,{},props.keys&&props.keys[ii])})),props,key)}(callback,block,{children:children,props:props,key:key})}:renderer[item]=getBlock(block.element,callback)})),renderer};exports.default=_default})),warn_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(msg){};exports.default=_default})),checkCleanup_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(block,prevType,_ref2){var cleanup=_ref2.cleanup;return!(!cleanup||function(block,options){return text=block.text,!!(options.trim?text.trim():text)||!(!block.data||!Object.keys(block.data).length)||!(!block.entityRanges||!block.entityRanges.length);var text}(block,cleanup))&&(!(cleanup.after&&"all"!==cleanup.after&&!cleanup.after.includes(prevType))&&(!(!cleanup.except||cleanup.except.includes(block.type))||!(!cleanup.types||"all"!==cleanup.types&&!cleanup.types.includes(block.type))))};exports.default=_default})),getKeyGenerator_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(){var key=0;return function(){var current=key;return key+=1,current}};exports.default=_default})),checkJoin_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(input,options){return Array.isArray(input)&&options.joinOutput?input.join(""):input};exports.default=_default})),pushString_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(string,array,index){var tempArray=array;return array[index]?tempArray[index]+=string:tempArray[index]=string,tempArray};exports.default=_default})),defaultOptions_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default={joinOutput:!1,cleanup:{after:["atomic"],types:["unstyled"],trim:!1,split:!0}};exports.default=_default})),CompositeDecorator=createCommonjsModule((function(module,exports){function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(){function CompositeDraftDecorator(decorators){var obj,key,value;!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CompositeDraftDecorator),value=void 0,(key="decorators")in(obj=this)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,this.decorators=decorators.slice()}var Constructor,protoProps,staticProps;return Constructor=CompositeDraftDecorator,(protoProps=[{key:"getDecorations",value:function(block,contentState){var decorations=Array(block.getText().length).fill(null);return this.decorators.forEach((function(decorator,ii){var counter=0;(0,decorator.strategy)(block,(function(start,end){(function(decorations,start,end){for(var ii=start;ii<end;ii++)if(null!=decorations[ii])return!1;return!0})(decorations,start,end)&&(function(targetArr,start,end,componentKey){for(var ii=start;ii<end;ii++)targetArr[ii]=componentKey}(decorations,start,end,ii+"."+counter),counter++)}),contentState)})),decorations}},{key:"getComponentForKey",value:function(key){var componentKey=parseInt(key.split(".")[0],10);return this.decorators[componentKey].component}},{key:"getPropsForKey",value:function(key){var componentKey=parseInt(key.split(".")[0],10);return this.decorators[componentKey].props}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),CompositeDraftDecorator}();exports.default=_default})),MultiDecorator_1=createCommonjsModule((function(module,exports){function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(){function MultiDecorator(decorators){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MultiDecorator),this.decorators=decorators}var Constructor,protoProps,staticProps;return Constructor=MultiDecorator,staticProps=[{key:"getInnerKey",value:function(key){return key.split("-").slice(1).join("-")}}],(protoProps=[{key:"getDecorations",value:function(block,contentState){var decorations=new Array(block.getText().length).fill(null);return this.decorators.forEach((function(decorator,i){decorator.getDecorations(block,contentState).forEach((function(key,offset){key&&(decorations[offset]=i+"-"+key)}))})),decorations}},{key:"getComponentForKey",value:function(key){return this.getDecoratorForKey(key).getComponentForKey(MultiDecorator.getInnerKey(key))}},{key:"getPropsForKey",value:function(key){return this.getDecoratorForKey(key).getPropsForKey(MultiDecorator.getInnerKey(key))}},{key:"getDecoratorForKey",value:function(key){var parts=key.split("-"),index=Number(parts[0]);return this.decorators[index]}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),MultiDecorator}();exports.default=_default})),stubContentBlock_1=createCommonjsModule((function(module,exports){function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var ContentBlockStub=function(){function ContentBlockStub(block){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ContentBlockStub),Object.assign(this,block)}var Constructor,protoProps,staticProps;return Constructor=ContentBlockStub,(protoProps=[{key:"get",value:function(name){return this[name]}},{key:"getText",value:function(){return this.text}},{key:"getType",value:function(){return this.type}},{key:"getKey",value:function(){return this.key}},{key:"getLength",value:function(){return this.text.length}},{key:"getDepth",value:function(){return this.depth}},{key:"getData",value:function(){return this.data}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),ContentBlockStub}(),_default=function(block){return new ContentBlockStub(block)};exports.default=_default})),withDecorators_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _punycode=_interopRequireDefault(require$$0__default.default),_CompositeDecorator=_interopRequireDefault(CompositeDecorator),_MultiDecorator=_interopRequireDefault(MultiDecorator_1),_stubContentBlock=_interopRequireDefault(stubContentBlock_1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}var offsetRanges=function(ranges,block){return ranges.forEach((function(range){var pre=block.text.substring(0,range.offset),decorated=block.text.substring(range.offset,range.offset+range.length);range.offset=_punycode.default.ucs2.decode(pre).length,range.length=_punycode.default.ucs2.decode(decorated).length})),ranges},decoratorIsCustom=function(decorator){return"function"==typeof decorator.getDecorations&&"function"==typeof decorator.getComponentForKey&&"function"==typeof decorator.getPropsForKey},decorateBlock=function(block,decorators,contentState,_ref){var createContentBlock=_ref.createContentBlock,decoratorRanges=[],decorator=function(decorators){var compositeDecorator=new _CompositeDecorator.default(decorators.filter((function(decorator){return!decoratorIsCustom(decorator)}))),customDecorators=decorators.filter((function(decorator){return decoratorIsCustom(decorator)})),decor=[].concat(_toConsumableArray(customDecorators),[compositeDecorator]);return new _MultiDecorator.default(decor)}(decorators),contentBlock=createContentBlock?createContentBlock(block):(0,_stubContentBlock.default)(block),decorations=decorator.getDecorations(contentBlock,contentState),offset=0;return decorations.forEach((function(key,index){if(key){var nextIndex=index+1,next=decorations[nextIndex];next&&next===key||(decoratorRanges.push({offset:offset,length:nextIndex-offset,component:decorator.getComponentForKey(key),decoratorProps:decorator.getPropsForKey(key)||{},contentState:contentState}),offset=nextIndex)}else offset+=1})),Object.assign({},block,{decoratorRanges:offsetRanges(decoratorRanges,block)})},_default=function(raw,decorators,options){var contentState=options.convertFromRaw&&options.convertFromRaw(raw);return raw.blocks.map((function(block){return decorateBlock(block,decorators,contentState,options||{})}))};exports.default=_default})),render_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.render=exports.renderNode=void 0;var _RawParser=_interopRequireDefault(RawParser_1),_warn=_interopRequireDefault(warn_1),_checkCleanup=_interopRequireDefault(checkCleanup_1),_getKeyGenerator=_interopRequireDefault(getKeyGenerator_1),_checkJoin=_interopRequireDefault(checkJoin_1),_pushString=_interopRequireDefault(pushString_1),_defaultOptions=_interopRequireDefault(defaultOptions_1),_withDecorators=_interopRequireDefault(withDecorators_1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var renderNode=function renderNode(node,inlineRenderers,entityRenderers,styleRenderers,entityMap,options,keyGenerator){if(node.styles&&styleRenderers)return styleRenderers((0,_checkJoin.default)(node.content,options),node.styles,{key:keyGenerator()});var children=[],index=0;if(node.content.forEach((function(part){"string"==typeof part?children=(0,_pushString.default)(part,children,index):(children[index+=1]=renderNode(part,inlineRenderers,entityRenderers,styleRenderers,entityMap,options,keyGenerator),index+=1)})),node.style&&inlineRenderers[node.style])return inlineRenderers[node.style]((0,_checkJoin.default)(children,options),{key:keyGenerator()});if(null!==node.entity){var entity=entityMap[node.entity],entityRenderer=entity&&(entityRenderers[entity.type]||"atomic"===node.block.type&&entityRenderers.atomicFallbackRenderer);if(entityRenderer)return entityRenderer((0,_checkJoin.default)(children,options),entity.data,{key:node.entity,block:node.block},entity.type)}if(null!==node.decorator){var decoratorOffsetKey=[node.block.key,node.start,0].join(".");return node.decorator(Object.assign({children:(0,_checkJoin.default)(children,options),decoratedText:node.decoratedText,contentState:node.contentState,entityKey:node.entity,offsetKey:decoratorOffsetKey,key:decoratorOffsetKey},node.decoratorProps))}return children};exports.renderNode=renderNode;var byDepth=function(blocks){var group=[],depthStack=[],prevDepth=0,unwind=function(targetDepth){var i=prevDepth-targetDepth;for(depthStack.length<i&&(i=depthStack.length);i>0;i-=1){var tmp=group;(group=depthStack.pop())[group.length-1].children=tmp}};return blocks.forEach((function(block){prevDepth<block.depth?(depthStack.push(group),group=[]):prevDepth>block.depth&&unwind(block.depth),prevDepth=block.depth,group.push(block)})),0!==prevDepth&&unwind(0),group},renderGroup=function(group,blockRenderers,rendered,params){var type=params.prevType,depth=params.prevDepth,keys=params.prevKeys,data=params.prevData;if(0!==group.length){if(blockRenderers[type]){var props={depth:depth,keys:keys};return data&&data.some((function(item){return!!item}))&&(props.data=data),void rendered.push(blockRenderers[type](group,props))}rendered.push(group)}},renderBlocks=function renderBlocks(blocks){var inlineRenderers=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},blockRenderers=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},entityRenderers=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},stylesRenderer=arguments.length>4?arguments[4]:void 0,entityMap=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},userOptions=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},options=Object.assign({},_defaultOptions.default,userOptions),rendered=[],group=[],prevType=null,prevDepth=0,prevKeys=[],prevData=[],splitGroup=!1,Parser=new _RawParser.default({flat:!!stylesRenderer});return blocks.forEach((function(block){if((0,_checkCleanup.default)(block,prevType,options))!0===options.cleanup.split&&(splitGroup=!0);else{var node=Parser.parse(block),renderedNode=renderNode(node,inlineRenderers,entityRenderers,stylesRenderer,entityMap,options,(0,_getKeyGenerator.default)());if((prevType&&prevType!==block.type||splitGroup)&&(renderGroup(group,blockRenderers,rendered,{prevType:prevType,prevDepth:prevDepth,prevKeys:prevKeys,prevData:prevData}),prevData=[],prevKeys=[],group=[],splitGroup=!1),block.children){var children=renderBlocks(block.children,inlineRenderers,blockRenderers,entityRenderers,stylesRenderer,entityMap,options);renderedNode.push(children)}group.push(renderedNode),prevType=block.type,prevDepth=block.depth,prevKeys.push(block.key),prevData.push(block.data)}})),renderGroup(group,blockRenderers,rendered,{prevType:prevType,prevDepth:prevDepth,prevKeys:prevKeys,prevData:prevData}),(0,_checkJoin.default)(rendered,options)};exports.render=function(raw){var renderers=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!raw||!Array.isArray(raw.blocks))return(0,_warn.default)("invalid raw object"),null;if(!raw.blocks.length)return null;var inlineRenderers=renderers.inline,blockRenderers=renderers.blocks,entityRenderers=renderers.entities,stylesRenderer=renderers.styles,decorators=renderers.decorators,blocksWithDecorators=decorators?(0,_withDecorators.default)(raw,decorators,options):raw.blocks,blocks=byDepth(blocksWithDecorators);return renderBlocks(blocks,inlineRenderers,blockRenderers,entityRenderers,stylesRenderer,raw.entityMap,options)}})),redraft=getDefaultExportFromCjs(createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"RawParser",{enumerable:!0,get:function(){return _RawParser.default}}),Object.defineProperty(exports,"createStylesRenderer",{enumerable:!0,get:function(){return _createStyleRenderer.default}}),Object.defineProperty(exports,"createBlockRenderer",{enumerable:!0,get:function(){return _createBlockRenderer.default}}),Object.defineProperty(exports,"renderNode",{enumerable:!0,get:function(){return render_1.renderNode}}),Object.defineProperty(exports,"CompositeDecorator",{enumerable:!0,get:function(){return _CompositeDecorator.default}}),exports.default=void 0;var _RawParser=_interopRequireDefault(RawParser_1),_createStyleRenderer=_interopRequireDefault(createStyleRenderer_1),_createBlockRenderer=_interopRequireDefault(createBlockRenderer_1),_CompositeDecorator=_interopRequireDefault(CompositeDecorator);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _default=render_1.render;exports.default=_default}))),kebabToCamelObjectKeys=function(obj){return void 0===obj&&(obj={}),Object.keys(obj).reduce((function(result,key){var s;return result[(s=key,s.replace(/-([a-z])/,(function(_,p1){return p1.toUpperCase()})))]=obj[key],result}),{})},hasText=function hasText(child){return!!child&&("string"==typeof child?child.trim().length>0:Array.isArray(child)?hasText(child[0])||hasText(child[1]):"object"==typeof child&&hasText(child.props.children))},getPaywallSeoClass=function(_ref,blockIndex){var _ref$className=_ref.className,className=void 0===_ref$className?"paywall":_ref$className,_ref$index=_ref.index;return blockIndex<(void 0===_ref$index?3:_ref$index)&&className},isPaywallSeo=function(seoMode){return"object"==typeof seoMode&&"object"==typeof seoMode.paywall},viewerStyles={fontElementMap:"_27i2k",wrapper:"kvdbP",pluginContainerMobile:"_3iGUk",desktop:"_1O7aH",editor:"_1hN1O",android:"_23La5",atomic:"_2vd5k",toolbar:"_3j-bQ",underline:"_3zM-5",block:"_3RIlU",elementSpacing:"_1j-51",blockStyleSpacing:"_3Dd1B",text:"mm8Nw _1j-51",child:"_2PHJq",orderedList:"_2ULPL",unorderedList:"_3Kjjs",lineHeightFix:"NSjbv",center:"_37Oe5",contentCenterAlignment:"_3LGTx",justify:"_78FBa",quote:"_3cMZT _3Dd1B",headerOne:"_3qzEG _1j-51",headerTwo:"eSWI6 _1j-51",headerThree:"_3qMKZ _1j-51",headerFour:"_2TrLF _1j-51",headerFive:"_1zZGG _1j-51",headerSix:"_1joqJ _1j-51",code:"_3-Hex _3Dd1B",codeBlock:"_3M8UJ _3Dd1B",renderedInTable:"_3sj65",normalText:"_3iu3e",anchor:"_3mt3E",embed:"_1-N88",horizontalScrollbar:"_34Kbu",overrideLinkColor:"_2nl-9"},combineMappers=function(mappers){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return mappers&&mappers.length&&!mappers.some((function(resolver){return"function"!=typeof resolver}))?mappers.reduce((function(map,mapper){return Object.assign(map,mapper.apply(void 0,args))}),{}):(console.warn(mappers+" is expected to be a function array"),{})},DefaultInteractionWrapper=function(_ref){return _ref.children},withInteraction=function(element,interactions,context){var _config$PREVIEW,_config$PREVIEW$conte,config=context.config;if(null===(_config$PREVIEW=config.PREVIEW)||void 0===_config$PREVIEW||null===(_config$PREVIEW$conte=_config$PREVIEW.contentInteractionMappers)||void 0===_config$PREVIEW$conte||!_config$PREVIEW$conte.length||!config.PREVIEW.onPreviewExpand||!lodash.isArray(interactions))return element;var BlockInteractionWrapper=function(_ref2){var interactions=_ref2.interactions,context=_ref2.context;return function(_ref3){var children=_ref3.children,_ref4=context.config.PREVIEW||{},_ref4$contentInteract=_ref4.contentInteractionMappers,contentInteractionMappers=void 0===_ref4$contentInteract?[]:_ref4$contentInteract,_ref4$onPreviewExpand=_ref4.onPreviewExpand,interactionMap=combineMappers(contentInteractionMappers,void 0===_ref4$onPreviewExpand?function(){}:_ref4$onPreviewExpand);return interactions.reduce((function(child,_ref5){var type=_ref5.type,settings=_ref5.settings,Interaction=interactionMap[type]||DefaultInteractionWrapper;return React__default.default.createElement(Interaction,_extends__default.default({},settings,context),child)}),children)}}({interactions:interactions,context:context});return React__default.default.createElement(BlockInteractionWrapper,null,element)},draftPublic="public-DraftStyleDefault",getBlockClassName=function(direction,listType,depth,_ref){var isNewList=_ref.isNewList;return[].concat(function(listType,depth,textDirection){return[draftPublic+"-"+listType+"ListItem",draftPublic+"-depth"+depth,draftPublic+"-list-"+textDirection]}(listType,depth,direction),["fixed-tab-size"],isNewList?[draftPublic+"-reset"]:[]).join(" ")},List=function(_ref2){var ordered=_ref2.ordered,items=_ref2.items,mergedStyles=_ref2.mergedStyles,textDirection=_ref2.textDirection,blockProps=_ref2.blockProps,getBlockStyleClasses=_ref2.getBlockStyleClasses,blockDataToStyle=_ref2.blockDataToStyle,context=_ref2.context,Component=ordered?"ol":"ul",listType=ordered?"ordered":"unordered",containerClassName=draftPublic+"-"+Component,listItemTypeClassName=listType+"List",prevDepth=0;return React__default.default.createElement(Component,{className:containerClassName},items.map((function(children,childIndex){var dataEntry=blockProps.data.length>childIndex?blockProps.data[childIndex]:{},interactions=blockProps.data[childIndex].interactions,paragraphGroup=[],result=[],alignment=(null==dataEntry?void 0:dataEntry.textAlignment)||context.textAlignment,textClassName=getBlockStyleClasses(mergedStyles,textDirection||dataEntry.textDirection,alignment),hasJustifyText="justify"===alignment&&hasText(children),blockStyle=blockDataToStyle(blockProps.data[childIndex]),elementProps=function(key){var _classNames;return{className:classNames__default.default(mergedStyles.elementSpacing,textClassName,(_classNames={},_classNames[viewerStyles.hasJustifyText]=hasJustifyText,_classNames[viewerStyles.contentCenterAlignment]="center"===alignment,_classNames)),style:{lineHeight:blockStyle.lineHeight},key:key}};React__default.default.Children.forEach(children,(function(child,i){child&&("string"==typeof child.type&&/h\d/.exec(child.type)?(paragraphGroup.length&&(result.push(React__default.default.createElement("p",elementProps(i),paragraphGroup)),paragraphGroup=[]),result.push(React__default.default.cloneElement(child,elementProps(i)))):paragraphGroup.push(child))})),paragraphGroup.length&&result.push(React__default.default.createElement("p",elementProps("just_some_key"),paragraphGroup));var depth=dataEntry.depth,listItemDirection=wixRichContentCommon.getDirectionFromAlignmentAndTextDirection(alignment,textDirection||dataEntry.textDirection),className=getBlockClassName(listItemDirection,listType,depth,{isNewList:0===childIndex||depth>prevDepth});prevDepth=depth;var blockIndex=dataEntry.index,wrappedBlock=withInteraction(0===result.length?" ":result,interactions,context);return React__default.default.createElement("li",{id:"viewer-"+blockProps.keys[childIndex],className:classNames__default.default(context.theme[listItemTypeClassName],viewerStyles[listItemTypeClassName],viewerStyles[alignment],getBlockStyleClasses(mergedStyles,listItemDirection,alignment,className,!0),isPaywallSeo(context.seoMode)&&getPaywallSeoClass(context.seoMode.paywall,blockIndex),blockStyle.lineHeight&&viewerStyles.lineHeightFix),key:blockProps.keys[childIndex],style:blockDataToStyle(blockProps.data[childIndex])},wrappedBlock)})))},Anchor=React__default.default.memo((function(_ref){var anchorKey=_ref.anchorKey,type=_ref.type;return React__default.default.createElement("div",{key:anchorKey,type:type,"data-hook":anchorKey})})),PluginViewer=function(_PureComponent){function PluginViewer(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_PureComponent.call.apply(_PureComponent,[this].concat(args))||this).getContainerClassNames=function(){var _classNames,_this$props=_this.props,pluginComponent=_this$props.pluginComponent,componentData=_this$props.componentData,styles=_this$props.styles,_this$props$context=_this$props.context,theme=_this$props$context.theme,isMobile=_this$props$context.isMobile;_this$props.type;var _ref=pluginComponent.classNameStrategies||{},size=_ref.size,alignment=_ref.alignment,textWrap=_ref.textWrap,custom=_ref.custom,hasLink=_this.componentHasLink(),html=componentData.html;return classNames__default.default(styles.pluginContainerReadOnly,((_classNames={})[styles.pluginContainerMobile]=isMobile,_classNames[styles.anchor]=hasLink,_classNames[theme.anchor]=hasLink&&theme.anchor,_classNames[styles.embed]=hasLink&&html,_classNames[styles.horizontalScrollbar]=pluginComponent.withHorizontalScroll,_classNames),lodash.isFunction(alignment)?alignment(componentData,theme,styles,isMobile):wixRichContentCommon.alignmentClassName(componentData,theme,styles,isMobile),lodash.isFunction(size)?size(componentData,theme,styles,isMobile):wixRichContentCommon.sizeClassName(componentData,theme,styles,isMobile),lodash.isFunction(textWrap)?textWrap(componentData,theme,styles,isMobile):wixRichContentCommon.textWrapClassName(componentData,theme,styles,isMobile),lodash.isFunction(custom)?custom(componentData,theme,styles,isMobile):null)},_this.componentHasLink=function(){var _this$props2,_this$props2$componen,_this$props2$componen2,_this$props2$componen3;return null===(_this$props2=_this.props)||void 0===_this$props2||null===(_this$props2$componen=_this$props2.componentData)||void 0===_this$props2$componen||null===(_this$props2$componen2=_this$props2$componen.config)||void 0===_this$props2$componen2||null===(_this$props2$componen3=_this$props2$componen2.link)||void 0===_this$props2$componen3?void 0:_this$props2$componen3.url},_this.componentHasAnchor=function(){var _this$props3,_this$props3$componen,_this$props3$componen2,_this$props3$componen3;return null===(_this$props3=_this.props)||void 0===_this$props3||null===(_this$props3$componen=_this$props3.componentData)||void 0===_this$props3$componen||null===(_this$props3$componen2=_this$props3$componen.config)||void 0===_this$props3$componen2||null===(_this$props3$componen3=_this$props3$componen2.link)||void 0===_this$props3$componen3?void 0:_this$props3$componen3.anchor},_this.innerRCV=function(_ref2){var contentState=_ref2.contentState,textAlignment=_ref2.textAlignment,direction=_ref2.direction,renderedIn=_ref2.renderedIn,innerRCEViewerProps=_this.props.innerRCEViewerProps,renderedInTable=renderedIn===wixRichContentCommon.TABLE_TYPE;return React__default.default.createElement(RichContentViewer,_extends__default.default({initialState:contentState,textAlignment:textAlignment,direction:direction},innerRCEViewerProps,{isInnerRcv:!0,renderedInTable:renderedInTable}))},_this}return _inheritsLoose__default.default(PluginViewer,_PureComponent),PluginViewer.prototype.render=function(){var _this$props4=this.props,id=_this$props4.id,type=_this$props4.type,pluginComponent=_this$props4.pluginComponent,componentData=_this$props4.componentData,children=_this$props4.children,styles=_this$props4.styles,entityIndex=_this$props4.entityIndex,context=_this$props4.context,blockIndex=_this$props4.blockIndex,SpoilerViewerWrapper=_this$props4.SpoilerViewerWrapper,blockKey=_this$props4.blockKey,Component=pluginComponent.component,elementType=pluginComponent.elementType,container=(pluginComponent.classNameStrategies||{}).container,anchorTarget=context.anchorTarget,config=context.config,theme=context.theme,isMobile=context.isMobile,settings=(null==config?void 0:config[type])||{},componentProps=_extends__default.default({type:type,componentData:componentData,settings:settings,children:children,entityIndex:entityIndex},context,{innerRCV:this.innerRCV,blockKey:blockKey});if(Component){if("inline"!==elementType){var _containerProps,_containerProps$style,customStyles,_componentData$config=componentData.config,_config=void 0===_componentData$config?{}:_componentData$config,hasLink=this.componentHasLink(),hasAnchor=this.componentHasAnchor(),ContainerElement=hasLink||hasAnchor?"a":"div",containerProps={};if(hasLink){var _config$link=_config.link,url=_config$link.url,_config$link$target=_config$link.target,target=void 0===_config$link$target?anchorTarget:_config$link$target,rel=_config$link.rel;containerProps={href:wixRichContentCommon.normalizeUrl(url),target:target,rel:wixRichContentCommon.getRelValue(rel)}}if(hasAnchor)containerProps={href:"#viewer-"+_config.link.anchor,target:"_self"};if("inline"!==_config.size&&type!==wixRichContentCommon.HTML_TYPE&&type!==wixRichContentCommon.MAP_TYPE||(customStyles={width:_config.width}),type===wixRichContentCommon.IMAGE_TYPE){var _componentData$src=componentData.src,src=void 0===_componentData$src?{}:_componentData$src,size=_config.size;src.width&&("original"===size||isMobile&&"inline"===size&&_config.width&&_config.width>150)&&(customStyles={width:src.width,maxWidth:"100%"})}type!==wixRichContentCommon.ACTION_BUTTON_TYPE&&type!==wixRichContentCommon.LINK_BUTTON_TYPE||!lodash.isNumber(_config.width)||(componentProps.style={width:_config.width}),customStyles&&(containerProps.style=customStyles);var ContainerClassName=this.getContainerClassNames(),ContainerComponent=React__default.default.createElement(ContainerElement,_extends__default.default({className:ContainerClassName},containerProps),lodash.isFunction(container)?React__default.default.createElement("div",{className:container(theme)},React__default.default.createElement(Component,componentProps)):React__default.default.createElement(Component,componentProps));return React__default.default.createElement("div",{id:id,className:classNames__default.default(styles.atomic,isPaywallSeo(context.seoMode)&&getPaywallSeoClass(context.seoMode.paywall,blockIndex))},SpoilerViewerWrapper?React__default.default.createElement(SpoilerViewerWrapper,_extends__default.default({},componentProps,{className:ContainerClassName,width:null===(_containerProps=containerProps)||void 0===_containerProps||null===(_containerProps$style=_containerProps.style)||void 0===_containerProps$style?void 0:_containerProps$style.width}),ContainerComponent):ContainerComponent)}return SpoilerViewerWrapper?React__default.default.createElement(SpoilerViewerWrapper,componentProps,React__default.default.createElement(Component,componentProps)):React__default.default.createElement(Component,componentProps)}return null},PluginViewer}(React.PureComponent);PluginViewer.defaultProps={styles:{}};var textColorInlineStyleMapper=wixRichContentCommon.getDynamicInlineStyleMapper(wixRichContentCommon.RICOS_TEXT_COLOR_TYPE),textHighlightInlineStyleMapper=wixRichContentCommon.getDynamicInlineStyleMapper(wixRichContentCommon.RICOS_TEXT_HIGHLIGHT_TYPE),fontSizeInlineStyleMapper=wixRichContentCommon.getDynamicInlineStyleMapper(wixRichContentCommon.RICOS_FONT_SIZE_TYPE),staticInlineStyleMapper=function(mergedStyles){return{BOLD:function(children,_ref){var key=_ref.key;return React__default.default.createElement("strong",{key:key},children)},ITALIC:function(children,_ref2){var key=_ref2.key;return React__default.default.createElement("em",{key:key},children)},UNDERLINE:function(children,_ref3){var key=_ref3.key;return React__default.default.createElement("u",{key:key,className:mergedStyles.underline},children)},CODE:function(children,_ref4){var key=_ref4.key;return React__default.default.createElement("span",{key:key,className:mergedStyles.code},children)},NOT_BOLD:function(children,_ref5){var key=_ref5.key;return React__default.default.createElement("span",{style:{fontWeight:"normal"},key:key},children)},NOT_ITALIC:function(children,_ref6){var key=_ref6.key;return React__default.default.createElement("span",{style:{fontStyle:"normal"},key:key},children)}}},_excluded=["addAnchors"],isEmptyBlock=function(_ref){_ref[0];var data=_ref[1];return data&&0===data.length},getBlockStyleClasses=function(mergedStyles,textDirection,textAlignment,classes,isListItem){var rtl="rtl"===textDirection,alignmentClass=textAlignment||(rtl?"right":"left"),directionClass=(isListItem?rtl:"ltr"!==(textDirection||"ltr"))?mergedStyles.rtl:mergedStyles.ltr;return classNames__default.default(classes,directionClass,mergedStyles[alignmentClass])},_blockDataToStyle=function(_ref2){var dynamicStyles=_ref2.dynamicStyles;return kebabToCamelObjectKeys(dynamicStyles)},getInline=function(contentState,config,inlineStyleMappers,mergedStyles){return combineMappers([].concat(inlineStyleMappers,function(contentState,config){return[staticInlineStyleMapper,fontSizeInlineStyleMapper({},contentState),textColorInlineStyleMapper(config,contentState),textHighlightInlineStyleMapper(config,contentState)]}(contentState,config)),mergedStyles)},getBlocks=function(mergedStyles,textDirection,context,addAnchorsPrefix,documentStyle){var getList=function(ordered){return function(items,blockProps){var fixedItems=items.map((function(item){return item.length?item:[" "]})),props={key:blockProps.keys[0],items:fixedItems,ordered:ordered,mergedStyles:mergedStyles,textDirection:textDirection,blockProps:blockProps,getBlockStyleClasses:getBlockStyleClasses,blockDataToStyle:function(_ref3){var dynamicStyles=_ref3.dynamicStyles;return _extends__default.default({},kebabToCamelObjectKeys(null==documentStyle?void 0:documentStyle[wixRichContentCommon.DOC_STYLE_TYPES.P]),_blockDataToStyle({dynamicStyles:dynamicStyles}))},context:context};return React__default.default.createElement(List,_extends__default.default({},props))}},blockFactory=function(type,style){return function(children,blockProps){return children.map((function(child,i){var _blockProps$data$i,_blockProps$data$i2,_blockProps$data$i3,_blockProps$data$i4,alignment=(null===(_blockProps$data$i=blockProps.data[i])||void 0===_blockProps$data$i?void 0:_blockProps$data$i.textAlignment)||context.textAlignment,depth=blockProps.data[i].depth,blockDirection=wixRichContentCommon.getDirectionFromAlignmentAndTextDirection(alignment,textDirection||(null===(_blockProps$data$i2=blockProps.data[i])||void 0===_blockProps$data$i2?void 0:_blockProps$data$i2.textDirection)),hasJustifyText="justify"===alignment&&hasText(child),directionBlockClassName="public-DraftStyleDefault-text-"+blockDirection,directionTextClassName="public-DraftStyleDefault-"+(textDirection||(null===(_blockProps$data$i3=blockProps.data[i])||void 0===_blockProps$data$i3?void 0:_blockProps$data$i3.textDirection)||"ltr"),ChildTag="string"==typeof type?type:type(child),blockIndex=blockProps.data[i].index,interactions=blockProps.data[i].interactions,_child=isEmptyBlock(child)?React__default.default.createElement("br",{role:"presentation"}):child,nodeStyle=null==documentStyle?void 0:documentStyle["text"===style?wixRichContentCommon.DOC_STYLE_TYPES.P:style],parsedNodeStyle=kebabToCamelObjectKeys(nodeStyle),content=_child;("text"===style||Object.values(wixRichContentCommon.DOC_STYLE_TYPES).includes(style))&&(content=lodash.isEmpty(nodeStyle)?React__default.default.createElement("span",null,content):React__default.default.createElement("span",{className:nodeStyle.color&&viewerStyles.overrideLinkColor,style:parsedNodeStyle},content));var inner=React__default.default.createElement(React__default.default.Fragment,{key:blockProps.keys[i]},React__default.default.createElement(ChildTag,{id:"viewer-"+blockProps.keys[i],className:classNames__default.default(getBlockStyleClasses(mergedStyles,textDirection||(null===(_blockProps$data$i4=blockProps.data[i])||void 0===_blockProps$data$i4?void 0:_blockProps$data$i4.textDirection),alignment,mergedStyles[style]),wixRichContentCommon.depthClassName(depth),"fixed-tab-size",directionBlockClassName,isPaywallSeo(context.seoMode)&&getPaywallSeoClass(context.seoMode.paywall,blockIndex)),style:_blockDataToStyle(blockProps.data[i])},React__default.default.createElement("span",{className:classNames__default.default(viewerStyles.child,directionTextClassName,hasJustifyText&&viewerStyles.hasJustifyText)},content))),wrappedBlock=withInteraction(inner,interactions,context),wrapperKey=blockProps.keys[i]+"_wrap",resultBlock=React__default.default.createElement(React__default.default.Fragment,{key:wrapperKey},wrappedBlock);if(addAnchorsPrefix){var anchorKey=""+addAnchorsPrefix+(blockIndex+1);resultBlock=React__default.default.createElement(React__default.default.Fragment,{key:wrapperKey},wrappedBlock,React__default.default.createElement(Anchor,{type:isEmptyBlock(child)?"empty-line":"string"==typeof type?type:"paragraph",key:anchorKey,anchorKey:anchorKey}))}return resultBlock}))}};return{unstyled:blockFactory((function(child){return isEmptyBlock(child)?"div":"p"}),"text"),blockquote:blockFactory("blockquote","quote"),"header-one":blockFactory("h1","headerOne"),"header-two":blockFactory("h2","headerTwo"),"header-three":blockFactory("h3","headerThree"),"header-four":blockFactory("h4","headerFour"),"header-five":blockFactory("h5","headerFive"),"header-six":blockFactory("h6","headerSix"),"code-block":blockFactory("pre","codeBlock"),"unordered-list-item":getList(!1),"ordered-list-item":getList(!0)}},getEntities=function(typeMappers,context,styles,addAnchorsPrefix,innerRCEViewerProps,SpoilerViewerWrapper){return _extends__default.default({EMOJI_TYPE:function(emojiUnicode,data,_ref4){var key=_ref4.key;return React__default.default.createElement("span",{key:key,style:{fontFamily:"cursive"}},emojiUnicode)}},function(SpoilerViewerWrapper,typeMappers,context,styles,addAnchorsPrefix,innerRCEViewerProps){var res={};return Object.keys(typeMappers).forEach((function(type,i){res[type]=function(children,entity,_ref4){var content,blockKey,anchorElement,key=_ref4.key,block=_ref4.block,pluginComponent=typeMappers[type],isInline="inline"===pluginComponent.elementType,interactions=entity.interactions,pluginViewer=React__default.default.createElement(PluginViewer,{id:"viewer-"+block.key,type:type,pluginComponent:pluginComponent,componentData:entity,entityIndex:key,context:context,styles:styles,blockIndex:(content=context.contentState,blockKey=block.key,content.blocks.findIndex((function(block){return block.key===blockKey}))),typeMap:typeMappers,innerRCEViewerProps:innerRCEViewerProps,SpoilerViewerWrapper:SpoilerViewerWrapper,withHorizontalScroll:!0,blockKey:block.key},isInline?children:null),wrappedPluginViewer=withInteraction(pluginViewer,interactions,context);if(addAnchorsPrefix&&!isInline){var anchorType=type.replace("wix-draft-plugin-","").toLowerCase(),anchorKey=""+addAnchorsPrefix+(block.data.index+1);anchorElement=React__default.default.createElement(Anchor,{type:anchorType,anchorKey:anchorKey})}return React__default.default.createElement(React__default.default.Fragment,{key:i+"_"+key},wrappedPluginViewer,anchorElement)}})),res}(SpoilerViewerWrapper,typeMappers,context,styles,addAnchorsPrefix,innerRCEViewerProps))},redraftOptions={cleanup:{after:wixRichContentCommon.BLOCK_TYPES.filter((function(t){return-1===t.indexOf("header")})),split:!0,except:["unordered-list-item","ordered-list-item","unstyled","header-one","header-two","header-three","header-four","header-five","header-six"]},convertFromRaw:function(contentState){return contentState}},convertToReact=function(mergedStyles,textDirection,typeMappers,context,decorators,inlineStyleMappers,config,initSpoilers,SpoilerViewerWrapper,options,innerRCEViewerProps,externalDocumentStyle){if(void 0===options&&(options={}),!(raw=context.contentState)||!raw.blocks||1===raw.blocks.length&&""===raw.blocks[0].text&&"unstyled"===raw.blocks[0].type)return null;var raw,contentState,_options=options,addAnchors=_options.addAnchors,restOptions=_objectWithoutPropertiesLoose__default.default(_options,_excluded),normalizedContentState=context.contentState?(contentState=context.contentState,_extends__default.default({},contentState,{blocks:contentState.blocks.map((function(block,index){if("atomic"===block.type)return _extends__default.default({},block,{data:{index:index}});var textDirection=wixRichContentCommon.getTextDirection(block.text),data=_extends__default.default({},block.data,{depth:block.depth,index:index},"rtl"===textDirection&&{textDirection:textDirection}),text=block.text;return lodash.endsWith(text,"\n")&&(text+="\n"),_extends__default.default({},block,{depth:0,data:data,text:text})}))})):context.contentState,newContentState=initSpoilers?initSpoilers(normalizedContentState):normalizedContentState,addAnchorsPrefix=addAnchors&&(!0===addAnchors?"rcv-block":addAnchors),documentStyle=externalDocumentStyle||(null==newContentState?void 0:newContentState.documentStyle),result=redraft(newContentState,{inline:getInline(newContentState,config,inlineStyleMappers,mergedStyles),blocks:getBlocks(mergedStyles,textDirection,context,addAnchorsPrefix,documentStyle),entities:getEntities(typeMappers,context,mergedStyles,addAnchorsPrefix,_extends__default.default({},innerRCEViewerProps,{documentStyle:documentStyle}),SpoilerViewerWrapper),decorators:decorators},_extends__default.default({},redraftOptions,restOptions));if(addAnchors){var firstAnchorKey=addAnchorsPrefix+"-first",lastAnchorKey=addAnchorsPrefix+"-last";result=React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(Anchor,{type:"first",anchorKey:firstAnchorKey}),result,React__default.default.createElement(Anchor,{type:"last",anchorKey:lastAnchorKey}))}return result},viewerAlignmentStyles={alignLeft:"_17-_F",textWrapNowrap:"_3OKLB",alignRight:"_3VL_9",alignCenter:"_3CWa-",sizeFullWidth:"_28A1_",renderedInTable:"erqrj",sizeOriginal:"_1GSK2",sizeContent:"_3mymk",sizeSmall:"_3vo3y",sizeSmallCenter:"_3fofE",flex:"_2orjS",left:"_3M0Fe",center:"_1oG79",right:"_2wn-L"},rtlStyle={rtl:"ZF7FS",ltr:"_1FoOD"},RichContentViewer=function(_Component){function RichContentViewer(props){var _experiments$ricosVie,_this;(_this=_Component.call(this,props)||this).styles=void 0,_this.typeMappers=void 0,_this.getContextualData=function(_ref,contentState){var _config$uiSettings,t=_ref.t,theme=_ref.theme,_ref$isMobile=_ref.isMobile,isMobile=void 0!==_ref$isMobile&&_ref$isMobile,anchorTarget=_ref.anchorTarget,relValue=_ref.relValue,customAnchorScroll=_ref.customAnchorScroll,config=_ref.config,_ref$helpers=_ref.helpers,helpers=void 0===_ref$helpers?{}:_ref$helpers,locale=_ref.locale,disabled=_ref.disabled,seoMode=_ref.seoMode,iframeSandboxDomain=_ref.iframeSandboxDomain,textAlignment=_ref.textAlignment,experiments=_ref.experiments;return deprecateHelpers.deprecateHelpers(helpers,config),{t:t,theme:theme,isMobile:isMobile,anchorTarget:anchorTarget,relValue:relValue,customAnchorScroll:customAnchorScroll,config:config,helpers:helpers,locale:locale,disabled:disabled,seoMode:seoMode,contentState:contentState,iframeSandboxDomain:iframeSandboxDomain,disableRightClick:null==config||null===(_config$uiSettings=config.uiSettings)||void 0===_config$uiSettings?void 0:_config$uiSettings.disableRightClick,textAlignment:textAlignment,experiments:experiments}};var _props$experiments=props.experiments,_experiments=void 0===_props$experiments?{}:_props$experiments,_props$isMobile=props.isMobile,_isMobile=void 0!==_props$isMobile&&_props$isMobile,_t=props.t,styles=_extends__default.default({},viewerStyles,viewerAlignmentStyles,rtlStyle);return _this.styles=null!=_experiments&&null!==(_experiments$ricosVie=_experiments.ricosViewerNext)&&void 0!==_experiments$ricosVie&&_experiments$ricosVie.enabled?styles:wixRichContentCommon.mergeStyles({styles:styles,theme:props.theme}),_this.typeMappers=combineMappers(props.typeMappers),_this.state={context:{experiments:_experiments,isMobile:_isMobile,t:_t}},_this}_inheritsLoose__default.default(RichContentViewer,_Component),RichContentViewer.getDerivedStateFromProps=function(props){return{raw:RichContentViewer.getInitialState(props)}},RichContentViewer.getDerivedStateFromError=function(error){return{error:error}};var _proto=RichContentViewer.prototype;return _proto.componentDidCatch=function(error,errorInfo){console.error({error:error,errorInfo:errorInfo})},_proto.componentDidMount=function(){this.reportDebuggingInfo()},_proto.reportDebuggingInfo=function(){var _this2=this;"undefined"!=typeof window&&/ricos-debug/i.test(window.location.search)&&!window.__RICOS_INFO__&&Promise.resolve().then((function(){return _interopNamespace(require(/* webpackChunkName: "debugging-info" */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),englishResources=require("wix-rich-content-common/dist/statics/viewer/locale/messages_en.json"),wixRichContentCommon=require("wix-rich-content-common"),classNames=require("classnames"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require$$0=require("punycode"),lodash=require("lodash"),deprecateHelpers=require("wix-rich-content-common/libs/deprecateHelpers");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(k){if("default"!==k){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}})),n.default=e,Object.freeze(n)}var _extends__default=_interopDefaultLegacy(_extends),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),englishResources__default=_interopDefaultLegacy(englishResources),classNames__default=_interopDefaultLegacy(classNames),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),require$$0__default=_interopDefaultLegacy(require$$0),draftDefaultStyles_renderedInTable="fYHOr";function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}function createCommonjsModule(fn){var module={exports:{}};return fn(module,module.exports),module.exports}var arrayEqual=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(arr1,arr2){if(arr1.length!==arr2.length)return!1;for(var i=0;i<arr1.length;i++)if(arr1[i]!==arr2[i])return!1;return!0};exports.default=_default})),ContentNode_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var obj,_arrayEqual=(obj=arrayEqual)&&obj.__esModule?obj:{default:obj};function _toArray(arr){return function(arr){if(Array.isArray(arr))return arr}(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _iterableToArray(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var ContentNode=function(){function ContentNode(props){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ContentNode),this.content=props.content||[],this.start=void 0!==props.start?props.start:null,this.end=void 0!==props.end?props.end:null,this.entity=void 0!==props.entity?props.entity:null,this.decorator=void 0!==props.decorator?props.decorator:null,this.decoratorProps=props.decoratorProps||null,this.decoratedText=void 0!==props.decoratedText?props.decoratedText:null,this.contentState=props.contentState,this.style=props.style||null,this.styles=props.styles||null,this.block=props.block||{}}var Constructor,protoProps,staticProps;return Constructor=ContentNode,protoProps=[{key:"getCurrentContent",value:function(){return this.content[this.content.length-1]}},{key:"addToCurrentContent",value:function(string){this.content[this.content.length-1]=this.content[this.content.length-1]+string}},{key:"handleFlatPush",value:function(string,stack){var current=this.getCurrentContent();if(current instanceof ContentNode&&(0,_arrayEqual.default)(stack,current.styles))current.addToCurrentContent(string);else{var newNode=new ContentNode({styles:_toConsumableArray(stack),content:[string]});this.content.push(newNode)}}},{key:"pushContent",value:function(string){var stack=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],flat=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!stack||stack.length<1)return"string"==typeof string&&"string"==typeof this.getCurrentContent()?this.addToCurrentContent(string):this.content.push(string),this;if(flat)return this.handleFlatPush(string,stack),this;var _stack=_toArray(stack),head=_stack[0],rest=_stack.slice(1),current=this.getCurrentContent();if(current instanceof ContentNode&&current.style===head)current.pushContent(string,rest,flat);else{var newNode=new ContentNode({style:head});newNode.pushContent(string,rest,flat),this.content.push(newNode)}return this}}],protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),ContentNode}(),_default=ContentNode;exports.default=_default})),RawParser_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _punycode=_interopRequireDefault(require$$0__default.default),_ContentNode=_interopRequireDefault(ContentNode_1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}var getString=function(array,from,to){return _punycode.default.ucs2.encode(array.slice(from,to))};function addIndexes(indexes,ranges){return ranges.forEach((function(range){indexes.push(range.offset),indexes.push(range.offset+range.length)})),indexes}var RawParser=function(){function RawParser(_ref){var _ref$flat=_ref.flat,flat=void 0!==_ref$flat&&_ref$flat;!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RawParser),this.flat=flat}var Constructor,protoProps,staticProps;return Constructor=RawParser,protoProps=[{key:"relevantStyles",value:function(offset){return this.ranges.filter((function(range){return offset>=range.offset&&offset<range.offset+range.length})).map((function(style){return style.style}))}},{key:"nodeIterator",value:function(node,start,end){var _this=this,indexes=this.relevantIndexes.slice(this.relevantIndexes.indexOf(start),this.relevantIndexes.indexOf(end));return indexes.forEach((function(index,key){var characterStyles=_this.relevantStyles(index),distance=indexes[key+1]?indexes[key+1]-index:1,text=getString(_this.textArray,index,index+distance);node.pushContent(text,characterStyles,_this.flat),!indexes[key+1]&&index<end&&node.pushContent(getString(_this.textArray,index+1,end),_this.relevantStyles(end-1),_this.flat)})),node}},{key:"parse",value:function(block){var _this2=this,text=block.text,ranges=block.inlineStyleRanges,entityRanges=block.entityRanges,_block$decoratorRange=block.decoratorRanges,decoratorRanges=void 0===_block$decoratorRange?[]:_block$decoratorRange;this.textArray=_punycode.default.ucs2.decode(text),this.ranges=ranges,this.iterator=0,this.relevantIndexes=function(text,inlineRanges){var entityRanges=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],decoratorRanges=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],relevantIndexes=[];return relevantIndexes=addIndexes(relevantIndexes,inlineRanges),relevantIndexes=addIndexes(relevantIndexes,entityRanges),(relevantIndexes=addIndexes(relevantIndexes,decoratorRanges)).push(0),relevantIndexes.push(text.length),relevantIndexes.filter((function(value,index,self){return self.indexOf(value)===index})).sort((function(aa,bb){return aa-bb}))}(text,ranges,entityRanges,decoratorRanges);var nodes=function(entityRanges){var decoratorRanges=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],textArray=arguments.length>2?arguments[2]:void 0,block=arguments.length>3?arguments[3]:void 0,lastIndex=0,mergedRanges=[].concat(_toConsumableArray(entityRanges),_toConsumableArray(decoratorRanges)).sort((function(a,b){return a.offset-b.offset})),nodes=[];return mergedRanges.length<1?(nodes.push(new _ContentNode.default({block:block,start:0,end:textArray.length})),nodes):(mergedRanges.forEach((function(range){range.offset>lastIndex&&nodes.push(new _ContentNode.default({block:block,start:lastIndex,end:range.offset})),nodes.push(new _ContentNode.default({block:block,entity:range.key,decorator:range.component,decoratorProps:range.decoratorProps,decoratedText:range.component?getString(textArray,range.offset,range.offset+range.length):void 0,start:range.offset,end:range.offset+range.length,contentState:range.contentState})),lastIndex=range.offset+range.length})),lastIndex<textArray.length&&nodes.push(new _ContentNode.default({block:block,start:lastIndex,end:textArray.length})),nodes)}(entityRanges,decoratorRanges,this.textArray,block),parsedNodes=nodes.map((function(node){return _this2.nodeIterator(node,node.start,node.end)}));return new _ContentNode.default({block:block,content:parsedNodes})}}],protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),RawParser}();exports.default=RawParser})),createStyleRenderer_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(wrapper,stylesMap){return function(children,styleArray,params){var style=function(styleArray,stylesMap){return styleArray.map((function(style){return stylesMap[style]})).reduce((function(prev,next){var mergedStyles={};if(void 0!==next){var key="text-decoration"in next?"text-decoration":"textDecoration";next[key]!==prev[key]&&(mergedStyles[key]=[prev[key],next[key]].join(" ").trim())}return Object.assign(prev,next,mergedStyles)}),{})}(styleArray,stylesMap);return wrapper(Object.assign({},{children:children},params,{style:style}))}};exports.default=_default})),createBlockRenderer_1=createCommonjsModule((function(module,exports){function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var getKey=function(_ref,key){var keys=_ref.keys;return key||(keys?keys.join(","):void 0)},getBlock=function(element,wrapper,withDepth){return function(children,properties,key){var props=Object.assign({},properties);return withDepth||delete props.depth,wrapper.apply(void 0,[element,Object.assign({},props,{key:getKey(props,key)})].concat(_toConsumableArray(children)))}},_default=function(callback,blockMap){var renderer={};return Object.keys(blockMap).forEach((function(item){var block=blockMap[item];block.wrapper?renderer[item]=function(children,props,key){return function(callback,block,_ref2){var children=_ref2.children,props=_ref2.props,key=_ref2.key,wrapperBlockFn=getBlock(block.wrapper,callback),blockFn=getBlock(block.element,callback,!0);return wrapperBlockFn(children.map((function(child,ii){return blockFn(child,{},props.keys&&props.keys[ii])})),props,key)}(callback,block,{children:children,props:props,key:key})}:renderer[item]=getBlock(block.element,callback)})),renderer};exports.default=_default})),warn_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(msg){};exports.default=_default})),checkCleanup_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(block,prevType,_ref2){var cleanup=_ref2.cleanup;return!(!cleanup||function(block,options){return text=block.text,!!(options.trim?text.trim():text)||!(!block.data||!Object.keys(block.data).length)||!(!block.entityRanges||!block.entityRanges.length);var text}(block,cleanup))&&(!(cleanup.after&&"all"!==cleanup.after&&!cleanup.after.includes(prevType))&&(!(!cleanup.except||cleanup.except.includes(block.type))||!(!cleanup.types||"all"!==cleanup.types&&!cleanup.types.includes(block.type))))};exports.default=_default})),getKeyGenerator_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(){var key=0;return function(){var current=key;return key+=1,current}};exports.default=_default})),checkJoin_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(input,options){return Array.isArray(input)&&options.joinOutput?input.join(""):input};exports.default=_default})),pushString_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(string,array,index){var tempArray=array;return array[index]?tempArray[index]+=string:tempArray[index]=string,tempArray};exports.default=_default})),defaultOptions_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default={joinOutput:!1,cleanup:{after:["atomic"],types:["unstyled"],trim:!1,split:!0}};exports.default=_default})),CompositeDecorator=createCommonjsModule((function(module,exports){function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(){function CompositeDraftDecorator(decorators){var obj,key,value;!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CompositeDraftDecorator),value=void 0,(key="decorators")in(obj=this)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,this.decorators=decorators.slice()}var Constructor,protoProps,staticProps;return Constructor=CompositeDraftDecorator,(protoProps=[{key:"getDecorations",value:function(block,contentState){var decorations=Array(block.getText().length).fill(null);return this.decorators.forEach((function(decorator,ii){var counter=0;(0,decorator.strategy)(block,(function(start,end){(function(decorations,start,end){for(var ii=start;ii<end;ii++)if(null!=decorations[ii])return!1;return!0})(decorations,start,end)&&(function(targetArr,start,end,componentKey){for(var ii=start;ii<end;ii++)targetArr[ii]=componentKey}(decorations,start,end,ii+"."+counter),counter++)}),contentState)})),decorations}},{key:"getComponentForKey",value:function(key){var componentKey=parseInt(key.split(".")[0],10);return this.decorators[componentKey].component}},{key:"getPropsForKey",value:function(key){var componentKey=parseInt(key.split(".")[0],10);return this.decorators[componentKey].props}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),CompositeDraftDecorator}();exports.default=_default})),MultiDecorator_1=createCommonjsModule((function(module,exports){function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=function(){function MultiDecorator(decorators){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MultiDecorator),this.decorators=decorators}var Constructor,protoProps,staticProps;return Constructor=MultiDecorator,staticProps=[{key:"getInnerKey",value:function(key){return key.split("-").slice(1).join("-")}}],(protoProps=[{key:"getDecorations",value:function(block,contentState){var decorations=new Array(block.getText().length).fill(null);return this.decorators.forEach((function(decorator,i){decorator.getDecorations(block,contentState).forEach((function(key,offset){key&&(decorations[offset]=i+"-"+key)}))})),decorations}},{key:"getComponentForKey",value:function(key){return this.getDecoratorForKey(key).getComponentForKey(MultiDecorator.getInnerKey(key))}},{key:"getPropsForKey",value:function(key){return this.getDecoratorForKey(key).getPropsForKey(MultiDecorator.getInnerKey(key))}},{key:"getDecoratorForKey",value:function(key){var parts=key.split("-"),index=Number(parts[0]);return this.decorators[index]}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),MultiDecorator}();exports.default=_default})),stubContentBlock_1=createCommonjsModule((function(module,exports){function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var ContentBlockStub=function(){function ContentBlockStub(block){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ContentBlockStub),Object.assign(this,block)}var Constructor,protoProps,staticProps;return Constructor=ContentBlockStub,(protoProps=[{key:"get",value:function(name){return this[name]}},{key:"getText",value:function(){return this.text}},{key:"getType",value:function(){return this.type}},{key:"getKey",value:function(){return this.key}},{key:"getLength",value:function(){return this.text.length}},{key:"getDepth",value:function(){return this.depth}},{key:"getData",value:function(){return this.data}}])&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),ContentBlockStub}(),_default=function(block){return new ContentBlockStub(block)};exports.default=_default})),withDecorators_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _punycode=_interopRequireDefault(require$$0__default.default),_CompositeDecorator=_interopRequireDefault(CompositeDecorator),_MultiDecorator=_interopRequireDefault(MultiDecorator_1),_stubContentBlock=_interopRequireDefault(stubContentBlock_1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(iter))return Array.from(iter)}(arr)||function(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}var offsetRanges=function(ranges,block){return ranges.forEach((function(range){var pre=block.text.substring(0,range.offset),decorated=block.text.substring(range.offset,range.offset+range.length);range.offset=_punycode.default.ucs2.decode(pre).length,range.length=_punycode.default.ucs2.decode(decorated).length})),ranges},decoratorIsCustom=function(decorator){return"function"==typeof decorator.getDecorations&&"function"==typeof decorator.getComponentForKey&&"function"==typeof decorator.getPropsForKey},decorateBlock=function(block,decorators,contentState,_ref){var createContentBlock=_ref.createContentBlock,decoratorRanges=[],decorator=function(decorators){var compositeDecorator=new _CompositeDecorator.default(decorators.filter((function(decorator){return!decoratorIsCustom(decorator)}))),customDecorators=decorators.filter((function(decorator){return decoratorIsCustom(decorator)})),decor=[].concat(_toConsumableArray(customDecorators),[compositeDecorator]);return new _MultiDecorator.default(decor)}(decorators),contentBlock=createContentBlock?createContentBlock(block):(0,_stubContentBlock.default)(block),decorations=decorator.getDecorations(contentBlock,contentState),offset=0;return decorations.forEach((function(key,index){if(key){var nextIndex=index+1,next=decorations[nextIndex];next&&next===key||(decoratorRanges.push({offset:offset,length:nextIndex-offset,component:decorator.getComponentForKey(key),decoratorProps:decorator.getPropsForKey(key)||{},contentState:contentState}),offset=nextIndex)}else offset+=1})),Object.assign({},block,{decoratorRanges:offsetRanges(decoratorRanges,block)})},_default=function(raw,decorators,options){var contentState=options.convertFromRaw&&options.convertFromRaw(raw);return raw.blocks.map((function(block){return decorateBlock(block,decorators,contentState,options||{})}))};exports.default=_default})),render_1=createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.render=exports.renderNode=void 0;var _RawParser=_interopRequireDefault(RawParser_1),_warn=_interopRequireDefault(warn_1),_checkCleanup=_interopRequireDefault(checkCleanup_1),_getKeyGenerator=_interopRequireDefault(getKeyGenerator_1),_checkJoin=_interopRequireDefault(checkJoin_1),_pushString=_interopRequireDefault(pushString_1),_defaultOptions=_interopRequireDefault(defaultOptions_1),_withDecorators=_interopRequireDefault(withDecorators_1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var renderNode=function renderNode(node,inlineRenderers,entityRenderers,styleRenderers,entityMap,options,keyGenerator){if(node.styles&&styleRenderers)return styleRenderers((0,_checkJoin.default)(node.content,options),node.styles,{key:keyGenerator()});var children=[],index=0;if(node.content.forEach((function(part){"string"==typeof part?children=(0,_pushString.default)(part,children,index):(children[index+=1]=renderNode(part,inlineRenderers,entityRenderers,styleRenderers,entityMap,options,keyGenerator),index+=1)})),node.style&&inlineRenderers[node.style])return inlineRenderers[node.style]((0,_checkJoin.default)(children,options),{key:keyGenerator()});if(null!==node.entity){var entity=entityMap[node.entity],entityRenderer=entity&&(entityRenderers[entity.type]||"atomic"===node.block.type&&entityRenderers.atomicFallbackRenderer);if(entityRenderer)return entityRenderer((0,_checkJoin.default)(children,options),entity.data,{key:node.entity,block:node.block},entity.type)}if(null!==node.decorator){var decoratorOffsetKey=[node.block.key,node.start,0].join(".");return node.decorator(Object.assign({children:(0,_checkJoin.default)(children,options),decoratedText:node.decoratedText,contentState:node.contentState,entityKey:node.entity,offsetKey:decoratorOffsetKey,key:decoratorOffsetKey},node.decoratorProps))}return children};exports.renderNode=renderNode;var byDepth=function(blocks){var group=[],depthStack=[],prevDepth=0,unwind=function(targetDepth){var i=prevDepth-targetDepth;for(depthStack.length<i&&(i=depthStack.length);i>0;i-=1){var tmp=group;(group=depthStack.pop())[group.length-1].children=tmp}};return blocks.forEach((function(block){prevDepth<block.depth?(depthStack.push(group),group=[]):prevDepth>block.depth&&unwind(block.depth),prevDepth=block.depth,group.push(block)})),0!==prevDepth&&unwind(0),group},renderGroup=function(group,blockRenderers,rendered,params){var type=params.prevType,depth=params.prevDepth,keys=params.prevKeys,data=params.prevData;if(0!==group.length){if(blockRenderers[type]){var props={depth:depth,keys:keys};return data&&data.some((function(item){return!!item}))&&(props.data=data),void rendered.push(blockRenderers[type](group,props))}rendered.push(group)}},renderBlocks=function renderBlocks(blocks){var inlineRenderers=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},blockRenderers=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},entityRenderers=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},stylesRenderer=arguments.length>4?arguments[4]:void 0,entityMap=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},userOptions=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},options=Object.assign({},_defaultOptions.default,userOptions),rendered=[],group=[],prevType=null,prevDepth=0,prevKeys=[],prevData=[],splitGroup=!1,Parser=new _RawParser.default({flat:!!stylesRenderer});return blocks.forEach((function(block){if((0,_checkCleanup.default)(block,prevType,options))!0===options.cleanup.split&&(splitGroup=!0);else{var node=Parser.parse(block),renderedNode=renderNode(node,inlineRenderers,entityRenderers,stylesRenderer,entityMap,options,(0,_getKeyGenerator.default)());if((prevType&&prevType!==block.type||splitGroup)&&(renderGroup(group,blockRenderers,rendered,{prevType:prevType,prevDepth:prevDepth,prevKeys:prevKeys,prevData:prevData}),prevData=[],prevKeys=[],group=[],splitGroup=!1),block.children){var children=renderBlocks(block.children,inlineRenderers,blockRenderers,entityRenderers,stylesRenderer,entityMap,options);renderedNode.push(children)}group.push(renderedNode),prevType=block.type,prevDepth=block.depth,prevKeys.push(block.key),prevData.push(block.data)}})),renderGroup(group,blockRenderers,rendered,{prevType:prevType,prevDepth:prevDepth,prevKeys:prevKeys,prevData:prevData}),(0,_checkJoin.default)(rendered,options)};exports.render=function(raw){var renderers=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!raw||!Array.isArray(raw.blocks))return(0,_warn.default)("invalid raw object"),null;if(!raw.blocks.length)return null;var inlineRenderers=renderers.inline,blockRenderers=renderers.blocks,entityRenderers=renderers.entities,stylesRenderer=renderers.styles,decorators=renderers.decorators,blocksWithDecorators=decorators?(0,_withDecorators.default)(raw,decorators,options):raw.blocks,blocks=byDepth(blocksWithDecorators);return renderBlocks(blocks,inlineRenderers,blockRenderers,entityRenderers,stylesRenderer,raw.entityMap,options)}})),redraft=getDefaultExportFromCjs(createCommonjsModule((function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"RawParser",{enumerable:!0,get:function(){return _RawParser.default}}),Object.defineProperty(exports,"createStylesRenderer",{enumerable:!0,get:function(){return _createStyleRenderer.default}}),Object.defineProperty(exports,"createBlockRenderer",{enumerable:!0,get:function(){return _createBlockRenderer.default}}),Object.defineProperty(exports,"renderNode",{enumerable:!0,get:function(){return render_1.renderNode}}),Object.defineProperty(exports,"CompositeDecorator",{enumerable:!0,get:function(){return _CompositeDecorator.default}}),exports.default=void 0;var _RawParser=_interopRequireDefault(RawParser_1),_createStyleRenderer=_interopRequireDefault(createStyleRenderer_1),_createBlockRenderer=_interopRequireDefault(createBlockRenderer_1),_CompositeDecorator=_interopRequireDefault(CompositeDecorator);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _default=render_1.render;exports.default=_default}))),kebabToCamelObjectKeys=function(obj){return void 0===obj&&(obj={}),Object.keys(obj).reduce((function(result,key){var s;return result[(s=key,s.replace(/-([a-z])/,(function(_,p1){return p1.toUpperCase()})))]=obj[key],result}),{})},hasText=function hasText(child){return!!child&&("string"==typeof child?child.trim().length>0:Array.isArray(child)?hasText(child[0])||hasText(child[1]):"object"==typeof child&&hasText(child.props.children))},getPaywallSeoClass=function(_ref,blockIndex){var _ref$className=_ref.className,className=void 0===_ref$className?"paywall":_ref$className,_ref$index=_ref.index;return blockIndex<(void 0===_ref$index?3:_ref$index)&&className},isPaywallSeo=function(seoMode){return"object"==typeof seoMode&&"object"==typeof seoMode.paywall},viewerStyles={fontElementMap:"_27i2k",wrapper:"kvdbP",pluginContainerMobile:"_3iGUk",desktop:"_1O7aH",editor:"_1hN1O",android:"_23La5",atomic:"_2vd5k",toolbar:"_3j-bQ",underline:"_3zM-5",block:"_3RIlU",elementSpacing:"_1j-51",blockStyleSpacing:"_3Dd1B",text:"mm8Nw _1j-51",child:"_2PHJq",orderedList:"_2ULPL",unorderedList:"_3Kjjs",lineHeightFix:"NSjbv",center:"_37Oe5",contentCenterAlignment:"_3LGTx",justify:"_78FBa",quote:"_3cMZT _3Dd1B",headerOne:"_3qzEG _1j-51",headerTwo:"eSWI6 _1j-51",headerThree:"_3qMKZ _1j-51",headerFour:"_2TrLF _1j-51",headerFive:"_1zZGG _1j-51",headerSix:"_1joqJ _1j-51",code:"_3-Hex _3Dd1B",codeBlock:"_3M8UJ _3Dd1B",renderedInTable:"_3sj65",normalText:"_3iu3e",anchor:"_3mt3E",embed:"_1-N88",horizontalScrollbar:"_34Kbu",overrideLinkColor:"_2nl-9"},combineMappers=function(mappers){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return mappers&&mappers.length&&!mappers.some((function(resolver){return"function"!=typeof resolver}))?mappers.reduce((function(map,mapper){return Object.assign(map,mapper.apply(void 0,args))}),{}):(console.warn(mappers+" is expected to be a function array"),{})},DefaultInteractionWrapper=function(_ref){return _ref.children},withInteraction=function(element,interactions,context){var _config$PREVIEW,_config$PREVIEW$conte,config=context.config;if(null===(_config$PREVIEW=config.PREVIEW)||void 0===_config$PREVIEW||null===(_config$PREVIEW$conte=_config$PREVIEW.contentInteractionMappers)||void 0===_config$PREVIEW$conte||!_config$PREVIEW$conte.length||!config.PREVIEW.onPreviewExpand||!lodash.isArray(interactions))return element;var BlockInteractionWrapper=function(_ref2){var interactions=_ref2.interactions,context=_ref2.context;return function(_ref3){var children=_ref3.children,_ref4=context.config.PREVIEW||{},_ref4$contentInteract=_ref4.contentInteractionMappers,contentInteractionMappers=void 0===_ref4$contentInteract?[]:_ref4$contentInteract,_ref4$onPreviewExpand=_ref4.onPreviewExpand,interactionMap=combineMappers(contentInteractionMappers,void 0===_ref4$onPreviewExpand?function(){}:_ref4$onPreviewExpand);return interactions.reduce((function(child,_ref5){var type=_ref5.type,settings=_ref5.settings,Interaction=interactionMap[type]||DefaultInteractionWrapper;return React__default.default.createElement(Interaction,_extends__default.default({},settings,context),child)}),children)}}({interactions:interactions,context:context});return React__default.default.createElement(BlockInteractionWrapper,null,element)},draftPublic="public-DraftStyleDefault",getBlockClassName=function(direction,listType,depth,_ref){var isNewList=_ref.isNewList;return[].concat(function(listType,depth,textDirection){return[draftPublic+"-"+listType+"ListItem",draftPublic+"-depth"+depth,draftPublic+"-list-"+textDirection]}(listType,depth,direction),["fixed-tab-size"],isNewList?[draftPublic+"-reset"]:[]).join(" ")},List=function(_ref2){var ordered=_ref2.ordered,items=_ref2.items,mergedStyles=_ref2.mergedStyles,textDirection=_ref2.textDirection,blockProps=_ref2.blockProps,getBlockStyleClasses=_ref2.getBlockStyleClasses,blockDataToStyle=_ref2.blockDataToStyle,context=_ref2.context,Component=ordered?"ol":"ul",listType=ordered?"ordered":"unordered",containerClassName=draftPublic+"-"+Component,listItemTypeClassName=listType+"List",prevDepth=0;return React__default.default.createElement(Component,{className:containerClassName},items.map((function(children,childIndex){var dataEntry=blockProps.data.length>childIndex?blockProps.data[childIndex]:{},interactions=blockProps.data[childIndex].interactions,paragraphGroup=[],result=[],alignment=(null==dataEntry?void 0:dataEntry.textAlignment)||context.textAlignment,textClassName=getBlockStyleClasses(mergedStyles,textDirection||dataEntry.textDirection,alignment),hasJustifyText="justify"===alignment&&hasText(children),blockStyle=blockDataToStyle(blockProps.data[childIndex]),elementProps=function(key){var _classNames;return{className:classNames__default.default(mergedStyles.elementSpacing,textClassName,(_classNames={},_classNames[viewerStyles.hasJustifyText]=hasJustifyText,_classNames[viewerStyles.contentCenterAlignment]="center"===alignment,_classNames)),style:{lineHeight:blockStyle.lineHeight},key:key}};React__default.default.Children.forEach(children,(function(child,i){child&&("string"==typeof child.type&&/h\d/.exec(child.type)?(paragraphGroup.length&&(result.push(React__default.default.createElement("p",elementProps(i),paragraphGroup)),paragraphGroup=[]),result.push(React__default.default.cloneElement(child,elementProps(i)))):paragraphGroup.push(child))})),paragraphGroup.length&&result.push(React__default.default.createElement("p",elementProps("just_some_key"),paragraphGroup));var depth=dataEntry.depth,listItemDirection=wixRichContentCommon.getDirectionFromAlignmentAndTextDirection(alignment,textDirection||dataEntry.textDirection),className=getBlockClassName(listItemDirection,listType,depth,{isNewList:0===childIndex||depth>prevDepth});prevDepth=depth;var blockIndex=dataEntry.index,wrappedBlock=withInteraction(0===result.length?" ":result,interactions,context);return React__default.default.createElement("li",{id:"viewer-"+blockProps.keys[childIndex],className:classNames__default.default(context.theme[listItemTypeClassName],viewerStyles[listItemTypeClassName],viewerStyles[alignment],getBlockStyleClasses(mergedStyles,listItemDirection,alignment,className,!0),isPaywallSeo(context.seoMode)&&getPaywallSeoClass(context.seoMode.paywall,blockIndex),blockStyle.lineHeight&&viewerStyles.lineHeightFix),key:blockProps.keys[childIndex],style:blockDataToStyle(blockProps.data[childIndex])},wrappedBlock)})))},Anchor=React__default.default.memo((function(_ref){var anchorKey=_ref.anchorKey,type=_ref.type;return React__default.default.createElement("div",{key:anchorKey,type:type,"data-hook":anchorKey})})),PluginViewer=function(_PureComponent){function PluginViewer(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_PureComponent.call.apply(_PureComponent,[this].concat(args))||this).getContainerClassNames=function(){var _classNames,_this$props=_this.props,pluginComponent=_this$props.pluginComponent,componentData=_this$props.componentData,styles=_this$props.styles,_this$props$context=_this$props.context,theme=_this$props$context.theme,isMobile=_this$props$context.isMobile;_this$props.type;var _ref=pluginComponent.classNameStrategies||{},size=_ref.size,alignment=_ref.alignment,textWrap=_ref.textWrap,custom=_ref.custom,hasLink=_this.componentHasLink(),html=componentData.html;return classNames__default.default(styles.pluginContainerReadOnly,((_classNames={})[styles.pluginContainerMobile]=isMobile,_classNames[styles.anchor]=hasLink,_classNames[theme.anchor]=hasLink&&theme.anchor,_classNames[styles.embed]=hasLink&&html,_classNames[styles.horizontalScrollbar]=pluginComponent.withHorizontalScroll,_classNames),lodash.isFunction(alignment)?alignment(componentData,theme,styles,isMobile):wixRichContentCommon.alignmentClassName(componentData,theme,styles,isMobile),lodash.isFunction(size)?size(componentData,theme,styles,isMobile):wixRichContentCommon.sizeClassName(componentData,theme,styles,isMobile),lodash.isFunction(textWrap)?textWrap(componentData,theme,styles,isMobile):wixRichContentCommon.textWrapClassName(componentData,theme,styles,isMobile),lodash.isFunction(custom)?custom(componentData,theme,styles,isMobile):null)},_this.componentHasLink=function(){var _this$props2,_this$props2$componen,_this$props2$componen2,_this$props2$componen3;return null===(_this$props2=_this.props)||void 0===_this$props2||null===(_this$props2$componen=_this$props2.componentData)||void 0===_this$props2$componen||null===(_this$props2$componen2=_this$props2$componen.config)||void 0===_this$props2$componen2||null===(_this$props2$componen3=_this$props2$componen2.link)||void 0===_this$props2$componen3?void 0:_this$props2$componen3.url},_this.componentHasAnchor=function(){var _this$props3,_this$props3$componen,_this$props3$componen2,_this$props3$componen3;return null===(_this$props3=_this.props)||void 0===_this$props3||null===(_this$props3$componen=_this$props3.componentData)||void 0===_this$props3$componen||null===(_this$props3$componen2=_this$props3$componen.config)||void 0===_this$props3$componen2||null===(_this$props3$componen3=_this$props3$componen2.link)||void 0===_this$props3$componen3?void 0:_this$props3$componen3.anchor},_this.innerRCV=function(_ref2){var contentState=_ref2.contentState,textAlignment=_ref2.textAlignment,direction=_ref2.direction,renderedIn=_ref2.renderedIn,innerRCEViewerProps=_this.props.innerRCEViewerProps,renderedInTable=renderedIn===wixRichContentCommon.TABLE_TYPE;return React__default.default.createElement(RichContentViewer,_extends__default.default({initialState:contentState,textAlignment:textAlignment,direction:direction},innerRCEViewerProps,{isInnerRcv:!0,renderedInTable:renderedInTable}))},_this}return _inheritsLoose__default.default(PluginViewer,_PureComponent),PluginViewer.prototype.render=function(){var _this$props4=this.props,id=_this$props4.id,type=_this$props4.type,pluginComponent=_this$props4.pluginComponent,componentData=_this$props4.componentData,children=_this$props4.children,styles=_this$props4.styles,entityIndex=_this$props4.entityIndex,context=_this$props4.context,blockIndex=_this$props4.blockIndex,SpoilerViewerWrapper=_this$props4.SpoilerViewerWrapper,blockKey=_this$props4.blockKey,Component=pluginComponent.component,elementType=pluginComponent.elementType,container=(pluginComponent.classNameStrategies||{}).container,anchorTarget=context.anchorTarget,config=context.config,theme=context.theme,isMobile=context.isMobile,settings=(null==config?void 0:config[type])||{},componentProps=_extends__default.default({type:type,componentData:componentData,settings:settings,children:children,entityIndex:entityIndex},context,{innerRCV:this.innerRCV,blockKey:blockKey});if(Component){if("inline"!==elementType){var _containerProps,_containerProps$style,customStyles,_componentData$config=componentData.config,_config=void 0===_componentData$config?{}:_componentData$config,hasLink=this.componentHasLink(),hasAnchor=this.componentHasAnchor(),ContainerElement=hasLink||hasAnchor?"a":"div",containerProps={};if(hasLink){var _config$link=_config.link,url=_config$link.url,_config$link$target=_config$link.target,target=void 0===_config$link$target?anchorTarget:_config$link$target,rel=_config$link.rel;containerProps={href:wixRichContentCommon.normalizeUrl(url),target:target,rel:wixRichContentCommon.getRelValue(rel)}}if(hasAnchor)containerProps={href:"#viewer-"+_config.link.anchor,target:"_self"};if("inline"!==_config.size&&type!==wixRichContentCommon.HTML_TYPE&&type!==wixRichContentCommon.MAP_TYPE||(customStyles={width:_config.width}),type===wixRichContentCommon.IMAGE_TYPE){var _componentData$src=componentData.src,src=void 0===_componentData$src?{}:_componentData$src,size=_config.size;src.width&&("original"===size||isMobile&&"inline"===size&&_config.width&&_config.width>150)&&(customStyles={width:src.width,maxWidth:"100%"})}type!==wixRichContentCommon.ACTION_BUTTON_TYPE&&type!==wixRichContentCommon.LINK_BUTTON_TYPE||!lodash.isNumber(_config.width)||(componentProps.style={width:_config.width}),customStyles&&(containerProps.style=customStyles);var ContainerClassName=this.getContainerClassNames(),ContainerComponent=React__default.default.createElement(ContainerElement,_extends__default.default({className:ContainerClassName},containerProps),lodash.isFunction(container)?React__default.default.createElement("div",{className:container(theme)},React__default.default.createElement(Component,componentProps)):React__default.default.createElement(Component,componentProps));return React__default.default.createElement("div",{id:id,className:classNames__default.default(styles.atomic,isPaywallSeo(context.seoMode)&&getPaywallSeoClass(context.seoMode.paywall,blockIndex))},SpoilerViewerWrapper?React__default.default.createElement(SpoilerViewerWrapper,_extends__default.default({},componentProps,{className:ContainerClassName,width:null===(_containerProps=containerProps)||void 0===_containerProps||null===(_containerProps$style=_containerProps.style)||void 0===_containerProps$style?void 0:_containerProps$style.width}),ContainerComponent):ContainerComponent)}return SpoilerViewerWrapper?React__default.default.createElement(SpoilerViewerWrapper,componentProps,React__default.default.createElement(Component,componentProps)):React__default.default.createElement(Component,componentProps)}return null},PluginViewer}(React.PureComponent);PluginViewer.defaultProps={styles:{}};var textColorInlineStyleMapper=wixRichContentCommon.getDynamicInlineStyleMapper(wixRichContentCommon.RICOS_TEXT_COLOR_TYPE),textHighlightInlineStyleMapper=wixRichContentCommon.getDynamicInlineStyleMapper(wixRichContentCommon.RICOS_TEXT_HIGHLIGHT_TYPE),fontSizeInlineStyleMapper=wixRichContentCommon.getDynamicInlineStyleMapper(wixRichContentCommon.RICOS_FONT_SIZE_TYPE),staticInlineStyleMapper=function(mergedStyles){return{BOLD:function(children,_ref){var key=_ref.key;return React__default.default.createElement("strong",{key:key},children)},ITALIC:function(children,_ref2){var key=_ref2.key;return React__default.default.createElement("em",{key:key},children)},UNDERLINE:function(children,_ref3){var key=_ref3.key;return React__default.default.createElement("u",{key:key,className:mergedStyles.underline},children)},CODE:function(children,_ref4){var key=_ref4.key;return React__default.default.createElement("span",{key:key,className:mergedStyles.code},children)},NOT_BOLD:function(children,_ref5){var key=_ref5.key;return React__default.default.createElement("span",{style:{fontWeight:"normal"},key:key},children)},NOT_ITALIC:function(children,_ref6){var key=_ref6.key;return React__default.default.createElement("span",{style:{fontStyle:"normal"},key:key},children)}}},_excluded=["addAnchors"],isEmptyBlock=function(_ref){_ref[0];var data=_ref[1];return data&&0===data.length},getBlockStyleClasses=function(mergedStyles,textDirection,textAlignment,classes,isListItem){var rtl="rtl"===textDirection,alignmentClass=textAlignment||(rtl?"right":"left"),directionClass=(isListItem?rtl:"ltr"!==(textDirection||"ltr"))?mergedStyles.rtl:mergedStyles.ltr;return classNames__default.default(classes,directionClass,mergedStyles[alignmentClass])},_blockDataToStyle=function(_ref2){var dynamicStyles=_ref2.dynamicStyles;return kebabToCamelObjectKeys(dynamicStyles)},getInline=function(contentState,config,inlineStyleMappers,mergedStyles){return combineMappers([].concat(inlineStyleMappers,function(contentState,config){return[staticInlineStyleMapper,fontSizeInlineStyleMapper({},contentState),textColorInlineStyleMapper(config,contentState),textHighlightInlineStyleMapper(config,contentState)]}(contentState,config)),mergedStyles)},getBlocks=function(mergedStyles,textDirection,context,addAnchorsPrefix,documentStyle){var getList=function(ordered){return function(items,blockProps){var fixedItems=items.map((function(item){return item.length?item:[" "]})),props={key:blockProps.keys[0],items:fixedItems,ordered:ordered,mergedStyles:mergedStyles,textDirection:textDirection,blockProps:blockProps,getBlockStyleClasses:getBlockStyleClasses,blockDataToStyle:function(_ref3){var dynamicStyles=_ref3.dynamicStyles;return _extends__default.default({},kebabToCamelObjectKeys(null==documentStyle?void 0:documentStyle[wixRichContentCommon.DOC_STYLE_TYPES.P]),_blockDataToStyle({dynamicStyles:dynamicStyles}))},context:context};return React__default.default.createElement(List,_extends__default.default({},props))}},blockFactory=function(type,style){return function(children,blockProps){return children.map((function(child,i){var _blockProps$data$i,_blockProps$data$i2,_blockProps$data$i3,_blockProps$data$i4,alignment=(null===(_blockProps$data$i=blockProps.data[i])||void 0===_blockProps$data$i?void 0:_blockProps$data$i.textAlignment)||context.textAlignment,depth=blockProps.data[i].depth,blockDirection=wixRichContentCommon.getDirectionFromAlignmentAndTextDirection(alignment,textDirection||(null===(_blockProps$data$i2=blockProps.data[i])||void 0===_blockProps$data$i2?void 0:_blockProps$data$i2.textDirection)),hasJustifyText="justify"===alignment&&hasText(child),directionBlockClassName="public-DraftStyleDefault-text-"+blockDirection,directionTextClassName="public-DraftStyleDefault-"+(textDirection||(null===(_blockProps$data$i3=blockProps.data[i])||void 0===_blockProps$data$i3?void 0:_blockProps$data$i3.textDirection)||"ltr"),ChildTag="string"==typeof type?type:type(child),blockIndex=blockProps.data[i].index,interactions=blockProps.data[i].interactions,_child=isEmptyBlock(child)?React__default.default.createElement("br",{role:"presentation"}):child,nodeStyle=null==documentStyle?void 0:documentStyle["text"===style?wixRichContentCommon.DOC_STYLE_TYPES.P:style],parsedNodeStyle=kebabToCamelObjectKeys(nodeStyle),content=_child;("text"===style||Object.values(wixRichContentCommon.DOC_STYLE_TYPES).includes(style))&&(content=lodash.isEmpty(nodeStyle)?React__default.default.createElement("span",null,content):React__default.default.createElement("span",{className:nodeStyle.color&&viewerStyles.overrideLinkColor,style:parsedNodeStyle},content));var inner=React__default.default.createElement(React__default.default.Fragment,{key:blockProps.keys[i]},React__default.default.createElement(ChildTag,{id:"viewer-"+blockProps.keys[i],className:classNames__default.default(getBlockStyleClasses(mergedStyles,textDirection||(null===(_blockProps$data$i4=blockProps.data[i])||void 0===_blockProps$data$i4?void 0:_blockProps$data$i4.textDirection),alignment,mergedStyles[style]),wixRichContentCommon.depthClassName(depth),"fixed-tab-size",directionBlockClassName,isPaywallSeo(context.seoMode)&&getPaywallSeoClass(context.seoMode.paywall,blockIndex)),style:_blockDataToStyle(blockProps.data[i])},React__default.default.createElement("span",{className:classNames__default.default(viewerStyles.child,directionTextClassName,hasJustifyText&&viewerStyles.hasJustifyText)},content))),wrappedBlock=withInteraction(inner,interactions,context),wrapperKey=blockProps.keys[i]+"_wrap",resultBlock=React__default.default.createElement(React__default.default.Fragment,{key:wrapperKey},wrappedBlock);if(addAnchorsPrefix){var anchorKey=""+addAnchorsPrefix+(blockIndex+1);resultBlock=React__default.default.createElement(React__default.default.Fragment,{key:wrapperKey},wrappedBlock,React__default.default.createElement(Anchor,{type:isEmptyBlock(child)?"empty-line":"string"==typeof type?type:"paragraph",key:anchorKey,anchorKey:anchorKey}))}return resultBlock}))}};return{unstyled:blockFactory((function(child){return isEmptyBlock(child)?"div":"p"}),"text"),blockquote:blockFactory("blockquote","quote"),"header-one":blockFactory("h1","headerOne"),"header-two":blockFactory("h2","headerTwo"),"header-three":blockFactory("h3","headerThree"),"header-four":blockFactory("h4","headerFour"),"header-five":blockFactory("h5","headerFive"),"header-six":blockFactory("h6","headerSix"),"code-block":blockFactory("pre","codeBlock"),"unordered-list-item":getList(!1),"ordered-list-item":getList(!0)}},getEntities=function(typeMappers,context,styles,addAnchorsPrefix,innerRCEViewerProps,SpoilerViewerWrapper){return _extends__default.default({EMOJI_TYPE:function(emojiUnicode,data,_ref4){var key=_ref4.key;return React__default.default.createElement("span",{key:key,style:{fontFamily:"cursive"}},emojiUnicode)}},function(SpoilerViewerWrapper,typeMappers,context,styles,addAnchorsPrefix,innerRCEViewerProps){var res={};return Object.keys(typeMappers).forEach((function(type,i){res[type]=function(children,entity,_ref4){var content,blockKey,anchorElement,key=_ref4.key,block=_ref4.block,pluginComponent=typeMappers[type],isInline="inline"===pluginComponent.elementType,interactions=entity.interactions,pluginViewer=React__default.default.createElement(PluginViewer,{id:"viewer-"+block.key,type:type,pluginComponent:pluginComponent,componentData:entity,entityIndex:key,context:context,styles:styles,blockIndex:(content=context.contentState,blockKey=block.key,content.blocks.findIndex((function(block){return block.key===blockKey}))),typeMap:typeMappers,innerRCEViewerProps:innerRCEViewerProps,SpoilerViewerWrapper:SpoilerViewerWrapper,withHorizontalScroll:!0,blockKey:block.key},isInline?children:null),wrappedPluginViewer=withInteraction(pluginViewer,interactions,context);if(addAnchorsPrefix&&!isInline){var anchorType=type.replace("wix-draft-plugin-","").toLowerCase(),anchorKey=""+addAnchorsPrefix+(block.data.index+1);anchorElement=React__default.default.createElement(Anchor,{type:anchorType,anchorKey:anchorKey})}return React__default.default.createElement(React__default.default.Fragment,{key:i+"_"+key},wrappedPluginViewer,anchorElement)}})),res}(SpoilerViewerWrapper,typeMappers,context,styles,addAnchorsPrefix,innerRCEViewerProps))},redraftOptions={cleanup:{after:wixRichContentCommon.BLOCK_TYPES.filter((function(t){return-1===t.indexOf("header")})),split:!0,except:["unordered-list-item","ordered-list-item","unstyled","header-one","header-two","header-three","header-four","header-five","header-six"]},convertFromRaw:function(contentState){return contentState}},convertToReact=function(mergedStyles,textDirection,typeMappers,context,decorators,inlineStyleMappers,config,initSpoilers,SpoilerViewerWrapper,options,innerRCEViewerProps,externalDocumentStyle){if(void 0===options&&(options={}),!(raw=context.contentState)||!raw.blocks||1===raw.blocks.length&&""===raw.blocks[0].text&&"unstyled"===raw.blocks[0].type)return null;var raw,contentState,_options=options,addAnchors=_options.addAnchors,restOptions=_objectWithoutPropertiesLoose__default.default(_options,_excluded),normalizedContentState=context.contentState?(contentState=context.contentState,_extends__default.default({},contentState,{blocks:contentState.blocks.map((function(block,index){if("atomic"===block.type)return _extends__default.default({},block,{data:{index:index}});var textDirection=wixRichContentCommon.getTextDirection(block.text),data=_extends__default.default({},block.data,{depth:block.depth,index:index},"rtl"===textDirection&&{textDirection:textDirection}),text=block.text;return lodash.endsWith(text,"\n")&&(text+="\n"),_extends__default.default({},block,{depth:0,data:data,text:text})}))})):context.contentState,newContentState=initSpoilers?initSpoilers(normalizedContentState):normalizedContentState,addAnchorsPrefix=addAnchors&&(!0===addAnchors?"rcv-block":addAnchors),documentStyle=externalDocumentStyle||(null==newContentState?void 0:newContentState.documentStyle),result=redraft(newContentState,{inline:getInline(newContentState,config,inlineStyleMappers,mergedStyles),blocks:getBlocks(mergedStyles,textDirection,context,addAnchorsPrefix,documentStyle),entities:getEntities(typeMappers,context,mergedStyles,addAnchorsPrefix,_extends__default.default({},innerRCEViewerProps,{documentStyle:documentStyle}),SpoilerViewerWrapper),decorators:decorators},_extends__default.default({},redraftOptions,restOptions));if(addAnchors){var firstAnchorKey=addAnchorsPrefix+"-first",lastAnchorKey=addAnchorsPrefix+"-last";result=React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(Anchor,{type:"first",anchorKey:firstAnchorKey}),result,React__default.default.createElement(Anchor,{type:"last",anchorKey:lastAnchorKey}))}return result},viewerAlignmentStyles={alignLeft:"_17-_F",textWrapNowrap:"_3OKLB",alignRight:"_3VL_9",alignCenter:"_3CWa-",sizeFullWidth:"_28A1_",renderedInTable:"erqrj",sizeOriginal:"_1GSK2",sizeContent:"_3mymk",sizeSmall:"_3vo3y",sizeSmallCenter:"_3fofE",flex:"_2orjS",left:"_3M0Fe",center:"_1oG79",right:"_2wn-L"},rtlStyle={rtl:"ZF7FS",ltr:"_1FoOD"},RichContentViewer=function(_Component){function RichContentViewer(props){var _experiments$ricosVie,_this;(_this=_Component.call(this,props)||this).styles=void 0,_this.typeMappers=void 0,_this.getContextualData=function(_ref,contentState){var _config$uiSettings,t=_ref.t,theme=_ref.theme,_ref$isMobile=_ref.isMobile,isMobile=void 0!==_ref$isMobile&&_ref$isMobile,anchorTarget=_ref.anchorTarget,relValue=_ref.relValue,customAnchorScroll=_ref.customAnchorScroll,config=_ref.config,_ref$helpers=_ref.helpers,helpers=void 0===_ref$helpers?{}:_ref$helpers,locale=_ref.locale,disabled=_ref.disabled,seoMode=_ref.seoMode,iframeSandboxDomain=_ref.iframeSandboxDomain,textAlignment=_ref.textAlignment,experiments=_ref.experiments;return deprecateHelpers.deprecateHelpers(helpers,config),{t:t,theme:theme,isMobile:isMobile,anchorTarget:anchorTarget,relValue:relValue,customAnchorScroll:customAnchorScroll,config:config,helpers:helpers,locale:locale,disabled:disabled,seoMode:seoMode,contentState:contentState,iframeSandboxDomain:iframeSandboxDomain,disableRightClick:null==config||null===(_config$uiSettings=config.uiSettings)||void 0===_config$uiSettings?void 0:_config$uiSettings.disableRightClick,textAlignment:textAlignment,experiments:experiments}};var _props$experiments=props.experiments,_experiments=void 0===_props$experiments?{}:_props$experiments,_props$isMobile=props.isMobile,_isMobile=void 0!==_props$isMobile&&_props$isMobile,_t=props.t,styles=_extends__default.default({},viewerStyles,viewerAlignmentStyles,rtlStyle);return _this.styles=null!=_experiments&&null!==(_experiments$ricosVie=_experiments.ricosViewerNext)&&void 0!==_experiments$ricosVie&&_experiments$ricosVie.enabled?styles:wixRichContentCommon.mergeStyles({styles:styles,theme:props.theme}),_this.typeMappers=combineMappers(props.typeMappers),_this.state={context:{experiments:_experiments,isMobile:_isMobile,t:_t}},_this}_inheritsLoose__default.default(RichContentViewer,_Component),RichContentViewer.getDerivedStateFromProps=function(props){return{raw:RichContentViewer.getInitialState(props)}},RichContentViewer.getDerivedStateFromError=function(error){return{error:error}};var _proto=RichContentViewer.prototype;return _proto.componentDidCatch=function(error,errorInfo){console.error({error:error,errorInfo:errorInfo})},_proto.componentDidMount=function(){this.reportDebuggingInfo()},_proto.reportDebuggingInfo=function(){var _this2=this;"undefined"!=typeof window&&/ricos-debug/i.test(window.location.search)&&!window.__RICOS_INFO__&&Promise.resolve().then((function(){return _interopNamespace(require(/* webpackChunkName: "debugging-info" */
"wix-rich-content-common/libs/debugging-info"))})).then((function(_ref2){(0,_ref2.reportDebuggingInfo)({version:wixRichContentCommon.Version.currentVersion,reporter:"Rich Content Viewer",plugins:Object.keys(_this2.typeMappers),getContent:function(){return _this2.props.initialState},getConfig:function(){return _this2.props.config}})}))},_proto.render=function(){var _this$props=this.props,onError=_this$props.onError,_this$props$config=_this$props.config,config=void 0===_this$props$config?{}:_this$props$config,onHover=_this$props.onHover,isMobile=_this$props.isMobile,isInnerRcv=_this$props.isInnerRcv,textDirection=_this$props.textDirection,direction=_this$props.direction,inlineStyleMappers=_this$props.inlineStyleMappers,locale=_this$props.locale,addAnchors=_this$props.addAnchors,renderedInTable=_this$props.renderedInTable,platform=_this$props.platform,t=_this$props.t,typeMappers=_this$props.typeMappers,_this$props$setRef=_this$props.setRef,setRef=void 0===_this$props$setRef?function(){}:_this$props$setRef,_this$props$onMouseOv=_this$props.onMouseOver,onMouseOver=void 0===_this$props$onMouseOv?function(){}:_this$props$onMouseOv;_this$props.experiments;var decorators=[].concat(this.props.decorators,[wixRichContentCommon.createJustificationFixDecorator()]);try{var _classNames,_classNames2,_config$SPOILER_TYPE,_config$SPOILER_TYPE2;if(this.state.error)return onError(this.state.error),null;var styles=this.styles,wrapperClassName=classNames__default.default(styles.wrapper,((_classNames={})[styles.desktop]=!platform||"desktop"===platform,_classNames)),tableClassNames=classNames__default.default(styles.renderedInTable,viewerStyles.renderedInTable,draftDefaultStyles_renderedInTable),editorClassName=classNames__default.default(styles.editor,renderedInTable&&tableClassNames,((_classNames2={})[styles.rtl]="rtl"===textDirection,_classNames2)),initSpoilers=null===(_config$SPOILER_TYPE=config[wixRichContentCommon.SPOILER_TYPE])||void 0===_config$SPOILER_TYPE?void 0:_config$SPOILER_TYPE.initSpoilersContentState,SpoilerViewerWrapper=null===(_config$SPOILER_TYPE2=config[wixRichContentCommon.SPOILER_TYPE])||void 0===_config$SPOILER_TYPE2?void 0:_config$SPOILER_TYPE2.SpoilerViewerWrapper,contextualData=this.getContextualData(this.props,this.state.raw),innerRCEViewerProps={typeMappers:typeMappers,inlineStyleMappers:inlineStyleMappers,decorators:decorators,config:config,t:t,renderedInTable:renderedInTable,isMobile:isMobile},output=convertToReact(styles,textDirection,this.typeMappers,contextualData,decorators,inlineStyleMappers,config,initSpoilers,SpoilerViewerWrapper,{addAnchors:addAnchors},innerRCEViewerProps,this.props.documentStyle),dataId=isInnerRcv?{}:{"data-id":"rich-content-viewer"};return React__default.default.createElement(wixRichContentCommon.GlobalContext.Provider,{value:this.state.context},React__default.default.createElement("div",_extends__default.default({className:wrapperClassName,dir:direction||wixRichContentCommon.getLangDir(locale),onMouseEnter:function(e){return onHover&&onHover(e)},ref:setRef,onMouseOver:onMouseOver},dataId),React__default.default.createElement("div",{className:editorClassName},output),React__default.default.createElement(wixRichContentCommon.AccessibilityListener,{isMobile:isMobile})))}catch(err){return onError(err),null}},RichContentViewer}(React.Component);RichContentViewer.defaultProps={theme:{},decorators:[],typeMappers:[],inlineStyleMappers:[],locale:"en",onError:function(err){throw err},normalize:{},config:{}},RichContentViewer.getInitialState=function(props){var _config$IMAGE_TYPE,_config$GALLERY_TYPE,_config$VIDEO_TYPE,initialState=props.initialState,anchorTarget=props.anchorTarget,relValue=props.relValue,_props$normalize=props.normalize,_props$normalize$disa=_props$normalize.disableInlineImages,disableInlineImages=void 0!==_props$normalize$disa&&_props$normalize$disa,_props$normalize$remo=_props$normalize.removeInvalidInlinePlugins,removeInvalidInlinePlugins=void 0!==_props$normalize$remo&&_props$normalize$remo,config=props.config,uiSettings=config.uiSettings,disableImagesExpand=null===(_config$IMAGE_TYPE=config[wixRichContentCommon.IMAGE_TYPE])||void 0===_config$IMAGE_TYPE?void 0:_config$IMAGE_TYPE.disableExpand,disableGalleryExpand=null===(_config$GALLERY_TYPE=config[wixRichContentCommon.GALLERY_TYPE])||void 0===_config$GALLERY_TYPE?void 0:_config$GALLERY_TYPE.disableExpand,disableDownload=(null===(_config$VIDEO_TYPE=config[wixRichContentCommon.VIDEO_TYPE])||void 0===_config$VIDEO_TYPE?void 0:_config$VIDEO_TYPE.disableDownload)||(null==uiSettings?void 0:uiSettings.disableRightClick)||(null==uiSettings?void 0:uiSettings.disableDownload);return initialState?wixRichContentCommon.normalizeInitialState(initialState,{anchorTarget:anchorTarget,relValue:relValue,disableInlineImages:disableInlineImages,removeInvalidInlinePlugins:removeInvalidInlinePlugins,disableDownload:disableDownload,disableImagesExpand:disableImagesExpand,disableGalleryExpand:disableGalleryExpand}):void 0};var WrappedViewer=wixRichContentCommon.withI18n(RichContentViewer,englishResources__default.default,{forceRemount:!1}),I18nRichContentViewer=function(_Component){function I18nRichContentViewer(){return _Component.apply(this,arguments)||this}return _inheritsLoose__default.default(I18nRichContentViewer,_Component),I18nRichContentViewer.prototype.render=function(){return React__default.default.createElement(WrappedViewer,_extends__default.default({},this.props))},I18nRichContentViewer}(React.Component);I18nRichContentViewer.displayName="RichContentViewer",exports.RichContentViewer=I18nRichContentViewer,exports.convertToHTML=function(reactOutput,renderToStaticMarkup){return reactOutput?reactOutput.reduce((function(html,blocks){return(blocks instanceof Array?blocks:[blocks]).forEach((function(c){return html+=renderToStaticMarkup(c)})),html}),""):null},exports.convertToReact=convertToReact;

@@ -3,0 +3,0 @@ //# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/inheritsLoose";import"react";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"wix-rich-content-common";import"./utils/draftUtils.js";export{g as default}from"./getPluginViewers-f9965417.js";import"./withInteraction.js";import"./components/Anchor.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"punycode";import"./List-e06150b2.js";import"./utils/textUtils.js";import"./inlineStyleMapper.js";import"./utils/combineMappers.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./utils/getInteractionWrapper.js";
import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/inheritsLoose";import"react";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"wix-rich-content-common";import"./utils/draftUtils.js";export{g as default}from"./getPluginViewers-8aaab95f.js";import"./withInteraction.js";import"./components/Anchor.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"punycode";import"./List-ceec4745.js";import"./utils/textUtils.js";import"./inlineStyleMapper.js";import"./utils/combineMappers.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./utils/getInteractionWrapper.js";
//# sourceMappingURL=getPluginViewers.js.map

@@ -1,2 +0,2 @@

import _extends from"@babel/runtime/helpers/extends";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component}from"react";import englishResources from"wix-rich-content-common/dist/statics/viewer/locale/messages_en.json";import{withI18n}from"wix-rich-content-common";import{R as RichContentViewer}from"./getPluginViewers-f9965417.js";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"punycode";import"./List-e06150b2.js";import"./utils/textUtils.js";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./utils/combineMappers.js";import"./components/Anchor.js";import"./inlineStyleMapper.js";import"wix-rich-content-common/libs/deprecateHelpers";var WrappedViewer=withI18n(RichContentViewer,englishResources,{forceRemount:!1}),I18nRichContentViewer=function(_Component){function I18nRichContentViewer(){return _Component.apply(this,arguments)||this}return _inheritsLoose(I18nRichContentViewer,_Component),I18nRichContentViewer.prototype.render=function(){return React.createElement(WrappedViewer,_extends({},this.props))},I18nRichContentViewer}(Component);I18nRichContentViewer.displayName="RichContentViewer";export{I18nRichContentViewer as default};
import _extends from"@babel/runtime/helpers/extends";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component}from"react";import englishResources from"wix-rich-content-common/dist/statics/viewer/locale/messages_en.json";import{withI18n}from"wix-rich-content-common";import{R as RichContentViewer}from"./getPluginViewers-8aaab95f.js";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"punycode";import"./List-ceec4745.js";import"./utils/textUtils.js";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./utils/combineMappers.js";import"./components/Anchor.js";import"./inlineStyleMapper.js";import"wix-rich-content-common/libs/deprecateHelpers";var WrappedViewer=withI18n(RichContentViewer,englishResources,{forceRemount:!1}),I18nRichContentViewer=function(_Component){function I18nRichContentViewer(){return _Component.apply(this,arguments)||this}return _inheritsLoose(I18nRichContentViewer,_Component),I18nRichContentViewer.prototype.render=function(){return React.createElement(WrappedViewer,_extends({},this.props))},I18nRichContentViewer}(Component);I18nRichContentViewer.displayName="RichContentViewer";export{I18nRichContentViewer as default};
//# sourceMappingURL=I18nRichContentViewer.js.map

@@ -1,4 +0,4 @@

export{default as RichContentViewer}from"./I18nRichContentViewer.js";export{a as convertToHTML,c as convertToReact}from"./getPluginViewers-f9965417.js";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/inheritsLoose";import"react";import"wix-rich-content-common/dist/statics/viewer/locale/messages_en.json";import"wix-rich-content-common";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"punycode";import"./List-e06150b2.js";import"./utils/textUtils.js";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./utils/combineMappers.js";import"./components/Anchor.js";import"./inlineStyleMapper.js";import"wix-rich-content-common/libs/deprecateHelpers";
export{default as RichContentViewer}from"./I18nRichContentViewer.js";export{a as convertToHTML,c as convertToReact}from"./getPluginViewers-8aaab95f.js";import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/inheritsLoose";import"react";import"wix-rich-content-common/dist/statics/viewer/locale/messages_en.json";import"wix-rich-content-common";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"punycode";import"./List-ceec4745.js";import"./utils/textUtils.js";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./utils/combineMappers.js";import"./components/Anchor.js";import"./inlineStyleMapper.js";import"wix-rich-content-common/libs/deprecateHelpers";
//# sourceMappingURL=index.js.map
import 'wix-rich-content-viewer/dist/styles.editor.min.global.css'

@@ -1,2 +0,2 @@

import"react";import"classnames";import"./utils/textUtils.js";import"./utils/paywallSeo.js";import"wix-rich-content-common";export{L as default}from"./List-e06150b2.js";import"./withInteraction.js";import"lodash";import"./utils/getInteractionWrapper.js";import"@babel/runtime/helpers/extends";import"./utils/combineMappers.js";
import"react";import"classnames";import"./utils/textUtils.js";import"./utils/paywallSeo.js";import"wix-rich-content-common";export{L as default}from"./List-ceec4745.js";import"./withInteraction.js";import"lodash";import"./utils/getInteractionWrapper.js";import"@babel/runtime/helpers/extends";import"./utils/combineMappers.js";
//# sourceMappingURL=List.js.map

@@ -1,2 +0,2 @@

import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/inheritsLoose";import"react";import"classnames";import"wix-rich-content-common";export{R as default}from"./getPluginViewers-f9965417.js";import"./List-e06150b2.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./utils/combineMappers.js";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"punycode";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./components/Anchor.js";import"./utils/textUtils.js";import"./inlineStyleMapper.js";
import"@babel/runtime/helpers/extends";import"@babel/runtime/helpers/inheritsLoose";import"react";import"classnames";import"wix-rich-content-common";export{R as default}from"./getPluginViewers-8aaab95f.js";import"./List-ceec4745.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./utils/combineMappers.js";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"punycode";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./components/Anchor.js";import"./utils/textUtils.js";import"./inlineStyleMapper.js";
//# sourceMappingURL=RichContentViewer.js.map

@@ -1,2 +0,2 @@

import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/extends";import"react";import"wix-rich-content-common";export{a as convertToHTML,c as convertToReact}from"../getPluginViewers-f9965417.js";import"classnames";import"lodash";import"../List-e06150b2.js";import"./paywallSeo.js";import"./textUtils.js";import"../inlineStyleMapper.js";import"./combineMappers.js";import"../components/Anchor.js";import"../withInteraction.js";import"@babel/runtime/helpers/inheritsLoose";import"./draftUtils.js";import"punycode";import"wix-rich-content-common/libs/deprecateHelpers";import"./getInteractionWrapper.js";
import"@babel/runtime/helpers/objectWithoutPropertiesLoose";import"@babel/runtime/helpers/extends";import"react";import"wix-rich-content-common";export{a as convertToHTML,c as convertToReact}from"../getPluginViewers-8aaab95f.js";import"classnames";import"lodash";import"../List-ceec4745.js";import"./paywallSeo.js";import"./textUtils.js";import"../inlineStyleMapper.js";import"./combineMappers.js";import"../components/Anchor.js";import"../withInteraction.js";import"@babel/runtime/helpers/inheritsLoose";import"./draftUtils.js";import"punycode";import"wix-rich-content-common/libs/deprecateHelpers";import"./getInteractionWrapper.js";
//# sourceMappingURL=convertContentState.js.map
{
"name": "wix-rich-content-viewer",
"version": "9.5.19",
"version": "9.5.20-alpha",
"author": {

@@ -19,11 +19,10 @@ "name": "Jonathan Bachman",

"clean": "rm -rf dist/",
"prebuild": "npm run clean",
"build:rollup": "rollup --environment MODULE_NAME:viewer,ALLOW_JS,FORCE_CSS_EXTRACT -c ../../../rollup.config.js",
"build": "npm run build:rollup && node ../../../scripts/cssFix.js",
"build:dev": "cross-env NODE_ENV=development npm run build",
"build:analyze:editor": "npm run build -- --environment MODULE_ANALYZE_EDITOR && open stats.html",
"build:analyze:viewer": "npm run build -- --environment MODULE_ANALYZE_VIEWER && open stats.html",
"watch": "cross-env NODE_ENV=development npm run build:rollup -- --watch",
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx,d.ts}'",
"test": "jest --verbose"
"build:rollup": "run -T rollup --environment MODULE_NAME:viewer,ALLOW_JS,FORCE_CSS_EXTRACT -c ../../rollup.config.js",
"build": "yarn clean && yarn build:rollup && node ../../scripts/cssFix.js",
"build:dev": "run -T cross-env NODE_ENV=development yarn build",
"build:analyze:editor": "yarn build --environment MODULE_ANALYZE_EDITOR && open stats.html",
"build:analyze:viewer": "yarn build --environment MODULE_ANALYZE_VIEWER && open stats.html",
"watch": "run -T cross-env NODE_ENV=development yarn build:rollup --watch",
"lint": "run -T eslint 'src/**/*.{js,jsx,ts,tsx,d.ts}'",
"test": "run -T jest --verbose"
},

@@ -39,3 +38,3 @@ "jest": {

"^.+\\.(ts|tsx)?$": "ts-jest",
"^.+\\.jsx?$": "<rootDir>/../../../babel.jest.monorepo.js"
"^.+\\.jsx?$": "<rootDir>/../../babel.jest.monorepo.js"
},

@@ -45,4 +44,4 @@ "moduleNameMapper": {

"\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.js",
"^draft-js$": "<rootDir>/../../../node_modules/@wix/draft-js",
"^draft-js/": "<rootDir>/../../../node_modules/@wix/draft-js/"
"^draft-js$": "<rootDir>/../../node_modules/@wix/draft-js",
"^draft-js/": "<rootDir>/../../node_modules/@wix/draft-js/"
}

@@ -53,3 +52,3 @@ },

"wix-redraft": "^1.1.2",
"wix-rich-content-common": "9.5.19"
"wix-rich-content-common": "9.5.20-alpha"
},

@@ -56,0 +55,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc