\n \n "));this.elTools=l;var c=null==r?void 0:r.toolsWrapper;return c&&c.appendChild(l),a&&a({el:s,elTop:s.querySelector('[data-frame-top]'),elRight:s.querySelector('[data-frame-right]'),elBottom:s.querySelector('[data-frame-bottom]'),elLeft:s.querySelector('[data-frame-left]'),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},n}(Pt);var Zt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Qt=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,!0)||this;return o.listenTo(o.collection,'reset',o.render),o.canvasView=n.canvasView,o._module=n.module,o}return Zt(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach((function(t){return t.remove(e)}))},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.renderView=function(t,e){return new Jt(t,this.canvasView)},e}(jt);const te=Qt;var ee=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ne=void 0&&(void 0).__assign||function(){return ne=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n ")},n.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},n.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,o=t.config,r=t.em,i=n.frames;r.set('readyCanvas',0),i.once('loaded:all',(function(){return r.set('readyCanvas',1)})),null==e||e.remove(),this.frames=new te({collection:i},ne(ne({},o),{canvasView:this}))},n.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var o=e.scroll,r=this.em.get('currentFrame');o&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t._getFrame()===r&&t.scrollIntoView(o)})))},n.prototype.remove=function(){for(var t,e=[],n=0;n=0&&s>=0&&i<=o.height&&s<=o.width},n.prototype.offset=function(t,e){var n,o;void 0===e&&(e={});var i=(0,r.getElRect)(t),s=null==t?void 0:t.ownerDocument.body,a=e.noScroll;return{top:i.top+(a?0:null!==(n=null==s?void 0:s.scrollTop)&&void 0!==n?n:0),left:i.left+(a?0:null!==(o=null==s?void 0:s.scrollLeft)&&void 0!==o?o:0),width:i.width,height:i.height}},n.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},n.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,o=null==t?void 0:t.ownerDocument.defaultView,r=o?o.frameElement:n;this.frmOff=this.offset(r||n)}return this.frmOff},n.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},n.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.getZoom(),o=e||{},r=this.getFrameOffset(t),i=this.el,s=this.getCanvasOffset(),a=this.offset(t,e),l=o.avoidFrameOffset?0:r.top,c=o.avoidFrameOffset?0:r.left;return{top:a.top*n+l-s.top+i.scrollTop,left:a.left*n+c-s.left+i.scrollLeft,height:a.height*n,width:a.width*n,zoom:n,rect:a}},n.prototype.getElementOffsets=function(t){var e=this;if(!t||(0,r.isTextNode)(t))return{};var n={},o=window.getComputedStyle(t);return['marginTop','marginRight','marginBottom','marginLeft','paddingTop','paddingRight','paddingBottom','paddingLeft'].forEach((function(t){n[t]=parseFloat(o[t])*e.getZoom()})),n},n.prototype.getPosition=function(t){var e;void 0===t&&(t={});var n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(n){var o=n.body,r=this.getZoom(),i=this.getFrameOffset(),s=this.getCanvasOffset(),a=t.noScroll;return{top:i.top+(a?0:o.scrollTop)*r-s.top,left:i.left+(a?0:o.scrollLeft)*r-s.left,width:s.width,height:s.height}}},n.prototype.updateScript=function(t){var e=t.model,n=e.getId();t.scriptContainer||(t.scriptContainer=(0,Et.ut)('div',{'data-id':n}),this.getJsContainer().appendChild(t.scriptContainer)),t.el.id=n,t.scriptContainer.innerHTML='';var o=document.createElement('script'),r=e.getScriptString(),i=e.get('script-props')?r:"function(){\n".concat(r,"\n;}"),s=JSON.stringify(e.__getScriptProps());o.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (").concat(i,".bind(item))(").concat(s,")\n }, 1);"),setTimeout((function(){var e=t.scriptContainer;null==e||e.appendChild(o)}),0)},n.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return e&&e.getJsContainer()},n.prototype.getFrameView=function(t){return(null==t?void 0:t._getFrame())||this.em.get('currentFrame')},n.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,o=t.em,r=t.framesArea,i=e.frames;i.listenToLoad(),n.render();var s=i.at(0),a=null==s?void 0:s.view;o.setCurrentFrame(a),null==r||r.appendChild(n.el),this.frame=a}},n.prototype.render=function(){var t=this,e=t.el,n=t.$el,o=t.ppfx,i=t.config,s=t.em;n.html(this.template());var a=n.find('[data-frames]');this.framesArea=a.get(0);var l=n.find('[data-tools]');return this.toolsWrapper=l.get(0),l.append("\n
\n
\n \n
\n
\n
\n ").concat(i.extHl?""):'',"\n \n \n \n \n \n \n
\n ")),this.toolsEl=e.querySelector("#".concat(o,"tools")),this.hlEl=e.querySelector(".".concat(o,"highlighter")),this.badgeEl=e.querySelector(".".concat(o,"badge")),this.placerEl=e.querySelector(".".concat(o,"placeholder")),this.ghostEl=e.querySelector(".".concat(o,"ghost")),this.toolbarEl=e.querySelector(".".concat(o,"toolbar")),this.resizerEl=e.querySelector(".".concat(o,"resizer")),this.offsetEl=e.querySelector(".".concat(o,"offset-v")),this.fixedOffsetEl=e.querySelector(".".concat(o,"offset-fixed-v")),this.toolsGlobEl=e.querySelector(".".concat(o,"tools-gl")),this.el.className=(0,r.getUiClass)(s,this.className),this.ready=!0,this._renderFrames(),this},n}(Pt);const re=oe;var ie=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),se=void 0&&(void 0).__assign||function(){return se=Object.assign||function(t){for(var e,n=1,o=arguments.length;ni.top+i.height?i.top+i.height:f,left:d,elementTop:i.top,elementLeft:i.left,elementWidth:i.width,elementHeight:i.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:r.top,canvasLeft:r.left,canvasWidth:r.width,canvasHeight:r.height};return c&&this.em&&this.em.trigger(c,h),h}},n.prototype.canvasRectOffset=function(t,e,n){var o=this;void 0===n&&(n={});var r=function(t,e,r){void 0===e&&(e=1);var i=o.em.getZoomDecimal(),s=e?'top':'left',a=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(a):{},c=l.offsetTop,u=void 0===c?0:c,p=l.offsetLeft,d=void 0===p?0:p,f=a.body||{},h=f.scrollTop,g=void 0===h?0:h,v=f.scrollLeft,y=e?g:void 0===v?0:v,m=e?u:d;return r[s]-(y-m)*i};return{top:r(t,1,e),left:r(t,0,e)}},n.prototype.getTargetToElementFixed=function(e,n,o){var r;void 0===o&&(o={});var i=o.pos||this.getElementPos(e),s=o.canvasOff||this.canvasRectOffset(e,i),a=n.offsetHeight||0,l=n.offsetWidth||0,c=i.left+i.width,u=this.getCanvasView(),p=u.getPosition(),d=u.getFrameOffset(e),f=o.event,h=-a,g=(0,t.isUndefined)(o.left)?i.width-l:o.left;g=i.left<-g?-i.left:g;var v=null!==(r=null==p?void 0:p.width)&&void 0!==r?r:0;g=c>v?g-(c-v):g;var y=i.height+a,m=y'!=="".concat(a.outerHTML).slice(-2)||(f.void=!0);var T=f.components;if(!f.type&&T){for(var k=1,P=0,E=0;E".concat(e,""),l=r.parseFromString(a,i);if(s){var c=l.head,u=l.body,p=c.querySelectorAll('script');(0,t.each)(p,(function(t){return u.appendChild(t)}));var d=[];(0,t.each)(c.children,(function(t){return d.push(t)})),(0,t.each)(d,(function(t,e){return u.insertBefore(t,u.children[e])})),o=u}else o=l.firstChild;return o}(o,u),d=p.querySelectorAll('script'),f=d.length;if(!((0,t.isUndefined)(a.allowScripts)?u.allowScripts:a.allowScripts))for(;f--;)d[f].parentNode.removeChild(d[f]);if(u.allowUnsafeAttr||this.__clearUnsafeAttr(p),r){for(var h=p.querySelectorAll('style'),g=h.length,v='';g--;)v=h[g].innerHTML+v,h[g].parentNode.removeChild(h[g]);v&&(l.css=r.parse(v))}e&&e.trigger("".concat(ge,":root"),{input:o,root:p});var y=this.parseNode(p,c),m=1!==y.length||c.returnArray?y:y[0];return l.html=m,e&&e.trigger(ge,{input:o,output:l}),l},__clearUnsafeAttr:function(e){var n=this,o=e.attributes||[],r=e.childNodes||[],i=[];(0,t.each)(o,(function(t){var e=t.nodeName||'';0===e.indexOf('on')&&i.push(e)})),i.map((function(t){return e.removeAttribute(t)})),(0,t.each)(r,(function(t){return n.__clearUnsafeAttr(t)}))}}};var ye=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),me=void 0&&(void 0).__assign||function(){return me=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0:i,a="".concat(o[r]).concat(s?' !important':''),l='__'==r.substr(0,2);a&&!l&&n.push("".concat(r,":").concat(a,";"))}return n.join('')},n.prototype.getSelectors=function(){return this.get('selectors')||this.get('classes')},n.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},n}(u.Hn);var we=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xe=void 0&&(void 0).__assign||function(){return xe=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&f.reset(d,o)}else p.components=d}return p}))},ke=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return we(n,e),n.prototype.initialize=function(t,e){void 0===e&&(e={}),this.opt=e,this.listenTo(this,'add',this.onAdd),this.listenTo(this,'remove',this.removeChildren),this.listenTo(this,'reset',this.resetChildren);var n=e.em,o=e.config;this.config=o,this.em=n,this.domc=e.domc||(null==n?void 0:n.Components)},n.prototype.resetChildren=function(t,e){var n=this;void 0===e&&(e={});var o=this,r=e.previousModels||[],i=r.filter((function(e){return!t.get(e.cid)})),s=Oe(t);e.keepIds=Oe(r).filter((function(t){return s.indexOf(t)>=0})),i.forEach((function(t){return n.removeChildren(t,o,e)})),t.each((function(t){return n.onAdd(t)}))},n.prototype.resetFromString=function(t,e){void 0===t&&(t=''),void 0===e&&(e={}),e.keepIds=Oe(this);var n=this,o=n.domc,r=n.em,i=n.parent,s=null==r?void 0:r.Css,a=(null==o?void 0:o.allById())||{},l=this.parseString(t,e),c=Te(l,a,e),u=e.visitedCmps,p=void 0===u?{}:u;Object.keys(p).forEach((function(t){var e=p[t];if(e.length){var n=(null==s?void 0:s.getRules("#".concat(t)))||[];n.length&&e.forEach((function(t){n.forEach((function(e){var n=e.clone();n.set('selectors',["#".concat(t.attributes.id)]),s.getAll().add(n)}))}))}})),this.reset(c,e),null==r||r.trigger('component:content',i,e,t)},n.prototype.removeChildren=function(t,e,n){var o=this;if(void 0===n&&(n={}),t){var r=this.domc,i=this.em,s=n.temporary||n.fromUndo;if(t.prevColl=this,!s){var a=t.getId(),l=i.Selectors.getAll(),c=i.Css.getAll(),u=(n.keepIds||[]).indexOf(a)<0;delete(r?r.allById():{})[a];var p=u?c.remove(c.filter((function(t){return t.getSelectors().getFullString()==="#".concat(a)})),n):[];l.remove(p.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(i.Commands.run('core:component-style-clear',{target:t}),t.removed(),t.trigger('removed'),i.trigger('component:remove',t)),t.components().forEach((function(t){return o.removeChildren(t,e,n)}))}var d=t.components();i.stopListening(d),i.stopListening(t),i.stopListening(t.get('classes')),t.__postRemove()}},n.prototype.model=function(t,e){var n,o=e.collection.opt,r=o.em,i=r.Components.componentTypes;e.em=r,e.config=o.config,e.componentTypes=i,e.domc=o.domc;for(var s=0;s=0&&this.set('void',!0),o.em=i,this.opt=o,this.em=i,this.frame=o.frame,this.config=o.config||{},this.set('attributes',$e($e({},(0,t.result)(this,'defaults').attributes||{}),this.get('attributes')||{})),this.ccid=n.createId(this,o),this.initClasses(),this.initTraits(),this.initComponents(),this.initToolbar(),this.initScriptProps(),this.listenTo(this,'change:script',this.scriptUpdated),this.listenTo(this,'change:tagName',this.tagUpdated),this.listenTo(this,'change:attributes',this.attrUpdated),this.listenTo(this,'change:attributes:id',this._idUpdated),this.on('change:toolbar',this.__emitUpdateTlb),this.on('change',this.__onChange),this.on(Qe,this.__propToParent),this.set('status',''),this.views=[],['classes','traits','components'].forEach((function(t){var e="add remove ".concat('components'!==t?'change':'');r.listenTo(r.get(t),e.trim(),(function(){for(var e=[],n=0;n=0}))},n.prototype.__getSymbToUp=function(t){var e=this;void 0===t&&(t={});var n=[],o=t.changed;if(t.fromInstance||t.noPropagate||t.fromUndo||o&&this.__isSymbOvrd(o))return n;var r=this.__getSymbols()||[],i=this.__getSymbol();return n=(i?qe([i],i.__getSymbols()||[],!0):r).filter((function(t){return t!==e})).filter((function(t){return!(o&&t.__isSymbOvrd(o))}))},n.prototype.__getSymbTop=function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e},n.prototype.__upSymbProps=function(e,n){var o=this;void 0===n&&(n={});var i=this.changedAttributes()||{},s=i.attributes||{};if(delete i.status,delete i.open,delete i[Ye],delete i[Xe],delete i[Je],delete i.attributes,delete s.id,(0,r.isEmptyObj)(s)||(i.attributes=s),!(0,r.isEmptyObj)(i)){var a=this.__getSymbToUp(n);(0,t.keys)(i).map((function(t){o.__isSymbOvrd(t)&&delete i[t]})),this.__logSymbol('props',a,{opts:n,changed:i}),a.forEach((function(e){var r=$e({},i);(0,t.keys)(r).map((function(t){e.__isSymbOvrd(t)&&delete r[t]})),e.set(r,$e({fromInstance:o},n))}))}},n.prototype.__upSymbCls=function(t,e,n){var o=this;void 0===n&&(n={});var r=this.__getSymbToUp(n);this.__logSymbol('classes',r,{opts:n}),r.forEach((function(t){t.set('classes',o.get('classes'),{fromInstance:o})})),this.__changesUp(n)},n.prototype.__upSymbComps=function(t,e,n){var o=this,r=n||e||{},i={fromInstance:r.fromInstance,fromUndo:r.fromUndo},s=t.opt.temporary;if(n)if(n.add){var a=[],l=!!this.__getSymbols();if((y=this.__getSymbToUp($e($e({},i),{changed:'components:add'}))).length){var c=t.__getSymbol();a=(c?c.__getSymbols():t.__getSymbols())||[],(a=qe([],a,!0)).push(c||t)}!s&&this.__logSymbol('add',y,{opts:n,addedInstances:a.map((function(t){return t.cid})),added:t.cid}),y.forEach((function(e){var r=e.__getSymbTop(),i=a.filter((function(t){var e=t.__getSymbTop({prev:1});return r&&e&&e===r}))[0]||t.clone({symbol:!0,symbolInv:l});e.append(i,$e({fromInstance:o},n))}))}else{var u=t.__getSymbol();if(u&&!n.temporary&&u.set(Ye,u.__getSymbols().filter((function(e){return e!==t}))),!t.__isSymbolTop()){var p='components:remove',d=n.index,f=t.parent(),h=$e({fromInstance:t},n),g=t.__isSymbolNested(),v=function(t){var e=t.parent();e&&!e.__isSymbOvrd(p)&&t.remove(h)};y=(null==f?void 0:f.__isSymbOvrd(p))?[]:t.__getSymbToUp(i);g&&(y=null==f?void 0:f.__getSymbToUp($e($e({},i),{changed:p})),v=function(t){var e=t.components().at(d);e&&e.remove($e({fromInstance:f},h))}),!s&&this.__logSymbol('remove',y,{opts:n,removed:t.cid,isSymbNested:g}),y.forEach(v)}}else{var y=this.__getSymbToUp($e($e({},i),{changed:'components:reset'})),m=t.models;this.__logSymbol('reset',y,{components:m}),y.forEach((function(t){var n=m.map((function(t){return t.clone({symbol:!0})}));t.components().reset(n,$e({fromInstance:o},e))}))}this.__changesUp(r)},n.prototype.initClasses=function(e,n,o){void 0===o&&(o={});var r=this.get('attributes').class||[],i=[this,'change:classes',this.initClasses],s=this.get('classes')||r,a=(0,t.isString)(s)?s.split(' '):s;this.stopListening.apply(this,i);var l=this.normalizeClasses(a),c=new Fe([]);return this.set('classes',c,o),c.add(l),c.on('add remove reset',this.__upSymbCls),this.listenTo.apply(this,i),this},n.prototype.initComponents=function(){var e=[this,'change:components',this.initComponents];this.stopListening.apply(this,e);var n=new Pe([],this.opt);n.parent=this;var o=this.get('components'),r=!this.opt.avoidChildren;return this.set('components',n),r&&o&&n.add((0,t.isFunction)(o)?o(this):o,this.opt),n.on('add remove reset',this.__upSymbComps),this.listenTo.apply(this,e),this},n.prototype.initTraits=function(t){var e=this.em,n='change:traits';this.off(n,this.initTraits),this.__loadTraits();var o=$e({},this.get('attributes')),r=this.traits;return r.each((function(t){if(!t.get('changeProp')){var e=t.get('name'),n=t.getInitValue();e&&n&&(o[e]=n)}})),r.length&&this.set('attributes',o),this.on(n,this.initTraits),t&&e&&e.trigger('component:toggled'),this},n.prototype.initScriptProps=function(){if(!this.opt.temporary){var t='script-props',e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],o=this.get(t)||[],r=n.map((function(t){return"change:".concat(t)})).join(' '),i=o.map((function(t){return"change:".concat(t)})).join(' ');r&&this.off(r,this.__scriptPropsChange),i&&this.on(i,this.__scriptPropsChange),this.on.apply(this,e)}},n.prototype.__scriptPropsChange=function(t,e,n){void 0===n&&(n={}),n.avoidStore||this.trigger('rerender')},n.prototype.append=function(e,n){void 0===n&&(n={});var o=((0,t.isArray)(e)?qe([],e,!0):[e]).map((function(e){return(0,t.isString)(e)||e.collection&&e.collection.remove(e,{temporary:!0}),e})),r=this.components().add(o,n);return(0,t.isArray)(r)?r:[r]},n.prototype.components=function(e,n){void 0===n&&(n={});var o=this.get('components');return(0,t.isUndefined)(e)?o:(o.reset(void 0,n),e?this.append(e,n):[])},n.prototype.getChildAt=function(t){return this.components().at(t||0)||void 0},n.prototype.getLastChild=function(){var t=this.components();return t.at(t.length-1)||null},n.prototype.empty=function(t){return void 0===t&&(t={}),this.components().reset(void 0,t),this},n.prototype.parent=function(t){void 0===t&&(t={});var e=this.collection||t.prev&&this.prevColl;return e?e.parent:void 0},n.prototype.parents=function(){var t=this.parent();return t?[t].concat(t.parents()):[]},n.prototype.scriptUpdated=function(){this.set('scriptUpdated',1)},n.prototype.initToolbar=function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||'';if(!e.get('toolbar')&&t){var o=[];e.collection&&o.push({label:t.getIcon('arrowUp'),command:function(t){return t.runCommand('core:component-exit',{force:1})}}),e.get('draggable')&&o.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon('move'),command:'tlb-move'}),e.get('copyable')&&o.push({label:t.getIcon('copy'),command:'tlb-clone'}),e.get('removable')&&o.push({label:t.getIcon('delete'),command:'tlb-delete'}),e.set('toolbar',o)}},n.prototype.__loadTraits=function(e,n){void 0===n&&(n={});var o=e||this.traits;if(!(o instanceof Ue)){o=(0,t.isFunction)(o)?o(this):o;var r=new Ue([],this.opt);r.setTarget(this),o.length&&(o.forEach((function(t){return t.attributes&&delete t.attributes.value})),r.add(o)),this.set({traits:r},n)}return this},n.prototype.getTraits=function(){return this.__loadTraits(),qe([],this.traits.models,!0)},n.prototype.setTraits=function(e){var n=(0,t.isArray)(e)?e:[e];return this.set({traits:n}),this.getTraits()},n.prototype.getTrait=function(t){return this.getTraits().filter((function(e){return e.get('id')===t||e.get('name')===t}))[0]||null},n.prototype.updateTrait=function(t,e){var n,o=this.getTrait(t);return o&&o.set(e),null===(n=this.em)||void 0===n||n.trigger('component:toggled'),this},n.prototype.getTraitIndex=function(t){var e=this.getTrait(t);return e?this.traits.indexOf(e):-1},n.prototype.removeTrait=function(e){var n,o=this,r=((0,t.isArray)(e)?e:[e]).map((function(t){return o.getTrait(t)})),i=this.traits,s=r.length?i.remove(r):[];return null===(n=this.em)||void 0===n||n.trigger('component:toggled'),(0,t.isArray)(s)?s:[s]},n.prototype.addTrait=function(e,n){var o;void 0===n&&(n={}),this.__loadTraits();var r=this.traits.add(e,n);return null===(o=this.em)||void 0===o||o.trigger('component:toggled'),(0,t.isArray)(r)?r:[r]},n.prototype.normalizeClasses=function(t){var e=[],n=this.em,o=null==n?void 0:n.Selectors;return o?t.models?qe([],t.models,!0):(t.forEach((function(t){return e.push(o.add(t))})),e):[]},n.prototype.clone=function(t){void 0===t&&(t={});var e=this.em,n=$e({},this.attributes),o=$e({},this.opt),r=this.getId(),i=null==e?void 0:e.Css;n.attributes=$e({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=!0),this.get('components').each((function(e,o){n.components[o]=e.clone($e($e({},t),{_inner:1}))})),this.get('traits').each((function(t,e){n.traits[e]=t.clone()})),this.get('classes').each((function(t,e){n.classes[e]=t.get('name')})),n.status='',o.collection=null;var s=new this.constructor(n,o),a="#".concat(s.getId());(i?i.getRules("#".concat(r)):[]).forEach((function(t){var e=t.clone();e.set('selectors',[a]),i.getAll().add(e)})),s.set(Ye,0);var l=this.__getSymbol(),c=this.__getSymbols();t.symbol||!l&&!c?l?(l.set(Ye,qe(qe([],l.__getSymbols(),!0),[s],!1)),s.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(Ye,qe(qe([],c,!0),[s],!1)),s.set(Xe,this),s.__initSymb()):t.symbolInv?(this.set(Ye,[s]),s.set(Xe,this),[this,s].map((function(t){return t.__initSymb()}))):(s.set(Ye,[this]),[this,s].map((function(t){return t.__initSymb()})),this.set(Xe,s))):(s.set(Xe,0),s.set(Ye,0));var u='component:clone';return e&&e.trigger(u,s),this.trigger(u,s),s},n.prototype.getName=function(t){void 0===t&&(t={});var e=this.em,n=this.attributes,o=n.type,i=n.tagName,s=n.name,a=o||i,l=o?'':i,c='domComponents.names.',u=s&&(null==e?void 0:e.t("".concat(c).concat(s))),p=l&&(null==e?void 0:e.t("".concat(c).concat(l))),d=e&&(e.t("".concat(c).concat(o))||e.t("".concat(c).concat(i))),f=this.get('custom-name');return(t.noCustom?'':f)||u||s||p||(0,r.capitalize)(l)||d||(0,r.capitalize)(a)},n.prototype.getIcon=function(){var t=this.get('icon');return t?t+' ':''},n.prototype.toHTML=function(e){void 0===e&&(e={});var n=this,o=[],i=e.tag||n.get('tagName'),s=n.get('void'),a=e.attributes,l=this.getAttrToHTML();if(delete e.tag,a&&((0,t.isFunction)(a)?l=a(n,l)||{}:(0,r.isObject)(a)&&(l=a)),e.withProps){var c=this.toJSON();(0,t.forEach)(c,(function(e,n){'_'!==n[0]&&['classes','attributes','components'].indexOf(n)<0&&(l["data-gjs-".concat(n)]=(0,t.isArray)(e)||(0,r.isObject)(e)?JSON.stringify(e):e)}))}for(var u in l){var p=l[u];if(!(0,t.isUndefined)(p)&&null!==p)if((0,t.isBoolean)(p))p&&o.push(u);else{var d='';if(e.altQuoteAttr&&(0,t.isString)(p)&&p.indexOf('"')>=0)d="'".concat(p.replace(/'/g,'''),"'");else{var f=(0,t.isString)(p)?p.replace(/"/g,'"'):p;d="\"".concat(f,"\"")}o.push("".concat(u,"=").concat(d))}}var h=o.length?" ".concat(o.join(' ')):'',g=n.getInnerHTML(e),v="<".concat(i).concat(h).concat(s?'/':'',">").concat(g);return!s&&(v+="".concat(i,">")),v},n.prototype.getInnerHTML=function(t){return this.__innerHTML(t)},n.prototype.__innerHTML=function(t){void 0===t&&(t={});var e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(''):this.get('content')},n.prototype.getAttrToHTML=function(){var t=this.getAttributes();return delete t.style,t},n.prototype.toJSON=function(e){void 0===e&&(e={});var n=a.Model.prototype.toJSON.call(this,e);if(n.attributes=this.getAttributes(),delete n.attributes.class,delete n.toolbar,delete n.traits,delete n.status,delete n.open,delete n._undoexc,!e.fromUndo){var o=n[Xe],r=n[Ye];r&&(0,t.isArray)(r)&&(n[Ye]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),o&&!(0,t.isString)(o)&&(n[Xe]=o.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(n),n},n.prototype.getChangedProps=function(e){var n=e||a.Model.prototype.toJSON.apply(this),o=(0,t.result)(this,'defaults');return(0,t.forEach)(o,(function(t,e){-1===['type'].indexOf(e)&&n[e]===t&&delete n[e]})),(0,t.isEmpty)(n.type)&&delete n.type,(0,t.forEach)(['attributes','style'],(function(e){(0,t.isEmpty)(o[e])&&(0,t.isEmpty)(n[e])&&delete n[e]})),(0,t.forEach)(['classes','components'],(function(e){(!n[e]||(0,t.isEmpty)(o[e])&&!n[e].length)&&delete n[e]})),n},n.prototype.getId=function(){return(this.get('attributes')||{}).id||this.ccid||this.cid},n.prototype.setId=function(t,e){var n=$e({},this.get('attributes'));return n.id=t,this.set('attributes',n,e),this},n.prototype.getEl=function(t){void 0===t&&(t=void 0);var e=this.getView(t);return e&&e.el},n.prototype.getView=function(t){var e=this.view,n=this.views;return t&&(e=n.filter((function(e){return e._getFrame()===t.view}))[0]),e},n.prototype.getCurrentView=function(){var t=(this.em.get('currentFrame')||{}).model;return this.getView(t)},n.prototype.__getScriptProps=function(){var t=this.props();return(this.get('script-props')||[]).reduce((function(e,n){return e[n]=t[n],e}),{})},n.prototype.getScriptString=function(e){var n=this,o=e||this.get('script')||'';if(!o)return o;if(this.get('script-props'))o=o.toString().trim();else{if('function'==typeof o){var r=o.toString().trim();o=(r=r.replace(/^function[\s\w]*\(\)\s?\{/,'').replace(/\}$/,'')).trim()}var i=this.em.getConfig(),s=Ge(i.tagVarStart||'{[ '),a=Ge(i.tagVarEnd||' ]}'),l=new RegExp("".concat(s,"([\\w\\d-]*)").concat(a),'g');o=o.replace(l,(function(e,o){n.scriptUpdated();var r=n.attributes[o]||'';return(0,t.isArray)(r)||'object'==typeof r?JSON.stringify(r):r}))}return o},n.prototype.emitUpdate=function(t){for(var e,n=[],o=1;o=0&&this.__propSelfToParent({component:this,changed:(e={},e[t]=s,e),options:n[2]||n[1]||{}})},n.prototype.onAll=function(e){return(0,t.isFunction)(e)&&(e(this),this.components().forEach((function(t){return t.onAll(e)}))),this},n.prototype.remove=function(t){var e=this;void 0===t&&(t={});var n=this.em,o=this.collection,r=function(){o&&o.remove(e,$e($e({},t),{action:'remove-component'})),o||(e.components('',t),e.components().removeChildren(e,void 0,t))},i=$e({},t);return[this,n].map((function(t){return t.trigger('component:remove:before',e,r,i)})),!i.abort&&r(),this},n.prototype.move=function(t,e){if(void 0===e&&(e={}),t){var n=e.at,o=this.index(),r=t===this.parent();r&&(o===n||o===n-1)||(r&&n&&n>o&&(e.at=n-1),this.remove({temporary:1}),t.append(this,e),this.emitUpdate())}return this},n.prototype.isInstanceOf=function(t){var e,n,o=null===(n=null===(e=this.em)||void 0===e?void 0:e.Components.getType(t))||void 0===n?void 0:n.model;return!!o&&this instanceof o},n.prototype.isChildOf=function(e){for(var n=(0,t.isString)(e),o=this.parent();o;){if(n){if(o.isInstanceOf(e))return!0}else if(o===e)return!0;o=o.parent()}return!1},n.prototype.resetId=function(t){void 0===t&&(t={});var e=this.em,o=this.getId();if(!o)return this;var r=n.createId(this);this.setId(r);var i=null==e?void 0:e.Css.getIdRule(o),s=null==i?void 0:i.get('selectors').at(0);return null==s||s.set('name',r),this},n.prototype._getStyleRule=function(t){var e=(void 0===t?{}:t).id,n=this.em,o=e||this.getId();return null==n?void 0:n.Css.getIdRule(o)},n.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return null==e?void 0:e.get('selectors').at(0)},n.prototype._idUpdated=function(t,e,o){if(void 0===o&&(o={}),!o.idUpdate){var r=this.ccid,i=(this.get('attributes')||{}).id,s=(this.previous('attributes')||{}).id||r,a=n.getList(this);if(a[i]||!i&&s)return this.setId(s,{idUpdate:!0});delete a[s],a[i]=this,this.ccid=i;var l=this._getStyleSelector({id:s});l&&l.set({name:i,label:i})}},n.getDefaults=function(){return(0,t.result)(this.prototype,'defaults')},n.isComponent=function(t){return{tagName:(0,r.toLowerCase)(t.tagName)}},n.ensureInList=function(t){var e=n.getList(t),o=t.getId(),r=e[o];if(r){if(r!==t){var i=n.getIncrementId(o,e);t.setId(i),e[i]=t}}else e[o]=t;t.components().forEach((function(t){return n.ensureInList(t)}))},n.createId=function(t,e){void 0===e&&(e={});var o,r=n.getList(t),i=e.idMap,s=void 0===i?{}:i,a=t.get('attributes').id;return a?(o=n.getIncrementId(a,r,e),t.setId(o),a!==o&&(s[a]=o)):o=n.getNewId(r),r[o]=t,o},n.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,o=(Math.random()+1.1).toString(36).slice(-e),r="i".concat(o);t[r];)r=n.getNewId(t);return r},n.getIncrementId=function(t,e,n){void 0===n&&(n={});var o=n.keepIds,r=1,i=t;if((void 0===o?[]:o).indexOf(t)<0)for(;e[i];)r++,i="".concat(t,"-").concat(r);return i},n.getList=function(t){var e=t.opt,n=void 0===e?{}:e,o=n.domc,r=n.em,i=o||(null==r?void 0:r.Components);return i?i.componentsById:{}},n.checkId=function(e,o,r,i){void 0===o&&(o=[]),void 0===r&&(r={}),void 0===i&&(i={});var s=(0,t.isArray)(e)?e:[e],a=i.keepIds,l=void 0===a?[]:a;s.forEach((function(e){e.attributes;var s=e.attributes,a=void 0===s?{}:s,c=e.components,u=a.id;if(u&&r[u]&&l.indexOf(u)<0){var p=n.getIncrementId(u,r);a.id=p,(0,t.isArray)(o)&&o.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(u)&&(e[n]="#".concat(p))}))}))}c&&n.checkId(c,o,r,i)}))},n}(_e);const en=tn;var nn=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),on=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.compView=cn,t}return nn(n,e),n.prototype.initialize=function(t){this.opts=t||{},this.config=t.config||{},this.em=this.config.em;var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.resetChildren),this.listenTo(e,'remove',this.removeChildren)},n.prototype.removeChildren=function(t,e,n){var o=this;void 0===n&&(n={}),t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,Et.L_)(n),t.remove.apply(t)}})),t.components().forEach((function(t){return o.removeChildren(t,e,n)}))},n.prototype.addTo=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=this.em,r=this.collection.indexOf(t);if(this.addToCollection(t,null,r),o&&!n.temporary){var i=function(t){o.trigger('component:add',t),t.components().forEach((function(t){return i(t)}))};i(t)}},n.prototype.addToCollection=function(e,n,o){for(var r=this,i=r.config,s=r.opts,a=r.em,l=n||null,c=i.frameView,u=(null==c?void 0:c.model)&&e.getView(c.model),p=s.componentTypes||(null==a?void 0:a.Components.getTypes()),d=e.get('type')||'default',f=this.compView,h=0;h=c.scrollTop&&l>=c.scrollLeft&&a<=c.scrollBottom&&l<=(null==i?void 0:i.offsetWidth)+r.scrollLeft},n.prototype.scrollIntoView=function(t){var e;void 0===t&&(t={});var n=this.getOffsetRect();if(!this.isInViewport({rect:n})||t.force){var o=this.el;'smooth'!==t.behavior?null===(e=o.ownerDocument.defaultView)||void 0===e||e.scrollTo(0,n.top):o.scrollIntoView(an({behavior:'smooth',block:'nearest'},t))}},n.prototype.reset=function(){var t=this.el;this.el='',this._ensureElement(),this._setData(),(0,Et.dL)(t,this.el),this.render()},n.prototype._setData=function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},n.prototype._getFrame=function(){var t;return null===(t=this.em)||void 0===t?void 0:t.get('Canvas').config.frameView},n.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new rn({collection:this.model.get('components'),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),o=0,r=n.length;o=0},e}(en);var gn=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const vn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return gn(e,t),e}(cn);var yn=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),mn=void 0&&(void 0).__assign||function(){return mn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n "),fallback:""),file:''})},enumerable:!1,configurable:!0}),n.prototype.initialize=function(n,o){e.prototype.initialize.call(this,n,o);var i=this.get('attributes').src;i&&(0,r.buildBase64UrlFromSvg)((0,t.result)(this,'defaults').src)!==i&&this.set('src',i,{silent:!0})},n.prototype.initToolbar=function(){e.prototype.initToolbar.call(this);var t=this.em;if(t){var n='image-editor';if(t.Commands.has(n)){for(var o=!1,r=this.get('toolbar'),i=0;i=0)&&delete o.editable}))}return o},n}(lo);const ho=fo;var go=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vo=void 0&&(void 0).__assign||function(){return vo=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]-1;return Sr(Sr({},i),!u||p?{reason:2}:{result:!0})},n.prototype.allById=function(){return this.componentsById},n.prototype.getById=function(t){return this.componentsById[t]||null},n.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach((function(t){return e[t]&&e[t].remove()})),null===(t=this.componentView)||void 0===t||t.remove(),[this.em,this.componentsById,this.componentView].forEach((function(t){return{}}))},n}(b);const kr=Tr;const Pr={stylePrefix:'css-',rules:[]};var Er=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ar=Number.MAX_VALUE,jr=function(e){function n(){var n=e.call(this)||this;return(0,t.bindAll)(n,'sortRules'),n.compCls=[],n.ids=[],n}return Er(n,e),n.prototype.buildFromModel=function(t,e){var n=this;void 0===e&&(e={});var o='',r=this.em,i=r&&r.getConfig().avoidInlineStyle,s=t.styleToString(),a=t.classes;return this.ids.push("#".concat(t.getId())),a.forEach((function(t){return n.compCls.push(t.getFullName())})),!i&&s&&(o="#".concat(t.getId(),"{").concat(s,"}")),t.components().forEach((function(t){return o+=n.buildFromModel(t,e)})),o},n.prototype.build=function(e,n){var o=this;void 0===n&&(n={});var i=n.json,s=n.em,a=n.cssc||(null==s?void 0:s.Css);this.em=s,this.compCls=[],this.ids=[],this.model=e;var l=[],c=e?this.buildFromModel(e,n):'',u=(0,t.isUndefined)(n.clearStyles)&&s?s.getConfig().clearStyles:n.clearStyles;if(a){var p=n.rules||a.getAll(),d={},f=[];n.onlyMatched&&e&&(0,r.hasWin)()&&(p=this.matchedRules(e,p)),p.forEach((function(t){var e=t.getAtRule();if(e){var r=d[e];r?r.push(t):d[e]=[t]}else{var s=o.buildFromRule(t,f,n);i?l.push(s):c+=s}})),this.sortMediaObject(d).forEach((function(t){var e='',r=t.key;t.value.forEach((function(t){var s=o.buildFromRule(t,f,n);t.get('singleAtRule')?c+="".concat(r,"{").concat(s,"}"):e+=s,i&&l.push(s)})),e&&(c+="".concat(r,"{").concat(e,"}"))})),s&&u&&p.remove&&p.remove(f)}return i?l.filter((function(t){return t})):c},n.prototype.buildFromRule=function(t,e,n){var o,r=this;void 0===n&&(n={});var i,s='',a=this.model,l=t.selectorsToString({skipAdd:1}),c=t.get('selectorsAdd'),u=t.get('singleAtRule');if(null===(o=t.get('selectors'))||void 0===o||o.forEach((function(t){var e=t.getFullName();(r.compCls.indexOf(e)>=0||r.ids.indexOf(e)>=0||n.keepUnusedStyles)&&(i=1)})),l&&i||c||u||!a){var p=t.getDeclaration({body:1});p&&(n.json?s=t:s+=p)}else e.push(t);return s},n.prototype.matchedRules=function(t,e){var n=this,o=t.getEl(),r=[];return e.forEach((function(t){try{t.selectorsToString().split(',').some((function(t){return null==o?void 0:o.matches(n.__cleanSelector(t))}))&&r.push(t)}catch(t){}})),t.components().forEach((function(t){r=r.concat(n.matchedRules(t,e))})),r=r.filter((function(t,e){return r.indexOf(t)===e}))},n.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):Ar},n.prototype.sortMediaObject=function(e){var n=this;void 0===e&&(e={});var o=[];return(0,t.each)(e,(function(t,e){return o.push({key:e,value:t})})),o.sort((function(t,e){var o=[t.key,e.key].every((function(t){return-1!==t.indexOf('min-width')})),r=o?t.key:e.key,i=o?e.key:t.key;return n.getQueryLength(r)-n.getQueryLength(i)}))},n.prototype.sortRules=function(t,e){var n=function(t){return t.get('mediaText')||''},o=[n(t),n(e)].every((function(t){return-1!==t.indexOf('min-width')})),r=n(o?t:e),i=n(o?e:t);return this.getQueryLength(r)-this.getQueryLength(i)},n.prototype.__cleanSelector=function(t){return t.split(' ').map((function(t){return t.split(':')[0]})).join(' ')},n}(u.Hn);const Mr=jr;var Lr=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dr=void 0&&(void 0).__assign||function(){return Dr=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0}))},n.prototype.setIdRule=function(e,n,o){void 0===n&&(n={}),void 0===o&&(o={});var r=o.addOpts,i=void 0===r?{}:r,s=o.mediaText,a=o.state||'',l=(0,t.isUndefined)(s)?this.em.getCurrentMedia():s,c=this.em.Selectors.add({name:e,type:Le.TYPE_ID},i),u=this.add(c,a,l,{},i);return u.setStyle(n,Ur(Ur({},o),i)),u},n.prototype.getIdRule=function(e,n){void 0===n&&(n={});var o=n.mediaText,r=n.state||'',i=(0,t.isUndefined)(o)?this.em.getCurrentMedia():o,s=this.em.Selectors.get(e,Le.TYPE_ID);return s&&this.get(s,r,i)},n.prototype.setClassRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=n.state||'',r=n.mediaText||this.em.getCurrentMedia(),i=this.em.Selectors.add({name:t,type:Le.TYPE_CLASS}),s=this.add(i,o,r);return s.setStyle(e,n),s},n.prototype.getClassRule=function(t,e){void 0===e&&(e={});var n=e.state||'',o=e.mediaText||this.em.getCurrentMedia(),r=this.em.Selectors.get(t,Le.TYPE_CLASS);return r&&this.get(r,n,o)},n.prototype.remove=function(e,n){var o=(0,t.isString)(e)?this.getRules(e):e,r=this.getAll().remove(o,n);return(0,t.isArray)(r)?r:[r]},n.prototype.clear=function(t){return void 0===t&&(t={}),this.getAll().reset([],t),this},n.prototype.getComponentRules=function(e,n){void 0===n&&(n={});var o=n.state,r=n.mediaText;n.current&&(o=this.em.get('state')||'',r=this.em.getCurrentMedia());var i=e.getId();return this.getAll().filter((function(e){return!(!(0,t.isUndefined)(o)&&e.get('state')!==o)&&(!(!(0,t.isUndefined)(r)&&e.get('mediaText')!==r)&&e.getSelectorsString()==="#".concat(i))}))},n.prototype.render=function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new Rt({collection:this.rules,config:this.config}),this.rulesView.render().el},n.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove()},n}(b);const qr=$r;const Gr={appendTo:'',blocks:[],appendOnClick:!1,custom:!1};var Kr=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Yr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Kr(n,e),n.prototype.defaults=function(){return{label:'',content:'',media:'',category:'',activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},n.prototype.getId=function(){return this.id},n.prototype.getLabel=function(){return this.get('label')},n.prototype.getMedia=function(){return this.get('media')},n.prototype.getContent=function(){return this.get('content')},n.prototype.getCategoryLabel=function(){var e=this.get('category');return(0,t.isFunction)(null==e?void 0:e.get)?e.get('label'):(null==e?void 0:e.label)?null==e?void 0:e.label:e},n}(u.Hn);var Xr=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Jr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Xr(e,t),e}(u.FE);const Zr=Jr;Jr.prototype.model=Yr;var Qr=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const ti=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Qr(e,t),e.prototype.defaults=function(){return{id:'',label:'',open:!0,attributes:{}}},e}(u.Hn);var ei=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ni=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ei(e,t),e}(u.FE);const oi=ni;ni.prototype.model=ti;var ri=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ii=function(e){function n(t,n){void 0===n&&(n={});var o=e.call(this,t)||this,r=o.model;return o.em=n.em,o.config=n,o.endDrag=o.endDrag.bind(o),o.ppfx=n.pStylePrefix||'',o.listenTo(r,'destroy remove',o.remove),o.listenTo(r,'change',o.render),o}return ri(n,e),n.prototype.events=function(){return{click:'handleClick',mousedown:'startDrag',dragstart:'handleDragStart',drag:'handleDrag',dragend:'handleDragEnd'}},n.prototype.__getModule=function(){return this.em.Blocks},n.prototype.handleClick=function(e){var n=this,o=n.config,r=n.model,i=n.em,s=r.get('onClick')||o.appendOnClick;if(i.trigger('block:click',r,e),s){if((0,t.isFunction)(s))return s(r,null==i?void 0:i.getEditor(),{event:e});var a,l,c=o.getSorter(),u=r.get('content'),p=i.getSelected();if(c.setDropContent(u),p)if(c.validTarget(p.getEl(),u).valid)a=p;else{var d=p.parent();d&&c.validTarget(d.getEl(),u).valid&&(a=d,l=d.components().indexOf(p)+1)}if(!a){var f=i.getWrapper();c.validTarget(f.getEl(),u).valid&&(a=f)}var h=a&&a.append(u,{at:l})[0];h&&i.setSelected(h,{scroll:1})}},n.prototype.startDrag=function(t){var e=this,n=e.config,o=e.em,i=e.model,s=i.get('disable');if(0===t.button&&n.getSorter&&!this.el.draggable&&!s){o.refreshCanvas();var a=n.getSorter();a.__currentBlock=i,a.setDragHelper(this.el,t),a.setDropContent(this.model.get('content')),a.startSort(this.el),(0,r.on)(document,'mouseup',this.endDrag)}},n.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},n.prototype.handleDrag=function(t){this.__getModule().__drag(t)},n.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},n.prototype.endDrag=function(){(0,r.off)(document,'mouseup',this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},n.prototype.render=function(){var t,e=this,n=e.em,o=e.el,i=e.$el,s=e.ppfx,a=e.model,l=a.get('disable'),c=a.get('attributes')||{},u=c.class||'',p="".concat(s,"block"),d=n&&n.t("blockManager.labels.".concat(a.id))||a.get('label'),f=a.get('render'),h=a.get('media'),g=l?"".concat(p,"--disable"):"".concat(s,"four-color-h");i.attr(c),o.className="".concat(u," ").concat(p," ").concat(s,"one-bg ").concat(g).trim(),o.innerHTML="\n ".concat(h?"
").concat(h,"
"):'',"\n
").concat(d,"
\n "),o.title=c.title||(null===(t=o.textContent)||void 0===t?void 0:t.trim()),o.setAttribute('draggable',"".concat(!(!(0,r.hasDnd)(n)||l)));var v=f&&f({el:o,model:a,className:p,prefix:s});return v&&(o.innerHTML=v),this},n}(u.G7);const si=ii;var ai=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),li=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},ci=function(t){function e(e,n){var o=t.call(this,e)||this;o.config=n;var r=n.pStylePrefix||'';return o.em=n.em,o.pfx=r,o.caretR='fa fa-caret-right',o.caretD='fa fa-caret-down',o.iconClass="".concat(r,"caret-icon"),o.activeClass="".concat(r,"open"),o.className="".concat(r,"block-category"),o.listenTo(o.model,'change:open',o.updateVisibility),o.model.view=o,o}return ai(e,t),e.prototype.events=function(){return{'click [data-title]':'toggle'}},e.prototype.template=function(t){var e=t.pfx,n=t.label;return i(pi||(pi=li(["\n
\n \n ","\n
\n \n "],["\n
\n \n ","\n
\n \n "])),e,e,n,e)},e.prototype.attributes=function(){return this.model.get('attributes')||{}},e.prototype.updateVisibility=function(){this.model.get('open')?this.open():this.close()},e.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=''},e.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display='none'},e.prototype.toggle=function(){var t=this.model;t.set('open',!t.get('open'))},e.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},e.prototype.getBlocksEl=function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.pfx,"blocks-c"))),this.blocksEl},e.prototype.append=function(t){this.getBlocksEl().appendChild(t)},e.prototype.render=function(){var t=this,e=t.em,n=t.el,o=t.$el,r=t.model,i=t.pfx,s=e.t("blockManager.categories.".concat(r.id))||r.get('label');return n.innerHTML=this.template({pfx:i,label:s}),o.addClass(this.className),o.css({order:r.get('order')}),this.updateVisibility(),this},e}(u.G7);const ui=ci;var pi,di=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),fi=void 0&&(void 0).__assign||function(){return fi=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n \n
\n "),this.collection.each((function(e){return t.add(e,n)})),this.append(n);var o="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(o),this.rendered=!0,this},n}(u.G7);const gi=hi;var vi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),yi=void 0&&(void 0).__assign||function(){return yi=Object.assign||function(t){for(var e,n=1,o=arguments.length;n',iconSync:'',iconTagOn:'',iconTagOff:'',iconTagRemove:'',componentFirst:!1,custom:!1};var Ei=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ai=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ei(e,t),e.prototype.defaults=function(){return{name:'',label:''}},e.prototype.getName=function(){return this.get('name')},e.prototype.getLabel=function(){return this.get('label')||this.getName()},e}(u.Hn);const ji=Ai;Ai.prototype.idAttribute='name';var Mi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Li=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Di='contentEditable',Ni=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.config||{};return n.config=o,n.module=e.module,n.coll=e.coll||null,n.pfx=o.stylePrefix||'',n.ppfx=o.pStylePrefix||'',n.em=o.em,n.listenTo(n.model,'change:active',n.updateStatus),n}return Mi(e,t),e.prototype.template=function(){var t=this,e=t.pfx,n=t.model,o=t.config,r=n.get('label')||'';return i(Fi||(Fi=Li(["\n \n ","\n $"," \n "],["\n \n ","\n $"," \n "])),e,e,e,r,e,e,o.iconTagRemove)},e.prototype.events=function(){return{'click [data-tag-remove]':'removeTag','click [data-tag-status]':'changeStatus','dblclick [data-tag-name]':'startEditTag','focusout [data-tag-name]':'endEditTag'}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector('[data-tag-name]')),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[Di]='true',e.focus(),null==t||t.setEditing(!0)},e.prototype.endEditTag=function(){var t=this.model,e=this.em,n=this.getInputEl(),o=n.textContent||'',r=null==e?void 0:e.Selectors;n[Di]='false',null==e||e.setEditing(!1),r&&r.rename(t,o)!==t&&(n.innerText=t.get('label'))},e.prototype.changeStatus=function(){var t=this.model;t.set('active',!t.get('active'))},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,o=t.config,r=o.iconTagOn,i=o.iconTagOff,s=n.find('[data-tag-status]');e.get('active')?(s.html(r),n.removeClass('opac50')):(s.html(i),n.addClass('opac50'))},e.prototype.render=function(){var t=this.pfx,e=this.ppfx;return this.$el.html(this.template()),this.$el.attr('class',"".concat(t,"tag ").concat(e,"three-bg")),this.updateStatus(),this},e}(u.G7);const Ii=Ni;var Fi,Vi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ri=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Hi=function(e){function n(n){void 0===n&&(n={});var o=e.call(this,n)||this;o.config=n.config||{},o.pfx=o.config.stylePrefix||'',o.ppfx=o.config.pStylePrefix||'',o.className=o.pfx+'tags',o.stateInputId=o.pfx+'states',o.stateInputC=o.pfx+'input-c',o.states=o.config.states||[];var r=o.config.em,i=o.collection;o.target=r;var s=r.Selectors;o.module=s,o.em=r,o.componentChanged=(0,t.debounce)(o.componentChanged.bind(o),0),o.checkSync=(0,t.debounce)(o.checkSync.bind(o),0);return o.listenTo(r,'component:toggled component:update:classes',o.componentChanged),o.listenTo(r,'styleManager:update',o.componentChanged),o.listenTo(r,'component:update:classes change:state',o.__handleStateChange),o.listenTo(r,'styleable:change change:device',o.checkSync),o.listenTo(i,'add',o.addNew),o.listenTo(i,'reset',o.renderClasses),o.listenTo(i,'remove',o.tagRemoved),o.listenTo(s.getAll(),s.events.state,(0,t.debounce)((function(){return o.renderStates()}),0)),o.delegateEvents(),o}return Vi(n,e),n.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,o=t.iconSync,r=t.iconAdd,s=t.pfx,a=t.ppfx;return i(Bi||(Bi=Ri(["
");return n.empty().append(u),l&&this.renderLabel(),this.renderField(),this.el.className="".concat(c,"__wrp ").concat(c,"__wrp-").concat(a),this.postUpdate(),this.onRender(this.getClbOpts()),this},o}(u.G7);const pa=ua;ua.prototype.eventCapture=['change'];var da=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),fa=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e)||this;o.reuseView=!0,o.itemsView=n;var r=e.config||{},i=r.stylePrefix||'',s=e.editor;return o.config=r,o.em=s,o.pfx=i,o.ppfx=r.pStylePrefix||'',o.className="".concat(i,"traits"),o.listenTo(s,'component:toggled',o.updatedCollection),o.updatedCollection(),o}return da(e,t),e.prototype.updatedCollection=function(){var t=this,e=t.ppfx,n=t.className,o=t.em.getSelected();this.el.className="".concat(n," ").concat(e,"one-bg ").concat(e,"two-color"),this.collection=o?o.traits:[],this.render()},e}(aa.Z);const ha=fa;fa.prototype.itemView=pa;var ga=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const va=function(n){function o(t){void 0===t&&(t={});var e=n.call(this,t)||this;return e.listenTo(e.model,'change:options',e.rerender),e}return ga(o,n),o.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return"
\n \n
\n \n
\n
")},o.prototype.getInputEl=function(){if(!this.$input){var n=this.model,o=this.em,r=n.get('name'),i=n.get('options')||[],s=[],a='',this.$input=(0,e["default"])(a);var l=n.getTargetValue(),c=s.indexOf(l)>=0?l:n.get('default');!(0,t.isUndefined)(c)&&this.$input.val(c)}return this.$input.get(0)},o}(pa);var ya=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const ma=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.appendInput=!1,t}return ya(n,e),n.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return"")},n.prototype.onChange=function(){this.model.set('value',this.getInputElem().checked)},n.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},n.prototype.getInputEl=function(){for(var e=[],n=0;n")},n.prototype.inputClass=function(){return"".concat(this.ppfx,"field")},n.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},n.prototype.elementUpdated=function(){this.model.trigger('el:change')},n.prototype.setValue=function(t,e){var n=this.model,o=t||n.get('defaults'),r=this.getInputEl();r&&(r.value=o)},n.prototype.handleModelChange=function(t,e,n){this.setValue(e,n)},n.prototype.handleChange=function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},n.prototype.__onInputChange=function(t){this.model.set({value:t},{fromInput:1})},n.prototype.getInputEl=function(){if(!this.inputEl){var t=this.model,n=this.opts.type||'text',o=t.get('placeholder')||t.get('defaults')||t.get('default')||'';this.inputEl=(0,e["default"])(""))}return this.inputEl.get(0)},n.prototype.render=function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this},n}(u.G7);const wa=_a;_a.prototype.events={change:'handleChange'};var xa=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ca=function(e){function n(n){void 0===n&&(n={});var o=e.call(this,n)||this;return(0,t.bindAll)(o,'moveIncrement','upIncrement'),o.doc=document,o.listenTo(o.model,'change:unit',o.handleModelChange),o}return xa(n,e),n.prototype.template=function(){var t=this.ppfx;return"\n \n \n
\n ")},o.prototype.inputClass=function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},o.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},o.prototype.remove=function(){return n.prototype.remove.call(this),this.colorEl.spectrum('destroy'),this},o.prototype.handleChange=function(e){e.stopPropagation();var n=e.target.value;(0,t.isUndefined)(n)||this.__onInputChange(n)},o.prototype.__onInputChange=function(t){var e=this.model,n=this.opts.onChange,o=t,r=this.getColorEl();if(r){r.spectrum('set',o);var i=r.spectrum('get'),s=o&&Ea(i);s&&(o=s)}n?n(o):e.set({value:o},{fromInput:1})},o.prototype.setValue=function(e,n){void 0===n&&(n={});var o=this.model,r=(0,t.isUndefined)(n.def)?o.get('defaults'):n.def,i=(0,t.isUndefined)(e)?(0,t.isUndefined)(r)?'':r:e,s=this.getInputEl(),a=this.getColorEl(),l='none'!=i?i:'';s.value=i,a.get(0).style.backgroundColor=l,(n.fromTarget||n.fromInput&&!n.avoidStore)&&(a.spectrum('set',l),this.noneColor='none'==i,this.movedColor=l)},o.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var n=this,o=n.em,r=n.model,i=n.opts,s=this.ppfx,a=i.onChange,l=(0,e["default"])("")),c=l.get(0).style,u=o&&o.config?o.config.el:'',p=o&&o.getConfig&&o.getConfig().colorPicker||{};this.movedColor='';var d,f=!1;this.$el.find('[data-colorp-c]').append(l);var h=function(t,e){void 0===e&&(e=!0),a?a(t,!e):(e&&r.setValueFromInput(0,!1),r.setValueFromInput(t,e))};l.spectrum(Pa(Pa(Pa({color:r.getValue()||!1,containerClassName:"".concat(s,"one-bg ").concat(s,"two-color"),appendTo:u||'body',maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:'Ok',cancelText:'⨯',palette:[]},p),r.get('colorPicker')||{}),{move:function(e){var n=Ea(e);t.movedColor=n,c.backgroundColor=n,h(n,!1)},change:function(e){f=!0;var n=Ea(e);c.backgroundColor=n,h(n),t.noneColor=!1},show:function(e){f=!1,t.movedColor='',d=a?r.getValue({noDefault:!0}):Ea(e)},hide:function(){f||!d&&!a||(t.noneColor&&(d=''),c.backgroundColor=d,l.spectrum('set',d),h(d,!1))}})),o&&o.on&&this.listenTo(o,'component:selected',(function(){t.movedColor&&h(t.movedColor),f=!0,t.movedColor='',l.spectrum('hide')})),this.colorEl=l}return this.colorEl},o.prototype.render=function(){return wa.prototype.render.call(this),this.getColorEl(),this},o}(wa);var ja=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Ma=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ja(e,t),e.prototype.templateInput=function(){return''},e.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new Aa({model:t,target:this.config.em,contClass:this.ppfx+'field-color',ppfx:this.ppfx}).render();n.setValue(e,{fromTarget:1}),this.input=n.el}return this.input},e}(pa);var La=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Da=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return La(n,e),n.prototype.templateInput=function(){return''},n.prototype.onChange=function(){this.handleClick()},n.prototype.handleClick=function(){var e=this.model,n=this.em,o=e.get('command');o&&((0,t.isString)(o)?n.Commands.run(o):o(n.Editor,e))},n.prototype.renderLabel=function(){this.model.get('label')&&pa.prototype.renderLabel.apply(this)},n.prototype.getInputEl=function(){var t=this.model,e=this.ppfx,n=t.props(),o=n.labelButton,r=n.text,i=n.full,s=o||r,a="".concat(e,"btn");return"")},n}(pa);const Na=Da;Da.prototype.eventCapture=['click button'];var Ia=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Fa=void 0&&(void 0).__assign||function(){return Fa=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n ").concat(x,"\n ").concat(C,"\n "):'',"\n
\n ")},n.prototype.remove=function(){var t=this;return u.G7.prototype.remove.apply(this,arguments),['em','input','$input','view'].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts()),this},n.prototype.updateStatus=function(){var t,e=this,n=e.model,o=e.pfx,r=e.ppfx,i=e.config,s="".concat(r,"four-color"),a="".concat(r,"color-warn"),l=this.$el.children(".".concat(o,"label")),c=this.getClearEl(),u=c?c.style:{};l.removeClass("".concat(s," ").concat(a)),u.display='none',n.hasValue({noParent:!0})&&i.highlightChanged?(l.addClass(s),i.clearProperties&&(u.display='')):n.hasValue()&&i.highlightComputed&&l.addClass(a),null===(t=this.parent)||void 0===t||t.updateStatus()},n.prototype.clear=function(t){t&&t.stopPropagation(),this.model.clear()},n.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(md,"]"))),this.clearEl},n.prototype.inputValueChanged=function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)},n.prototype.onValueChange=function(t,e,n){void 0===n&&(n={}),this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},n.prototype.setValue=function(e){var n=this.model,o=(0,t.isUndefined)(e)||''===e?n.getDefaultValue():e;if(this.update)return this.__update(o);this.__setValueInput(o)},n.prototype.__setValueInput=function(t){var e=this.getInputEl();e&&(e.value=t)},n.prototype.getInputEl=function(){return this.input||(this.input=this.el.querySelector('input')),this.input},n.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?'':'none'},n.prototype.clearCached=function(){delete this.clearEl,delete this.input,delete this.$input},n.prototype.__unset=function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},n.prototype.__update=function(t){var e=this.update&&this.update.bind(this);e&&e(gd(gd({},this._getClbOpts()),{value:t}))},n.prototype.__change=function(){for(var t=[],e=0;e\n \n \n ")},e.prototype.remove=function(){var t;return null===(t=this.props)||void 0===t||t.remove(),_d.prototype.remove.apply(this,arguments),this},e.prototype.onValueChange=function(){},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.get('properties');if(n.length&&!this.props){var o=e.isDetached(),r=new Cd({config:Od(Od({},this.config),{highlightComputed:o,highlightChanged:o}),collection:n,parent:this});r.render(),this.$el.find("#".concat(t,"input-holder")).append(r.el),this.props=r}},e.prototype.clearCached=function(){_d.prototype.clearCached.apply(this,arguments),delete this.props},e}(_d);var kd=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Pd=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return kd(n,e),n.prototype.events=function(){return{click:'select','click [data-close-layer]':'removeItem','mousedown [data-move-layer]':'initSorter','touchstart [data-move-layer]':'initSorter'}},n.prototype.template=function(){var t=this,e=t.pfx,n=t.ppfx,o=t.em,r=null==o?void 0:o.getConfig().icons,i=(null==r?void 0:r.close)||'',s=(null==r?void 0:r.move)||'';return"\n
\n
\n ").concat(s,"\n
\n \n
\n \n
\n
\n ").concat(i,"\n
\n
\n \n ")},n.prototype.initialize=function(t){void 0===t&&(t={});var e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.propertyView=t.propertyView;var o=this.propertyView.model;this.listenTo(e,'destroy remove',this.remove),this.listenTo(e,'change:values',this.updateLabel),this.listenTo(o,'change:selectedLayer',this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data('model',e)},n.prototype.initSorter=function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)},n.prototype.removeItem=function(t){t&&t.stopPropagation(),this.model.remove()},n.prototype.select=function(){this.model.select()},n.prototype.getPropertiesWrapper=function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector('[data-properties]')),this.propsWrapEl},n.prototype.getPreviewEl=function(){return this.previewEl||(this.previewEl=this.el.querySelector('[data-preview]')),this.previewEl},n.prototype.getLabelEl=function(){return this.labelEl||(this.labelEl=this.el.querySelector('[data-label]')),this.labelEl},n.prototype.updateLabel=function(){var e=this.model,n=e.getLabel();if(this.getLabelEl().innerHTML=n,e.hasPreview()){var o=this.getPreviewEl(),r=e.getStylePreview({number:{min:-3,max:3}}),i=(0,t.keys)(r).map((function(t){return"".concat(t,":").concat(r[t])})).join(';');o.setAttribute('style',i)}},n.prototype.updateVisibility=function(){var t,e=this,n=e.pfx,o=e.model,r=e.propertyView,i=this.getPropertiesWrapper(),s=o.isSelected();i.style.display=s?'':'none',this.$el[s?'addClass':'removeClass']("".concat(n,"active")),s&&i.appendChild(null===(t=r.props)||void 0===t?void 0:t.el)},n.prototype.render=function(){var t=this,e=t.el,n=t.pfx,o=t.model;return e.innerHTML=this.template(),e.className="".concat(n,"layer"),o.hasPreview()&&(e.querySelector('[data-preview-box]').style.display=''),this.updateLabel(),this.updateVisibility(),this},n}(u.G7);const Ed=Pd;var Ad=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),jd=function(t){function e(e){var n=t.call(this,e)||this,o=n.collection,r=e.config||{},i=r.em,s=r.stylePrefix||'',a=r.pStylePrefix||'';n.config=r,n.pfx=s,n.ppfx=a,n.propertyView=e.propertyView,n.className="".concat(s,"layers ").concat(a,"field"),n.listenTo(o,'add',n.addTo),n.listenTo(o,'reset',n.reset),n.items=[];var l=null==i?void 0:i.Utils;return n.sorter=l?new l.Sorter({container:n.el,ignoreViewChildren:1,containerSel:".".concat(s,"layers"),itemSel:".".concat(s,"layer"),pfx:r.pStylePrefix}):'',o.view=n,n.$el.data('model',o),n.$el.data('collection',o),n}return Ad(e,t),e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var o=e||null,r=this,i=r.propertyView,s=r.config,a=r.sorter,l=r.$el,c=new Ed({model:t,config:s,sorter:a,propertyView:i}),u=c.render().el;if(this.items.push(c),o)o.appendChild(u);else if(void 0!==n){var p='before';l.children().length===n&&(n--,p='after'),n<0?l.append(u):l.children().eq(n)[p](u)}else l.append(u);return u},e.prototype.reset=function(t,e){this.clearItems(),this.render()},e.prototype.remove=function(){return this.clearItems(),u.G7.prototype.remove.apply(this,arguments),this},e.prototype.clearItems=function(){this.items.forEach((function(t){return t.remove()})),this.items=[]},e.prototype.render=function(){var t=this,e=this.$el,n=this.sorter,o=document.createDocumentFragment();return e.empty(),this.collection.forEach((function(e){return t.addToCollection(e,o)})),e.append(o),e.attr('class',this.className),n&&(n.plh=null),this},e}(u.G7);const Md=jd;var Ld=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dd=void 0&&(void 0).__assign||function(){return Dd=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n \n \n ")},e.prototype.init=function(){var t=this.model;this.listenTo(t.__getLayers(),'change reset',this.updateStatus)},e.prototype.addLayer=function(){this.model.addLayer({},{at:0})},e.prototype.setValue=function(){},e.prototype.remove=function(){var t;return null===(t=this.layersView)||void 0===t||t.remove(),Td.prototype.remove.apply(this,arguments),this},e.prototype.clearCached=function(){Td.prototype.clearCached.apply(this,arguments),delete this.layersView},e.prototype.onRender=function(){var t=this,e=t.model,n=t.el,o=t.config,r=e.get('properties');if(r.length&&!this.props){var i=new Cd({config:Dd(Dd({},o),{highlightComputed:!1,highlightChanged:!1}),collection:r,parent:this});i.render();var s=new Md({collection:e.__getLayers(),config:o,propertyView:this});s.render(),n.querySelector('[data-layers-wrapper]').appendChild(s.el),this.props=i,this.layersView=s}},e}(Td);const Id=Nd;var Fd=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Vd=void 0&&(void 0).__assign||function(){return Vd=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n
\n \n
\n \n
\n
\n \n
").concat(r,"
\n
\n \n ")},n.prototype.__setValueInput=function(t){var e=this.model,n=this.el,o=e.getDefaultValue(),r=n.querySelector('[data-preview-box]'),i=n.querySelector('[data-preview]');r.style.display=t&&t!==o?'':'none',i.style.backgroundImage=t||e.getDefaultValue()},n.prototype.openAssetManager=function(){var e,n=this,o=null===(e=this.em)||void 0===e?void 0:e.Assets;null==o||o.open({select:function(e,r){var i=(0,t.isString)(e)?e:e.get('src');n.model.upValue(i,{partial:!r}),r&&o.close()},types:['image'],accept:'image/*'})},n}(_d);var Hd=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const zd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Hd(e,t),e.prototype.templateInput=function(t){return''},e.prototype.init=function(){var t=this.model;this.listenTo(t,'change:unit',this.onValueChange),this.listenTo(t,'change:units',this.render)},e.prototype.setValue=function(t){},e.prototype.onRender=function(){var t=this,e=t.ppfx,n=t.model,o=t.el;if(!this.inputInst){var r=n.input;r.ppfx=e,r.render(),o.querySelector(".".concat(e,"fields")).appendChild(r.el),this.input=r.inputEl.get(0),this.inputInst=r}},e.prototype.clearCached=function(){_d.prototype.clearCached.apply(this,arguments),this.inputInst=null},e}(_d);var Bd=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Ud=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Bd(e,t),e.prototype.setValue=function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})},e.prototype.remove=function(){var t=this;zd.prototype.remove.apply(this,arguments);var e=this.inputInst;return e&&e.remove&&e.remove(),['inputInst','$color'].forEach((function(e){return t[e]=null})),this},e.prototype.__handleChange=function(t,e){this.model.upValue(t,{partial:e})},e.prototype.onRender=function(){var t;if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var e=this,n=e.ppfx,o=e.model,r=e.em,i=e.el,s=new Aa({target:r,model:o,ppfx:n,onChange:this.__handleChange}).render();i.querySelector(".".concat(n,"fields")).appendChild(s.el),this.input=null===(t=s.inputEl)||void 0===t?void 0:t.get(0),this.inputInst=s}},e}(zd);var Wd=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),$d=void 0&&(void 0).__assign||function(){return $d=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n
\n \n
\n \n ")},e.prototype.updateOptions=function(){delete this.input,this.onRender()},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.getOptions();if(!this.input){var o=[];n.forEach((function(t){var n=e.getOptionId(t),r=e.getOptionLabel(n),i=t.style?t.style.replace(/"/g,'"'):'',s=i?"style=\"".concat(i,"\""):'',a=n.replace(/"/g,'"');o.push(""))}));var r=this.el.querySelector("#".concat(t,"input-holder"));r.innerHTML=""),this.input=r.firstChild}},e.prototype.__setValueInput=function(t){var e=this.model,n=this.getInputEl(),o=e.getOptions()[0],r=o?e.getOptionId(o):'';n&&(n.value=t||r)},e}(_d);var Xd=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Jd=void 0&&(void 0).__assign||function(){return Jd=Object.assign||function(t){for(var e,n=1,o=arguments.length;n")},e.prototype.onRender=function(){var t=this.pfx,e=this.ppfx,n=this.model,o="".concat(e,"radio-item-label"),r=n.getName(),i=n.getOptions(),s="".concat(t,"radio ").concat(t,"radio-").concat(r),a=n.cid;if(!this.input){var l=[];i.forEach((function(i){var c=i.className?"".concat(i.className," ").concat(t,"icon ").concat(o):'',u=n.getOptionId(i),p="".concat(r,"-").concat(u,"-").concat(a),d=c?'':n.getOptionLabel(u),f=i.title?"title=\"".concat(i.title,"\""):'',h=n.getValue()===u?'checked':'';l.push("\n
"),this.input=c.firstChild}},e.prototype.__setValueInput=function(t){var e,n=this.model,o=t||n.getDefaultValue(),r=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector("[value=\"".concat(o,"\"]"));r&&(r.checked=!0)},e}(Yd);var ef=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),nf=void 0&&(void 0).__assign||function(){return nf=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n \n ")},e.prototype.getSliderEl=function(){return this.slider||(this.slider=this.el.querySelector('input[type=range]')),this.slider},e.prototype.inputValueChanged=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value)},e.prototype.inputValueChangedSoft=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value,{partial:!0})},e.prototype.setValue=function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=''===t?e.getDefaultValue():parseFloat(n.value),zd.prototype.setValue.apply(this,arguments)},e.prototype.onRender=function(){zd.prototype.onRender.apply(this,arguments),this.model.get('showInput')||(this.inputInst.el.style.display='none')},e.prototype.clearCached=function(){zd.prototype.clearCached.apply(this,arguments),delete this.slider},e}(zd);const pf=u.FE.extend(Pl).extend({extendViewApi:1,init:function(){var t=this.opts,e=this.em,n=t.module||(null==e?void 0:e.get('StyleManager'));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:'stack',model:fd,view:Id,isType:function(t){if(t&&'stack'==t.type)return t}},{id:'composite',model:Qp,view:Td,isType:function(t){if(t&&'composite'==t.type)return t}},{id:'file',model:Gp,view:Rd,isType:function(t){if(t&&'file'==t.type)return t}},{id:'color',model:Gp,view:Ud,isType:function(t){if(t&&'color'==t.type)return t}},{id:'select',model:Gd,view:Yd,isType:function(t){if(t&&'select'==t.type)return t}},{id:'radio',model:Zd,view:tf,isType:function(t){if(t&&'radio'==t.type)return t}},{id:'slider',model:af,view:uf,isType:function(t){if(t&&'slider'==t.type)return t}},{id:'integer',model:of,view:zd,isType:function(t){if(t&&'integer'==t.type)return t}},{id:'number',model:of,view:zd,isType:function(t){if(t&&'number'==t.type)return t}},{id:'base',model:Gp,view:_d,isType:function(t){return t.type='base',t}}]});var df=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ff=void 0&&(void 0).__assign||function(){return ff=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
$","
\n
","
\n \n "],["\n
\n
$","
\n
","
\n
\n "])),a,a,s,a,o)},e.prototype.events=function(){return{'click [data-sector-title]':'toggle'}},e.prototype.updateOpen=function(){var t=this,e=t.$el,n=t.model,o=t.pfx,r=n.isOpen();e[r?'addClass':'removeClass']("".concat(o,"open")),this.getPropertiesEl().style.display=r?'':'none'},e.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?'':'none'},e.prototype.getPropertiesEl=function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)},e.prototype.toggle=function(){var t=this.model;t.setOpen(!t.get('open'))},e.prototype.renderProperties=function(){var t=this.model,e=this.config,n=t.get('properties');if(n){var o=new Cd({collection:n,config:e});this.$el.append(o.render().el)}},e.prototype.render=function(){var t=this,e=t.pfx,n=t.model,o=t.$el,r=n.getId(),i=n.getName();return o.html(this.template({pfx:e,label:i})),this.renderProperties(),o.attr('class',"".concat(e,"sector ").concat(e,"sector__").concat(r," no-select")),this.updateOpen(),this},e}(u.G7);const Ef=Pf;var Af,jf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Mf=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.module,r=e.config,i=n.collection;return n.pfx=(null==r?void 0:r.stylePrefix)||'',n.ppfx=(null==r?void 0:r.pStylePrefix)||'',n.config=r,n.module=o,n.listenTo(i,'add',n.addTo),n.listenTo(i,'reset',n.render),n}return jf(e,t),e.prototype.remove=function(){var t=this;return u.G7.prototype.remove.apply(this,arguments),['config','module','em'].forEach((function(e){return t[e]={}})),this},e.prototype.addTo=function(t,e,n){void 0===n&&(n={}),this.addToCollection(t,null,n)},e.prototype.addToCollection=function(t,e,n){void 0===n&&(n={});var o=this.config,r=this.el,i=e||r,s=new Ef({model:t,config:o}).render().el;return(0,Et.$Q)(i,s,n.at),s},e.prototype.render=function(){var t=this,e=this,n=e.$el,o=e.pfx,r=e.ppfx;n.empty();var i=document.createDocumentFragment();return this.collection.each((function(e){return t.addToCollection(e,i)})),n.append(i),n.addClass("".concat(o,"sectors ").concat(r,"one-bg ").concat(r,"two-color")),this},e}(u.G7);const Lf=Mf;var Df=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Nf=void 0&&(void 0).__assign||function(){return Nf=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]=e.getStepsBeforeSave()&&this.store().catch((function(e){return t.logError(e)}))},o.prototype.loadModule=function(t){var e=new t(this);return this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),e},o.prototype.loadStorableModule=function(t){var e=this.loadModule(t);return this.storables.push(e),e},o.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set('Editor',t)},o.prototype.getEditor=function(){return this.get('Editor')},o.prototype.handleUpdates=function(t,e,n){var o=this;void 0===n&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get('ready')||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout((function(){var t=o.getDirtyCount()||0,e=(n.unset,rh(n,["unset"]));o.set('changesCount',t+1,e)}),0))},o.prototype.changesUp=function(t){this.handleUpdates(0,0,t)},o.prototype.componentHovered=function(t,e,n){var o=this.previous('componentHovered');o&&this.trigger('component:unhovered',o,n),e&&this.trigger('component:hovered',e,n)},o.prototype.getSelected=function(){return this.selected.lastComponent()},o.prototype.getSelectedAll=function(){return this.selected.allComponents()},o.prototype.setSelected=function(n,o){var i=this;void 0===o&&(o={});var s=o.event,a=s&&(s.ctrlKey||s.metaKey),l=(s||{}).shiftKey,c=((0,t.isArray)(n)?n:[n]).map((function(t){return(0,r.getModel)(t,e["default"])})),u=this.getSelectedAll(),p=this.getConfig().multipleSelection,d=(0,t.isArray)(n);d&&this.removeSelected(u.filter((function(e){return!(0,t.contains)(c,e)}))),c.forEach((function(e){var n=(0,r.getModel)(e,void 0);if(n&&(i.trigger('component:select:before',n,o),!n.get('selectable')||o.abort)){if(!o.useValid)return;for(var s=n.parent();s&&!s.get('selectable');)s=s.parent();n=s}if(a&&p)return i.toggleSelected(n);if(l&&p){i.clearSelection(i.get('Canvas').getWindow());var c,f,h=n.collection,g=n.index();if(i.getSelectedAll().forEach((function(e){var n=e.collection,o=e.index();n===h&&(og&&(f=(0,t.isUndefined)(f)?o:Math.min(f,o)))})),!(0,t.isUndefined)(c))for(;c!==g;)i.addSelected(h.at(c)),c++;if(!(0,t.isUndefined)(f))for(;f!==g;)i.addSelected(h.at(f)),f--;return i.addSelected(n)}!d&&i.removeSelected(u.filter((function(t){return t!==n}))),i.addSelected(n,o),n}))},o.prototype.addSelected=function(n,o){var i=this;void 0===o&&(o={});var s=(0,r.getModel)(n,e["default"]);((0,t.isArray)(s)?s:[s]).forEach((function(e){var n=i.selected;e&&e.get('selectable')&&!e.parents().some((function(t){return n.hasComponent(t)}))&&(o.forceChange&&i.removeSelected(e,o),n.allComponents().filter((function(n){return(0,t.contains)(n.parents(),e)})).forEach((function(t){return i.removeSelected(t,o)})),n.addComponent(e,o),e&&i.trigger('component:select',e,o))}))},o.prototype.removeSelected=function(t,n){void 0===n&&(n={}),this.selected.removeComponent((0,r.getModel)(t,e["default"]),n)},o.prototype.toggleSelected=function(n,o){var i=this;void 0===o&&(o={});var s=(0,r.getModel)(n,e["default"]);((0,t.isArray)(s)?s:[s]).forEach((function(t){i.selected.hasComponent(t)?i.removeSelected(t,o):i.addSelected(t,o)}))},o.prototype.setHovered=function(t,e){if(void 0===e&&(e={}),!t)return this.set('componentHovered','');var n='component:hover',o=(0,r.getModel)(t,void 0);if(o){if(e.forceChange&&this.set('componentHovered',''),this.trigger("".concat(n,":before"),o,e),!o.get('hoverable')){if(!e.useValid||e.abort)return;for(var i=o&&o.parent();i&&!i.get('hoverable');)i=i.parent();o=i}e.abort||(this.set('componentHovered',o,e),this.trigger(n,o,e))}},o.prototype.getHovered=function(){return this.get('componentHovered')},o.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.get('DomComponents').setComponents(t,e)},o.prototype.getComponents=function(){var t=this.get('DomComponents'),e=this.get('CodeManager');if(t&&e){var n=t.getComponents();return e.getCode(n,'json')}},o.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.get('CssComposer');return n.clear(e),n.getAll().add(t,e),this},o.prototype.addStyle=function(e,n){void 0===n&&(n={});var o=this.getStyle().add(e,n);return(0,t.isArray)(o)?o:[o]},o.prototype.getStyle=function(){return this.Css.getAll()},o.prototype.setState=function(t){return this.set('state',t),this},o.prototype.getState=function(){return this.get('state')||''},o.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,o=e.jsInHtml?this.getJs(t):'',r=t.component||this.get('DomComponents').getComponent(),i=r?this.get('CodeManager').getCode(r,'html',eh(eh({},n),t)):'';return i+=o?"