\n \n ").concat(i.get('name')||'',"\n
\n \n \n \n \n \n ")).append(e.el);var l=h('div',{class:"".concat(o,"tools"),style:'pointer-events:none; display: none'},"\n \n \n \n \n \n \n \n \n "));this.elTools=l;var c=null==r?void 0:r.toolsWrapper;return c&&c.appendChild(l),s&&s({el:a,elTop:a.querySelector('[data-frame-top]'),elRight:a.querySelector('[data-frame-right]'),elBottom:a.querySelector('[data-frame-bottom]'),elLeft:a.querySelector('[data-frame-left]'),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},n}(Ce);const fi=di;var hi=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)}}(),vi=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 hi(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.clearItems=function(){(this.viewCollection||[]).forEach((function(t){return t.remove()})),this.viewCollection=[]},e.prototype.renderView=function(t,e){return new fi(t,this.canvasView)},e}(Se);const gi=vi;var yi=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)}}(),mi=void 0&&(void 0).__assign||function(){return mi=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n \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 gi({collection:i},mi(mi({},o),{canvasView:this}))},n.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var o=e.scroll,r=this.em.getCurrentFrame();o&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t.frameView===r&&t.scrollIntoView(o)})))},n.prototype.remove=function(){for(var t,e=[],n=0;n=S?S/2-C/2:-w),M=-g.y+T/2-O/2,D=s.getZoomDecimal(),L={x:(A+w)*D,y:(M+x)*D};if(m){var I=s.getZoomMultiplier(),N=(T*I-T)/2;L.y=(-g.y+x)*D-N/I}s.setCoords(L.x,L.y)},n.prototype.isElInViewport=function(t){var e=Q(t),n=b(e),o=this.getFrameOffset(e),r=n.top,i=n.left;return r>=0&&i>=0&&r<=o.height&&i<=o.width},n.prototype.offset=function(t,e){void 0===e&&(e={});var n=e.noScroll,o=b(t),r=n?{x:0,y:0}:_(t);return{top:o.top+r.y,left:o.left+r.x,width:o.width,height:o.height}},n.prototype.getRectToScreen=function(t){var e,n,o,r,i=this.getCanvasScroll(),a=this.module.getZoomDecimal(),s=this.module.getCoords(),l=this.getViewportDelta();return{x:(null!==(e=t.x)&&void 0!==e?e:0)*a-i.scrollLeft+s.x+l.x||0,y:(null!==(n=t.y)&&void 0!==n?n:0)*a-i.scrollTop+s.y+l.y||0,width:(null!==(o=t.width)&&void 0!==o?o:0)*a,height:(null!==(r=t.height)&&void 0!==r?r:0)*a}},n.prototype.getElBoxRect=function(t,e){var n,o,r;void 0===e&&(e={});var i=this.module,a=b(t),s=a.width,l=a.height,c=a.left,u=a.top,p=null===(n=ft(t))||void 0===n?void 0:n.frameView,d=null==p?void 0:p.getBoxRect(),f=i.getZoomMultiplier(),h=null!==(o=null==d?void 0:d.x)&&void 0!==o?o:0,v=null!==(r=null==d?void 0:d.y)&&void 0!==r?r:0,g=this.el,y=_(),m={x:c+h+(g.scrollLeft+y.x)*f,y:u+v+(g.scrollTop+y.y)*f,width:s,height:l};return e.local&&(m.x=c,m.y=u),e.toScreen?this.getRectToScreen(m):m},n.prototype.getViewportRect=function(t){void 0===t&&(t={});var e=this.getCanvasOffset(),n=e.top,o=e.left,r=e.width,i=e.height,a=this.module;if(t.toWorld){var s=a.getZoomMultiplier(),l=a.getCoords(),c=this.getViewportDelta();return{x:(-l.x-c.x||0)*s,y:(-l.y-c.y||0)*s,width:r*s,height:i*s}}return{x:o,y:n,width:r,height:i}},n.prototype.getViewportDelta=function(t){void 0===t&&(t={});var e=this.module.getZoomMultiplier(),n=this.getCanvasOffset(),o=n.width,r=n.height;return{x:(o*e-o)/2/e,y:(r*e-r)/2/e}},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.module.getZoomDecimal(),o=this.getFrameOffset(t),r=this.el,i=this.getCanvasOffset(),a=this.offset(t,e),s=e.avoidFrameOffset?0:o.top,l=e.avoidFrameOffset?0:o.left,c=e.avoidFrameZoom?a.top:a.top*n,u=e.avoidFrameZoom?a.left:a.left*n;return{top:e.avoidFrameOffset?c:c+s-i.top+r.scrollTop,left:e.avoidFrameOffset?u:u+l-i.left+r.scrollLeft,height:e.avoidFrameZoom?a.height:a.height*n,width:e.avoidFrameZoom?a.width:a.width*n,zoom:n,rect:a}},n.prototype.getElementOffsets=function(t){if(!t||y(t))return{};var e={},n=window.getComputedStyle(t),o=this.module.getZoomDecimal();return['marginTop','marginRight','marginBottom','marginLeft','paddingTop','paddingRight','paddingBottom','paddingLeft','borderTopWidth','borderRightWidth','borderBottomWidth','borderLeftWidth'].forEach((function(t){e[t]=parseFloat(n[t])*o})),e},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)return{top:0,left:0,width:0,height:0};var o=n.body,r=this.module.getZoomDecimal(),i=this.getFrameOffset(),a=this.getCanvasOffset(),s=t.noScroll;return{top:i.top+(s?0:o.scrollTop)*r-a.top,left:i.left+(s?0:o.scrollLeft)*r-a.left,width:a.width,height:a.height}},n.prototype.getCanvasScroll=function(){return this.config.scrollableCanvas?{scrollTop:this.el.scrollTop,scrollLeft:this.el.scrollLeft}:{scrollTop:0,scrollLeft:0}},n.prototype.updateScript=function(t){var e=t.model,n=e.getId(),o={component:e,view:t,el:t.el};if(!t.scriptContainer){t.scriptContainer=h('div',{'data-id':n});var r=this.getJsContainer();null==r||r.appendChild(t.scriptContainer)}t.el.id=n,t.scriptContainer.innerHTML='';var i=document.createElement('script'),a=e.getScriptString(),s=e.get('script-props')?a:"function(){\n".concat(a,"\n;}"),l=JSON.stringify(e.__getScriptProps());i.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n var script = (").concat(s,").bind(item);\n script(").concat(l,", { el: item });\n }, 1);"),setTimeout((function(){e.emitWithEditor(Zt.scriptMountBefore,o);var n=t.scriptContainer;null==n||n.appendChild(i),e.emitWithEditor(Zt.scriptMount,o)}),0)},n.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return null==e?void 0:e.getJsContainer()},n.prototype.getFrameView=function(t){return(null==t?void 0:t.frameView)||this.em.getCurrentFrame()},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 a=i.at(0),s=null==a?void 0:a.view;o.setCurrentFrame(s),null==r||r.appendChild(n.el),this.frame=s,this.updateFramesArea()}},n.prototype.renderFrames=function(){this._renderFrames()},n.prototype.render=function(){var t=this,e=t.el,n=t.$el,o=t.ppfx,r=t.config,i=t.em;n.html(this.template());var a=n.find('[data-frames]');this.framesArea=a.get(0);var s=n.find('[data-tools]');return this.toolsWrapper=s.get(0),s.append("\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.spotsEl=e.querySelector('[data-spots]'),this.cvStyle=e.querySelector('[data-canvas-style]'),e.className=$(i,this.className),!0===r.scrollableCanvas&&(e.style.overflow='auto'),this.ready=!0,this._renderFrames(),this},n}(Ce);const _i=bi;var wi=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)}}(),xi=void 0&&(void 0).__assign||function(){return xi=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(),a=e?'top':'left',s=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(s):{},c=l.offsetTop,u=void 0===c?0:c,p=l.offsetLeft,d=void 0===p?0:p,f=s.body||{},h=f.scrollTop,v=void 0===h?0:h,g=f.scrollLeft,y=e?v:void 0===g?0:g,m=e?u:d;return r[a]-(y-m)*i};return{top:r(t,1,e),left:r(t,0,e)}},n.prototype.getTargetToElementFixed=function(t,n,o){void 0===o&&(o={});var r=o.pos||this.getElementPos(t,{noScroll:!0}),i=o.canvasOff||this.canvasRectOffset(t,r),a=n.offsetHeight||0,s=n.offsetWidth||0,l=this.getCanvasView(),c=l.getCanvasScroll(),u=c.scrollTop,p=c.scrollLeft,d=l.getPosition(),f=o.event,h=r.width-s,v=-a,g=(0,e.isUndefined)(o.left)?h:o.left,y=Math.max(-r.left+p,0);g=Math.max(g,y);var m=r.width-s;g=Math.min(g,m);var b=d.width+p-s-r.left;g=Math.min(g,b);var _=v;if(i.top=0?e:void 0},e}(kt);const qi=$i;$i.prototype.model=zi;var Gi=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)}}(),Ki=void 0&&(void 0).__assign||function(){return Ki=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&(l=Math.max(0,s-i+1)),{startIndex:i,endIndex:s,totalItems:l,isArray:o}},n.prototype.ensureFirstChild=function(){var t=this.em.Components.getType(Ne.collectionItem).model;return this.firstChild||new t({type:Ne.collectionItem},this.opt)},Object.defineProperty(n.prototype,"collectionId",{get:function(){var t,e;return null!==(e=null===(t=this.dataResolverProps)||void 0===t?void 0:t.collectionId)&&void 0!==e?e:''},enumerable:!1,configurable:!0}),n.isComponent=function(t){return W(t.tagName)===Ne.collection},n.prototype.toJSON=function(e){var n=t.prototype.toJSON.call(this,e);delete n.droppable,delete n[_r];var o=this.firstChild;return ia(ia({},n),{components:[o]})},n}(oa);const la=sa;function ca(t,e,n){return!!t||(n.logError("The \"".concat(e,"\" property is required in the collection definition.")),!1)}var ua=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 pa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ua(e,t),e}(Fr);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)}}();const fa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return da(e,t),e.prototype.initialize=function(e){void 0===e&&(e={}),t.prototype.initialize.call(this,e),this.postRender=this.postRender.bind(this),this.listenTo(this.model.components(),'reset',this.postRender),this.dataResolverListener=new qe({em:this.em,resolver:this.model.dataResolver,onUpdate:this.postRender})},e.prototype.renderDataResolver=function(){var t=this.model.getIfTrueContent(),e=this.model.getIfFalseContent(),n=null==t?void 0:t.getEl(),o=null==e?void 0:e.getEl(),r=this.model.isTrue();n&&(n.style.display=r?'':'none'),o&&(o.style.display=r?'none':'')},e.prototype.postRender=function(){this.renderDataResolver(),t.prototype.postRender.call(this)},e.prototype.remove=function(){return this.stopListening(this.model.components(),'reset',this.postRender),this.dataResolverListener.destroy(),t.prototype.remove.call(this)},e}(Fr);var ha=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(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ha(e,t),e.prototype.initialize=function(e){var n=this;void 0===e&&(e={}),t.prototype.initialize.call(this,e),this.dataResolverListener=new qe({em:this.em,resolver:this.model.dataResolver,onUpdate:function(){return n.postRender()}})},e.prototype.remove=function(){return this.dataResolverListener.destroy(),t.prototype.remove.call(this)},e.prototype.postRender=function(){var e=this.model;!!e.getDataResolver().asPlainText?this.el.textContent=e.getDataValue():this.el.innerHTML=e.getDataValue(),t.prototype.postRender.call(this)},e}(Fr);const ga=function(){return{stylePrefix:'comp-',components:[],draggableComponents:!0,disableTextInnerChilds:!1,processor:void 0,useFrameDoc:!1,voidElements:['area','base','br','col','embed','hr','img','input','keygen','link','menuitem','meta','param','source','track','wbr']}};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)}}(),ma=void 0&&(void 0).__assign||function(){return ma=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n "),fallback:""),file:''})},enumerable:!1,configurable:!0}),n.prototype.initToolbar=function(){t.prototype.initToolbar.call(this);var e=this.em;if(e){var n='image-editor';if(e.Commands.has(n)){for(var o=!1,r=this.get('toolbar'),i=0;i=0)&&delete o.editable}))}return o},n}(Na);const $a=Wa;var qa=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)}}(),Ga=void 0&&(void 0).__assign||function(){return Ga=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0},e}(Tr);var ms=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)}}(),bs=void 0&&(void 0).__assign||function(){return bs=Object.assign||function(t){for(var e,n=1,o=arguments.length;n").concat(l).concat(s,"