!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.grapesjs=t():e.grapesjs=t()}(window,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(t){return e[t]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./src/index.js")}({"./node_modules/@babel/runtime/helpers/arrayWithHoles.js":function(e,t){function n(e){if(Array.isArray(e))return e}e.exports=n},"./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js":function(e,t){function n(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=n("./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");e.exports=r},"./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":function(e,t){function n(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}e.exports=n},"./node_modules/@babel/runtime/helpers/slicedToArray.js":function(e,t,n){function r(e,t){return i(e)||o(e,t)||s()}var i=n("./node_modules/@babel/runtime/helpers/arrayWithHoles.js"),o=n("./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"),s=n("./node_modules/@babel/runtime/helpers/nonIterableRest.js");e.exports=r},"./node_modules/@babel/runtime/helpers/toConsumableArray.js":function(e,t,n){function r(e){return i(e)||o(e)||s()}var i=n("./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"),o=n("./node_modules/@babel/runtime/helpers/iterableToArray.js"),s=n("./node_modules/@babel/runtime/helpers/nonIterableSpread.js");e.exports=r},"./node_modules/@babel/runtime/helpers/typeof.js":function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},"./node_modules/backbone-undo/Backbone.Undo.js":function(e,t,n){var r,i,o;!function(s){i=[n("./node_modules/underscore/underscore.js"),n("./node_modules/backbone/backbone.js")],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o))}(function(e,t){function n(e,t,n){return n.length<=4?e.call(t,n[0],n[1],n[2],n[3]):e.apply(t,n)}function r(e,t){return f.call(e,t)}function i(t,n){return null!=t&&(e.isArray(n)||(n=r(arguments,1)),e.all(n,function(e){return e in t}))}function o(){this.registeredObjects=[],this.cidIndexes=[]}function s(t,n,r,i){for(var o,s=0,a=n.length;se.maximumStackLength&&(e.shift(),e.pointer--)}}}function d(){}function h(t,n,r,o){if("object"==typeof n)return e.each(n,function(e,n){2===t?h(t,e,r,o):h(t,n,e,r)});switch(t){case 0:i(r,"undo","redo","on")&&e.all(e.pick(r,"undo","redo","on"),e.isFunction)&&(o[n]=r);break;case 1:o[n]&&e.isObject(r)&&(o[n]=e.extend({},o[n],r));break;case 2:delete o[n]}return this}var f=Array.prototype.slice,p=function(){function t(){r++,n=!0,e.defer(function(){n=!1})}var n=!1,r=-1;return function(){return n||t(),r}}();o.prototype={isRegistered:function(t){return t&&t.cid?this.registeredObjects[t.cid]:e.contains(this.registeredObjects,t)},register:function(e){return!this.isRegistered(e)&&(e&&e.cid?(this.registeredObjects[e.cid]=e,this.cidIndexes.push(e.cid)):this.registeredObjects.push(e),!0)},unregister:function(t){if(this.isRegistered(t)){if(t&&t.cid)delete this.registeredObjects[t.cid],this.cidIndexes.splice(e.indexOf(this.cidIndexes,t.cid),1);else{var n=e.indexOf(this.registeredObjects,t);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return e.map(this.cidIndexes,function(e){return this.registeredObjects[e]},this).concat(this.registeredObjects)}};var g={add:{undo:function(e,t,n,r){e.remove(n,r)},redo:function(e,t,n,r){r.index&&(r.at=r.index),e.add(n,r)},on:function(t,n,r){return{object:n,before:void 0,after:t,options:e.clone(r)}}},remove:{undo:function(e,t,n,r){"index"in r&&(r.at=r.index),e.add(t,r)},redo:function(e,t,n,r){e.remove(t,r)},on:function(t,n,r){return{object:n,before:t,after:void 0,options:e.clone(r)}}},change:{undo:function(t,n,r,i){e.isEmpty(n)?e.each(e.keys(r),t.unset,t):(t.set(n),i&&i.unsetData&&i.unsetData.before&&i.unsetData.before.length&&e.each(i.unsetData.before,t.unset,t))},redo:function(t,n,r,i){e.isEmpty(r)?e.each(e.keys(n),t.unset,t):(t.set(r),i&&i.unsetData&&i.unsetData.after&&i.unsetData.after.length&&e.each(i.unsetData.after,t.unset,t))},on:function(t,n){var r=t.changedAttributes(),i=e.keys(r),o=e.pick(t.previousAttributes(),i),s=e.keys(o),a=(n||(n={})).unsetData={after:[],before:[]};return i.length!=s.length&&(i.length>s.length?e.each(i,function(e){e in o||a.before.push(e)},this):e.each(s,function(e){e in r||a.after.push(e)})),{object:t,before:o,after:r,options:e.clone(n)}}},reset:{undo:function(e,t,n){e.reset(t)},redo:function(e,t,n){e.reset(n)},on:function(t,n){return{object:t,before:n.previousModels,after:e.clone(t.models)}}}};d.prototype=g;var m=t.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(e){a("undo",this.attributes)},redo:function(e){a("redo",this.attributes)}}),v=t.Collection.extend({model:m,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(e){this.maximumStackLength=e}}),b=t.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(t){this.stack=new v,this.objectRegistry=new o,this.undoTypes=new d,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(e,t){this.stack.setMaxLength(t)},this),t&&t.track&&this.startTracking(),t&&t.register&&(e.isArray(t.register)||e.isArguments(t.register)?n(this.register,this,t.register):this.register(t.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(e){u(this.stack,e,r(arguments,1),this.undoTypes)},register:function(){s("on",arguments,this._addToStack,this)},unregister:function(){s("off",arguments,this._addToStack,this)},unregisterAll:function(){n(this.unregister,this,this.objectRegistry.get())},undo:function(e){l("undo",this,this.stack,e)},undoAll:function(){l("undo",this,this.stack,!1,!0)},redo:function(e){l("redo",this,this.stack,e)},redoAll:function(){l("redo",this,this.stack,!1,!0)},isAvailable:function(e){var t=this.stack,n=t.length;switch(e){case"undo":return n>0&&t.pointer>-1;case"redo":return n>0&&t.pointerthis.length&&(i=this.length),i<0&&(i+=this.length+1);var o,s,a=[],l=[],c=[],u=[],d={},h=t.add,f=t.merge,p=t.remove,g=!1,m=this.comparator&&null==i&&t.sort!==!1,v=n.isString(this.comparator)?this.comparator:null;for(s=0;s7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(I,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),N.started=!1; },route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();return t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t!==this.fragment&&(this.iframe&&this.navigate(t),void this.loadUrl())},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),n.some(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0}))},navigate:function(e,t){if(!N.started)return!1;t&&t!==!0||(t={trigger:!!t}),e=this.getFragment(e||"");var n=this.root;""!==e&&"?"!==e.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+e;if(e=this.decodeFragment(e.replace(F,"")),this.fragment!==e){if(this.fragment=e,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;t.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),t.history=new N;var R=function(e,t){var r,i=this;return r=e&&n.has(e,"constructor")?e.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,t),r.prototype=n.create(i.prototype,e),r.prototype.constructor=r,r.__super__=i.prototype,r};y.extend=x.extend=_.extend=S.extend=N.extend=R;var H=function(){throw new Error('A "url" property or function must be specified')},z=function(e,t){var n=t.error;t.error=function(r){n&&n.call(t.context,e,r,t),e.trigger("error",e,r,t)}};return t})}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/cash-dom/dist/cash.esm.js":function(e,t,n){"use strict";function r(e,t){return void 0===t&&(t=H),J.test(e)?t.getElementsByClassName(e.slice(1)):Q.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e)}function i(e,t){if(void 0===t&&(t=H),e){if(e.__cash)return e;var n=e;if(d(e)){if(t.__cash&&(t=t[0]),n=X.test(e)?t.getElementById(e.slice(1)):Z.test(e)?I(e):r(e,t),!n)return}else if(u(e))return this.ready(e);(n.nodeType||n===z)&&(n=[n]),this.length=n.length;for(var i=0,o=this.length;i/,Q=/^\w+$/,ee=o.fn=o.prototype=i.prototype={constructor:o,__cash:!0,length:0,splice:Y};ee.get=function(e){return void 0===e?K.call(this):this[e<0?e+this.length:e]},ee.eq=function(e){return o(this.get(e))},ee.first=function(){return this.eq(0)},ee.last=function(){return this.eq(-1)},ee.map=function(e){return o(U.call(this,function(t,n){return e.call(t,n,t)}))},ee.slice=function(){return o(K.apply(this,arguments))};var te=/(?:^\w|[A-Z]|\b\w)/g,ne=/[\s-_]+/g;o.camelCase=s,o.each=a,ee.each=function(e){return a(this,function(t,n){return e.call(t,n,t)}),this},ee.removeProp=function(e){return this.each(function(t,n){delete n[e]})},o.extend=ee.extend=l;var re=1;o.guid=re,o.matches=c,o.isFunction=u,o.isString=d,o.isNumeric=h;var ie=Array.isArray;o.isArray=ie,ee.prop=function(e,t){if(e){if(d(e))return arguments.length<2?this[0]&&this[0][e]:this.each(function(n,r){r[e]=t});for(var n in e)this.prop(n,e[n]);return this}},ee.filter=function(e){if(!e)return o();var t=u(e)?e:f(e);return o($.call(this,function(n,r){return t.call(n,r,n,e)}))};var oe=/\S+/g;ee.hasClass=function(e){var t=p(e),n=!1;return t.length&&this.each(function(e,r){return n=r.classList.contains(t[0]),!n}),n},ee.removeAttr=function(e){var t=p(e);return t.length?this.each(function(e,n){a(t,function(e){n.removeAttribute(e)})}):this},ee.attr=function(e,t){if(e){if(d(e)){if(arguments.length<2){if(!this[0])return;var n=this[0].getAttribute(e);return null===n?void 0:n}return null===t?this.removeAttr(e):this.each(function(n,r){r.setAttribute(e,t)})}for(var r in e)this.attr(r,e[r]);return this}},ee.toggleClass=function(e,t){var n=p(e),r=void 0!==t;return n.length?this.each(function(e,i){a(n,function(e){r?t?i.classList.add(e):i.classList.remove(e):i.classList.toggle(e)})}):this},ee.addClass=function(e){return this.toggleClass(e,!0)},ee.removeClass=function(e){return arguments.length?this.toggleClass(e,!1):this.attr("class","")},o.unique=g,ee.add=function(e,t){return o(g(this.get().concat(o(e,t).get())))};var se=/^--/,ae={},le=H.createElement("div"),ce=le.style,ue=["webkit","moz","ms","o"];o.prefixedProp=y;var de={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};ee.css=function(e,t){if(d(e)){var n=b(e);return e=y(e,n),arguments.length<2?this[0]&&m(this[0],e,n):e?(t=w(e,t,n),this.each(function(r,i){1===i.nodeType&&(n?i.style.setProperty(e,t):i.style[e]=t)})):this}for(var r in e)this.css(r,e[r]);return this};var he="__cashData",fe=/^data-(.*)/;o.hasData=function(e){return he in e},ee.data=function(e,t){var n=this;if(!e){if(!this[0])return;return a(this[0].attributes,function(e){var t=e.name.match(fe);t&&n.data(t[1])}),C(this[0])}if(d(e))return void 0===t?this[0]&&C(this[0],e):this.each(function(n,r){return O(r,e,t)});for(var r in e)this.data(r,e[r]);return this},ee.removeData=function(e){return this.each(function(t,n){return j(n,e)})},a(["Width","Height"],function(e){ee["inner"+e]=function(){if(this[0])return this[0]===z?z["inner"+e]:this[0]["client"+e]}}),a(["width","height"],function(e,t){ee[e]=function(n){return this[0]?arguments.length?(n=parseInt(n,10),this.each(function(r,i){if(1===i.nodeType){var o=m(i,"boxSizing");i.style[e]=w(e,n+("border-box"===o?k(i,!t):0))}})):this[0]===z?this[0][s("outer-"+e)]:this[0].getBoundingClientRect()[e]-k(this[0],!t):void 0===n?void 0:this}}),a(["Width","Height"],function(e,t){ee["outer"+e]=function(n){if(this[0])return this[0]===z?z["outer"+e]:this[0]["offset"+e]+(n?v(this[0],"margin"+(t?"Top":"Left"))+v(this[0],"margin"+(t?"Bottom":"Right")):0)}});var pe="__cashEvents",ge=".";ee.off=function(e,t){var n=this;return void 0===e?this.each(function(e,t){return D(t)}):a(p(e),function(e){var r=_(e),i=r[0],o=r[1];n.each(function(e,n){return D(n,i,o,t)})}),this},ee.on=function(e,t,n,r){var i=this;if(!d(e)){for(var o in e)this.on(o,t,e[o]);return this}return u(t)&&(n=t,t=!1),a(p(e),function(e){var o=_(e),s=o[0],a=o[1];i.each(function(e,i){var o=function l(e){if(!e.namespace||S(a,e.namespace.split(ge))){var o=i;if(t){for(var u=e.target;!c(u,t);){if(u===i)return;if(u=u.parentNode,!u)return}o=u}e.namespace=e.namespace||"";var d=n.call(o,e,e.data);r&&D(i,s,a,l),d===!1&&(e.preventDefault(),e.stopPropagation())}};o.guid=n.guid=n.guid||re++,E(i,s,a,o)})}),this},ee.one=function(e,t,n){return this.on(e,t,n,!0)},ee.ready=function(e){var t=function(){return e(o)};return"loading"!==H.readyState?setTimeout(t):H.addEventListener("DOMContentLoaded",t),this},ee.trigger=function(e,t){var n=e;if(d(e)){var r=_(e),i=r[0],o=r[1];n=H.createEvent("HTMLEvents"),n.initEvent(i,!0,!0),n.namespace=o.join(ge)}return n.data=t,this.each(function(e,t){t.dispatchEvent(n)})};var me=/select-one/i,ve=/select-multiple/i,be=/%20/g,ye=/file|reset|submit|button|image/i,we=/radio|checkbox/i;ee.serialize=function(){var e="";return this.each(function(t,n){a(n.elements||[n],function(t){if(!t.disabled&&t.name&&"FIELDSET"!==t.tagName&&!ye.test(t.type)&&(!we.test(t.type)||t.checked)){var n=L(t);if(void 0!==n){var r=ie(n)?n:[n];a(r,function(n){e+=N(t.name,n)})}}})}),e.substr(1)},ee.val=function(e){return void 0===e?this[0]&&L(this[0]):this.each(function(t,n){var r=ve.test(n.type),i=null===e?r?[]:"":e;r&&ie(i)?a(n.options,function(e){e.selected=i.indexOf(e.value)>=0}):n.value=i})},ee.clone=function(){return this.map(function(e,t){return t.cloneNode(!0)})},ee.detach=function(){return this.each(function(e,t){t.parentNode&&t.parentNode.removeChild(t)})};var xe,Ce=/^\s*<(\w+)[^>]*>/,je=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;o.parseHTML=I,ee.empty=function(){var e=this[0];if(e)for(;e.firstChild;)e.removeChild(e.firstChild);return this},ee.append=function(){var e=this;return a(arguments,function(t){R(e,t)}),this},ee.appendTo=function(e){return R(o(e),this),this},ee.html=function(e){if(void 0===e)return this[0]&&this[0].innerHTML;var t=e.nodeType?e[0].outerHTML:e;return this.each(function(e,n){n.innerHTML=t})},ee.insertAfter=function(e){var t=this;return o(e).each(function(e,n){var r=n.parentNode;t.each(function(t,i){r.insertBefore(e?i.cloneNode(!0):i,n.nextSibling)})}),this},ee.after=function(){var e=this;return a(G.apply(arguments),function(t){G.apply(o(t).slice()).insertAfter(e)}),this},ee.insertBefore=function(e){var t=this;return o(e).each(function(e,n){var r=n.parentNode;t.each(function(t,i){r.insertBefore(e?i.cloneNode(!0):i,n)})}),this},ee.before=function(){var e=this;return a(arguments,function(t){o(t).insertBefore(e)}),this},ee.prepend=function(){var e=this;return a(arguments,function(t){R(e,t,!0)}),this},ee.prependTo=function(e){return R(o(e),G.apply(this.slice()),!0),this},ee.remove=function(){return this.detach().off()},ee.replaceWith=function(e){var t=this;return this.each(function(n,r){var i=r.parentNode;if(i){var s=n?o(e).clone():o(e);if(!s[0])return t.remove(),!1;i.replaceChild(s[0],r),o(s[0]).after(s.slice(1))}})},ee.replaceAll=function(e){return o(e).replaceWith(this),this},ee.text=function(e){return void 0===e?this[0]?this[0].textContent:"":this.each(function(t,n){n.textContent=e})};var Oe=H.documentElement;ee.offset=function(){var e=this[0];if(e){var t=e.getBoundingClientRect();return{top:t.top+z.pageYOffset-Oe.clientTop,left:t.left+z.pageXOffset-Oe.clientLeft}}},ee.offsetParent=function(){return o(this[0]&&this[0].offsetParent)},ee.position=function(){var e=this[0];if(e)return{left:e.offsetLeft,top:e.offsetTop}},ee.children=function(e){var t=[];return this.each(function(e,n){q.apply(t,n.children)}),t=o(g(t)),e?t.filter(function(t,n){return c(n,e)}):t},ee.contents=function(){var e=[];return this.each(function(t,n){q.apply(e,"IFRAME"===n.tagName?[n.contentDocument]:n.childNodes)}),o(e.length&&g(e))},ee.find=function(e){for(var t=[],n=0,i=this.length;n",newlineAfterToken:function(e,n,r,i){var o=!1;return"html"==this.configuration&&(o=!!i.context&&t.test(i.context.tagName)),!o&&("tag"==e&&/>$/.test(n)&&i.context||/^-1&&a>-1&&a>s&&(e=e.substr(0,s)+e.substring(s+o.commentStart.length,a)+e.substr(a+o.commentEnd.length)),i.replaceRange(e,n,r)}})}),e.defineExtension("autoIndentRange",function(e,t){var n=this;this.operation(function(){for(var r=e.line;r<=t.line;r++)n.indentLine(r,"smart")})}),e.defineExtension("autoFormatRange",function(t,n){function r(){c+="\n",d=!0,++u}for(var i=this,o=i.getMode(),s=i.getRange(t,n).split("\n"),a=e.copyState(o,i.getTokenAt(t).state),l=i.getOption("tabSize"),c="",u=0,d=0===t.ch,h=0;h0;--t)e.removeChild(e.firstChild);return e}function n(e,n){return t(e).appendChild(n)}function r(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}}function h(e,t){for(var n=0;n=t)return r+Math.min(s,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function p(e){for(;Js.length<=e;)Js.push(g(Js)+" ");return Js[e]}function g(e){return e[e.length-1]}function m(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||Zs.test(e))}function x(e,t){return t?!!(t.source.indexOf("\\w")>-1&&w(e))||t.test(e):w(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function j(e){return e.charCodeAt(0)>=768&&Qs.test(e)}function O(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function S(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}function T(e,t,n){var r;ea=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ea=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ea=i)}return null!=r?r:ea}function P(e,t){var n=e.order;return null==n&&(n=e.order=ta(e.text,t)),n}function E(e,t){return e._handlers&&e._handlers[t]||na}function _(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=h(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function D(e,t){var n=E(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function N(e){e.prototype.on=function(e,t){ra(this,e,t)},e.prototype.off=function(e,t){_(this,e,t)}}function V(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function I(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function F(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function R(e){V(e),I(e)}function H(e){return e.target||e.srcElement}function z(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Ls&&e.ctrlKey&&1==t&&(t=3),t}function B(e){if(null==Ws){var t=r("span","​");n(e,r("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ws=t.offsetWidth<=1&&t.offsetHeight>2&&!(Cs&&js<8))}var i=Ws?r("span","​"):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function $(e){if(null!=Us)return Us;var r=n(e,document.createTextNode("AخA")),i=Fs(r,0,1).getBoundingClientRect(),o=Fs(r,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Us=o.right-i.right<3)}function W(e){if(null!=la)return la;var t=n(e,r("span","x")),i=t.getBoundingClientRect(),o=Fs(t,0,1).getBoundingClientRect();return la=Math.abs(i.left-o.left)>1}function U(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ca[e]=t}function q(e,t){ua[e]=t}function G(e){if("string"==typeof e&&ua.hasOwnProperty(e))e=ua[e];else if(e&&"string"==typeof e.name&&ua.hasOwnProperty(e.name)){var t=ua[e.name];"string"==typeof t&&(t={name:t}),e=y(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return G("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return G("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function K(e,t){t=G(t);var n=ca[t.name];if(!n)return K(e,"text/plain");var r=n(e,t);if(da.hasOwnProperty(t.name)){var i=da[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}function Y(e,t){var n=da.hasOwnProperty(e)?da[e]:da[e]={};u(t,n)}function X(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function J(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),n&&n.mode!=e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Z(e,t,n){return!e.startState||e.startState(t,n)}function Q(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?ae(n,Q(e,n).text.length):ge(t,Q(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?ae(e.line,t):n<0?ae(e.line,0):e}function me(e,t){for(var n=[],r=0;re&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&X(e.doc.mode,r.state),o=ve(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ye(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new pa(r,(!0),t);var o=Se(e,t,n),s=o>r.first&&Q(r,o-1).stateAfter,a=s?pa.fromSaved(r,s,o):new pa(r,Z(r.mode),o);return r.iter(o,t,function(n){we(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function je(e,t,n,r){var i,o=e.doc,s=o.mode;t=pe(o,t);var a,l=Q(o,t.line),c=ye(e,t.line,n),u=new ha(l.text,e.options.tabSize,c);for(r&&(a=[]);(r||u.pose.options.maxHighlightLength?(a=!1,s&&we(e,t,r,d.pos),d.pos=t.length,l=null):l=Oe(Ce(n,d,r.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;cs;--a){if(a<=o.first)return o.first;var l=Q(o,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof fa?c.lookAhead:0)<=o.modeFrontier))return a;var u=d(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=a-1,r=u)}return i}function Te(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Q(e,r).stateAfter;if(i&&(!(i instanceof fa)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new _e(s,o.from,l?null:o.to))}}return r}function Ne(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(a||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=t:o.from0&&a)for(var x=0;x0)){var u=[l,1],d=le(c.from,a.from),f=le(c.to,a.to);(d<0||!s.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(f>0||!s.inclusiveRight&&!f)&&u.push({from:a.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function Re(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||$e(n,o.marker)<0)&&(n=o.marker)}return n}function Ke(e,t,n,r,i){var o=Q(e,t),s=va&&o.markedSpans;if(s)for(var a=0;a=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?le(c.to,n)>=0:le(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?le(c.from,r)<=0:le(c.from,r)<0)))return!0}}}function Ye(e){for(var t;t=Ue(e);)e=t.find(-1,!0).line;return e}function Xe(e){for(var t;t=qe(e);)e=t.find(1,!0).line;return e}function Je(e){for(var t,n;t=qe(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ze(e,t){var n=Q(e,t),r=Ye(n);return n==r?t:re(r)}function Qe(e,t){if(t>e.lastLine())return t;var n,r=Q(e,t);if(!et(e,r))return t;for(;n=qe(r);)r=n.find(1,!0).line;return re(r)+1}function et(e,t){var n=va&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function ot(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Re(e),He(e,n);var i=r?r(e):1;i!=e.height&&ne(e,i)}function st(e){e.parent=null,Re(e)}function at(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?xa:wa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function lt(e,t){var n=i("span",null,null,Os?"padding-right: .1px":null),r={pre:i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var s=o?t.rest[o-1]:t.line,a=void 0;r.pos=0,r.addToken=ut,$(e.display.measure)&&(a=P(s,e.doc.direction))&&(r.addToken=ht(r.addToken,a)),r.map=[];var c=t!=e.display.externalMeasured&&re(s);pt(s,r,be(e,s,c)),s.styleClasses&&(s.styleClasses.bgClass&&(r.bgClass=l(s.styleClasses.bgClass,r.bgClass||"")),s.styleClasses.textClass&&(r.textClass=l(s.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(B(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Os){var u=r.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return D(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=l(r.pre.className,r.textClass||"")),r}function ct(e){var t=r("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ut(e,t,n,i,o,s,a){if(t){var l,c=e.splitSpaces?dt(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){l=document.createDocumentFragment();for(var h=0;;){u.lastIndex=h;var f=u.exec(t),g=f?f.index-h:t.length-h;if(g){var m=document.createTextNode(c.slice(h,h+g));Cs&&js<9?l.appendChild(r("span",[m])):l.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!f)break;h+=g+1;var v=void 0;if("\t"==f[0]){var b=e.cm.options.tabSize,y=b-e.col%b;v=l.appendChild(r("span",p(y),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==f[0]||"\n"==f[0]?(v=l.appendChild(r("span","\r"==f[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",f[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(f[0]),v.setAttribute("cm-text",f[0]),Cs&&js<9?l.appendChild(r("span",[v])):l.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,l=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,l),Cs&&js<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||i||o||d||s){var w=n||"";i&&(w+=i),o&&(w+=o);var x=r("span",[l],w,s);if(a)for(var C in a)a.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,a[C]);return e.content.appendChild(x)}e.content.appendChild(l)}}function dt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&d.from<=c));h++);if(d.to>=u)return e(n,r,i,o,s,a,l);e(n,r.slice(0,d.to-c),i,o,null,a,l),o=null,r=r.slice(d.to-c),c=d.to}}}function ft(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function pt(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var s,a,l,c,u,d,h,f=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=c=u=a="",h=null,d=null,v=1/0;for(var b=[],y=void 0,w=0;wp||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(u+=" "+C.startStyle),C.endStyle&&x.to==v&&(y||(y=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var j in C.attributes)(h||(h={}))[j]=C.attributes[j];C.collapsed&&(!d||$e(d.marker,C)<0)&&(d=x)}else x.from>p&&v>x.from&&(v=x.from)}if(y)for(var O=0;O=f)break;for(var S=Math.min(f,v);;){if(m){var T=p+m.length;if(!d){var P=T>S?m.slice(0,S-p):m;t.addToken(t,P,s?s+l:l,u,p+P.length==v?c:"",a,h)}if(T>=S){m=m.slice(S-p),p=S;break}p=T,u=""}m=i.slice(o,o=n[g++]),s=at(n[g++],t.cm.options)}}else for(var E=1;E2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function $t(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Wt(e,t){t=Ye(t);var r=re(t),i=e.display.externalMeasured=new gt(e.doc,t,r);i.lineN=r;var o=i.built=lt(e,i);return i.text=o.pre,n(e.display.lineMeasure,o.pre),i}function Ut(e,t,n,r){return Kt(e,Gt(e,t),n,r)}function qt(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=l-a,i=o-1,t>=l&&(s="right")),null!=i){if(r=e[c+2],a==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[(c-=3)+2],s="left";if("right"==n&&i==l-a)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function Jt(e,t,n,r){var i,o=Yt(t.map,n,r),s=o.node,a=o.start,l=o.end,c=o.collapse;if(3==s.nodeType){for(var u=0;u<4;u++){for(;a&&j(t.line.text.charAt(o.coverStart+a));)--a;for(;o.coverStart+l0&&(c=r="right");var d;i=e.options.lineWrapping&&(d=s.getClientRects()).length>1?d["right"==r?d.length-1:0]:s.getBoundingClientRect()}if(Cs&&js<9&&!a&&(!i||!i.left&&!i.right)){var h=s.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+wn(e.display),top:h.top,bottom:h.bottom}:Oa}for(var f=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(f+p)/2,m=t.view.measure.heights,v=0;v=r.text.length?(c=r.text.length,u="before"):c<=0&&(c=0,u="after"),!l)return s("before"==u?c-1:c,"before"==u);var d=T(l,c,u),h=ea,f=a(c,d,"before"==u);return null!=h&&(f.other=a(c,h,"before"!=u)),f}function un(e,t){var n=0;t=pe(e.doc,t),e.options.lineWrapping||(n=wn(e.display)*t.ch);var r=Q(e.doc,t.line),i=nt(r)+Vt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function dn(e,t,n,r,i){var o=ae(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function hn(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return dn(r.first,0,null,-1,-1);var i=ie(r,n),o=r.first+r.size-1;if(i>o)return dn(r.first+r.size-1,Q(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=Q(r,i);;){var a=mn(e,s,i,t,n),l=Ge(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==i)return c;s=Q(r,i=c.line)}}function fn(e,t,n,r){r-=on(t);var i=t.text.length,o=k(function(t){return Kt(e,n,t-1).bottom<=r},i,0);return i=k(function(t){return Kt(e,n,t).top>r},o,i),{begin:o,end:i}}function pn(e,t,n,r){n||(n=Gt(e,t));var i=sn(e,t,Kt(e,n,r),"line").top;return fn(e,t,n,i)}function gn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function mn(e,t,n,r,i){i-=nt(t);var o=Gt(e,t),s=on(t),a=0,l=t.text.length,c=!0,u=P(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?bn:vn)(e,t,n,o,u,r,i);c=1!=d.level,a=c?d.from:d.to-1,l=c?d.to:d.from-1}var h,f,p=null,g=null,m=k(function(t){var n=Kt(e,o,t);return n.top+=s,n.bottom+=s,!!gn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,g=n),!0)},a,l),v=!1;if(g){var b=r-g.left=w.bottom?1:0}return m=O(t.text,m,1),dn(n,m,f,v,r-h)}function vn(e,t,n,r,i,o,s){var a=k(function(a){var l=i[a],c=1!=l.level;return gn(cn(e,ae(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,s,!0)},0,i.length-1),l=i[a];if(a>0){var c=1!=l.level,u=cn(e,ae(n,c?l.from:l.to,c?"after":"before"),"line",t,r);gn(u,o,s,!0)&&u.top>s&&(l=i[a-1])}return l}function bn(e,t,n,r,i,o,s){var a=fn(e,t,r,s),l=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h=c||f.to<=l)){var p=1!=f.level,g=Kt(e,r,p?Math.min(c,f.to)-1:Math.max(l,f.from)).right,m=gm)&&(u=f,d=m)}}return u||(u=i[i.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function yn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ya){ya=r("pre",null,"CodeMirror-line-like");for(var i=0;i<49;++i)ya.appendChild(document.createTextNode("x")),ya.appendChild(r("br"));ya.appendChild(document.createTextNode("x"))}n(e.measure,ya);var o=ya.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function wn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=r("span","xxxxxxxxxx"),i=r("pre",[t],"CodeMirror-line-like");n(e.measure,i);var o=t.getBoundingClientRect(),s=(o.right-o.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function xn(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var a=e.display.gutterSpecs[s].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Cn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Cn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function jn(e){var t=yn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/wn(e.display)-3);return function(i){if(et(e.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)va&&Ze(e.doc,t)i.viewFrom?En(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)En(e);else if(t<=i.viewFrom){var o=_n(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):En(e)}else if(n>=i.viewTo){var s=_n(e,t,t,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):En(e)}else{var a=_n(e,t,t,-1),l=_n(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(mt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):En(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Sn(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);h(s,n)==-1&&s.push(n)}}}function En(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function _n(e,t,n,r){var i,o=Sn(e,t),s=e.display.view;if(!va||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,l=0;l0){if(o==s.length-1)return null;i=a+s[o].size-t,o++}else i=a-t;t+=i,n+=i}for(;Ze(e.doc,n)!=n;){if(o==(r<0?0:s.length-1))return null;n+=r*s[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Dn(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=mt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=mt(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Sn(e,n)))),r.viewTo=n}function Mn(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||a.to().line0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Rn(e){e.state.focused||(e.display.input.focus(),zn(e))}function Hn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Bn(e))},100)}function zn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(D(e,"focus",e,t),e.state.focused=!0,a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Os&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Fn(e))}function Bn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(D(e,"blur",e,t),e.state.focused=!1,zs(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function $n(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||u<-.005)&&(ne(i.line,s),Wn(i.line),i.rest))for(var d=0;de.display.sizerWidth){var h=Math.ceil(a/wn(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Wn(e){if(e.widgets)for(var t=0;t=s&&(o=ie(t,nt(Q(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function qn(e,t){if(!M(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!_s){var s=r("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Vt(e.display))+"px;\n height: "+(t.bottom-t.top+Rt(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(o),e.display.lineSpace.removeChild(s)}}}function Gn(e,t,n,r){null==r&&(r=0);var i;e.options.lineWrapping||t!=n||(t=t.ch?ae(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,n="before"==t.sticky?ae(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var s=!1,a=cn(e,t),l=n&&n!=t?cn(e,n):a;i={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r};var c=Yn(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(nr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(s=!0)),null!=c.scrollLeft&&(ir(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(s=!0)),!s)break}return i}function Kn(e,t){var n=Yn(e,t);null!=n.scrollTop&&nr(e,n.scrollTop),null!=n.scrollLeft&&ir(e,n.scrollLeft)}function Yn(e,t){var n=e.display,r=yn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=zt(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o); var a=e.doc.height+It(n),l=t.topa-r;if(t.topi+o){var u=Math.min(t.top,(c?a:t.bottom)-o);u!=i&&(s.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,h=Ht(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),f=t.right-t.left>h;return f&&(t.right=t.left+h),t.left<10?s.scrollLeft=0:t.lefth+d-3&&(s.scrollLeft=t.right+(f?0:10)-h),s}function Xn(e,t){null!=t&&(er(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Jn(e){er(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Zn(e,t,n){null==t&&null==n||er(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Qn(e,t){er(e),e.curOp.scrollToPos=t}function er(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=un(e,t.from),r=un(e,t.to);tr(e,n,r,t.margin)}}function tr(e,t,n,r){var i=Yn(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Zn(e,i.scrollLeft,i.scrollTop)}function nr(e,t){Math.abs(e.doc.scrollTop-t)<2||(bs||Pr(e,{top:t}),rr(e,t,!0),bs&&Pr(e),xr(e,100))}function rr(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ir(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Mr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function or(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+It(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Rt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function sr(e,t){t||(t=or(e));var n=e.display.barWidth,r=e.display.barHeight;ar(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&$n(e),ar(e,or(e)),n=e.display.barWidth,r=e.display.barHeight}function ar(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function lr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&zs(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ta[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ra(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?ir(e,t):nr(e,t)},e),e.display.scrollbars.addClass&&a(e.display.wrapper,e.display.scrollbars.addClass)}function cr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Pa},vt(e.curOp)}function ur(e){var t=e.curOp;t&&yt(t,function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ea(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function fr(e){e.updatedDisplay=e.mustUpdate&&Sr(e.cm,e.update)}function pr(e){var t=e.cm,n=t.display;e.updatedDisplay&&$n(t),e.barMeasure=or(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ut(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Rt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ht(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function gr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ye(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength?X(t.mode,r.state):null,l=ve(e,o,r,!0);a&&(r.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hn)return xr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&vr(e,function(){for(var t=0;t=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Mn(e))return!1;Ar(e)&&(En(e),n.dims=xn(e));var o=i.first+i.size,s=Math.max(n.visible.from-e.options.viewportMargin,i.first),a=Math.min(o,n.visible.to+e.options.viewportMargin);r.viewFroma&&r.viewTo-a<20&&(a=Math.min(o,r.viewTo)),va&&(s=Ze(e.doc,s),a=Qe(e.doc,a));var l=s!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;Dn(e,s,a),r.viewOffset=nt(Q(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var c=Mn(e);if(!l&&0==c&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Or(e);return c>4&&(r.lineDiv.style.display="none"),Er(e,r.updateLineNumbers,n.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,kr(u),t(r.cursorDiv),t(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,xr(e,400)),r.updateLineNumbers=null,!0}function Tr(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ht(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+It(e.display)-zt(e),n.top)}),t.visible=Un(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Sr(e,t);r=!1){$n(e);var i=or(e);An(e),sr(e,i),Dr(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Pr(e,t){var n=new Ea(e,t);if(Sr(e,n)){$n(e),Tr(e,n);var r=or(e);An(e),sr(e,r),Dr(e,r),n.finish()}}function Er(e,n,r){function i(t){var n=t.nextSibling;return Os&&Ls&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var o=e.display,s=e.options.lineNumbers,a=o.lineDiv,l=a.firstChild,c=o.view,u=o.viewFrom,d=0;d-1&&(p=!1),Ct(e,f,u,r)),p&&(t(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(se(e.options,u)))),l=f.node.nextSibling}else{var g=_t(e,f,u,r);a.insertBefore(g,l)}u+=f.size}for(;l;)l=i(l)}function _r(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Dr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Rt(e)+"px"}function Mr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Cn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",s=0;ss.clientWidth,l=s.scrollHeight>s.clientHeight;if(r&&a||i&&l){if(i&&Ls&&Os)e:for(var c=t.target,u=o.view;c!=s;c=c.parentNode)for(var d=0;d0:l>=0){var c=he(a.from(),s.from()),u=de(a.to(),s.to()),d=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Aa(d?u:c,d?c:u))}}return new Ma(t,n)}function Br(e,t){return new Ma([new Aa(e,t||e)],0)}function $r(e){return e.text?ae(e.from.line+e.text.length-1,g(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Wr(e,t){if(le(e,t.from)<0)return e;if(le(e,t.to)<=0)return $r(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=$r(t).ch-t.to.ch),ae(n,r)}function Ur(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,p-1),e.insert(a.line+1,b)}wt(e,"change",e,t)}function Zr(e,t,n){function r(e,i,o){if(e.linked)for(var s=0;s1&&!e.done[e.done.length-2].ranges?(e.done.pop(),g(e.done)):void 0}function si(e,t,n,r){var i=e.history;i.undone.length=0;var o,s,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=oi(i,i.lastOp==r)))s=g(o.changes),0==le(t.from,t.to)&&0==le(t.from,s.to)?s.to=$r(t):o.changes.push(ri(e,t));else{var l=g(i.done);for(l&&l.ranges||ci(e.sel,i.done),o={changes:[ri(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||D(e,"historyAdded")}function ai(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function li(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ai(e,o,g(i.done),t))?i.done[i.done.length-1]=t:ci(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ii(i.undone)}function ci(e,t){var n=g(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ui(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function di(e){if(!e)return null;for(var t,n=0;n-1&&(g(a)[d]=c[d],delete c[d])}}}return r}function gi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=le(t,i)<0;o!=le(n,i)<0?(i=t,t=n):o!=le(t,n)<0&&(t=n)}return new Aa(i,t)}return new Aa(n||t,t)}function mi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ci(e,new Ma([gi(e.sel.primary(),t,n,i)],0),r)}function vi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(D(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(d=Ei(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(h=le(d,n))&&(r<0?h<0:h>0))return Ti(e,d,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=Ei(e,f,r,f.line==t.line?o:null)),f?Ti(e,f,t,r,i):null}}return t}function Pi(e,t,n,r,i){var o=r||1,s=Ti(e,t,n,o,i)||!i&&Ti(e,t,n,o,!0)||Ti(e,t,n,-o,i)||!i&&Ti(e,t,n,-o,!0);return s?s:(e.cantEdit=!0,ae(e.first,0))}function Ei(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?pe(e,ae(t.line-1)):null:n>0&&t.ch==(r||Q(e,t.line)).text.length?t.line=0;--i)Ai(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ai(e,t)}}function Ai(e,t){if(1!=t.text.length||""!=t.text[0]||0!=le(t.from,t.to)){var n=Ur(e,t);si(e,t,n,e.cm?e.cm.curOp.id:NaN),Vi(e,t,n,Ve(e,t));var r=[];Zr(e,function(e,n){n||h(r,e.history)!=-1||(zi(e.history,t),r.push(e.history)),Vi(e,t,null,Ve(e,t))})}}function Li(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,s=e.sel,a="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--p){var m=f(p);if(m)return m.v}}}}function Ni(e,t){if(0!=t&&(e.first+=t,e.sel=new Ma(m(e.sel.ranges,function(e){return new Aa(ae(e.anchor.line+t,e.anchor.ch),ae(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Tn(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:ae(o,Q(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ee(e,t.from,t.to),n||(n=Ur(e,t)),e.cm?Ii(e.cm,t,r):Jr(e,t,r),ji(e,n,Ks),e.cantEdit&&Pi(e,ae(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ii(e,t,n){var r=e.doc,i=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=re(Ye(Q(r,o.line))),r.iter(l,s.line+1,function(e){if(e==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&A(e),Jr(r,t,n,jn(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(e){var t=rt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),Te(r,o.line),xr(e,400);var c=t.text.length-(s.line-o.line)-1;t.full?Tn(e):o.line!=s.line||1!=t.text.length||Xr(e.doc,t)?Tn(e,o.line,s.line+1,c):Pn(e,o.line,"text");var u=L(e,"changes"),d=L(e,"change");if(d||u){var h={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&wt(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Fi(e,t,n,r,i){var o;r||(r=n),le(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Mi(e,{from:n,to:r,text:t,origin:i})}function Ri(e,t,n,r){n0||0==a&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=i("span",[s.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Ke(e,t.line,t,n,s)||t.line!=n.line&&Ke(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ee()}s.addToHistory&&si(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,c=t.line,d=e.cm;if(e.iter(c,n.line+1,function(e){d&&s.collapsed&&!d.options.lineWrapping&&Ye(e)==d.display.maxLine&&(l=!0),s.collapsed&&c!=t.line&&ne(e,0),Ae(e,new _e(s,c==t.line?t.ch:null,c==n.line?n.ch:null)),++c}),s.collapsed&&e.iter(t.line,n.line+1,function(t){et(e,t)&&ne(t,0)}),s.clearOnEnter&&ra(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Pe(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Na,s.atomic=!0),d){if(l&&(d.curOp.updateMaxLine=!0),s.collapsed)Tn(d,t.line,n.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var h=t.line;h<=n.line;h++)Pn(d,h,"text"); s.atomic&&ki(d.doc),wt(d,"markerAdded",d,s)}return s}function Ki(e,t,n,r,i){r=u(r),r.shared=!1;var o=[Gi(e,t,n,r,i)],s=o[0],a=r.widgetNode;return Zr(e,function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(Gi(e,pe(e,t),pe(e,n),r,i));for(var l=0;l-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),ji(t.doc,Br(n,n)),u)for(var d=0;d=0;t--)Fi(e.doc,"",r[t].from,r[t].to,"+delete");Jn(e)})}function go(e,t,n){var r=O(e.text,t+n,n);return r<0||r>e.text.length?null:r}function mo(e,t,n){var r=go(e,t.ch,n);return null==r?null:new ae(t.line,r,n<0?"after":"before")}function vo(e,t,n,r,i){if(e){var o=P(n,t.doc.direction);if(o){var s,a=i<0?g(o):o[0],l=i<0==(1==a.level),c=l?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=Gt(t,n);s=i<0?n.text.length-1:0;var d=Kt(t,u,s).top;s=k(function(e){return Kt(t,u,e).top==d},i<0==(1==a.level)?a.from:a.to-1,s),"before"==c&&(s=go(n,s,1))}else s=i<0?a.to:a.from;return new ae(r,s,c)}}return new ae(r,i<0?n.text.length:0,i<0?"before":"after")}function bo(e,t,n,r){var i=P(t,e.doc.direction);if(!i)return mo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=T(i,n.ch,n.sticky),s=i[o];if("ltr"==e.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from=s.from&&h>=u.begin)){var f=d?"before":"after";return new ae(n.line,h,f)}}var p=function(e,t,r){for(var o=function(e,t){return t?new ae(n.line,l(e,1),"before"):new ae(n.line,e,"after")};e>=0&&e0==(1!=s.level),c=a?r.begin:l(r.end,-1);if(s.from<=c&&c0?u.end:l(u.begin,-1);return null==m||r>0&&m==t.text.length||!(g=p(r>0?0:i.length-1,r,c(m)))?null:g}function yo(e,t){var n=Q(e.doc,t),r=Ye(n);return r!=n&&(t=re(r)),vo(!0,e,r,t,1)}function wo(e,t){var n=Q(e.doc,t),r=Xe(n);return r!=n&&(t=re(r)),vo(!0,e,n,t,-1)}function xo(e,t){var n=yo(e,t.line),r=Q(e.doc,n.line),i=P(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),s=t.line==n.line&&t.ch<=o&&t.ch;return ae(n.line,s?0:o,n.sticky)}return n}function Co(e,t,n){if("string"==typeof t&&(t=Ga[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Gs}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function jo(e,t,n){for(var r=0;r-1&&(le((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(le(i.to(),t)>0||t.xRel<0)?Io(e,r,t,o):Ro(e,r,t,o)}function Io(e,t,n,r){var i=e.display,o=!1,s=br(e,function(t){Os&&(i.scroller.draggable=!1),e.state.draggingText=!1,_(i.wrapper.ownerDocument,"mouseup",s),_(i.wrapper.ownerDocument,"mousemove",a),_(i.scroller,"dragstart",l),_(i.scroller,"drop",s),o||(V(t),r.addNew||mi(e.doc,n,null,null,r.extend),Os||Cs&&9==js?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),a=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},l=function(){return o=!0};Os&&(i.scroller.draggable=!0),e.state.draggingText=s,s.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ra(i.wrapper.ownerDocument,"mouseup",s),ra(i.wrapper.ownerDocument,"mousemove",a),ra(i.scroller,"dragstart",l),ra(i.scroller,"drop",s),Hn(e),setTimeout(function(){return i.input.focus()},20)}function Fo(e,t,n){if("char"==n)return new Aa(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Aa(ae(t.line,0),pe(e.doc,ae(t.line+1,0)));var r=n(e,t);return new Aa(r.from,r.to)}function Ro(e,t,n,r){function i(t){if(0!=le(v,t))if(v=t,"rectangle"==r.unit){for(var i=[],o=e.options.tabSize,s=d(Q(c,n.line).text,n.ch,o),a=d(Q(c,t.line).text,t.ch,o),l=Math.min(s,a),g=Math.max(s,a),m=Math.min(n.line,t.line),b=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=b;m++){var y=Q(c,m).text,w=f(y,l,o);l==g?i.push(new Aa(ae(m,w),ae(m,w))):y.length>w&&i.push(new Aa(ae(m,w),ae(m,f(y,g,o))))}i.length||i.push(new Aa(n,n)),Ci(c,zr(e,p.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,C=u,j=Fo(e,t,r.unit),O=C.anchor;le(j.anchor,O)>0?(x=j.head,O=he(C.from(),j.anchor)):(x=j.anchor,O=de(C.to(),j.head));var k=p.ranges.slice(0);k[h]=Ho(e,new Aa(pe(c,O),x)),Ci(c,zr(e,k,h),Ys)}}function o(t){var n=++y,a=kn(e,t,!0,"rectangle"==r.unit);if(a)if(0!=le(a,v)){e.curOp.focus=s(),i(a);var u=Un(l,c);(a.line>=u.to||a.lineb.bottom?20:0;d&&setTimeout(br(e,function(){y==n&&(l.scroller.scrollTop+=d,o(t))}),50)}}function a(t){e.state.selectingText=!1,y=1/0,t&&(V(t),l.input.focus()),_(l.wrapper.ownerDocument,"mousemove",w),_(l.wrapper.ownerDocument,"mouseup",x),c.history.lastSelOrigin=null}var l=e.display,c=e.doc;V(t);var u,h,p=c.sel,g=p.ranges;if(r.addNew&&!r.extend?(h=c.sel.contains(n),u=h>-1?g[h]:new Aa(n,n)):(u=c.sel.primary(),h=c.sel.primIndex),"rectangle"==r.unit)r.addNew||(u=new Aa(n,n)),n=kn(e,t,!0,!0),h=-1;else{var m=Fo(e,n,r.unit);u=r.extend?gi(u,m.anchor,m.head,r.extend):m}r.addNew?h==-1?(h=g.length,Ci(c,zr(e,g.concat([u]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"char"==r.unit&&!r.extend?(Ci(c,zr(e,g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),p=c.sel):bi(c,h,u,Ys):(h=0,Ci(c,new Ma([u],0),Ys),p=c.sel);var v=n,b=l.wrapper.getBoundingClientRect(),y=0,w=br(e,function(e){0!==e.buttons&&z(e)?o(e):a(e)}),x=br(e,a);e.state.selectingText=x,ra(l.wrapper.ownerDocument,"mousemove",w),ra(l.wrapper.ownerDocument,"mouseup",x)}function Ho(e,t){var n=t.anchor,r=t.head,i=Q(e.doc,n.line);if(0==le(n,r)&&n.sticky==r.sticky)return t;var o=P(i);if(!o)return t;var s=T(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return t;var l=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==l||l==o.length)return t;var c;if(r.line!=n.line)c=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=T(o,r.ch,r.sticky),d=u-s||(r.ch-n.ch)*(1==a.level?-1:1);c=u==l-1||u==l?d<0:d>0}var h=o[l+(c?-1:0)],f=c==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?t:new Aa(new ae(n.line,p,g),r)}function zo(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&V(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!L(e,n))return F(t);o-=a.top-s.viewOffset;for(var l=0;l=i){var u=ie(e.doc,o),d=e.display.gutterSpecs[l];return D(e,n,e,u,d.className,t),F(t)}}}function Bo(e,t){return zo(e,t,"gutterClick",!0)}function $o(e,t){Nt(e.display,t)||Wo(e,t)||M(e,t,"contextmenu")||Hs||e.display.input.onContextMenu(t)}function Wo(e,t){return!!L(e,"gutterContextMenu")&&zo(e,t,"gutterContextMenu",!1)}function Uo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),tn(e)}function qo(e){function t(t,r,i,o){e.defaults[t]=r,i&&(n[t]=o?function(e,t,n){n!=el&&i(e,t,n)}:i)}var n=e.optionHandlers;e.defineOption=t,e.Init=el,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Kr(e)},!0),t("indentUnit",2,Kr,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Yr(e),tn(e),Tn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,n.push(ae(r,o))}r++});for(var i=n.length-1;i>=0;i--)Fi(e.doc,t,n[i],ae(n[i].line,n[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=el&&e.refresh()}),t("specialCharPlaceholder",ct,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",As?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),t("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),t("rtlMoveVisually",!Vs),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Uo(e),Vr(e)},!0),t("keyMap","default",function(e,t,n){var r=fo(t),i=n!=el&&fo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,Ko,!0),t("gutters",[],function(e,t){e.display.gutterSpecs=Lr(t,e.options.lineNumbers),Vr(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?Cn(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return sr(e)},!0),t("scrollbarStyle","native",function(e){lr(e),sr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e,t){e.display.gutterSpecs=Lr(e.options.gutters,t),Vr(e)},!0),t("firstLineNumber",1,Vr,!0),t("lineNumberFormatter",function(e){return e},Vr,!0),t("showCursorWhenSelecting",!1,An,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("selectionsMayTouch",!1),t("readOnly",!1,function(e,t){"nocursor"==t&&(Bn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Go),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,An,!0),t("singleCursorHeightPerLine",!0,An,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Yr,!0),t("addModeClass",!1,Yr,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Yr,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),t("phrases",null)}function Go(e,t,n){var r=n&&n!=el;if(!t!=!r){var i=e.display.dragFunctions,o=t?ra:_;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Ko(e){e.options.lineWrapping?(a(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(zs(e.display.wrapper,"CodeMirror-wrap"),it(e)),On(e),Tn(e),tn(e),setTimeout(function(){return sr(e)},100)}function Yo(e,t){var n=this;if(!(this instanceof Yo))return new Yo(e,t);this.options=t=t?u(t):{},u(tl,t,!1);var r=t.value;"string"==typeof r?r=new Ra(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Yo.inputStyles[t.inputStyle](this),o=this.display=new Ir(e,r,i,t);o.wrapper.CodeMirror=this,Uo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),lr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $s,keySeq:null,specialChars:null},t.autofocus&&!As&&o.input.focus(),Cs&&js<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Xo(this),ro(),cr(this),this.curOp.forceUpdate=!0,Qr(this,r),t.autofocus&&!As||this.hasFocus()?setTimeout(c(zn,this),20):Bn(this);for(var s in nl)nl.hasOwnProperty(s)&&nl[s](n,t[s],el);Ar(this),t.finishInit&&t.finishInit(this);for(var a=0;a400}var i=e.display;ra(i.scroller,"mousedown",br(e,Ao)),Cs&&js<11?ra(i.scroller,"dblclick",br(e,function(t){if(!M(e,t)){var n=kn(e,t);if(n&&!Bo(e,t)&&!Nt(e.display,t)){V(t);var r=e.findWordAt(n);mi(e.doc,r.anchor,r.head)}}})):ra(i.scroller,"dblclick",function(t){return M(e,t)||V(t)}),ra(i.scroller,"contextmenu",function(t){return $o(e,t)});var o,s={end:0};ra(i.scroller,"touchstart",function(t){if(!M(e,t)&&!n(t)&&!Bo(e,t)){i.input.ensurePolled(),clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-s.end<=300?s:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),ra(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),ra(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Nt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var s,a=e.coordsChar(i.activeTouch,"page");s=!o.prev||r(o,o.prev)?new Aa(a,a):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(a):new Aa(ae(a.line,0),pe(e.doc,ae(a.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),V(n)}t()}),ra(i.scroller,"touchcancel",t),ra(i.scroller,"scroll",function(){i.scroller.clientHeight&&(nr(e,i.scroller.scrollTop),ir(e,i.scroller.scrollLeft,!0),D(e,"scroll",e))}),ra(i.scroller,"mousewheel",function(t){return Hr(e,t)}),ra(i.scroller,"DOMMouseScroll",function(t){return Hr(e,t)}),ra(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){M(e,t)||R(t)},over:function(t){M(e,t)||(eo(e,t),R(t))},start:function(t){return Qi(e,t)},drop:br(e,Zi),leave:function(t){M(e,t)||to(e)}};var a=i.input.getField();ra(a,"keyup",function(t){return _o.call(e,t)}),ra(a,"keydown",br(e,Po)),ra(a,"keypress",br(e,Do)),ra(a,"focus",function(t){return zn(e,t)}),ra(a,"blur",function(t){return Bn(e,t)})}function Jo(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=ye(e,t).state:n="prev");var s=e.options.tabSize,a=Q(o,t),l=d(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&(c=o.mode.indent(i,a.text.slice(u.length),a.text),c==Gs||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?d(Q(o,t-1).text,null,s):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",f=0;if(e.options.indentWithTabs)for(var g=Math.floor(c/s);g;--g)f+=s,h+="\t";if(fs,l=oa(t),c=null;if(a&&r.ranges.length>1)if(il&&il.text.join("\n")==t){if(r.ranges.length%il.text.length==0){c=[];for(var u=0;u=0;h--){var f=r.ranges[h],p=f.from(),v=f.to();f.empty()&&(n&&n>0?p=ae(p.line,p.ch-n):e.state.overwrite&&!a?v=ae(v.line,Math.min(Q(o,v.line).text.length,v.ch+g(l).length)):a&&il&&il.lineWise&&il.text.join("\n")==t&&(p=v=ae(p.line,0)));var b={from:p,to:v,text:c?c[h%c.length]:l,origin:i||(a?"paste":e.state.cutIncoming>s?"cut":"+input")};Mi(e.doc,b),wt(e,"inputRead",e,b)}t&&!a&&ts(e,t),Jn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function es(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||vr(t,function(){return Qo(t,n,0,null,"paste")}),!0}function ts(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Jo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Q(e.doc,i.head.line).text.slice(0,i.head.ch))&&(s=Jo(e,i.head.line,"smart"));s&&wt(e,"electricInput",e,i.head.line)}}}function ns(e){for(var t=[],n=[],r=0;rr&&(Jo(t,o.head.line,e,!0),r=o.head.line,i==t.doc.sel.primIndex&&Jn(t));else{var s=o.from(),a=o.to(),l=Math.max(r,s.line);r=Math.min(t.lastLine(),a.line-(a.ch?0:1))+1;for(var c=l;c0&&bi(t.doc,i,new Aa(s,u[i].to()),Ks)}}}),getTokenAt:function(e,t){return je(this,e,t)},getLineTokens:function(e,t){return je(this,ae(e),t,!0)},getTokenTypeAt:function(e){e=pe(this.doc,e);var t,n=be(this,Q(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=r+i>>1;if((s?n[2*s-1]:0)>=o)i=s;else{if(!(n[2*s+1]o&&(e=o,i=!0),r=Q(this.doc,e)}else r=e;return sn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-nt(r):0)},defaultTextHeight:function(){return yn(this.display)},defaultCharWidth:function(){return wn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=cn(this,pe(this.doc,e));var s=e.bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)s=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),a+t.offsetWidth>c&&(a=c-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&Kn(this,{left:a,top:s,right:a+t.offsetWidth,bottom:s+t.offsetHeight})},triggerOnKeyDown:yr(Po),triggerOnKeyPress:yr(Do),triggerOnKeyUp:_o,triggerOnMouseDown:yr(Ao),execCommand:function(e){if(Ga.hasOwnProperty(e))return Ga[e].call(null,this)},triggerElectric:yr(function(e){ts(this,e)}),findPosH:function(e,t,n,r){var i=this,o=1;t<0&&(o=-1,t=-t);for(var s=pe(this.doc,e),a=0;a0&&a(n.charAt(r-1));)--r;for(;i.5)&&On(this),D(this,"refresh",this)}),swapDoc:yr(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Qr(this,e),tn(this),this.display.input.reset(),Zn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,wt(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},N(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function ss(e,t,n,r,i){function o(){var r=t.line+n;return!(r=e.first+e.size)&&(t=new ae(r,t.ch,t.sticky),c=Q(e,r))}function s(r){var s;if(s=i?bo(e.cm,c,t,n):mo(c,t,n),null==s){if(r||!o())return!1;t=vo(i,e.cm,c,t.line,n)}else t=s;return!0}var a=t,l=n,c=Q(e,t.line);if("char"==r)s();else if("column"==r)s(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||s(!f);f=!1){var p=c.text.charAt(t.ch)||"\n",g=x(p,h)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||f||g||(g="s"),u&&u!=g){n<0&&(n=1,s(),t.sticky="after");break}if(g&&(u=g),n>0&&!s(!f))break}var m=Pi(e,t,a,l,!0);return ce(a,m)&&(m.hitSide=!0),m}function as(e,t,n,r){var i,o=e.doc,s=t.left;if("page"==r){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(a-.5*yn(e.display),3);i=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(var c;c=hn(e,s,i),c.outside;){if(n<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*n}return c}function ls(e,t){var n=qt(e,t.line);if(!n||n.hidden)return null;var r=Q(e.doc,t.line),i=$t(n,r,t.line),o=P(r,e.doc.direction),s="left";if(o){var a=T(o,t.ch);s=a%2?"right":"left"}var l=Yt(i.map,t.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function cs(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function us(e,t){return t&&(e.bad=!0),e}function ds(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function s(){u&&(c+=d,h&&(c+=d),u=h=!1)}function a(e){e&&(s(),c+=e)}function l(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void a(n);var c,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(ae(r,0),ae(i+1,0),o(+f));return void(p.length&&(c=p[0].find(0))&&a(ee(e.doc,c.from,c.to).join(d)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&s();for(var m=0;m=15&&(Ts=!1,Os=!0);var Fs,Rs=Ls&&(ks||Ts&&(null==Is||Is<12.11)),Hs=bs||Cs&&js>=9,zs=function(t,n){var r=t.className,i=e(n).exec(r);if(i){var o=r.slice(i.index+i[0].length);t.className=r.slice(0,i.index)+(o?i[1]+o:"")}};Fs=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Bs=function(e){e.select()};Ds?Bs=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Cs&&(Bs=function(e){try{e.select()}catch(t){}});var $s=function(){this.id=null,this.f=null,this.time=0,this.handler=c(this.onTimeout,this)};$s.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$s.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=this.string.length},ha.prototype.sol=function(){return this.pos==this.lineStart},ha.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ha.prototype.next=function(){if(this.post},ha.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},ha.prototype.skipToEnd=function(){this.pos=this.string.length},ha.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ha.prototype.backUp=function(e){this.pos-=e},ha.prototype.column=function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},ha.prototype.current=function(){return this.string.slice(this.start,this.pos)},ha.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ha.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ha.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var fa=function(e,t){this.state=e,this.lookAhead=t},pa=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};pa.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pa.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)t.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},pa.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pa.fromSaved=function(e,t,n){return t instanceof fa?new pa(e,X(e.mode,t.state),n,t.lookAhead):new pa(e,X(e.mode,t),n)},pa.prototype.save=function(e){var t=e!==!1?X(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fa(t,this.maxLookAhead):t};var ga=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n},ma=!1,va=!1,ba=function(e,t,n){this.text=e,He(this,t),this.height=n?n(this):1};ba.prototype.lineNo=function(){return re(this)},N(ba);var ya,wa={},xa={},Ca=null,ja=null,Oa={left:0,right:0,top:0,bottom:0},ka=function(e,t,n){this.cm=n;var i=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=o.tabIndex=-1,e(i),e(o),ra(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),ra(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Cs&&js<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ka.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},ka.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ka.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ka.prototype.zeroWidthHack=function(){var e=Ls&&!Es?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $s,this.disableVert=new $s},ka.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},ka.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};var Ta={"native":ka,"null":Sa},Pa=0,Ea=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Un(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ht(e),this.force=n,this.dims=xn(e),this.events=[]};Ea.prototype.signal=function(e,t){L(e,t)&&this.events.push(arguments)},Ea.prototype.finish=function(){for(var e=this,t=0;t=0&&le(e,i.to())<=0)return r}return-1};var Aa=function(e,t){this.anchor=e,this.head=t};Aa.prototype.from=function(){return he(this.anchor,this.head)},Aa.prototype.to=function(){return de(this.anchor,this.head)},Aa.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},$i.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=this,r=e,i=e+t;r1||!(this.children[0]instanceof $i))){var l=[];this.collapse(l),this.children=[new $i(l)],this.children[0].parent=this}},collapse:function(e){for(var t=this,n=0;n50){for(var a=o.lines.length%25+25,l=a;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=this,i=0;it.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Tn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ki(t.doc)),t&&wt(t,"markerCleared",t,this,i,o),n&&ur(t),this.parent&&this.parent.clear()}},Va.prototype.find=function(e,t){var n=this;null==e&&"bookmark"==this.type&&(e=1);for(var r,i,o=0;o=0;c--)Mi(r,i[c]);l?xi(this,l):this.cm&&Jn(this.cm)}),undo:wr(function(){Li(this,"undo")}),redo:wr(function(){Li(this,"redo")}),undoSelection:wr(function(){Li(this,"undo",!0)}),redoSelection:wr(function(){Li(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pe(this,e),t=pe(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re?(t=e,!0):(e-=o,void++n)}),pe(this,ae(n,t))},indexFromPos:function(e){e=pe(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new ae(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ae(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var s=Q(e.doc,i.line-1).text;s&&(i=new ae(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),ae(i.line-1,s.length-1),i,"+transpose"))}n.push(new Aa(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return vr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&0==le(t,this.pos)&&n==this.button};var Za,Qa,el={toString:function(){return"CodeMirror.Init"}},tl={},nl={};Yo.defaults=tl,Yo.optionHandlers=nl;var rl=[];Yo.defineInitHook=function(e){return rl.push(e)};var il=null,ol=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $s,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ol.prototype.init=function(e){function t(e){if(!M(i,e)){if(i.somethingSelected())Zo({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=ns(i);Zo({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Ks),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var n=il.text.join("\n");if(e.clipboardData.setData("Text",n),e.clipboardData.getData("Text")==n)return void e.preventDefault()}var s=is(),a=s.firstChild;i.display.lineSpace.insertBefore(s,i.display.lineSpace.firstChild),a.value=il.text.join("\n");var l=document.activeElement;Bs(a),setTimeout(function(){i.display.lineSpace.removeChild(s),l.focus(),l==o&&r.showPrimarySelection()},50)}}var n=this,r=this,i=r.cm,o=r.div=e.lineDiv;rs(o,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),ra(o,"paste",function(e){M(i,e)||es(e,i)||js<=11&&setTimeout(br(i,function(){return n.updateFromDOM()}),20)}),ra(o,"compositionstart",function(e){n.composing={data:e.data,done:!1}}),ra(o,"compositionupdate",function(e){n.composing||(n.composing={data:e.data,done:!1})}),ra(o,"compositionend",function(e){n.composing&&(e.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),ra(o,"touchstart",function(){return r.forceCompositionEnd()}),ra(o,"input",function(){n.composing||n.readFromDOMSoon()}),ra(o,"copy",t),ra(o,"cut",t)},ol.prototype.prepareSelection=function(){var e=Ln(this.cm,!1);return e.focus=this.cm.state.focused,e},ol.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ol.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ol.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&ls(t,r)||{node:a[0].measure.map[2],offset:0},c=i.linee.firstLine()&&(r=ae(r.line-1,Q(e.doc,r.line-1).length)),i.ch==Q(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,s,a;r.line==t.viewFrom||0==(o=Sn(e,r.line))?(s=re(t.view[0].line),a=t.view[0].node):(s=re(t.view[o].line),a=t.view[o-1].node.nextSibling);var l,c,u=Sn(e,i.line);if(u==t.view.length-1?(l=t.viewTo-1,c=t.lineDiv.lastChild):(l=re(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling),!a)return!1;for(var d=e.doc.splitLines(ds(e,a,c,s,l)),h=ee(e.doc,ae(s,0),ae(l,Q(e.doc,l).text.length));d.length>1&&h.length>1;)if(g(d)==g(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),s++}for(var f=0,p=0,m=d[0],v=h[0],b=Math.min(m.length,v.length);fr.ch&&y.charCodeAt(y.length-p-1)==w.charCodeAt(w.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var C=ae(s,f),j=ae(l,h.length?g(h).length-p:0);return d.length>1||d[0]||le(C,j)?(Fi(e.doc,d,C,j,"+input"),!0):void 0},ol.prototype.ensurePolled=function(){this.forceCompositionEnd()},ol.prototype.reset=function(){this.forceCompositionEnd()},ol.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ol.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},ol.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||vr(this.cm,function(){return Tn(e.cm)})},ol.prototype.setUneditable=function(e){e.contentEditable="false"},ol.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||br(this.cm,Qo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ol.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ol.prototype.onContextMenu=function(){},ol.prototype.resetPosition=function(){},ol.prototype.needsContentAttribute=!0;var sl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $s,this.hasSelection=!1,this.composing=null};sl.prototype.init=function(e){function t(e){if(!M(i,e)){if(i.somethingSelected())Zo({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=ns(i);Zo({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Ks):(r.prevInput="",o.value=t.text.join("\n"),Bs(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}var n=this,r=this,i=this.cm;this.createField(e);var o=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),Ds&&(o.style.width="0px"),ra(o,"input",function(){Cs&&js>=9&&n.hasSelection&&(n.hasSelection=null),r.poll()}),ra(o,"paste",function(e){M(i,e)||es(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())}),ra(o,"cut",t),ra(o,"copy",t),ra(e.scroller,"paste",function(t){if(!Nt(e,t)&&!M(i,t)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void r.focus();var n=new Event("paste");n.clipboardData=t.clipboardData,o.dispatchEvent(n)}}),ra(e.lineSpace,"selectstart",function(t){Nt(e,t)||V(t)}),ra(o,"compositionstart",function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ra(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},sl.prototype.createField=function(e){this.wrapper=is(),this.textarea=this.wrapper.firstChild},sl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ln(e);if(e.options.moveInputWithCursor){var i=cn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+s.left-o.left))}return r},sl.prototype.showSelection=function(e){var t=this.cm,r=t.display;n(r.cursorDiv,e.cursors),n(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},sl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Bs(this.textarea),Cs&&js>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",Cs&&js>=9&&(this.hasSelection=null))}},sl.prototype.getField=function(){return this.textarea},sl.prototype.supportsTouch=function(){return!1},sl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!As||s()!=this.textarea))try{this.textarea.focus()}catch(e){}},sl.prototype.blur=function(){this.textarea.blur()},sl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},sl.prototype.receivedFocus=function(){this.slowPoll()},sl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},sl.prototype.fastPoll=function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},sl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||sa(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(Cs&&js>=9&&this.hasSelection===i||Ls&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,a=Math.min(r.length,i.length);s1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},sl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},sl.prototype.onKeyPress=function(){Cs&&js>=9&&(this.hasSelection=null),this.fastPoll()},sl.prototype.onContextMenu=function(e){function t(){if(null!=s.selectionStart){var e=i.somethingSelected(),t="​"+(e?s.value:"");s.value="⇚",s.value=t,r.prevInput=e?"":"​",s.selectionStart=1,s.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending==n&&(r.contextMenuPending=!1,r.wrapper.style.cssText=d,s.style.cssText=u,Cs&&js<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=s.selectionStart)){(!Cs||Cs&&js<9)&&t();var e=0,a=function(){o.selForContextMenu==i.doc.sel&&0==s.selectionStart&&s.selectionEnd>0&&"​"==r.prevInput?br(i,_i)(i):e++<10?o.detectingSelectAll=setTimeout(a,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(a,200)}}var r=this,i=r.cm,o=i.display,s=r.textarea;r.contextMenuPending&&r.contextMenuPending();var a=kn(i,e),l=o.scroller.scrollTop;if(a&&!Ts){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(a)==-1&&br(i,Ci)(i.doc,Br(a),Ks);var u=s.style.cssText,d=r.wrapper.style.cssText,h=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static",s.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(Cs?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(Os&&(f=window.scrollY),o.input.focus(),Os&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(s.value=r.prevInput=" "),r.contextMenuPending=n,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),Cs&&js>=9&&t(),Hs){R(e);var p=function(){_(window,"mouseup",p),setTimeout(n,20)};ra(window,"mouseup",p)}else setTimeout(n,50)}},sl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},sl.prototype.setUneditable=function(){},sl.prototype.needsContentAttribute=!1,qo(Yo),os(Yo);var al="iter insert remove copy getEditor constructor".split(" ");for(var ll in Ra.prototype)Ra.prototype.hasOwnProperty(ll)&&h(al,ll)<0&&(Yo.prototype[ll]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ra.prototype[ll]));return N(Ra),Yo.inputStyles={textarea:sl,contenteditable:ol},Yo.defineMode=function(e){Yo.defaults.mode||"null"==e||(Yo.defaults.mode=e),U.apply(this,arguments)},Yo.defineMIME=q,Yo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Yo.defineMIME("text/plain","null"),Yo.defineExtension=function(e,t){Yo.prototype[e]=t},Yo.defineDocExtension=function(e,t){Ra.prototype[e]=t},Yo.fromTextArea=ps,gs(Yo),Yo.version="5.49.2",Yo})},"./node_modules/codemirror/mode/css/css.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"))}(function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=s),r("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function s(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")}function a(e,t,n){this.type=e,this.indent=t,this.prev=n}function l(e,t,n,r){return e.context=new a(n,t.indentation()+(r===!1?0:m),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,n){return D[n.context.type](e,t,n)}function d(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function h(e){var t=e.current().toLowerCase();g=T.hasOwnProperty(t)?"atom":S.hasOwnProperty(t)?"keyword":"variable"}var f=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var p,g,m=t.indentUnit,v=n.tokenHooks,b=n.documentTypes||{},y=n.mediaTypes||{},w=n.mediaFeatures||{},x=n.mediaValueKeywords||{},C=n.propertyKeywords||{},j=n.nonStandardPropertyKeywords||{},O=n.fontProperties||{},k=n.counterDescriptors||{},S=n.colorKeywords||{},T=n.valueKeywords||{},P=n.allowNested,E=n.lineComment,_=n.supportsAtComponent===!0,D={};return D.top=function(e,t,n){if("{"==e)return l(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(_&&/@component/i.test(e))return l(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return l(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return l(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(n,t,"at");if("hash"==e)g="builtin";else if("word"==e)g="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(n,t,"interpolation");if(":"==e)return"pseudo";if(P&&"("==e)return l(n,t,"parens")}return n.context.type},D.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return C.hasOwnProperty(r)?(g="property","maybeprop"):j.hasOwnProperty(r)?(g="string-2","maybeprop"):P?(g=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(g+=" error","maybeprop")}return"meta"==e?"block":P||"hash"!=e&&"qualifier"!=e?D.top(e,t,n):(g="error","block")},D.maybeprop=function(e,t,n){return":"==e?l(n,t,"prop"):u(e,t,n)},D.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&P)return l(n,t,"propBlock");if("}"==e||"{"==e)return d(e,t,n);if("("==e)return l(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)h(t);else if("interpolation"==e)return l(n,t,"interpolation")}else g+=" error";return"prop"},D.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(g="property","maybeprop"):n.context.type},D.parens=function(e,t,n){return"{"==e||"}"==e?d(e,t,n):")"==e?c(n):"("==e?l(n,t,"parens"):"interpolation"==e?l(n,t,"interpolation"):("word"==e&&h(t),"parens")},D.pseudo=function(e,t,n){return"meta"==e?"pseudo":"word"==e?(g="variable-3",n.context.type):u(e,t,n)},D.documentTypes=function(e,t,n){return"word"==e&&b.hasOwnProperty(t.current())?(g="tag",n.context.type):D.atBlock(e,t,n)},D.atBlock=function(e,t,n){if("("==e)return l(n,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,n);if("{"==e)return c(n)&&l(n,t,P?"block":"top");if("interpolation"==e)return l(n,t,"interpolation"); if("word"==e){var r=t.current().toLowerCase();g="only"==r||"not"==r||"and"==r||"or"==r?"keyword":y.hasOwnProperty(r)?"attribute":w.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?"keyword":C.hasOwnProperty(r)?"property":j.hasOwnProperty(r)?"string-2":T.hasOwnProperty(r)?"atom":S.hasOwnProperty(r)?"keyword":"error"}return n.context.type},D.atComponentBlock=function(e,t,n){return"}"==e?d(e,t,n):"{"==e?c(n)&&l(n,t,P?"block":"top",!1):("word"==e&&(g="error"),n.context.type)},D.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?d(e,t,n,2):D.atBlock(e,t,n)},D.restricted_atBlock_before=function(e,t,n){return"{"==e?l(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(g="variable","restricted_atBlock_before"):u(e,t,n)},D.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(g="@font-face"==n.stateArg&&!O.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},D.keyframes=function(e,t,n){return"word"==e?(g="variable","keyframes"):"{"==e?l(n,t,"top"):u(e,t,n)},D.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?d(e,t,n):("word"==e?g="tag":"hash"==e&&(g="builtin"),"at")},D.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?d(e,t,n):("word"==e?g="variable":"variable"!=e&&"("!=e&&")"!=e&&(g="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:f?"block":"top",stateArg:null,context:new a(f?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(p=n[1],n=n[0]),g=n,"comment"!=p&&(t.state=D[t.state](p,e,t)),g},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-m)):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:E,fold:"brace"}});var r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],s=t(o),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],l=t(a),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],h=t(d),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(f),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(g),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],b=t(v),y=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=t(y),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],C=t(x),j=r.concat(o).concat(a).concat(c).concat(d).concat(f).concat(y).concat(x);e.registerHelper("hintWords","css",j),e.defineMIME("text/css",{documentTypes:i,mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:h,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:b,colorKeywords:w,valueKeywords:C,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:h,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:C,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:h,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:C,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:s,mediaFeatures:l,propertyKeywords:h,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:b,colorKeywords:w,valueKeywords:C,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css",helperType:"gss"})})},"./node_modules/codemirror/mode/htmlmixed/htmlmixed.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"),n("./node_modules/codemirror/mode/xml/xml.js"),n("./node_modules/codemirror/mode/javascript/javascript.js"),n("./node_modules/codemirror/mode/css/css.js"))}(function(e){"use strict";function t(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}function n(e){var t=l[e];return t?t:l[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function r(e,t){var r=e.match(n(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"","i")}function o(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function s(e,t){for(var n=0;n\s\/]/.test(r.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&h&&/>$/.test(r.current())){var f=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==r.current()&&s(u[f[1]],f[2]),g=e.getMode(n,p),m=i(f[1],!0),v=i(f[1],!1);o.token=function(e,n){return e.match(m,!1)?(n.token=l,n.localState=n.localMode=null,null):t(e,v,n.localMode.token(e,n.localState))},o.localMode=g,o.localState=e.startState(g,c.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=r.current(),r.eol()&&(o.inTag+=" "));return d}var c=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),u={},d=r&&r.tags,h=r&&r.scriptTypes;if(o(a,u),d&&o(d,u),h)for(var f=h.length-1;f>=0;f--)u.script.unshift(["type",h[f].matches,h[f].mode]);return{startState:function(){var t=e.startState(c);return{token:l,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?c.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})},"./node_modules/codemirror/mode/javascript/javascript.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"))}(function(e){"use strict";e.defineMode("javascript",function(t,n){function r(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){return He=e,ze=n,t}function o(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=s(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return i("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),i("number","number");if("/"==n)return e.eat("*")?(t.tokenize=a,a(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):Re(e,t,1)?(r(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),i("regexp","string-2")):(e.eat("="),i("operator","operator",e.current()));if("`"==n)return t.tokenize=l,l(e,t);if("#"==n)return e.skipToEnd(),i("error","error");if("<"==n&&e.match("!--")||"-"==n&&e.match("->"))return e.skipToEnd(),i("comment","comment");if(Ye.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),i("operator","operator",e.current());if(Ge.test(n)){e.eatWhile(Ge);var o=e.current();if("."!=t.lastType){if(Ke.propertyIsEnumerable(o)){var c=Ke[o];return i(c.type,c.style,o)}if("async"==o&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return i("async","keyword",o)}return i("variable","variable",o)}}function s(e){return function(t,n){var r,s=!1;if(We&&"@"==t.peek()&&t.match(Xe))return n.tokenize=o,i("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||s);)s=!s&&"\\"==r;return s||(n.tokenize=o),i("string","string")}}function a(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(qe){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,s=n-1;s>=0;--s){var a=e.string.charAt(s),l=Je.indexOf(a);if(l>=0&&l<3){if(!i){++s;break}if(0==--i){"("==a&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(Ge.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--s){if(0==s)return;var c=e.string.charAt(s-1);if(c==a&&"\\"!=e.string.charAt(s-2)){s--;break}}else if(o&&!i){++s;break}}o&&!i&&(t.fatArrowAt=s)}}function u(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function d(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function h(e,t,n,r,i){var o=e.cc;for(Qe.state=e,Qe.stream=i,Qe.marked=null,Qe.cc=o,Qe.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var s=o.length?o.pop():Ue?E:T;if(s(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Qe.marked?Qe.marked:"variable"==n&&d(e,r)?"variable-2":t}}}function f(){for(var e=arguments.length-1;e>=0;e--)Qe.cc.push(arguments[e])}function p(){return f.apply(null,arguments),!0}function g(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function m(e){var t=Qe.state;if(Qe.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=v(e,t.context);if(null!=r)return void(t.context=r)}else if(!g(e,t.localVars))return void(t.localVars=new w(e,t.localVars));n.globalVars&&!g(e,t.globalVars)&&(t.globalVars=new w(e,t.globalVars))}function v(e,t){if(t){if(t.block){var n=v(e,t.prev);return n?n==t.prev?t:new y(n,t.vars,(!0)):null}return g(e,t.vars)?t:new y(t.prev,new w(e,t.vars),(!1))}return null}function b(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function y(e,t,n){this.prev=e,this.vars=t,this.block=n}function w(e,t){this.name=e,this.next=t}function x(){Qe.state.context=new y(Qe.state.context,Qe.state.localVars,(!1)),Qe.state.localVars=et}function C(){Qe.state.context=new y(Qe.state.context,Qe.state.localVars,(!0)),Qe.state.localVars=null}function j(){Qe.state.localVars=Qe.state.context.vars,Qe.state.context=Qe.state.context.prev}function O(e,t){var n=function(){var n=Qe.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new u(r,Qe.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function k(){var e=Qe.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function S(e){function t(n){return n==e?p():";"==e||"}"==n||")"==n||"]"==n?f():p(t)}return t}function T(e,t){return"var"==e?p(O("vardef",t),ce,S(";"),k):"keyword a"==e?p(O("form"),D,T,k):"keyword b"==e?p(O("form"),T,k):"keyword d"==e?Qe.stream.match(/^\s*$/,!1)?p():p(O("stat"),A,S(";"),k):"debugger"==e?p(S(";")):"{"==e?p(O("}"),C,X,k,j):";"==e?p():"if"==e?("else"==Qe.state.lexical.info&&Qe.state.cc[Qe.state.cc.length-1]==k&&Qe.state.cc.pop()(),p(O("form"),D,T,k,ge)):"function"==e?p(ye):"for"==e?p(O("form"),me,T,k):"class"==e||qe&&"interface"==t?(Qe.marked="keyword",p(O("form","class"==e?e:t),Oe,k)):"variable"==e?qe&&"declare"==t?(Qe.marked="keyword",p(T)):qe&&("module"==t||"enum"==t||"type"==t)&&Qe.stream.match(/^\s*\w/,!1)?(Qe.marked="keyword","enum"==t?p(Ve):"type"==t?p(xe,S("operator"),te,S(";")):p(O("form"),ue,S("{"),O("}"),X,k,k)):qe&&"namespace"==t?(Qe.marked="keyword",p(O("form"),E,T,k)):qe&&"abstract"==t?(Qe.marked="keyword",p(T)):p(O("stat"),$):"switch"==e?p(O("form"),D,S("{"),O("}","switch"),C,X,k,k,j):"case"==e?p(E,S(":")):"default"==e?p(S(":")):"catch"==e?p(O("form"),x,P,T,k,j):"export"==e?p(O("stat"),Pe,k):"import"==e?p(O("stat"),_e,k):"async"==e?p(T):"@"==t?p(E,T):f(O("stat"),E,S(";"),k)}function P(e){if("("==e)return p(Ce,S(")"))}function E(e,t){return M(e,t,!1)}function _(e,t){return M(e,t,!0)}function D(e){return"("!=e?f():p(O(")"),E,S(")"),k)}function M(e,t,n){if(Qe.state.fatArrowAt==Qe.stream.start){var r=n?R:F;if("("==e)return p(x,O(")"),K(Ce,")"),k,S("=>"),r,j);if("variable"==e)return f(x,ue,S("=>"),r,j)}var i=n?N:L;return Ze.hasOwnProperty(e)?p(i):"function"==e?p(ye,i):"class"==e||qe&&"interface"==t?(Qe.marked="keyword",p(O("form"),je,k)):"keyword c"==e||"async"==e?p(n?_:E):"("==e?p(O(")"),A,S(")"),k,i):"operator"==e||"spread"==e?p(n?_:E):"["==e?p(O("]"),Ne,k,i):"{"==e?Y(U,"}",null,i):"quasi"==e?f(V,i):"new"==e?p(H(n)):"import"==e?p(E):p()}function A(e){return e.match(/[;\}\)\],]/)?f():f(E)}function L(e,t){return","==e?p(E):N(e,t,!1)}function N(e,t,n){var r=0==n?L:N,i=0==n?E:_;return"=>"==e?p(x,n?R:F,j):"operator"==e?/\+\+|--/.test(t)||qe&&"!"==t?p(r):qe&&"<"==t&&Qe.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?p(O(">"),K(te,">"),k,r):"?"==t?p(E,S(":"),i):p(i):"quasi"==e?f(V,r):";"!=e?"("==e?Y(_,")","call",r):"."==e?p(W,r):"["==e?p(O("]"),A,S("]"),k,r):qe&&"as"==t?(Qe.marked="keyword",p(te,r)):"regexp"==e?(Qe.state.lastType=Qe.marked="operator",Qe.stream.backUp(Qe.stream.pos-Qe.stream.start-1),p(i)):void 0:void 0}function V(e,t){return"quasi"!=e?f():"${"!=t.slice(t.length-2)?p(V):p(E,I)}function I(e){if("}"==e)return Qe.marked="string-2",Qe.state.tokenize=l,p(V)}function F(e){return c(Qe.stream,Qe.state),f("{"==e?T:E)}function R(e){return c(Qe.stream,Qe.state),f("{"==e?T:_)}function H(e){return function(t){return"."==t?p(e?B:z):"variable"==t&&qe?p(se,e?N:L):f(e?_:E)}}function z(e,t){if("target"==t)return Qe.marked="keyword",p(L)}function B(e,t){if("target"==t)return Qe.marked="keyword",p(N)}function $(e){return":"==e?p(k,T):f(L,S(";"),k)}function W(e){if("variable"==e)return Qe.marked="property",p()}function U(e,t){if("async"==e)return Qe.marked="property",p(U);if("variable"==e||"keyword"==Qe.style){if(Qe.marked="property","get"==t||"set"==t)return p(q);var n;return qe&&Qe.state.fatArrowAt==Qe.stream.start&&(n=Qe.stream.match(/^\s*:\s*/,!1))&&(Qe.state.fatArrowAt=Qe.stream.pos+n[0].length),p(G)}return"number"==e||"string"==e?(Qe.marked=We?"property":Qe.style+" property",p(G)):"jsonld-keyword"==e?p(G):qe&&b(t)?(Qe.marked="keyword",p(U)):"["==e?p(E,J,S("]"),G):"spread"==e?p(_,G):"*"==t?(Qe.marked="keyword",p(U)):":"==e?f(G):void 0}function q(e){return"variable"!=e?f(G):(Qe.marked="property",p(ye))}function G(e){return":"==e?p(_):"("==e?f(ye):void 0}function K(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var s=Qe.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),p(function(n,r){return n==t||r==t?f():f(e)},r)}return i==t||o==t?p():n&&n.indexOf(";")>-1?f(e):p(S(t))}return function(n,i){return n==t||i==t?p():f(e,r)}}function Y(e,t,n){for(var r=3;r"),te):void 0}function ne(e){if("=>"==e)return p(te)}function re(e,t){return"variable"==e||"keyword"==Qe.style?(Qe.marked="property",p(re)):"?"==t||"number"==e||"string"==e?p(re):":"==e?p(te):"["==e?p(S("variable"),Z,S("]"),re):"("==e?f(we,re):void 0}function ie(e,t){return"variable"==e&&Qe.stream.match(/^\s*[?:]/,!1)||"?"==t?p(ie):":"==e?p(te):"spread"==e?p(ie):f(te)}function oe(e,t){return"<"==t?p(O(">"),K(te,">"),k,oe):"|"==t||"."==e||"&"==t?p(te):"["==e?p(te,S("]"),oe):"extends"==t||"implements"==t?(Qe.marked="keyword",p(te)):"?"==t?p(te,S(":"),te):void 0}function se(e,t){if("<"==t)return p(O(">"),K(te,">"),k,oe)}function ae(){return f(te,le)}function le(e,t){if("="==t)return p(te)}function ce(e,t){return"enum"==t?(Qe.marked="keyword",p(Ve)):f(ue,J,fe,pe)}function ue(e,t){return qe&&b(t)?(Qe.marked="keyword",p(ue)):"variable"==e?(m(t),p()):"spread"==e?p(ue):"["==e?Y(he,"]"):"{"==e?Y(de,"}"):void 0}function de(e,t){return"variable"!=e||Qe.stream.match(/^\s*:/,!1)?("variable"==e&&(Qe.marked="property"),"spread"==e?p(ue):"}"==e?f():"["==e?p(E,S("]"),S(":"),de):p(S(":"),ue,fe)):(m(t),p(fe))}function he(){return f(ue,fe)}function fe(e,t){if("="==t)return p(_)}function pe(e){if(","==e)return p(ce)}function ge(e,t){if("keyword b"==e&&"else"==t)return p(O("form","else"),T,k)}function me(e,t){return"await"==t?p(me):"("==e?p(O(")"),ve,k):void 0}function ve(e){return"var"==e?p(ce,be):"variable"==e?p(be):f(be)}function be(e,t){return")"==e?p():";"==e?p(be):"in"==t||"of"==t?(Qe.marked="keyword",p(E,be)):f(E,be)}function ye(e,t){return"*"==t?(Qe.marked="keyword",p(ye)):"variable"==e?(m(t),p(ye)):"("==e?p(x,O(")"),K(Ce,")"),k,Q,T,j):qe&&"<"==t?p(O(">"),K(ae,">"),k,ye):void 0}function we(e,t){return"*"==t?(Qe.marked="keyword",p(we)):"variable"==e?(m(t),p(we)):"("==e?p(x,O(")"),K(Ce,")"),k,Q,j):qe&&"<"==t?p(O(">"),K(ae,">"),k,we):void 0}function xe(e,t){return"keyword"==e||"variable"==e?(Qe.marked="type",p(xe)):"<"==t?p(O(">"),K(ae,">"),k):void 0}function Ce(e,t){return"@"==t&&p(E,Ce),"spread"==e?p(Ce):qe&&b(t)?(Qe.marked="keyword",p(Ce)):qe&&"this"==e?p(J,fe):f(ue,J,fe)}function je(e,t){return"variable"==e?Oe(e,t):ke(e,t)}function Oe(e,t){if("variable"==e)return m(t),p(ke)}function ke(e,t){return"<"==t?p(O(">"),K(ae,">"),k,ke):"extends"==t||"implements"==t||qe&&","==e?("implements"==t&&(Qe.marked="keyword"),p(qe?te:E,ke)):"{"==e?p(O("}"),Se,k):void 0}function Se(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||qe&&b(t))&&Qe.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Qe.marked="keyword",p(Se)):"variable"==e||"keyword"==Qe.style?(Qe.marked="property",p(qe?Te:ye,Se)):"number"==e||"string"==e?p(qe?Te:ye,Se):"["==e?p(E,J,S("]"),qe?Te:ye,Se):"*"==t?(Qe.marked="keyword",p(Se)):qe&&"("==e?f(we,Se):";"==e||","==e?p(Se):"}"==e?p():"@"==t?p(E,Se):void 0}function Te(e,t){if("?"==t)return p(Te);if(":"==e)return p(te,fe);if("="==t)return p(_);var n=Qe.state.lexical.prev,r=n&&"interface"==n.info;return f(r?we:ye)}function Pe(e,t){return"*"==t?(Qe.marked="keyword",p(Le,S(";"))):"default"==t?(Qe.marked="keyword",p(E,S(";"))):"{"==e?p(K(Ee,"}"),Le,S(";")):f(T)}function Ee(e,t){return"as"==t?(Qe.marked="keyword",p(S("variable"))):"variable"==e?f(_,Ee):void 0}function _e(e){return"string"==e?p():"("==e?f(E):f(De,Me,Le)}function De(e,t){return"{"==e?Y(De,"}"):("variable"==e&&m(t),"*"==t&&(Qe.marked="keyword"),p(Ae))}function Me(e){if(","==e)return p(De,Me)}function Ae(e,t){if("as"==t)return Qe.marked="keyword",p(De)}function Le(e,t){if("from"==t)return Qe.marked="keyword",p(E)}function Ne(e){return"]"==e?p():f(K(_,"]"))}function Ve(){return f(O("form"),ue,S("{"),O("}"),K(Ie,"}"),k,k)}function Ie(){return f(ue,fe)}function Fe(e,t){return"operator"==e.lastType||","==e.lastType||Ye.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function Re(e,t,n){return t.tokenize==o&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}var He,ze,Be=t.indentUnit,$e=n.statementIndent,We=n.jsonld,Ue=n.json||We,qe=n.typescript,Ge=n.wordCharacters||/[\w$\xa1-\uffff]/,Ke=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),s={type:"atom",style:"atom"};return{"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":i,"break":i,"continue":i,"new":e("new"),"delete":r,"void":r,"throw":r,"debugger":e("debugger"),"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":o,"typeof":o,"instanceof":o,"true":s,"false":s,"null":s,undefined:s,NaN:s,Infinity:s,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r,await:r}}(),Ye=/[+\-*&%=<>!?|~^@]/,Xe=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Je="([{}])",Ze={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Qe={state:null,column:null,marked:null,cc:null},et=new w("this",new w("arguments",null));return j.lex=!0,k.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new u((e||0)-Be,0,"block",(!1)),localVars:n.localVars,context:n.localVars&&new y(null,null,(!1)),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=a&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==He?n:(t.lastType="operator"!=He||"++"!=ze&&"--"!=ze?He:"incdec",h(t,n,He,ze,e))},indent:function(t,r){if(t.tokenize==a)return e.Pass;if(t.tokenize!=o)return 0;var i,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==k)l=l.prev;else if(u!=ge)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==L||i==N)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;$e&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,h=s==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+Be:"stat"==d?l.indented+(Fe(t,r)?$e||Be:0):"switch"!=l.info||h||0==n.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:Be):l.indented+(/^(?:case|default)\b/.test(r)?Be:2*Be)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ue?null:"/*",blockCommentEnd:Ue?null:"*/",blockCommentContinue:Ue?null:" * ",lineComment:Ue?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ue?"json":"javascript",jsonldMode:We,jsonMode:Ue,expressionAllowed:Re,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=E&&t!=_||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},"./node_modules/codemirror/mode/xml/xml.js":function(e,t,n){!function(e){e(n("./node_modules/codemirror/lib/codemirror.js"))}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(l("atom","]]>")):null:e.match("--")?n(l("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=l("meta","?>"),"meta"):(S=e.eat("/")?"closeTag":"openTag",t.tokenize=s,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function s(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,S=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return S="equals",null;if("<"==n){t.tokenize=o,t.state=f,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=a(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=s;break}return"string"};return t.isInAttribute=!0,t}function l(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(j.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!j.contextGrabbers.hasOwnProperty(n)||!j.contextGrabbers[n].hasOwnProperty(t))return;d(e)}}function f(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?g:f}function p(e,t,n){return"word"==e?(n.tagName=t.current(),T="tag",b):j.allowMissingTagName&&"endTag"==e?(T="tag bracket",b(e,t,n)):(T="error",p)}function g(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&j.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==r||j.matchClosing===!1?(T="tag",m):(T="tag error",v)}return j.allowMissingTagName&&"endTag"==e?(T="tag bracket",m(e,t,n)):(T="error",v)}function m(e,t,n){return"endTag"!=e?(T="error",m):(d(n),f)}function v(e,t,n){return T="error",m(e,t,n)}function b(e,t,n){if("word"==e)return T="attribute",y;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||j.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new u(n,r,i==n.indented)),f}return T="error",b}function y(e,t,n){return"equals"==e?w:(j.allowMissing||(T="error"),b(e,t,n))}function w(e,t,n){return"string"==e?x:"word"==e&&j.allowUnquoted?(T="string",b):(T="error",b(e,t,n))}function x(e,t,n){return"string"==e?x:b(e,t,n)}var C=r.indentUnit,j={},O=i.htmlMode?t:n;for(var k in O)j[k]=O[k];for(var k in i)j[k]=i[k];var S,T;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:f,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;S=null;var n=t.tokenize(e,t);return(n||S)&&"comment"!=n&&(T=null,t.state=t.state(S||n,e,t),T&&(n="error"==T?n+" error":T)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+C;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=s&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return j.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+C*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/$/,blockCommentStart:"",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=b)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"./node_modules/keymaster/keymaster.js":function(e,t,n){!function(t){function n(e,t){for(var n=e.length;n--;)if(e[n]===t)return n;return-1}function r(e,t){if(e.length!=t.length)return!1;for(var n=0;n0;for(o in C)(!C[o]&&n(r.mods,+o)>-1||C[o]&&n(r.mods,+o)==-1)&&(a=!1);(0!=r.mods.length||C[16]||C[18]||C[17]||C[91])&&!a||r.method(e,r)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function s(e){var t,r=e.keyCode,i=n(T,r);if(i>=0&&T.splice(i,1),93!=r&&224!=r||(r=91),r in C){C[r]=!1;for(t in O)O[t]==r&&(l[t]=!1)}}function a(){for(w in C)C[w]=!1;for(w in O)l[w]=!1}function l(e,t,n){var r,i;r=m(e),void 0===n&&(n=t,t="all");for(var o=0;o1&&(i=v(e),e=[e[e.length-1]]),e=e[0],e=S(e),e in x||(x[e]=[]),x[e].push({shortcut:r[o],scope:t,method:n,key:r[o],mods:i})}function c(e,t){var n,i,o,s,a,l=[];for(n=m(e),s=0;s1&&(l=v(i),e=i[i.length-1]),e=S(e),void 0===t&&(t=p()),!x[e])return;for(o=0;o1)for(var n=1;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/underscore/underscore.js":function(e,t,n){(function(e,n){var r,i;!function(){var o="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},s=o._,a=Array.prototype,l=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,u=a.push,d=a.slice,h=l.toString,f=l.hasOwnProperty,p=Array.isArray,g=Object.keys,m=Object.create,v=function(){},b=function(e){return e instanceof b?e:this instanceof b?void(this._wrapped=e):new b(e)};t.nodeType?o._=b:(!n.nodeType&&n.exports&&(t=n.exports=b),t._=b),b.VERSION="1.9.1";var y,w=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}},x=function(e,t,n){return b.iteratee!==y?b.iteratee(e,t):null==e?b.identity:b.isFunction(e)?w(e,t,n):b.isObject(e)&&!b.isArray(e)?b.matcher(e):b.property(e)};b.iteratee=y=function(e,t){return x(e,t,1/0)};var C=function(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i=0&&t<=T};b.each=b.forEach=function(e,t,n){t=w(t,n);var r,i;if(E(e))for(r=0,i=e.length;r0?0:s-1;for(i||(r=t[o?o[a]:a],a+=e);a>=0&&a=3;return t(e,w(n,i,4),r,o)}};b.reduce=b.foldl=b.inject=_(1),b.reduceRight=b.foldr=_(-1),b.find=b.detect=function(e,t,n){var r=E(e)?b.findIndex:b.findKey,i=r(e,t,n);if(void 0!==i&&i!==-1)return e[i]},b.filter=b.select=function(e,t,n){var r=[];return t=x(t,n),b.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},b.reject=function(e,t,n){return b.filter(e,b.negate(x(t)),n)},b.every=b.all=function(e,t,n){t=x(t,n);for(var r=!E(e)&&b.keys(e),i=(r||e).length,o=0;o=0},b.invoke=C(function(e,t,n){var r,i;return b.isFunction(t)?i=t:b.isArray(t)&&(r=t.slice(0,-1),t=t[t.length-1]),b.map(e,function(e){var o=i;if(!o){if(r&&r.length&&(e=S(e,r)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)})}),b.pluck=function(e,t){return b.map(e,b.property(t))},b.where=function(e,t){return b.filter(e,b.matcher(t))},b.findWhere=function(e,t){return b.find(e,b.matcher(t))},b.max=function(e,t,n){var r,i,o=-(1/0),s=-(1/0);if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=E(e)?e:b.values(e);for(var a=0,l=e.length;ao&&(o=r)}else t=x(t,n),b.each(e,function(e,n,r){i=t(e,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=e,s=i)});return o},b.min=function(e,t,n){var r,i,o=1/0,s=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=E(e)?e:b.values(e);for(var a=0,l=e.length;ar||void 0===n)return 1;if(n0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=t(d.call(r,s,a),b.isNaN),o>=0?o+s:-1;for(o=e>0?s:a-1;o>=0&&ot?(r&&(clearTimeout(r),r=null),a=c,s=e.apply(i,o),r||(i=o=null)):r||n.trailing===!1||(r=setTimeout(l,u)),s};return c.cancel=function(){clearTimeout(r),a=0,r=i=o=null},c},b.debounce=function(e,t,n){var r,i,o=function(t,n){r=null,n&&(i=e.apply(t,n))},s=C(function(s){if(r&&clearTimeout(r),n){var a=!r;r=setTimeout(o,t),a&&(i=e.apply(this,s))}else r=b.delay(o,t,this,s);return i});return s.cancel=function(){clearTimeout(r),r=null},s},b.wrap=function(e,t){return b.partial(t,e)},b.negate=function(e){return function(){return!e.apply(this,arguments)}},b.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},b.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},b.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},b.once=b.partial(b.before,2),b.restArguments=C;var I=!{toString:null}.propertyIsEnumerable("toString"),F=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],R=function(e,t){var n=F.length,r=e.constructor,i=b.isFunction(r)&&r.prototype||l,o="constructor";for(k(e,o)&&!b.contains(t,o)&&t.push(o);n--;)o=F[n],o in e&&e[o]!==i[o]&&!b.contains(t,o)&&t.push(o)};b.keys=function(e){if(!b.isObject(e))return[];if(g)return g(e);var t=[];for(var n in e)k(e,n)&&t.push(n);return I&&R(e,t),t},b.allKeys=function(e){if(!b.isObject(e))return[];var t=[];for(var n in e)t.push(n);return I&&R(e,t),t},b.values=function(e){for(var t=b.keys(e),n=t.length,r=Array(n),i=0;i1&&(r=w(r,t[1])),t=b.allKeys(e)):(r=z,t=A(t,!1,!1),e=Object(e));for(var i=0,o=t.length;i1&&(n=t[1])):(t=b.map(A(t,!1,!1),String),r=function(e,n){return!b.contains(t,n)}),b.pick(e,r,n)}),b.defaults=H(b.allKeys,!0),b.create=function(e,t){var n=j(e);return t&&b.extendOwn(n,t),n},b.clone=function(e){return b.isObject(e)?b.isArray(e)?e.slice():b.extend({},e):e},b.tap=function(e,t){return t(e),e},b.isMatch=function(e,t){var n=b.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),o=0;o":">",'"':""","'":"'","`":"`"},q=b.invert(U),G=function(e){var t=function(t){return e[t]},n="(?:"+b.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};b.escape=G(U),b.unescape=G(q),b.result=function(e,t,n){b.isArray(t)||(t=[t]);var r=t.length;if(!r)return b.isFunction(n)?n.call(e):n;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Y=/(.)^/,X={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},J=/\\|'|\r|\n|\u2028|\u2029/g,Z=function(e){return"\\"+X[e]};b.template=function(e,t,n){!t&&n&&(t=n),t=b.defaults({},t,b.templateSettings);var r=RegExp([(t.escape||Y).source,(t.interpolate||Y).source,(t.evaluate||Y).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(r,function(t,n,r,s,a){return o+=e.slice(i,a).replace(J,Z),i=a+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";var s;try{s=new Function(t.variable||"obj","_",o)}catch(a){throw a.source=o,a}var l=function(e){return s.call(this,e,b)},c=t.variable||"obj";return l.source="function("+c+"){\n"+o+"}",l},b.chain=function(e){var t=b(e);return t._chain=!0,t};var Q=function(e,t){return e._chain?b(t).chain():t};b.mixin=function(e){return b.each(b.functions(e),function(t){var n=b[t]=e[t];b.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),Q(this,n.apply(b,e))}}),b},b.mixin(b),b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];b.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],Q(this,n)}}),b.each(["concat","join","slice"],function(e){var t=a[e];b.prototype[e]=function(){return Q(this,t.apply(this._wrapped,arguments))}}),b.prototype.value=function(){return this._wrapped},b.prototype.valueOf=b.prototype.toJSON=b.prototype.value,b.prototype.toString=function(){return String(this._wrapped)},r=[],i=function(){return b}.apply(t,r),!(void 0!==i&&(n.exports=i))}()}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./src/asset_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={assets:[],noAssets:"",stylePrefix:"am-",upload:0,uploadName:"files",headers:{},params:{},credentials:"include",multiUpload:!0,autoAdd:1,customFetch:"",uploadFile:"",embedAsBase64:1,handleAdd:"",dropzone:0,openAssetsOnDrop:1,dropzoneContent:"",beforeUpload:null,showUrlInput:!0}},"./src/asset_manager/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/asset_manager/config/config.js"),i=n("./src/asset_manager/model/Assets.js"),o=n("./src/asset_manager/view/AssetsView.js"),s=n("./src/asset_manager/view/FileUploader.js");t["default"]=function(){var e,t,n,a={};return{name:"AssetManager",storageKey:"assets",getConfig:function(){return a},init:function(l){var c=this;a=l||{};for(var u in r["default"])u in a||(a[u]=r["default"][u]);var d=a.pStylePrefix,h=a.em;d&&(a.stylePrefix=d+a.stylePrefix),e=new i["default"]([]);var f={collection:new i["default"]([]),globalCollection:e,config:a};return n=new s["default"](f),f.fu=n,t=new o["default"](f),e.listenTo(e,"add",function(e){c.getAllVisible().add(e),h&&h.trigger("asset:add",e)}),e.listenTo(e,"remove",function(e){c.getAllVisible().remove(e),h&&h.trigger("asset:remove",e)}),this},add:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"undefined"==typeof n.at&&(n.at=0),e.add(t,n)},get:function(t){return e.where({src:t})[0]},getAll:function(){return e},getAllVisible:function(){return t.collection},remove:function(e){var t=this.get(e);return this.getAll().remove(t),this},store:function(e){var t={},n=JSON.stringify(this.getAll().toJSON());return t[this.storageKey]=n,!e&&a.stm&&a.stm.store(t),t},load:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.storageKey,n=e[t]||[];if("string"==typeof n)try{n=JSON.parse(e[t])}catch(r){}return n&&n.length&&this.getAll().reset(n),n},getContainer:function(){return t.el},getAssetsEl:function(){return t.el.querySelector("[data-el=assets]")},render:function(e){var n=e||this.getAll().models;return t.rendered||t.render(),t.collection.reset(n),this.getContainer()},addType:function(e,t){this.getAll().addType(e,t)},getType:function(e){return this.getAll().getType(e)},getTypes:function(){return this.getAll().getTypes()},AssetsView:function(){return t},FileUploader:function(){return n},onLoad:function(){this.getAll().reset(a.assets)},postRender:function(e){a.dropzone&&n.initDropzone(e)},setTarget:function(e){t.collection.target=e},onSelect:function(e){t.collection.onSelect=e},onClick:function(e){a.onClick=e},onDblClick:function(e){a.onDblClick=e}}}},"./src/asset_manager/model/Asset.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({idAttribute:"src",defaults:{type:"",src:""},getFilename:function(){return this.get("src").split("/").pop()},getExtension:function(){return this.getFilename().split(".").pop()}})},"./src/asset_manager/model/AssetImage.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t\n
\n ')},getInfo:function(){var e=this.pfx,t=this.model,n=t.get("name"),r=t.get("width"),i=t.get("height"),o=t.get("unitDim"),s=r&&i?"".concat(r,"x").concat(i).concat(o):"";return n=n||t.getFilename(),'\n
').concat(n,'
\n
').concat(s,"
\n ")},init:function(e){var t=this.pfx;this.className+=" ".concat(t,"asset-image")},onClick:function o(){var o=this.config.onClick,e=this.model;this.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),Object(r.isFunction)(o)?o(e):this.updateTarget(this.collection.target)},onDblClick:function s(){var e=this.em,t=this.model,s=this.config.onDblClick;Object(r.isFunction)(s)?s(t):(this.updateTarget(this.collection.target),e&&e.get("Modal").close());var n=this.collection.onSelect;Object(r.isFunction)(n)&&n(t)},onRemove:function(e){e.stopImmediatePropagation(),this.model.collection.remove(this.model)}})},"./src/asset_manager/view/AssetView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js");n.n(o);t["default"]=i.a.View.extend({initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e,this.collection=e.collection;var t=e.config||{};this.config=t,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.em=t.em,this.className=this.pfx+"asset",this.listenTo(this.model,"destroy remove",this.remove),this.model.view=this;var n=this.init&&this.init.bind(this);n&&n(e)},template:function(){var e=this.pfx;return'\n
\n ').concat(this.getPreview(),'\n
\n
\n ').concat(this.getInfo(),'\n
\n
\n ⨯\n
\n ')},updateTarget:function(e){e&&e.set&&(e.set("attributes",Object(o.clone)(e.get("attributes"))),e.set("src",this.model.get("src")))},getPreview:function(){return""},getInfo:function(){return""},render:function(){var e=this.el;return e.innerHTML=this.template(this,this.model),e.className=this.className,this}})},"./src/asset_manager/view/AssetsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),i=n.n(r),o=n("./node_modules/backbone/backbone.js"),s=n.n(o);t["default"]=s.a.View.extend({events:{submit:"handleSubmit"},template:function(e){var t=e.pfx,n=e.ppfx,r=e.em,o=(i()(e,["pfx","ppfx","em"]),"");return this.config.showUrlInput&&(o='\n
\n
\n \n
\n \n
\n
\n ')),'\n
\n
\n ').concat(o,'\n
\n
\n
\n
\n ')},initialize:function(e){this.options=e,this.config=e.config,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.em=this.config.em;var t=this.collection;this.listenTo(t,"reset",this.renderAssets),this.listenTo(t,"add",this.addToAsset),this.listenTo(t,"remove",this.removedAsset),this.listenTo(t,"deselectAll",this.deselectAll)},handleSubmit:function(e){e.preventDefault();var t=this.getAddInput(),n=t&&t.value.trim(),r=this.config.handleAdd;n&&(t.value="",this.getAssetsEl().scrollTop=0,r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0}))},getAssetsEl:function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},getAddInput:function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},removedAsset:function(e){this.collection.length||this.toggleNoAssets()},addToAsset:function(e){1==this.collection.length&&this.toggleNoAssets(1),this.addAsset(e)},addAsset:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t,r=this.collection,i=this.config,o=new e.typeView({model:e,collection:r,config:i}).render().el;if(n)n.appendChild(o);else{var s=this.getAssetsEl();s&&s.insertBefore(o,s.firstChild)}return o},toggleNoAssets:function(e){var t=this.$el.find(".".concat(this.pfx,"assets"));if(e)t.empty();else{var n=this.config.noAssets;n&&t.append(n)}},deselectAll:function(){var e=this.pfx;this.$el.find(".".concat(e,"highlight")).removeClass("".concat(e,"highlight"))},renderAssets:function(){var e=this,t=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(this.collection.length),this.collection.each(function(n){return e.addAsset(n,t)}),n.append(t)},render:function(){var e=this.options.fu.render().el;return this.$el.empty(),this.$el.append(e).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this.rendered=1,this}})},"./src/asset_manager/view/FileUploader.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/utils/fetch.js");t["default"]=o.a.View.extend({template:Object(r.template)('\n
\n
<%= title %>
\n <%= multiUpload ? \'multiple\' : \'\' %>/>\n
\n
\n '),events:{},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e;var t=e.config||{};this.config=t,this.em=this.config.em,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.target=this.options.globalCollection||{},this.uploadId=this.pfx+"uploadFile",this.disabled=void 0!==t.disableUpload?t.disableUpload:!t.upload&&!t.embedAsBase64,this.multiUpload=void 0===t.multiUpload||t.multiUpload,this.events["change #"+this.uploadId]="uploadFile";var n=t.uploadFile;n?this.uploadFile=n.bind(this):!t.upload&&t.embedAsBase64&&(this.uploadFile=this.constructor.embedAsBase64),this.delegateEvents()},onUploadStart:function(){var e=this.config.em;e&&e.trigger("asset:upload:start")},onUploadEnd:function(e){var t=this.$el,n=this.config,r=n.em;r&&r.trigger("asset:upload:end",e);var i=t.find("input");i&&i.val("")},onUploadError:function(e){var t=this.config.em;console.error(e),this.onUploadEnd(e),t&&t.trigger("asset:upload:error",e)},onUploadResponse:function(e,t){var n,r=this.config.em,i=this.config,o=this.target;try{n="string"==typeof e?JSON.parse(e):e}catch(s){n=e}r&&r.trigger("asset:upload:response",n),i.autoAdd&&o&&o.add(n.data,{at:0}),this.onUploadEnd(e),t&&t(n)},uploadFile:function(e,t){var n=this,r=e.dataTransfer?e.dataTransfer.files:e.target.files,i=this.config,o=i.beforeUpload,a=o&&o(r);if(a!==!1){var l=new FormData,c=i.params,u=i.customFetch;for(var d in c)l.append(d,c[d]);if(this.multiUpload)for(var h=0;h').concat(r.dropzoneContent,"")),d(),"draggable"in o&&[o,a].forEach(function(e){e.ondragover=h,e.ondragleave=f,e.ondrop=p})},render:function(){var e=this.$el,t=this.pfx,n=this.em;return e.html(this.template({title:n&&n.t("assetManager.uploadTitle"),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:t})),this.initDrop(),e.attr("class",t+"file-uploader"),this}},{embedAsBase64:function(e,t){var n=this,r=e.dataTransfer?e.dataTransfer.files:e.target.files,i={data:[]};if(!FileReader)return void this.onUploadError(new Error("Unsupported platform, FileReader is not defined"));var o=[],s=/^(.+)\/(.+)$/,a=!0,l=!1,c=void 0;try{for(var u,d=function(){var e=u.value,t=new Promise(function(t,n){var r=new FileReader;r.addEventListener("load",function(i){var o,a=e.name,l=s.exec(e.type);if(o=l?l[1]:e.type,"image"===o){var c={src:r.result,name:a,type:o,height:0,width:0},u=new Image;u.addEventListener("error",function(e){n(e)}),u.addEventListener("load",function(){c.height=u.height,c.width=u.width,t(c)}),u.src=c.src}else t(o?{src:r.result,name:a,type:o}:r.result)}),r.addEventListener("error",function(e){n(e)}),r.addEventListener("abort",function(e){n("Aborted")}),r.readAsDataURL(e)});o.push(t)},h=r[Symbol.iterator]();!(a=(u=h.next()).done);a=!0)d()}catch(f){l=!0,c=f}finally{try{a||null==h["return"]||h["return"]()}finally{if(l)throw c}}Promise.all(o).then(function(e){i.data=e,n.onUploadResponse(i,t)},function(e){n.onUploadError(e)})}})},"./src/block_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={appendTo:"",appendOnClick:0,blocks:[]}},"./src/block_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},s=e||this.getAll().models;return t.external?new d["default"]({collection:new c["default"](s),categories:o},i({},r,{},t)).render().el:(n.rendered||(n.render(),n.rendered=1),n.updateConfig(t),n.collection.reset(s),this.getContainer())}}}},"./src/block_manager/model/Block.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/block_manager/model/Category.js");t["default"]=i.a.Model.extend({defaults:{activate:0,select:0,resetId:0,label:"",media:"",content:"",category:"",attributes:{}},initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},this.get("category"));if(e&&"string"==typeof e){new o["default"]({id:e,label:e})}}})},"./src/block_manager/model/Blocks.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/block_manager/model/Block.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/block_manager/model/Categories.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/block_manager/model/Category.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/block_manager/model/Category.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{id:"",label:"",open:!0,attributes:{}}})},"./src/block_manager/view/BlockView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/utils/mixins.js"));t["default"]=i.a.View.extend({events:{click:"handleClick",mousedown:"startDrag",dragstart:"handleDragStart",drag:"handleDrag",dragend:"handleDragEnd"},initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model;this.em=t.em,this.config=t,this.endDrag=this.endDrag.bind(this),this.ppfx=t.pStylePrefix||"",this.listenTo(n,"destroy remove",this.remove),this.listenTo(n,"change",this.render)},handleClick:function(){var e=this.config,t=this.model,n=this.em;if(e.appendOnClick){var r=e.getSorter(),i=t.get("content"),o=n.getSelected();r.setDropContent(i);var s,a;if(o)if(a=r.validTarget(o.getEl(),i),a.valid)s=o;else{var l=o.parent();a=r.validTarget(l.getEl(),i),a.valid&&(s=l)}if(!s){var c=n.getWrapper();a=r.validTarget(c.getEl(),i),a.valid&&(s=c)}var u=s&&s.append(i)[0];u&&n.setSelected(u,{scroll:1})}},startDrag:function(e){var t=this.config,n=this.em;if(0===e.button&&t.getSorter&&!this.el.draggable){n.refreshCanvas();var r=t.getSorter();r.setDragHelper(this.el,e),r.setDropContent(this.model.get("content")),r.startSort(this.el),Object(s.on)(document,"mouseup",this.endDrag)}},handleDragStart:function(e){var t=this.em,n=this.model,r=n.get("content"),i=Object(o.isObject)(r),s=i?JSON.stringify(r):r;t.set("dragResult"),e.dataTransfer.setData("text",s),t.set("dragContent",r),t.trigger("block:drag:start",n,e)},handleDrag:function(e){this.em.trigger("block:drag",this.model,e)},handleDragEnd:function(){var e=this.em,t=this.model,n=e.get("dragResult");if(n){var r="activeOnRender",i=n.get&&n.get(r);(t.get("activate")||i)&&(n.trigger("active"),n.set(r,0)),t.get("select")&&e.setSelected(n),t.get("resetId")&&n.onAll(function(e){ return e.resetId()})}e.set({dragResult:null,dragContent:null}),e.trigger("block:drag:stop",n,t)},endDrag:function(e){Object(s.off)(document,"mouseup",this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},render:function a(){var e=this.em,t=this.el,n=this.ppfx,r=this.model,i="".concat(n,"block"),o=e&&e.t("blockManager.labels.".concat(r.id))||r.get("label"),a=r.get("render"),l=r.get("media");t.className+=" ".concat(i," ").concat(n,"one-bg ").concat(n,"four-color-h"),t.innerHTML="\n ".concat(l?'
').concat(l,"
"):"",'\n
').concat(o,"
\n "),t.title=t.textContent.trim(),Object(s.hasDnd)(e)&&t.setAttribute("draggable",!0);var c=a&&a({el:t,model:r,className:i,prefix:n});return c&&(t.innerHTML=c),this}})},"./src/block_manager/view/BlocksView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};this.config=i({},this.config,{},e)},getSorter:function(){if(this.em){if(!this.sorter){var e=this.em.get("Utils"),t=this.canvas;this.sorter=new e.Sorter({container:t.getBody(),placer:t.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:t.getFrameEl().contentDocument,direction:"a",wmargin:1,nested:1,em:this.em,canvasRelative:1})}return this.sorter}},onDrag:function(e){this.em.stopDefault(),this.em.trigger("block:drag:start",e)},onMove:function(e){this.em.trigger("block:drag:move",e)},onDrop:function(e){var t=this.em;t.runDefault(),e&&e.get&&(e.get("activeOnRender")&&(e.trigger("active"),e.set("activeOnRender",0)),t.trigger("block:drag:stop",e))},addTo:function(e){this.add(e)},add:function(e,t){var n=this.config,r=t||null,i=new u["default"]({model:e,attributes:e.get("attributes")},n),o=i.render().el,s=e.get("category");if(s&&this.categories&&!n.ignoreCategories){Object(c.isString)(s)?s={id:s,label:s}:Object(c.isObject)(s)&&!s.id&&(s.id=s.label);var a=this.categories.add(s),l=a.get("id"),h=this.renderedCategories[l],f=this.getCategoriesEl();return e.set("category",a),!h&&f&&(h=new d["default"]({model:a},this.config).render(),this.renderedCategories[l]=h,f.appendChild(h.el)),void(h&&h.append(o))}r?r.appendChild(o):this.append(o)},getCategoriesEl:function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl},getBlocksEl:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl},append:function(e){var t=this.getBlocksEl();t&&t.appendChild(e)},render:function(){var e=this,t=this.ppfx,n=document.createDocumentFragment();this.catsEl=null,this.blocksEl=null,this.renderedCategories=[],this.el.innerHTML='\n
\n
\n
\n
\n '),this.collection.each(function(t){return e.add(t,n)}),this.append(n);var r="".concat(this.blockContClass,"s ").concat(t,"one-bg ").concat(t,"two-color");return this.$el.addClass(r),this}})},"./src/block_manager/view/CategoryView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.View.extend({template:Object(r.template)('\n
\n \n <%= label %>\n
\n
\n '),events:{},initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});this.config=e;var t=e.pStylePrefix||"";this.em=e.em,this.pfx=t,this.caretR="fa fa-caret-right",this.caretD="fa fa-caret-down",this.iconClass="".concat(t,"caret-icon"),this.activeClass="".concat(t,"open"),this.className="".concat(t,"block-category"),this.events["click .".concat(t,"title")]="toggle",this.listenTo(this.model,"change:open",this.updateVisibility),this.delegateEvents()},updateVisibility:function(){this.model.get("open")?this.open():this.close()},open:function(){this.el.className="".concat(this.className," ").concat(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=""},close:function(){this.el.className=this.className,this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display="none"},toggle:function(){var e=this.model;e.set("open",!e.get("open"))},getIconEl:function(){return this.iconEl||(this.iconEl=this.el.querySelector("."+this.iconClass)),this.iconEl},getBlocksEl:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector("."+this.pfx+"blocks-c")),this.blocksEl},append:function(e){this.getBlocksEl().appendChild(e)},render:function(){var e=this.em,t=this.el,n=this.$el,r=this.model,i=e.t("blockManager.categories.".concat(r.id))||r.get("label");return t.innerHTML=this.template({pfx:this.pfx,label:i}),t.className=this.className,n.css({order:r.get("order")}),this.updateVisibility(),this}})},"./src/canvas/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"cv-",scripts:[],styles:[],customBadgeLabel:"",autoscrollLimit:50,notTextable:["button","a","input[type=checkbox]","input[type=radio]"]}},"./src/canvas/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};n=i({},h["default"],{},r,{module:this}),this.em=n.em;var o=n.pStylePrefix;o&&(n.stylePrefix=o+n.stylePrefix),e=new f["default"](r),t=new p["default"]({model:e,config:n});var s=n.em.get("DomComponents");return s&&this.setWrapper(s),this.model=e,this.startAutoscroll=this.startAutoscroll.bind(this),this.stopAutoscroll=this.stopAutoscroll.bind(this),this},getConfig:function(){return n},setWrapper:function(t){e.set("wrapper",t)},getElement:function(){return t.el},getFrame:function(){return e.get("frame")},getFrameEl:function(){var e=t,n=e.frame;return n&&n.el},getFramesEl:function(){return t.framesArea},getWindow:function(){return this.getFrameEl().contentWindow},getDocument:function(){var e=this.getFrameEl();return e&&e.contentDocument},getBody:function(){var e=this.getDocument();return e&&e.body},getWrapperEl:function(){var e=this.getBody();return e&&e.querySelector("#wrapper")},_getCompFrame:function(e){return e&&e._getFrame()},_getLocalEl:function(e,t,n){var r=e,i=this._getCompFrame(t);return r=i?i[n]():r},getGlobalToolsEl:function(){return t.toolsGlobEl},getToolsEl:function(e){return this._getLocalEl(t.toolsEl,e,"getToolsEl")},getHighlighter:function(e){return this._getLocalEl(t.hlEl,e,"getHighlighter")},getBadgeEl:function(e){return this._getLocalEl(t.badgeEl,e,"getBadgeEl")},getPlacerEl:function(){return t.placerEl},getGhostEl:function(){return t.ghostEl},getToolbarEl:function(){return t.toolbarEl},getResizerEl:function(){return t.resizerEl},getOffsetViewerEl:function(e){return this._getLocalEl(t.offsetEl,e,"getOffsetViewerEl")},getFixedOffsetViewerEl:function(){return t.fixedOffsetEl},render:function(){return t.render().el},getOffset:function(){var e=this.offset(this.getFrameEl()),t=this.offset(this.getElement());return{top:e.top-t.top,left:e.left-t.left}},offset:function(e){return t.offset(e)},setCustomBadgeLabel:function(e){n.customBadgeLabel=e},getElementPos:function(e,n){return t.getElementPos(e,n)},getElementOffsets:function(e){return t.getElementOffsets(e)},getRect:function(){var e=t.getPosition(),n=e.top,r=e.left;return i({},t.getCanvasOffset(),{topScroll:n,leftScroll:r})},getTargetToElementDim:function(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i||{},s=t.getPosition();if(s){var a=o.elPos||t.getElementPos(r),l=i.toRight||0,c=o.targetHeight||e.offsetHeight,u=o.targetWidth||e.offsetWidth,d=o.event||null,h=a.top-c,f=a.left;f+=l?a.width:0,f=l?f-u:f;var p=fa.top+a.height?a.top+a.height:g;var m={top:g,left:p,elementTop:a.top,elementLeft:a.left,elementWidth:a.width,elementHeight:a.height,targetWidth:e.offsetWidth,targetHeight:e.offsetHeight,canvasTop:s.top,canvasLeft:s.left,canvasWidth:s.width,canvasHeight:s.height};return d&&n.em&&n.em.trigger(d,m),m}},canvasRectOffset:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=function(e){var t=e.defaultView;return t&&t.frameElement},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0,s=n.em.getZoomDecimal(),a=t?"top":"left",l=e.ownerDocument,c=r.offset?i(l):{},u=c.offsetTop,d=void 0===u?0:u,h=c.offsetLeft,f=void 0===h?0:h,p=l.body||{},g=p.scrollTop,m=void 0===g?0:g,v=p.scrollLeft,b=void 0===v?0:v,y=t?m:b,w=t?d:f;return o[a]-(y-w)*s};return{top:o(e,1,t),left:o(e,0,t)}},getTargetToElementFixed:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.pos||this.getElementPos(e),i=n.canvasOff||this.canvasRectOffset(e,r),o=t.offsetHeight||0,s=t.offsetWidth||0,a=r.left+r.width,l=this.getCanvasView(),c=l.getPosition(),u=l.getFrameOffset(e),d=n.event,h=-o,f=r.width-s;f=r.left<-f?-r.left:f,f=a>c.width?f-(a-c.width):f;var p=r.height+o,g=p1&&void 0!==arguments[1]?arguments[1]:{},n=Object(c.getElement)(e),r=n&&Object(c.getViewEl)(n);r&&r.scrollIntoView(t)},startAutoscroll:function(e){var t=e&&e.view||this.em.getCurrentFrame();t&&t.startAutoscroll()},stopAutoscroll:function(e){var t=e&&e.view||this.em.getCurrentFrame();t&&t.stopAutoscroll()},postRender:function(){Object(c.hasDnd)(n.em)&&(this.droppable=new d["default"](n.em))},setZoom:function(t){return e.set("zoom",parseFloat(t)),this},getZoom:function(){return parseFloat(e.get("zoom"))},getZoomDecimal:function(){return this.getZoom()/100},getZoomMultiplier:function(){var e=this.getZoomDecimal();return e?1/e:1},toggleFramesEvents:function(e){var t=this.getFramesEl(),n=t.style;n.pointerEvents=e?"":"none"},getFrameWrapperEl:function(){return t.frame.getWrapper()},getFrames:function(){return e.get("frames").map(function(e){return e})},addFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.get("frames").add(i({},t),i({},n,{em:this.em}))}}}},"./src/canvas/model/Canvas.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/canvas/model/Frame.js"),s=n("./src/canvas/model/Frames.js");t["default"]=i.a.Model.extend({defaults:{frame:"",frames:"",wrapper:"",rulers:!1,zoom:100,x:0,y:0},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.em,n=e.styles,r=void 0===n?[]:n,i=e.scripts,a=void 0===i?[]:i,l=new o["default"]({},e);r.forEach(function(e){return l.addLink(e)}),a.forEach(function(e){return l.addScript(e)}),this.em=t,this.set("frame",l),this.set("frames",new s["default"]([l],e)),this.listenTo(this,"change:zoom",this.onZoomChange),this.listenTo(t,"change:device",this.updateDevice)},updateDevice:function(){var e=this.em,t=e.getDeviceModel(),n=e.getCurrentFrameModel();if(n&&t){var r=t.attributes,i=r.width,o=r.height;n.set({width:i,height:o})}},onZoomChange:function(){var e=this.get("zoom");e<1&&this.set("zoom",1)}})},"./src/canvas/model/Frame.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=this.attributes,r=n.root,i=n.styles,o=n.components;this.set("head",[]),this.em=t.em;var s={em:t.em,config:t.em.get("DomComponents").getConfig(),frame:this};!r&&this.set("root",new d["default"]({type:"wrapper",components:o||[]},s)),(!i||Object(f.isString)(i))&&this.set("styles",new h["default"](i,s))},remove:function(){this.view=0;var e=this.collection;return e&&e.remove(this)},getHead:function(){return l()(this.get("head"))},setHead:function(e){return this.set("head",l()(e))},addHeadItem:function(e){var t=this.getHead();t.push(e),this.setHead(t)},getHeadByAttr:function(e,t,n){var r=this.getHead();return r.filter(function(r){return r.attributes&&r.attributes[e]==t&&(!n||n===r.tag)})[0]},removeHeadByAttr:function(e,t,n){var r=this.getHead(),i=this.getHeadByAttr(e,t,n),o=r.indexOf(i);o>=0&&(r.splice(o,1),this.setHead(r))},addLink:function(e){var t="link";!this.getHeadByAttr("href",e,t)&&this.addHeadItem({tag:t,attributes:{href:e,rel:"stylesheet"}})},removeLink:function(e){this.removeHeadByAttr("href",e,"link")},addScript:function(e){var t="script";!this.getHeadByAttr("src",e,t)&&this.addHeadItem({tag:t,attributes:{src:e}})},removeScript:function(e){this.removeHeadByAttr("src",e,"script")},_emitUpdated:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.em.trigger("frame:updated",i({frame:this},e))}})},"./src/canvas/model/Frames.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/canvas/model/Frame.js");t["default"]=o.a.Collection.extend({model:s["default"],initialize:function(){Object(r.bindAll)(this,"itemLoaded")},itemLoaded:function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger("loaded:all"),this.listenToLoadItems(0))},listenToLoad:function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(1)},listenToLoadItems:function(e){var t=this;this.forEach(function(n){return n[e?"on":"off"]("loaded",t.itemLoaded)})}})},"./src/canvas/view/CanvasView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t\n
\n ')},initialize:function(e){Object(u.bindAll)(this,"clearOff","onKeyPress"),Object(d.on)(window,"scroll resize",this.clearOff);var t=this.model,n=t.get("frames");this.config=e.config||{},this.em=this.config.em||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.className=this.config.stylePrefix+"canvas";var r=this.em,o=this.config;this.frames=new h["default"]({collection:n,config:i({},o,{canvasView:this,renderContent:1})}),this.listenTo(r,"change:canvasOffset",this.clearOff),this.listenTo(r,"component:selected",this.checkSelected),this.listenTo(t,"change:zoom change:x change:y",this.updateFrames),this.listenTo(n,"loaded:all",function(){return r.trigger("loaded")}),this.toggleListeners(1)},checkSelected:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.scroll,r=this.em.get("currentFrame");n&&e.views.forEach(function(e){e._getFrame()!==r&&e.scrollIntoView(n)})},remove:function(){c.a.View.prototype.remove.apply(this,arguments),this.toggleListeners()},preventDefault:function(e){e&&(e.preventDefault(),e._parentEvent&&e._parentEvent.preventDefault())},toggleListeners:function(e){var t=e?"on":"off",n={on:d.on,off:d.off};n[t](document,"keypress",this.onKeyPress)},onKeyPress:function(e){var t=this.em,n=Object(d.getKeyChar)(e);" "===n&&1!==t.getZoomDecimal()&&(this.preventDefault(e),t.get("Editor").runCommand("core:canvas-move"))},onWheel:function(e){if((e.ctrlKey||e.metaKey)&&this.em.getConfig("multiFrames")){this.preventDefault(e);var t=this.model,n=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail)),r=t.get("zoom");t.set("zoom",r+2*n)}},updateFrames:function(e){var t=this.em,n=this.model,r=n.attributes,i=r.x,s=r.y,a=this.getZoom(),l={preserveSelected:1},c=a?1/a:1;this.framesArea.style.transform="scale(".concat(a,") translate(").concat(i*c,"px, ").concat(s*c,"px)"),this.clearOff(),t.stopDefault(l),t.trigger("canvas:update",e),o&&clearTimeout(o),o=setTimeout(function(){return t.runDefault(l)},300)},getZoom:function(){return this.em.getZoomDecimal()},isElInViewport:function(e){var t=Object(d.getElement)(e),n=Object(d.getElRect)(t),r=this.getFrameOffset(t),i=n.top,o=n.left;return i>=0&&o>=0&&i<=r.height&&o<=r.width},offset:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(d.getElRect)(e),r=e.ownerDocument.body,i=t.noScroll;return{top:n.top+(i?0:r.scrollTop),left:n.left+(i?0:r.scrollLeft),width:n.width,height:n.height}},clearOff:function(){this.frmOff=null,this.cvsOff=null},getFrameOffset:function(e){if(!this.frmOff||e){var t=e?e.ownerDocument.defaultView.frameElement:this.frame.el;this.frmOff=this.offset(t)}return this.frmOff},getCanvasOffset:function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},getElementPos:function(e,t){var n=this.getZoom(),r=t||{},i=this.getFrameOffset(e),o=this.getCanvasOffset(),s=this.offset(e,t),a=r.avoidFrameOffset?0:i.top,l=r.avoidFrameOffset?0:i.left,c=s.top*n+a-o.top,u=s.left*n+l-o.left,d=s.height*n,h=s.width*n;return{top:c,left:u,height:d,width:h,zoom:n,rect:s}},getElementOffsets:function(e){var t=this;if(!e||Object(d.isTextNode)(e))return{};var n={},r=window.getComputedStyle(e);return["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft"].forEach(function(e){n[e]=parseFloat(r[e])*t.getZoom()}),n},getPosition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.frame.el.contentDocument;if(t){var n=t.body,r=this.getZoom(),i=this.getFrameOffset(),o=this.getCanvasOffset(),s=e.noScroll;return{top:i.top+(s?0:n.scrollTop)*r-o.top,left:i.left+(s?0:n.scrollLeft)*r-o.left,width:o.width,height:o.height}}},updateScript:function(e){var t=e.model,n=t.getId();e.scriptContainer||(e.scriptContainer=f('
')),this.getJsContainer().appendChild(e.scriptContainer.get(0))),e.el.id=n,e.scriptContainer.html("");var r=document.createElement("script");r.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (function(){\n ").concat(t.getScriptString(),";\n }.bind(item))()\n }, 1);"),setTimeout(function(){return e.scriptContainer.get(0).appendChild(r)},0)},getJsContainer:function(e){var t=this.getFrameView(e);return t&&t.getJsContainer()},getFrameView:function(e){return e&&e._getFrame()||this.em.get("currentFrame")},render:function(){var e=this.el,t=this.$el,n=this.ppfx,r=this.model,i=this.em,o=this.frames,s=i.get("CssComposer"),a=r.get("wrapper");t.html(this.template());var l=t.find("[data-frames]");this.framesArea=l.get(0),this.wrapper=a,a&&"function"==typeof a.render&&r.get("frame").set({wrapper:a,root:a.getWrapper(),styles:s.getAll()});var c=t.find("[data-tools]");this.toolsWrapper=c.get(0),c.append('\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n '));var u=e.querySelector("#".concat(n,"tools"));this.hlEl=e.querySelector(".".concat(n,"highlighter")),this.badgeEl=e.querySelector(".".concat(n,"badge")),this.placerEl=e.querySelector(".".concat(n,"placeholder")),this.ghostEl=e.querySelector(".".concat(n,"ghost")),this.toolbarEl=e.querySelector(".".concat(n,"toolbar")),this.resizerEl=e.querySelector(".".concat(n,"resizer")),this.offsetEl=e.querySelector(".".concat(n,"offset-v")),this.fixedOffsetEl=e.querySelector(".".concat(n,"offset-fixed-v")),this.toolsGlobEl=e.querySelector(".".concat(n,"tools-gl")),this.toolsEl=u,this.el.className=this.className;var d=r.get("frames");return d.listenToLoad(),o.render(),i.setCurrentFrame(d.at(0).view),l.append(o.el),this.frame=d.at(0).view,this}})},"./src/canvas/view/FrameView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;ts&&(a+=i-s),a!==r&&a>0&&a0){var r=n.shift(),s=Object(p.createEl)("script",i({type:"text/javascript"},Object(d.isString)(r)?{src:r}:r));s.onerror=s.onload=o.bind(null,n),t.contentDocument.head.appendChild(s)}else e.renderBody()};t.onload=function(){return r(s()(n.scripts))}},renderBody:function(){var e=this,t=this.config,n=this.model,r=this.ppfx,o=n.get("root"),s=n.get("styles"),a=t.em,l=this.getDoc(),c=this.getHead(),u=this.getBody(),m=(this.getWindow(),a.get("Config")),v=[];t.styles.forEach(function(e){return v.push(Object(d.isString)(e)?{tag:"link",attributes:{href:e,rel:"stylesheet"}}:{tag:"link",attributes:i({rel:"stylesheet"},e)})}),v.length&&Object(p.appendVNodes)(c,v);var b="#ffca6f";Object(p.append)(u,"")),this.root=new f["default"]({model:o,config:i({},o.config,{frameView:this})}).render(),Object(p.append)(u,this.root.el),Object(p.append)(u,new h["default"]({collection:s,config:i({},a.get("CssComposer").getConfig(),{frameView:this})}).render().el), Object(p.append)(u,this.getJsContainer()),Object(g.on)(u,"click",function(e){return e&&"A"==e.target.tagName&&e.preventDefault()}),Object(g.on)(u,"submit",function(e){return e&&e.preventDefault()}),[{event:"keydown keyup keypress","class":"KeyboardEvent"},{event:"wheel","class":"WheelEvent"}].forEach(function(t){return t.event.split(" ").forEach(function(n){l.addEventListener(n,function(n){return e.el.dispatchEvent(Object(p.createCustomEvent)(n,t["class"]))})})}),this._toggleEffects(1),n.trigger("loaded")},_toggleEffects:function(e){var t=e?g.on:g.off,n=this.getWindow();t(n,"".concat(p.motionsEv," resize"),this._emitUpdate)},_emitUpdate:function(){this.model._emitUpdated()}})},"./src/canvas/view/FrameWrapView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(u.bindAll)(this,"onScroll","frameLoaded","updateOffset","remove","startDrag");var n=this.model,r=i({},e.config||t,{frameWrapView:this}),o=r.canvasView,s=r.em;this.cv=o,this.config=r,this.em=s,this.canvas=s&&s.get("Canvas"),this.ppfx=r.pStylePrefix||"",this.frame=new c["default"]({model:n,config:r}),this.classAnim="".concat(this.ppfx,"frame-wrapper--anim"),this.listenTo(n,"loaded",this.frameLoaded),this.listenTo(n,"change:x change:y",this.updatePos),this.listenTo(n,"change:width change:height",this.updateSize),this.updatePos(),this.setupDragger()},setupDragger:function(){var e,t,n,r=this,i=this.canvas,o=this.model,s=function(e){i.toggleFramesEvents(e)};this.dragger=new h["default"]({onStart:function(){var i=o.attributes,a=i.x,l=i.y;n=r.em.getZoomMultiplier(),e=a,t=l,s()},onEnd:function(){return s(1)},setPosition:function(r){o.set({x:e+r.x*n,y:t+r.y*n})}})},startDrag:function(e){e&&this.dragger.start(e)},remove:function(){return l.a.View.prototype.remove.apply(this,arguments),this.frame.remove(),this},updateOffset:Object(u.debounce)(function(){var e=this.em,t=this.$el,n=this.frame;e.runDefault({preserveSelected:1}),t.removeClass(this.classAnim),n.model._emitUpdated()}),updatePos:function(e){var t=this.model,n=this.el,r=t.attributes,i=r.x,o=r.y,s=n.style;this.frame.rect=0,s.left=isNaN(i)?i:"".concat(i,"px"),s.top=isNaN(o)?o:"".concat(o,"px"),e&&this.updateOffset()},updateSize:Object(u.debounce)(function(){this.updateDim()}),updateDim:function(){var e=this.em,t=this.el,n=this.$el,r=this.model,o=this.classAnim,s=r.attributes,a=s.width,l=s.height,c=t.style,h=c.width||"",f=c.height||"",p=a||"",g=l||"",m=h==p&&f==g,v="px";if(this.frame.rect=0,n.addClass(o),c.width=Object(u.isNumber)(p)?"".concat(p).concat(v):p,c.height=Object(u.isNumber)(g)?"".concat(g).concat(v):g,Object(u.isNull)(a)||Object(u.isNull)(l)){var b=i({},a?{}:{width:t.offsetWidth},{},l?{}:{height:t.offsetHeight});r.set(b,{silent:1})}e.stopDefault({preserveSelected:1}),m?this.updateOffset():n.one(d.motionsEv,this.updateOffset)},onScroll:function(){var e=this.frame,t=this.em;t.trigger("frame:scroll",{frame:e,body:e.getBody(),target:e.getWindow()})},frameLoaded:function(){var e=this.frame;e.getWindow().onscroll=this.onScroll,this.updateDim()},render:function(){var e=this.frame,t=this.$el,n=this.ppfx,r=this.cv,i=this.model,o=this.el,s=i.attributes.onRender;e.render(),t.empty().attr({"class":"".concat(n,"frame-wrapper")}).append('\n
\n
\n ').concat(i.get("name")||"",'\n
\n
\n \n
\n
\n
\n
\n
\n ')).append(e.el);var a=Object(d.createEl)("div",{"class":"".concat(n,"tools"),style:"pointer-events:none; opacity: 0"},'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n '));return this.elTools=a,r.toolsWrapper.appendChild(a),s&&s({el:o,elTop:o.querySelector("[data-frame-top]"),elRight:o.querySelector("[data-frame-right]"),elBottom:o.querySelector("[data-frame-bottom]"),elLeft:o.querySelector("[data-frame-left]"),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this}})},"./src/canvas/view/FramesView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/domain_abstract/view/DomainViews.js"),i=n("./src/canvas/view/FrameWrapView.js");t["default"]=r["default"].extend({itemView:i["default"],autoAdd:1,init:function(){this.listenTo(this.collection,"reset",this.render)},onRender:function(){var e=this.config,t=this.$el,n=e.em;n&&t.attr({"class":"".concat(n.getConfig("stylePrefix"),"frames")})}})},"./src/code_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"cm-",inlineCss:!1}},"./src/code_manager/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/code_manager/config/config.js")),o=n("./src/code_manager/model/HtmlGenerator.js"),s=n("./src/code_manager/model/CssGenerator.js"),a=n("./src/code_manager/model/JsonGenerator.js"),l=n("./src/code_manager/model/JsGenerator.js"),c=n("./src/code_manager/model/CodeMirrorEditor.js"),u=n("./src/code_manager/view/EditorView.js");t["default"]=function(){var e={},t={},n={},d={},h={},f="CodeMirror";return{getConfig:function(){return e},config:e,EditorView:u["default"],name:"CodeManager",init:function(t){e=t||{};for(var r in i["default"])r in e||(e[r]=i["default"][r]);var u=e.pStylePrefix;return u&&(e.stylePrefix=u+e.stylePrefix),n.html=new o["default"],n.css=new s["default"],n.json=new a["default"],n.js=new l["default"],h.CodeMirror=new c["default"],this.loadDefaultGenerators().loadDefaultViewers(),this},addGenerator:function(e,n){return t[e]=n,this},getGenerator:function(e){return t[e]||null},getGenerators:function(){return t},addViewer:function(e,t){return d[e]=t,this},getViewer:function(e){return d[e]||null},getViewers:function(){return d},createViewer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(r.isUndefined)(e.type)?f:e.type,n=this.getViewer(t)&&this.getViewer(t).clone(),i=document.createElement("div"),o=document.createElement("textarea");return i.appendChild(o),n.set(e),n.init(o),n.setElement(i),n},updateViewer:function(e,t){e.setContent(t)},getCode:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.em=e.em;var i=this.getGenerator(n);return i?i.build(t,r):""},loadDefaultGenerators:function(){for(var e in n)this.addGenerator(e,n[e]);return this},loadDefaultViewers:function(){for(var e in h)this.addViewer(e,h[e]);return this}}}},"./src/code_manager/model/CodeMirrorEditor.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=this.editor;r&&(r.setValue(e),r.autoFormatRange&&(d.a.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),d.a.commands.goDocStart(r)),!n.noRefresh&&setTimeout(function(){return t.refresh()}))}})},"./src/code_manager/model/CssGenerator.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),Number.MAX_VALUE);t["default"]=i.a.Model.extend({initialize:function(){this.compCls=[],this.ids=[]},buildFromModel:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="",i=this.em,o=i&&i.getConfig("avoidInlineStyle"),s=e.styleToString(),a=e.get("classes"),l=n.wrapperIsBody,c=e.get("wrapper");if(this.ids.push("#".concat(e.getId())),a.each(function(e){return t.compCls.push(e.getFullName())}),!o&&s){var u="#".concat(e.getId());u=l&&c?"body":u,r="".concat(u,"{").concat(s,"}")}var d=e.components();return d.each(function(e){return r+=t.buildFromModel(e,n)}),r},build:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.cssc,i=n.em||"";this.em=i,this.compCls=[],this.ids=[];var s=this.buildFromModel(e,n),a=Object(o.isUndefined)(n.clearStyles)&&i?i.getConfig("clearStyles"):n.clearStyles;if(r){var l=r.getAll(),c={},u=[];l.each(function(e){var r=e.getAtRule();if(r){var i=c[r];return void(i?i.push(e):c[r]=[e])}s+=t.buildFromRule(e,u,n)}),this.sortMediaObject(c).forEach(function(e){var r="",i=e.key,o=e.value;o.forEach(function(e){var o=t.buildFromRule(e,u,n);e.get("singleAtRule")?s+="".concat(i,"{").concat(o,"}"):r+=o}),r&&(s+="".concat(i,"{").concat(r,"}"))}),i&&a&&l.remove(u)}return s},buildFromRule:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o="",s=e.selectorsToString({skipAdd:1}),a=e.get("selectorsAdd"),l=e.get("singleAtRule");if(e.get("selectors").each(function(e){var t=e.getFullName();(r.compCls.indexOf(t)>=0||r.ids.indexOf(t)>=0||i.keepUnusedStyles)&&(n=1)}),s&&n||a||l){var c=e.getDeclaration();c&&(o+=c)}else t.push(e);return o},getQueryLength:function(e){var t=/(-?\d*\.?\d+)\w{0,}/.exec(e);return t?parseFloat(t[1]):s},sortMediaObject:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return Object(o.each)(t,function(e,t){return n.push({key:t,value:e})}),n.sort(function(t,n){var r=[t.key,n.key].every(function(e){return e.indexOf("min-width")!==-1}),i=r?t.key:n.key,o=r?n.key:t.key;return e.getQueryLength(i)-e.getQueryLength(o)})}})},"./src/code_manager/model/HtmlGenerator.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=e.get("components");return t.exportWrapper?e.toHTML(i({},t.wrapperIsBody&&{tag:"body"})):this.buildModels(n)},buildModels:function(e){var t="";return e.each(function(e){t+=e.toHTML()}),t}})},"./src/code_manager/model/JsGenerator.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.Model.extend({mapModel:function(e){var t="",n=e.get("script-export")||e.get("script"),i=e.get("type"),o=e.get("components"),s=e.getId();if(n){var a=e.get("attributes");a=Object(r.extend)({},a,{id:s}),e.set("attributes",a,{silent:1});var l=e.getScriptString(n);if(e.get("scriptUpdated"))this.mapJs[i+"-"+s]={ids:[s],code:l};else{var c=this.mapJs[i];c?c.ids.push(s):this.mapJs[i]={ids:[s],code:l}}}return o.each(function(e){t+=this.mapModel(e)},this),t},build:function(e){this.mapJs={},this.mapModel(e);var t="";for(var n in this.mapJs){var r=this.mapJs[n],i="#"+r.ids.join(", #");t+="\n var items = document.querySelectorAll('".concat(i,"');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){").concat(r.code,"}.bind(items[i]))();\n }")}return t}})},"./src/code_manager/model/JsonGenerator.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.Model.extend({build:function(e){var t=e.toJSON();return this.beforeEach(t),Object(r.each)(t,function(e,n){var r=t[n];if(r instanceof o.a.Model)t[n]=this.build(r);else if(r instanceof o.a.Collection){var i=r;t[n]=[],i.length&&i.each(function(e,r){t[n][r]=this.build(e)},this)}},this),t},beforeEach:function(e){delete e.status}})},"./src/code_manager/view/EditorView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.View.extend({template:Object(r.template)('\n
\n \t
<%= label %>
\n \t
\n
'),initialize:function(e){this.config=e.config||{},this.pfx=this.config.stylePrefix},render:function(){var e=this.model.toJSON();return e.pfx=this.pfx,this.$el.html(this.template(e)),this.$el.attr("class",this.pfx+"editor-c"),this.$el.find("#"+this.pfx+"code").append(this.model.get("input")),this}})},"./src/commands/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"com-",defaults:[],strict:1}},"./src/commands/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};t=i({},d["default"],{},r),e=t.em;var a=t.pStylePrefix;a&&(t.stylePrefix=a+t.stylePrefix);for(var u in t.defaults){var f=t.defaults[u];f.id&&this.add(f.id,f)}return o["tlb-delete"]={run:function(e){return e.runCommand("core:component-delete")}},o["tlb-clone"]={run:function(e){e.runCommand("core:copy"),e.runCommand("core:paste")}},o["tlb-move"]={run:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e.getModel(),o=r&&r.event,a=r.target,l=a||e.getSelected(),u=a?[a]:s()(e.getSelectedAll()),d=o&&"dragstart"==o.type,f={preserveSelected:1},p=["absolute","translate"],g=l.get("dmode")||i.get("dmode"),m=function(){return i.stopDefault(f)},v=Object(c.includes)(p,g);if(u.forEach(function(e){return e.trigger("disable")}),!l||!l.get("draggable"))return i.logWarning("The element is not draggable");d?setTimeout(m,0):m();var b=function(e){i.trigger("".concat(h.eventDrag,":start"),e)},y=function(e){i.trigger(h.eventDrag,e)},w=function(t,n,r){i.runDefault(f),u.forEach(function(e){return e.set("status","selected")}),e.select(u),l.emitUpdate(),i.trigger("".concat(h.eventDrag,":end"),r),(v||r.cancelled)&&i.set("_cmpDrag",1)};if(v)n=e.runCommand("core:component-drag",{guidesInfo:1,mode:g,target:l,onStart:b,onDrag:y,onEnd:w,event:o});else{d&&o.dataTransfer.setDragImage(l.view.el,0,0);var x=e.Commands.get("move-comp");x.onStart=b,x.onDrag=y,x.onEndMoveFromModel=w,x.initSorterFromModels(u)}u.forEach(function(e){return e.set("status","freezed-selected")})}},o["core:undo"]=function(e){return e.UndoManager.undo()},o["core:redo"]=function(e){return e.UndoManager.redo()},l.forEach(function(t){var r=t[2],i=n("./src/commands/view sync recursive ^\\.\\/.*$")("./".concat(t[1]))["default"],s="core:".concat(t[0]);o[s]=i,r&&(o[r]=i,["run","stop"].forEach(function(t){e.on("".concat(t,":").concat(r),function(){for(var n,r=arguments.length,i=new Array(r),o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=this.get(e);if(n){var r=i({},n.constructor.prototype,{},t);this.add(e,r);var o=l.filter(function(t){return"core:".concat(t[0])===e&&t[2]})[0];o&&this.add(o[2],r)}return this},has:function(e){return!!r[e]},getAll:function(){return r},run:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.runCommand(this.get(e),t)},stop:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.stopCommand(this.get(e),t)},isActive:function(e){return this.getActive().hasOwnProperty(e)},getActive:function(){return a},loadDefaultCommands:function(){for(var e in o)this.add(e,o[e]);return this},runCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,s=e.get("Editor");this.isActive(o)&&!i.force&&t.strict||(r=n.callRun(s,i),o&&n.stop&&!n.noStop&&!i.abort&&(a[o]=r))}return r},stopCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,s=e.get("Editor");(this.isActive(o)||i.force||!t.strict)&&(o&&delete a[o],r=n.callStop(s,i))}return r},create:function(e){e.stop||(e.noStop=1);var n=u["default"].extend(e);return new n(t)}}}},"./src/commands/view sync recursive ^\\.\\/.*$":function(e,t,n){function r(e){var t=i(e);return n(t)}function i(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}var o={"./CanvasClear":"./src/commands/view/CanvasClear.js","./CanvasClear.js":"./src/commands/view/CanvasClear.js","./CanvasMove":"./src/commands/view/CanvasMove.js","./CanvasMove.js":"./src/commands/view/CanvasMove.js","./CommandAbstract":"./src/commands/view/CommandAbstract.js","./CommandAbstract.js":"./src/commands/view/CommandAbstract.js","./ComponentDelete":"./src/commands/view/ComponentDelete.js","./ComponentDelete.js":"./src/commands/view/ComponentDelete.js","./ComponentDrag":"./src/commands/view/ComponentDrag.js","./ComponentDrag.js":"./src/commands/view/ComponentDrag.js","./ComponentEnter":"./src/commands/view/ComponentEnter.js","./ComponentEnter.js":"./src/commands/view/ComponentEnter.js","./ComponentExit":"./src/commands/view/ComponentExit.js","./ComponentExit.js":"./src/commands/view/ComponentExit.js","./ComponentNext":"./src/commands/view/ComponentNext.js","./ComponentNext.js":"./src/commands/view/ComponentNext.js","./ComponentPrev":"./src/commands/view/ComponentPrev.js","./ComponentPrev.js":"./src/commands/view/ComponentPrev.js","./ComponentStyleClear":"./src/commands/view/ComponentStyleClear.js","./ComponentStyleClear.js":"./src/commands/view/ComponentStyleClear.js","./CopyComponent":"./src/commands/view/CopyComponent.js","./CopyComponent.js":"./src/commands/view/CopyComponent.js","./DeleteComponent":"./src/commands/view/DeleteComponent.js","./DeleteComponent.js":"./src/commands/view/DeleteComponent.js","./ExportTemplate":"./src/commands/view/ExportTemplate.js","./ExportTemplate.js":"./src/commands/view/ExportTemplate.js","./Fullscreen":"./src/commands/view/Fullscreen.js","./Fullscreen.js":"./src/commands/view/Fullscreen.js","./MoveComponent":"./src/commands/view/MoveComponent.js","./MoveComponent.js":"./src/commands/view/MoveComponent.js","./OpenAssets":"./src/commands/view/OpenAssets.js","./OpenAssets.js":"./src/commands/view/OpenAssets.js","./OpenBlocks":"./src/commands/view/OpenBlocks.js","./OpenBlocks.js":"./src/commands/view/OpenBlocks.js","./OpenLayers":"./src/commands/view/OpenLayers.js","./OpenLayers.js":"./src/commands/view/OpenLayers.js","./OpenStyleManager":"./src/commands/view/OpenStyleManager.js","./OpenStyleManager.js":"./src/commands/view/OpenStyleManager.js","./OpenTraitManager":"./src/commands/view/OpenTraitManager.js","./OpenTraitManager.js":"./src/commands/view/OpenTraitManager.js","./PasteComponent":"./src/commands/view/PasteComponent.js","./PasteComponent.js":"./src/commands/view/PasteComponent.js","./Preview":"./src/commands/view/Preview.js","./Preview.js":"./src/commands/view/Preview.js","./Resize":"./src/commands/view/Resize.js","./Resize.js":"./src/commands/view/Resize.js","./SelectComponent":"./src/commands/view/SelectComponent.js","./SelectComponent.js":"./src/commands/view/SelectComponent.js","./SelectPosition":"./src/commands/view/SelectPosition.js","./SelectPosition.js":"./src/commands/view/SelectPosition.js","./ShowOffset":"./src/commands/view/ShowOffset.js","./ShowOffset.js":"./src/commands/view/ShowOffset.js","./SwitchVisibility":"./src/commands/view/SwitchVisibility.js","./SwitchVisibility.js":"./src/commands/view/SwitchVisibility.js"};r.keys=function(){return Object.keys(o)},r.resolve=i,e.exports=r,r.id="./src/commands/view sync recursive ^\\.\\/.*$"},"./src/commands/view/CanvasClear.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){e.DomComponents.clear(),e.CssComposer.clear()}}},"./src/commands/view/CanvasMove.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/utils/mixins.js")),o=n("./src/utils/Dragger.js");t["default"]={run:function(e){Object(r.bindAll)(this,"onKeyUp","enableDragger","disableDragger"),this.editor=e,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(e){this.toggleMove(),this.disableDragger()},onKeyUp:function(e){" "===Object(i.getKeyChar)(e)&&this.editor.stopCommand(this.id)},enableDragger:function(e){this.toggleDragger(1,e)},disableDragger:function(e){this.toggleDragger(0,e)},toggleDragger:function(e,t){var n=this.canvasModel,r=this.em,i=this.dragger,s=e?"add":"remove";this.getCanvas().classList[s]("".concat(this.ppfx,"is__grabbing")),i||(i=new o["default"]({getPosition:function(){return{x:n.get("x"),y:n.get("y")}},setPosition:function(e){var t=e.x,r=e.y;n.set({x:t,y:r})},onStart:function(e,t){r.trigger("canvas:move:start",t)},onDrag:function(e,t){r.trigger("canvas:move",t)},onEnd:function(e,t){r.trigger("canvas:move:end",t)}}),this.dragger=i),e?i.start(t):i.stop()},toggleMove:function(e){var t=this.ppfx,n=e?"add":"remove",r=e?"on":"off",o={on:i.on,off:i.off},s=this.getCanvas(),a=["".concat(t,"is__grab")];!e&&a.push("".concat(t,"is__grabbing")),a.forEach(function(e){return s.classList[n](e)}),o[r](document,"keyup",this.onKeyUp),o[r](s,"mousedown",this.enableDragger),o[r](document,"mouseup",this.disableDragger)}}},"./src/commands/view/CommandAbstract.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);i.a.$;t["default"]=i.a.View.extend({initialize:function(e){this.config=e||{},this.editorModel=this.em=this.config.em||{},this.pfx=this.config.stylePrefix,this.ppfx=this.config.pStylePrefix,this.hoverClass=this.pfx+"hover",this.badgeClass=this.pfx+"badge",this.plhClass=this.pfx+"placeholder",this.freezClass=this.ppfx+"freezed",this.canvas=this.em.get&&this.em.get("Canvas"),this.em.get&&this.setElement(this.getCanvas()),this.canvas&&(this.$canvas=this.$el,this.canvasTool=this.getCanvasTools()),this.init(this.config)},onFrameScroll:function(e){},getCanvas:function(){return this.canvas.getElement()},getCanvasBody:function(){return this.canvas.getBody()},getCanvasWrapper:function(){return this.canvas.getWrapperEl()},getCanvasTools:function(){return this.canvas.getToolsEl()},offset:function(e){var t=e.getBoundingClientRect();return{top:t.top+e.ownerDocument.body.scrollTop,left:t.left+e.ownerDocument.body.scrollLeft}},init:function(e){},callRun:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id;if(e.trigger("run:".concat(n,":before"),t),t&&t.abort)return void e.trigger("abort:".concat(n),t);var r=t.sender||e,i=this.run(e,r,t);return e.trigger("run:".concat(n),i,t),e.trigger("run",n,i,t),i},callStop:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id,r=t.sender||e;e.trigger("stop:".concat(n,":before"),t);var i=this.stop(e,r,t);return e.trigger("stop:".concat(n),i,t),e.trigger("stop",n,i,t),i},stopCommand:function(){this.em.get("Commands").stop(this.id)},run:function(e,t){},stop:function(e,t){}})},"./src/commands/view/ComponentDelete.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js");n.n(o);t["default"]={run:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=r.component||e.getSelectedAll();return s=Object(o.isArray)(s)?i()(s):[s],e.select(null),s.forEach(function(e){return e&&e.get("removable")?void e.remove():n.em.logWarning("The element is not removable",{component:e})}),s}}},"./src/commands/view/ComponentDrag.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};Object(a.bindAll)(this,"setPosition","onStart","onDrag","onEnd","getPosition","getGuidesStatic","renderGuide","getGuidesTarget");var o=r.target,s=r.event,u=r.mode,d=r.dragger,h=void 0===d?{}:d,f=o.getEl(),p=i({doc:f.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return n.guidesStatic},guidesTarget:function(){return n.guidesTarget}},h);this.setupGuides(),this.opts=r,this.editor=e,this.em=e.getModel(),this.target=o,this.isTran="translate"==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(p):(g=new l["default"](p),this.dragger=g),s&&g.start(s),this.toggleDrag(1),this.em.trigger("".concat(c,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode, target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach(function(e){var t=e.guide;t&&t.parentNode.removeChild(t)}),this.guides=[]},getGuidesContainer:function(){var e=this,t=this.guidesEl;if(!t){var n=this.editor,r=this.em,i=this.opts,o=n.getConfig("stylePrefix"),s=document.createElement("div"),l=document.createElement("div"),c='
\n
\n
');t=document.createElement("div"),t.className="".concat(o,"guides"),s.className="".concat(o,"guide-info ").concat(o,"guide-info__x"),l.className="".concat(o,"guide-info ").concat(o,"guide-info__y"),s.innerHTML=c,l.innerHTML=c,t.appendChild(s),t.appendChild(l),n.Canvas.getGlobalToolsEl().appendChild(t),this.guidesEl=t,this.elGuideInfoX=s,this.elGuideInfoY=l,this.elGuideInfoContentX=s.querySelector(".".concat(o,"guide-info__content")),this.elGuideInfoContentY=l.querySelector(".".concat(o,"guide-info__content")),r.on("canvas:update frame:scroll",Object(a.debounce)(function(){e.updateGuides(),i.debug&&e.guides.forEach(function(t){return e.renderGuide(t)})},200))}return t},getGuidesStatic:function(){var e=this,t=[],n=this.target.getEl(),r=n.parentNode,i=void 0===r?{}:r;return Object(a.each)(i.children,function(r){return t=t.concat(n!==r?e.getElementGuides(r):[])}),t.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(e){var t,n,r=this;(e||this.guides).forEach(function(e){var i=e.origin,o=t===i?n:r.getElementPos(i);t=i,n=o,Object(a.each)(r.getGuidePosUpdate(e,o),function(t,n){return e[n]=t}),e.originRect=o})},getGuidePosUpdate:function(e,t){var n={},r=t.top,i=t.height,o=t.left,s=t.width;switch(e.type){case"t":n.y=r;break;case"b":n.y=r+i;break;case"l":n.x=o;break;case"r":n.x=o+s;break;case"x":n.x=o+s/2;break;case"y":n.y=r+i/2}return n},renderGuide:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.guide||document.createElement("div"),n="px",r=e.active?2:1,i=t.children[0];return t.style="position: absolute; background-color: ".concat(e.active?"green":"red",";"),t.children.length||(i=document.createElement("div"),i.style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",t.appendChild(i)),e.y?(t.style.width="100%",t.style.height="".concat(r).concat(n),t.style.top="".concat(e.y).concat(n),t.style.left=0):(t.style.width="".concat(r).concat(n),t.style.height="100%",t.style.left="".concat(e.x).concat(n),t.style.top="0".concat(n)),!e.guide&&this.guidesContainer.appendChild(t),t},getElementPos:function(e){return this.editor.Canvas.getElementPos(e,{noScroll:1})},getElementGuides:function(e){var t=this,n=this.opts,r=this.getElementPos(e),o=r.top,s=r.height,a=r.left,l=r.width,c=[{type:"t",y:o},{type:"b",y:o+s},{type:"l",x:a},{type:"r",x:a+l},{type:"x",x:a+l/2},{type:"y",y:o+s/2}].map(function(o){return i({},o,{origin:e,originRect:r,guide:n.debug&&t.renderGuide(o)})});return c.forEach(function(e){return t.guides.push(e)}),c},getTranslate:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",n=0;return(e||"").split(" ").forEach(function(e){var r=e.trim(),i="translate".concat(t.toUpperCase(),"(");0===r.indexOf(i)&&(n=parseFloat(r.replace(i,"")))}),n},setTranslate:function(e,t,n){var r="translate".concat(t.toUpperCase(),"("),i="".concat(r).concat(n,")"),o=(e||"").split(" ").map(function(e){var t=e.trim();return 0===t.indexOf(r)&&(e=i),e}).join(" ");return o.indexOf(r)<0&&(o+=" ".concat(i)),o},getPosition:function(){var e=this.target,t=this.isTran,n=e.getStyle(),r=n.left,i=n.top,o=n.transform,s=0,a=0;return t?(s=this.getTranslate(o),a=this.getTranslate(o,"y")):(s=parseFloat(r),a=parseFloat(i)),{x:s,y:a}},setPosition:function(e){var t=e.x,n=e.y,r=e.end,i=e.position,o=e.width,s=e.height,l=this.target,c=this.isTran,u="px",d=r?"":1,h="".concat(t).concat(u),f="".concat(n).concat(u);if(c){var p=l.getStyle().transform||"";return p=this.setTranslate(p,"x",h),p=this.setTranslate(p,"y",f),l.addStyle({transform:p,en:d},{avoidStore:!r})}var g={position:i,width:o,height:s},m={left:h,top:f,en:d};Object(a.keys)(g).forEach(function(e){var t=g[e];t&&(m[e]=t)}),l.addStyle(m,{avoidStore:!r})},_getDragData:function(){var e=this.target;return{target:e,parent:e.parent(),index:e.index()}},onStart:function u(){var e=this.target,t=this.editor,n=this.isTran,r=this.opts,i=r.center,u=r.onStart,o=t.Canvas,s=e.getStyle(),a="absolute";if(u&&u(this._getDragData()),!n&&s.position!==a){var l=o.offset(e.getEl()),c=l.left,d=l.top,h=l.width,f=l.height;if(i){var p=o.getMouseRelativeCanvas(event),g=p.x,m=p.y;c=g,d=m}this.setPosition({x:c,y:d,width:"".concat(h,"px"),height:"".concat(f,"px"),position:a})}},onDrag:function d(){var e=this,t=this.guidesTarget,n=this.opts,d=n.onDrag;this.updateGuides(t),n.debug&&t.forEach(function(t){return e.renderGuide(t)}),n.guidesInfo&&this.renderGuideInfo(t.filter(function(e){return e.active})),d&&d(this._getDragData())},onEnd:function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.editor,o=this.opts,s=this.id,h=o.onEnd;h&&h(e,n,i({event:e},n,{},this._getDragData())),r.stopCommand(s),this.hideGuidesInfo(),this.em.trigger("".concat(c,":end"),this.getEventOpts())},hideGuidesInfo:function(){var e=this;["X","Y"].forEach(function(t){var n=e["elGuideInfo".concat(t)];n&&(n.style.display="none")})},renderGuideInfo:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.guidesStatic;this.hideGuidesInfo(),t.forEach(function(t){var r=t.origin,o=t.x,s=e.getElementPos(r),l=Object(a.isUndefined)(o)?"y":"x",u="y"===l,d=s[u?"left":"top"],h=s.rect[u?"left":"top"],f=u?d+s.width:d+s.height,p=u?h+s.rect.width:h+s.rect.height,g=e["elGuideInfo".concat(l.toUpperCase())],m=e["elGuideInfoContent".concat(l.toUpperCase())],v=g.style,b=n.filter(function(e){return e.type===t.type}).map(function(e){var t=e.originRect,n=t.left,r=t.width,i=t.top,o=t.height,s=u?n:i,a=u?n+r:i+o;return{gap:a0}).sort(function(e,t){return e.gap-t.gap}).map(function(e){return e.guide})[0];if(b){var y=b.originRect,w=y.left,x=y.width,C=y.top,j=y.height,O=y.rect,k=u?w2&&void 0!==arguments[2]?arguments[2]:{};if(e.Canvas.hasFocus()||n.force){var r=[];e.getSelectedAll().forEach(function(e){for(var t=e.parent();t&&!t.get("selectable");)t=t.parent();t&&r.push(t)}),r.length&&e.select(r)}}}},"./src/commands/view/ComponentNext.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){if(e.Canvas.hasFocus()){var t=[];e.getSelectedAll().forEach(function(e){var n=e.collection,r=n.indexOf(e),i=n.at(r+1);t.push(i||e)}),t.length&&e.select(t)}}}},"./src/commands/view/ComponentPrev.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){if(e.Canvas.hasFocus()){var t=[];e.getSelectedAll().forEach(function(e){var n=e.collection,r=n.indexOf(e),i=n.at(r-1);t.push(i&&r-1>=0?i:e)}),t.length&&e.select(t)}}}},"./src/commands/view/ComponentStyleClear.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]={run:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.target,o=e.DomComponents,s=i.get("type"),a=o.getWrapper().find('[data-gjs-type="'.concat(s,'"]')).length,l=[];if(!a){var c=e.CssComposer.getAll(),u=i.get("style-signature");u=Object(r.isArray)(u)?u:[u],c.forEach(function(e){var t=e.selectorsToString();u.forEach(function(n){n&&t.indexOf(n)>=0&&l.push(e)})}),c.remove(l)}return l}}},"./src/commands/view/CopyComponent.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),i=n.n(r);t["default"]={run:function(e){var t=e.getModel(),n=i()(e.getSelectedAll());n.length&&t.set("clipboard",n)}}},"./src/commands/view/DeleteComponent.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/commands/view/SelectComponent.js"),a=o.a.$;t["default"]=Object(r.extend)({},s["default"],{init:function(e){Object(r.bindAll)(this,"startDelete","stopDelete","onDelete"),this.hoverClass=this.pfx+"hover-delete",this.badgeClass=this.pfx+"badge-red"},enable:function(){this.$el.find("*").mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(e){e.stopPropagation();var t=a(e.target);t.data("model").get("removable")&&(t.addClass(this.hoverClass),this.attachBadge(t.get(0)))},stopDelete:function(e){e.stopPropagation();var t=a(e.target);t.removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(e){e.stopPropagation();var t=a(e.target);t.data("model").get("removable")&&(t.data("model").destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(e){this.badge.html("Remove "+e.getName())}})},"./src/commands/view/ExportTemplate.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=i.a.$;t["default"]={run:function(e,t){var n=this;arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t&&t.set&&t.set("active",0);var r=e.getConfig(),i=e.Modal,s=r.stylePrefix;if(this.cm=e.CodeManager||null,!this.$editors){var a=this.buildEditor("htmlmixed","hopscotch","HTML"),l=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=a.el,this.cssEditor=l.el;var c=o('
'));c.append(a.$el).append(l.$el),this.$editors=c}i.open({title:r.textViewCode,content:this.$editors}).getModel().once("change:open",function(){return e.stopCommand(n.id)}),this.htmlEditor.setContent(e.getHtml()),this.cssEditor.setContent(e.getCss())},stop:function(e){var t=e.Modal;t&&t.close()},buildEditor:function(e,t,n){var r=document.createElement("textarea");!this.codeMirror&&(this.codeMirror=this.cm.getViewer("CodeMirror"));var i=this.codeMirror.clone().set({label:n,codeName:e,theme:t,input:r}),o=new this.cm.EditorView({model:i,config:this.cm.getConfig()}).render().$el;return i.init(r),{el:i,$el:o}}}},"./src/commands/view/Fullscreen.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]={isEnabled:function(){var e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement?1:0},enable:function(e){var t="";return e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?(t="webkit",e.webkitRequestFullscreen()):e.mozRequestFullScreen?(t="moz",e.mozRequestFullScreen()):e.msRequestFullscreen?e.msRequestFullscreen():console.warn("Fullscreen not supported"),t},disable:function(){var e=document;this.isEnabled()&&(e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen())},fsChanged:function(e,t){var n=(document,(e||"")+"fullscreenchange");this.isEnabled()||(this.stop(null,this.sender),document.removeEventListener(n,this.fsChanged))},run:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sender=t;var i=n.target,o=Object(r.isElement)(i)?i:document.querySelector(i),s=this.enable(o||e.getContainer());this.fsChanged=this.fsChanged.bind(this,s),document.addEventListener(s+"fullscreenchange",this.fsChanged),e.trigger("change:canvasOffset")},stop:function(e,t){t&&t.set&&t.set("active",!1),this.disable(),e&&e.trigger("change:canvasOffset")}}},"./src/commands/view/MoveComponent.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/utils/mixins.js"),a=n("./src/commands/view/SelectComponent.js"),l=n("./src/commands/view/SelectPosition.js"),c=o.a.$;t["default"]=Object(r.extend)({},l["default"],a["default"],{init:function(e){a["default"].init.apply(this,arguments),Object(r.bindAll)(this,"initSorter","rollback","onEndMove"),this.opt=e,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:{},i=e.Modal,o=e.AssetManager,s=o.getConfig(),a=o.getContainer(),l=r.modalTitle||e.t("assetManager.modalTitle")||"",c=r.types,u=r.accept;if(o.setTarget(r.target),o.onClick(r.onClick),o.onDblClick(r.onDblClick),o.onSelect(r.onSelect),!this.rendered||c){var d=o.getAll().filter(function(e){return 1});c&&c.length&&(d=d.filter(function(e){return c.indexOf(e.get("type"))!==-1})),o.render(d),this.rendered=1}if(u){var h=a.querySelector("input#".concat(s.stylePrefix,"uploadFile"));h&&h.setAttribute("accept",u)}return i.open({title:l,content:a}).getModel().once("change:open",function(){return e.stopCommand(n.id)}),this},stop:function(e){return e.Modal.close(),this}}},"./src/commands/view/OpenBlocks.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e,t){var n=e.BlockManager,r=e.Panels;if(!this.blocks){n.render();var i="views-container",o=document.createElement("div"),s=r.getPanel(i)||r.addPanel({id:i});o.appendChild(n.getContainer()),s.set("appendContent",o).trigger("change:appendContent"),this.blocks=o}this.blocks.style.display="block"},stop:function(){var e=this.blocks;e&&(e.style.display="none")}}},"./src/commands/view/OpenLayers.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);n("./src/navigator/index.js"),i.a.$;t["default"]={run:function(e){var t=e.LayerManager,n=e.Panels;if(!this.layers){var r="views-container",i=document.createElement("div"),o=n.getPanel(r)||n.addPanel({id:r});i.appendChild(t.render()),o.set("appendContent",i).trigger("change:appendContent"),this.layers=i}this.layers.style.display="block"},stop:function(){var e=this.layers;e&&(e.style.display="none")}}},"./src/commands/view/OpenStyleManager.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=(n("./src/style_manager/index.js"),i.a.$);t["default"]={run:function(e,t){if(this.sender=t,!this.$cn){var n=e.getConfig(),r=e.Panels;this.$cn=o("
"),this.$cn2=o("
"),this.$cn.append(this.$cn2);var i=e.DeviceManager;if(i&&n.showDevices){var s=r.addPanel({id:"devices-c"});s.set("appendContent",i.render()).trigger("change:appendContent")}var a=e.SelectorManager;a&&this.$cn2.append(a.render([])),this.$cn2.append(e.StyleManager.render());var l=e.StyleManager.getConfig(),c=l.stylePrefix;this.$header=o('
').concat(e.t("styleManager.empty"),"
")),this.$cn.append(this.$header),r.getPanel("views-container")?this.panel=r.getPanel("views-container"):this.panel=r.addPanel({id:"views-container"}),this.panel.set("appendContent",this.$cn).trigger("change:appendContent"),this.target=e.editor,this.listenTo(this.target,"component:toggled",this.toggleSm)}this.toggleSm()},toggleSm:function(){var e=this.target,t=this.sender;if(!t||!t.get||t.get("active")){var n=e.get("SelectorManager").getConfig(),r=n.componentFirst,i=e.getSelectedAll().length;1===i||i>1&&r?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show())}},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},"./src/commands/view/OpenTraitManager.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=i.a.$;t["default"]={run:function(e,t){this.sender=t;var n,r=e.getModel(),i=e.Config,s=i.stylePrefix,a=e.TraitManager;if(!this.$cn){var l=a.getTraitsViewer(),c=a.getConfig();this.$cn=o("
"),this.$cn2=o("
"),this.$cn.append(this.$cn2),this.$header=o("
").append('
').concat(r.t("traitManager.empty"),"
")),this.$cn.append(this.$header),this.$cn2.append('
').concat(r.t("traitManager.label"),"
")),this.$cn2.append(l.render().el);var u=e.Panels;n=u.getPanel("views-container")?u.getPanel("views-container"):u.addPanel({id:"views-container"}),n.set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=e.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()},toggleTm:function(){var e=this.sender;e&&e.get&&!e.get("active")||(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},"./src/commands/view/PasteComponent.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]={run:function(e){var t=e.getModel(),n=t.get("clipboard"),i=e.getSelected();n&&i&&(e.getSelectedAll().forEach(function(t){if(t){var i,o=t.collection,s=o.indexOf(t)+1,a=n.filter(function(e){return e.get("copyable")});i=Object(r.contains)(n,t)&&t.get("copyable")?o.add(t.clone(),{at:s}):o.add(a.map(function(e){return e.clone()}),{at:s}),i=Object(r.isArray)(i)?i:[i],i.forEach(function(t){return e.trigger("component:paste",t)})}}),i.emitUpdate())}}},"./src/commands/view/Preview.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]={getPanels:function(e){return this.panels||(this.panels=e.Panels.getPanels()),this.panels},tglPointers:function(e,t){var n=e.Canvas.getBody(),i=n.querySelectorAll(".".concat(this.ppfx,"no-pointer"));Object(r.each)(i,function(e){return e.style.pointerEvents=t?"":"all"})},run:function(e,t){var n=this;this.sender=t,e.stopCommand("sw-visibility"),e.getModel().stopDefault();var r=this.getPanels(e),i=e.Canvas.getElement(),o=e.getEl(),s=e.Config.stylePrefix;if(!this.helper){var a=document.createElement("span");a.className="".concat(s,"off-prv fa fa-eye-slash"),o.appendChild(a),a.onclick=function(){return n.stopCommand()},this.helper=a}this.helper.style.display="inline-block",this.tglPointers(e),r.forEach(function(e){return e.set("visible",!1)});var l=i.style;l.width="100%",l.height="100%",l.top="0",l.left="0",l.padding="0",l.margin="0",e.refresh()},stop:function(e){var t=this.sender,n=void 0===t?{}:t;n.set&&n.set("active",0);var r=this.getPanels(e),i=e.Panels.getButton("options","sw-visibility");i&&i.get("active")&&e.runCommand("sw-visibility"),e.getModel().runDefault(),r.forEach(function(e){return e.set("visible",!0)});var o=e.Canvas.getElement();o.setAttribute("style",""),this.helper&&(this.helper.style.display="none"),e.refresh(),this.tglPointers(e,1)}}},"./src/commands/view/Resize.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e,t,n){var r=n||{},i=r.el||"",o=e.Canvas,s=this.canvasResizer,a=r.options||{},l=o.getCanvasView();return a.appendTo=o.getResizerEl(),a.prefix=e.getConfig().stylePrefix,a.posFetcher=l.getElementPos.bind(l),a.mousePosFetcher=o.getMouseRelativePos,s&&!r.forceNew||(this.canvasResizer=e.Utils.Resizer.init(a),s=this.canvasResizer),s.setOptions(a),s.blur(),s.focus(i),s},stop:function(){var e=this.canvasResizer;e&&e.blur()}}},"./src/commands/view/SelectComponent.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0;)o=s.data("model"),s=s.parent();if(o&&!o.get("hoverable")){for(var a=o&&o.parent();a&&!a.get("hoverable");)a=a.parent();o=a}this.currentDoc=t.ownerDocument,this.em.setHovered(o),r&&this.em.set("currentFrame",r)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(e,t){var n=this,r={};t&&t.views.forEach(function(e){var i=e.el,o=n.getElementPos(i);r={el:i,pos:o,component:t,view:Object(f.getViewEl)(i)},n.updateToolsLocal(r),i.ownerDocument===n.currentDoc&&(n.elHovered=r)})},onSelect:Object(h.debounce)(function(){var e=this.em,t=e.getSelected(),n=e.get("currentFrame")||{},r=t&&t.getView(n.model),i=r&&r.el,o={};if(i){var s=this.getElementPos(i);o={el:i,pos:s,component:t,view:Object(f.getViewEl)(i)}}this.elSelected=o,this.updateToolsGlobal(),this.updateToolsLocal(o)}),updateGlobalPos:function(){var e=this.getElSelected();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsGlobal())},updateLocalPos:function(){var e=this.getElHovered();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsLocal())},getElHovered:function(){return this.elHovered||{}},getElSelected:function(){return this.elSelected||{}},onOut:function(){var e=this;this.currentDoc=null,this.em.setHovered(0),this.canvas.getFrames().forEach(function(t){var n=t.view.getToolsEl();e.toggleToolsEl(0,0,{el:n})})},toggleToolsEl:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.el||this.canvas.getToolsEl(t);return r.style.opacity=e?1:0,r},showElementOffset:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o&&this.editor.runCommand("show-offset",{el:e,elPos:t,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(e){this.editor.stopCommand("show-offset",{view:e})},showFixedElementOffset:function(e,t){this.editor.runCommand("show-offset",{el:e,elPos:t,state:"Fixed"})},hideFixedElementOffset:function(e,t){this.editor&&this.editor.stopCommand("show-offset",{state:"Fixed"})},hideHighlighter:function(e){this.canvas.getHighlighter(e).style.opacity=0},onClick:function(e){e.stopPropagation(),e.preventDefault();var t=this.em;if(t.get("_cmpDrag"))return t.set("_cmpDrag");var n=m(e.target),r=n.data("model");if(!r)for(var i=n.parent();!r&&i.length>0;)r=i.data("model"),i=i.parent();if(r)if(r.get("selectable"))this.select(r,e);else{for(var o=r.parent();o&&!o.get("selectable");)o=o.parent();this.select(o,e)}},select:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var n=t.ctrlKey||t.metaKey,r=t.shiftKey,i=this.editor,o=this.em,s=i.getConfig("multipleSelection");if(n&&s)i.selectToggle(e);else if(r&&s){o.clearSelection(i.Canvas.getWindow());var a,l,c=e.collection,u=c.indexOf(e);i.getSelectedAll();if(i.getSelectedAll().forEach(function(e){var t=e.collection,n=t.indexOf(e);t===c&&(nu&&(l=Object(h.isUndefined)(l)?n:Math.min(l,n)))}),!Object(h.isUndefined)(a))for(;a!==u;)i.selectAdd(c.at(a)),a++;if(!Object(h.isUndefined)(l))for(;l!==u;)i.selectAdd(c.at(l)),l--;i.selectAdd(e)}else i.select(e,{scroll:{}});this.initResize(e)}},updateBadge:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=m(e).data("model");if(r&&r.get("badgable")){var i=this.getBadge(n);if(!n.posOnly){var o=this.canvas.getConfig(),s=r.getIcon(),a=o.pStylePrefix||"",l="".concat(a,"badge"),c=o.customBadgeLabel,u="".concat(s?'
').concat(s,"
"):"",'\n
').concat(r.getName(),"
");i.innerHTML=c?c(r):u}var d="px",h=i.style;h.display="block";var f=i?i.offsetHeight:0,p=0-f,g=n.topOff-f<0?-n.topOff:p,v=n.leftOff<0?-n.leftOff:0;h.top=g+d,h.left=v+d}},showHighlighter:function(e){this.canvas.getHighlighter(e).style.opacity=""},initResize:function(e){var t,n=this.em,r=this.canvas,s=n?n.get("Editor"):"",l=n?n.get("Config"):"",c=l.stylePrefix||"",u="".concat(c,"resizing"),d=!Object(h.isElement)(e)&&Object(f.isTaggableNode)(e)?e:n.getSelected(),p=d.get("resizable"),g=Object(h.isElement)(e)?e:d.getEl(),m={},v=function(e,t,n){var r=n.docs;r&&r.forEach(function(t){var n=t.body,r=n.className||"";n.className=("add"==e?"".concat(r," ").concat(u):r.replace(u,"")).trim()})};s&&p?(m={onStart:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=i.el,a=i.config,l=i.resizer,c=a.keyHeight,u=a.keyWidth,h=a.currentUnit,p=a.keepAutoHeight,g=a.keepAutoWidth;v("add",e,i),t=n.get("StyleManager").getModelToStyle(d),r.toggleFramesEvents();var m=getComputedStyle(s),b=t.getStyle(),y=b[u];a.autoWidth=g&&"auto"===y,isNaN(parseFloat(y))&&(y=m[u]);var w=b[c];a.autoHeight=p&&"auto"===w,isNaN(parseFloat(w))&&(w=m[c]),l.startDim.w=parseFloat(y),l.startDim.h=parseFloat(w),o=0,h&&(a.unitHeight=Object(f.getUnitFromValue)(w),a.unitWidth=Object(f.getUnitFromValue)(y))},onMove:function(){s.trigger("component:resize")},onEnd:function(e,t){v("remove",e,t),s.trigger("component:resize"),r.toggleFramesEvents(1),o=1},updateTarget:function(e,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var a=s.store,l=s.selectedHandler,c=s.config,u=c.keyHeight,d=c.keyWidth,h=c.autoHeight,f=c.autoWidth,p=c.unitWidth,g=c.unitHeight,m=["tc","bc"].indexOf(l)>=0,v=["cl","cr"].indexOf(l)>=0,b={},y=a?"":1;if(!m){var w=r.getBody().offsetWidth,x=o.w0&&void 0!==arguments[0]?arguments[0]:{};return this.canvas.getBadgeEl(e.view)},onFrameScroll:function(){this.updateTools()},updateTools:function(){this.updateToolsLocal(),this.updateGlobalPos()},isCompSelected:function(e){return e&&"selected"===e.get("status")},updateToolsLocal:function(e){var t=e||this.getElHovered(),n=t.el,r=t.pos,o=t.view,s=t.component;if(!n)return void(this.lastHovered=0);var a=s.get("hoverable"),l=this.lastHovered!==n,c=l?{}:{posOnly:1};l&&a&&(this.lastHovered=n,this.showHighlighter(o),this.showElementOffset(n,r,{view:o})),this.isCompSelected(s)&&(this.hideHighlighter(o),this.hideElementOffset(o));var u="px",d=this.toggleToolsEl(1,o),h=d.style,f=this.canvas.canvasRectOffset(n,r),p=f.top,g=f.left;this.updateBadge(n,r,i({},c,{ view:o,topOff:p,leftOff:g})),h.top=p+u,h.left=g+u,h.width=r.width+u,h.height=r.height+u},updateToolsGlobal:function(){var e=this.getElSelected(),t=e.el,n=e.pos,r=e.component;if(!t)return this.toggleToolsEl(),void(this.lastSelected=0);var i=this.canvas,o=this.lastSelected!==t;o&&(this.lastSelected=t,this.updateToolbar(r));var s="px",a=this.toggleToolsEl(1),l=a.style,c=i.getTargetToElementFixed(t,i.getToolbarEl(),{pos:n}),u=c.canvasOffsetTop,d=c.canvasOffsetLeft;l.top=u+s,l.left=d+s,l.width=n.width+s,l.height=n.height+s,this.updateToolbarPos({top:c.top,left:c.left})},updateAttached:Object(h.debounce)(function(){this.updateToolsGlobal()}),getElementPos:function(e){return this.canvas.getCanvasView().getElementPos(e)},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(e){e&&e.set({status:"",state:""})},getContentWindow:function(){return this.canvas.getWindow()},run:function(e){this.editor=e&&e.get("Editor"),this.enable()},stop:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.em,i=this.editor;this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.onOut(),this.toggleToolsEl(),i&&i.stopCommand("resize")}}},"./src/commands/view/SelectPosition.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=i.a.$;t["default"]={startSelectPosition:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.isPointed=!1;var i=this.editorModel.get("Utils"),o=e.ownerDocument.body;i&&!this.sorter&&(this.sorter=new i.Sorter({container:o,placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:t,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1,scale:function(){return n.em.getZoomDecimal()}})),r.onStart&&(this.sorter.onStart=r.onStart),e&&this.sorter.startSort(e,{container:o})},getOffsetDim:function(){var e=this.offset(this.canvas.getFrameEl()),t=this.offset(this.canvas.getElement()),n=e.top-t.top,r=e.left-t.left;return{top:n,left:r}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex="after"==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&(this.sorter.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&"after"==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?o(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?o(this.cDim[this.posIndex][5]).parent():o(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},enable:function(){this.startSelectPosition()},nearFloat:function(e,t,n){var r=e||0,i=t||"before",o=n.length,s=0!==o&&"after"==i&&r==o;return 0!==o&&(!s&&!n[r][4]||n[r-1]&&!n[r-1][4]||s&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},"./src/commands/view/ShowOffset.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t')).get(0),D=d('
')).get(0),M=g+P+"-el",A=g+E+"-el",L="".concat(M," ").concat(g+P),N="".concat(A," ").concat(g+E);y=d('
')).get(0),w=d('
')).get(0),x=d('
')).get(0),C=d('
')).get(0),j=d('
')).get(0),O=d('
')).get(0),k=d('
')).get(0),S=d('
')).get(0),this["marginT"+o]=y,this["marginB"+o]=w,this["marginL"+o]=x,this["marginR"+o]=C,this["padT"+o]=j,this["padB"+o]=O,this["padL"+o]=k,this["padR"+o]=S,_.appendChild(y),_.appendChild(w),_.appendChild(x),_.appendChild(C),D.appendChild(j),D.appendChild(O),D.appendChild(k),D.appendChild(S),b.appendChild(_),b.appendChild(D),this[m]="1"}var V="px",I=parseFloat(p.marginLeft.replace(V,""))*a,F=parseFloat(p.marginRight.replace(V,""))*a,R=parseFloat(p.marginTop.replace(V,""))*a,H=parseFloat(p.marginBottom.replace(V,""))*a,z=y.style,B=w.style,$=x.style,W=C.style,U=j.style,q=O.style,G=k.style,K=S.style,Y=parseFloat(f.left),X=parseFloat(p.width)*a+V;z.height=R+V,z.width=X,z.top=f.top-R+V,z.left=Y+V,B.height=H+V,B.width=X,B.top=f.top+f.height+V,B.left=Y+V;var J=f.height+R+H+V,Z=f.top-R+V;$.height=J,$.width=I+V,$.top=Z,$.left=Y-I+V,W.height=J,W.width=F+V,W.top=Z,W.left=Y+f.width+V;var Q=parseFloat(p.paddingTop)*a;U.height=Q+V;var ee=parseFloat(p.paddingBottom)*a;q.height=ee+V;var te=f.height-ee-Q+V,ne=f.top+Q+V;G.height=te,G.width=parseFloat(p.paddingLeft)*a+V,G.top=ne;var re=parseFloat(p.paddingRight)*a;K.height=te,K.width=re+V,K.top=ne},stop:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n||{},i=r.state||"",o=this.getOffsetMethod(i),s=e.Canvas,a=s[o](n.view);a.style.opacity=0}}},"./src/commands/view/SwitchVisibility.js":function(e,t,n){"use strict";n.r(t),t["default"]={run:function(e){this.toggleVis(e)},stop:function(e){this.toggleVis(e,0)},toggleVis:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=n?"add":"remove";e.Canvas.getFrames().forEach(function(e){e.view.getBody().classList[r]("".concat(t.ppfx,"dashed"))})}}},"./src/css_composer/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"css-",staticRules:"",rules:[]}},"./src/css_composer/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r="change:style",i=e.get("UndoManager");i&&i.add(t);var o=e.handleUpdates.bind(e);e.stopListening(t,r,o),e.listenTo(t,r,o),!n.avoidStore&&o("","",n)},load:function(e){var n=e||"";!n&&r.stm&&(n=r.em.getCacheLoad());var i=n.styles||"";if(n.styles)try{i=JSON.parse(n.styles)}catch(o){}else n.css&&(i=r.em.get("Parser").parseCss(n.css));return Object(a.isArray)(i)?i.length&&t.reset(i):i&&t.reset(i),i},store:function(e){if(r.stm){var n={},i=this.storageKey();return i.indexOf("css")>=0&&(n.css=r.em.getCss()),i.indexOf("styles")>=0&&(n.styles=JSON.stringify(t)),e||r.stm.store(n),n}},add:function(e,n,o){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=n||"",l=o||"",u=i({},s),d=this.get(e,a,l,u);return d&&d.config&&!d.config.singleAtRule?d:(u.state=a,u.mediaText=l,u.selectors="",d=new c["default"](u,r),d.get("selectors").add(e),t.add(d),d)},get:function(e,n,r,i){var o=null;return t.each(function(t){o||t.compare(e,n,r,i)&&(o=t)}),o},getAll:function(){return t},clear:function(){return this.getAll().reset(),this},addCollection:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],o=e instanceof Array?e:[e],s=0,a=o.length;s2&&void 0!==arguments[2]?arguments[2]:{},i=r.atRuleType,o=r.atRuleParams,s=e.get("Parser").parserCss.checkNode({selectors:t,style:n})[0],a=s.state,l=s.selectorsAdd,c=e.get("SelectorManager"),u=c.add(s.selectors),d=this.add(u,a,o,{selectorsAdd:l,atRule:i});return d.setStyle(n,r),d},getRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.get("SelectorManager"),i=e.get("Parser").parserCss.checkNode({selectors:t})[0],o=r.get(i.selectors),s=i.state,a=i.selectorsAdd,l=n.atRuleType,c=n.atRuleParams;return o&&this.get(o,s,c,{selectorsAdd:a,atRule:l})},setIdRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.state||"",o=r.mediaText||e.getCurrentMedia(),s=e.get("SelectorManager"),a=s.add({name:t,type:f["default"].TYPE_ID}),l=this.add(a,i,o);return l.setStyle(n,r),l},getIdRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.state||"",i=n.mediaText||e.getCurrentMedia(),o=e.get("SelectorManager").get(t,f["default"].TYPE_ID);return o&&this.get(o,r,i)},setClassRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.state||"",o=r.mediaText||e.getCurrentMedia(),s=e.get("SelectorManager"),a=s.add({name:t,type:f["default"].TYPE_CLASS}),l=this.add(a,i,o);return l.setStyle(n,r),l},getClassRule:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.state||"",i=n.mediaText||e.getCurrentMedia(),o=e.get("SelectorManager").get(t,f["default"].TYPE_CLASS);return o&&this.get(o,r,i)},render:function(){return n.render().el}}}},"./src/css_composer/model/CssRule.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/domain_abstract/model/Styleable.js"),a=n("./src/selector_manager/model/Selectors.js"),l=window,c=l.CSS;t["default"]=o.a.Model.extend(s["default"]).extend({defaults:{selectors:{},selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:0,important:0},initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=e||{};var n=t.em,r=this.config.selectors||[];if(this.em=n,n){var i=n.get("SelectorManager"),o=[];r.forEach(function(e){o.push(i.add(e))}),r=o}this.set("selectors",new a["default"](r))},getAtRule:function(){var e=this.get("atRuleType"),t=this.get("mediaText"),n=e?"@".concat(e):t?"@media":"";return n+(t&&n?" ".concat(t):"")},selectorsToString:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[],n=this.em,r=this.get("state"),i=this.get("wrapper"),o=this.get("selectorsAdd"),s=i&&n&&n.getConfig("wrapperIsBody"),a={escape:function(e){return c&&c.escape?c.escape(e):e}},l=s?"body":this.get("selectors").getFullString(0,a),u=r&&!e.skipState?":".concat(r):"";return l&&t.push("".concat(l).concat(u)),o&&!e.skipAdd&&t.push(o),t.join(", ")},getDeclaration:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="",n=this.selectorsToString(),r=this.styleToString(e),i=this.get("singleAtRule");return(n||i)&&r&&(t=i?r:"".concat(n,"{").concat(r,"}")),t},toCSS:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="",n=this.getAtRule(),r=this.getDeclaration(e);return r&&(t=r),n&&t&&(t="".concat(n,"{").concat(t,"}")),t},toJSON:function(){for(var e=arguments.length,t=new Array(e),n=0;n3&&void 0!==arguments[3]?arguments[3]:{},o=t||"",s=n||"",a=i.selectorsAdd||"",l=i.atRuleType||"";e instanceof Array||e.models||(e=[e]);var c=Object(r.map)(e.models||e,function(e){return e.get("name")}),u=Object(r.map)(this.get("selectors").models,function(e){return e.get("name")}),d=!1;if(c.length!==u.length)return d;for(var h=0;h1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=this.editor.get("Parser").parseCss(e)),t.em=this.editor,i.a.Collection.prototype.add.apply(this,[e,t])}})},"./src/css_composer/view/CssGroupRuleView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/css_composer/view/CssRuleView.js");t["default"]=r["default"].extend({_createElement:function(e){return document.createTextNode("")},render:function(){var e=this.model,t=e.get("important");return this.el.textContent=e.getDeclaration({important:t}),this}})},"./src/css_composer/view/CssRuleView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.View.extend({tagName:"style",initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=e.config||{};var t=this.model,n="change:style change:state change:mediaText";this.listenTo(t,n,this.render),this.listenTo(t,"destroy remove",this.remove),this.listenTo(t.get("selectors"),"change",this.render)},render:function(){var e=this.model,t=e.get("important");return this.el.innerHTML=this.model.toCSS({important:t}),this}})},"./src/css_composer/view/CssRulesView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/css_composer/view/CssRuleView.js"),s=n("./src/css_composer/view/CssGroupRuleView.js"),a=i.a.$,l=function(e,t){return"".concat(e).concat(t?"-".concat(parseFloat(t)):"")};t["default"]=i.a.View.extend({initialize:function(e){var t=e.config||{};this.atRules={},this.config=t,this.em=t.em,this.pfx=t.stylePrefix||"",this.className=this.pfx+"rules";var n=this.collection;this.listenTo(n,"add",this.addTo),this.listenTo(n,"reset",this.render)},addTo:function(e){this.addToCollection(e)},addToCollection:function(e,t){if(this.renderStarted){var n,r,i=t||null,a=this.config,c={model:e,config:a};if("keyframes"===e.get("atRuleType")){var u=e.getAtRule(),d=this.atRules[u];if(!d){var h=document.createElement("style");d=document.createTextNode(""),h.appendChild(document.createTextNode("".concat(u,"{"))),h.appendChild(d),h.appendChild(document.createTextNode("}")),this.atRules[u]=d,n=h}r=new s["default"](c),d.appendData(r.render().el.textContent)}else r=new o["default"](c),n=r.render().el;var f=this.className,p=e.get("mediaText"),g=l(f),m=g;if(p&&(m=l(f,this.getMediaWidth(p))),n){var v,b=i||this.el;try{v=b.querySelector("#".concat(m))}catch(y){}v||(v=b.querySelector("#".concat(g))),v.appendChild(n)}return n}},getMediaWidth:function(e){return e&&e.replace("(".concat(this.em.getConfig("mediaCondition"),": "),"").replace(")","")},render:function(){var e=this;this.renderStarted=1,this.atRules={};var t=this.em,n=this.$el,r=this.className,i=this.collection,o=document.createDocumentFragment();n.empty();var s=t.get("DeviceManager").getAll().pluck("priority");return s.every(function(e){return e})&&s.unshift(0),s.forEach(function(e){return a('
')).appendTo(o)}),i.each(function(t){return e.addToCollection(t,o)}),n.append(o),n.attr("class",r),this}})},"./src/device_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={devices:[]}},"./src/device_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},o=i({},r,{id:t,name:r.name||t,width:n});return e.add(o)},get:function(t){return e.get(t)},getAll:function(){return e},render:function(){return t.render().el}}}},"./src/device_manager/model/Device.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({idAttribute:"name",defaults:{name:"",width:null,height:"",widthMedia:null,priority:null},initialize:function(){var e=this;null===this.get("widthMedia")&&this.set("widthMedia",this.get("width")),null===this.get("width")&&this.set("width",this.get("widthMedia")),!this.get("priority")&&this.set("priority",parseFloat(this.get("widthMedia"))||0);var t=["width","height","widthMedia"];t.forEach(function(t){return e.checkUnit(t)})},checkUnit:function(e){var t=this.get(e)||"",n=(parseFloat(t)||0).toString()===t.toString();n&&this.set(e,"".concat(t,"px"))}})},"./src/device_manager/model/Devices.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/device_manager/model/Device.js");t["default"]=i.a.Collection.extend({model:o["default"],comparator:function(e,t){var n=Number.MAX_VALUE;return(t.get("priority")||n)-(e.get("priority")||n)},getSorted:function(){return this.sort()}})},"./src/device_manager/view/DevicesView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i);t["default"]=o.a.View.extend({template:Object(r.template)('\n
<%= deviceLabel %>
\n
\n \n \n \n
\n
\n
\n
\n '),events:{change:"updateDevice"},initialize:function(e){this.config=e.config||{},this.em=this.config.em,this.ppfx=this.config.pStylePrefix||"",this.events["click ."+this.ppfx+"add-trasp"]=this.startAdd,this.listenTo(this.em,"change:device",this.updateSelect),this.delegateEvents()},startAdd:function(){},updateDevice:function(){var e=this.em;if(e){var t=this.devicesEl,n=t?t.val():"";e.set("device",n)}},updateSelect:function(){var e=this.em,t=this.devicesEl;if(e&&e.getDeviceModel&&t){var n=e.getDeviceModel(),r=n?n.get("name"):"";t.val(r)}},getOptions:function(){var e=this.collection,t=this.em,n="";return e.each(function(e){var r=e.attributes,i=r.name,o=r.id,s=t&&t.t&&t.t("deviceManager.devices.".concat(o))||i;n+='")}),n},render:function(){var e=this.em,t=this.ppfx,n=this.$el,r=this.el;return n.html(this.template({ppfx:t,deviceLabel:e&&e.t&&e.t("deviceManager.device")})),this.devicesEl=n.find(".".concat(t,"devices")),this.devicesEl.append(this.getOptions()),r.className="".concat(t,"devices-c"),this}})},"./src/dom_components/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"comp-",wrapperId:"wrapper",wrapperName:"Body",wrapper:{removable:!1,copyable:!1,draggable:!1,components:[],traits:[],stylable:["background","background-color","background-image","background-repeat","background-attachment","background-position","background-size"]},components:[],draggableComponents:1,storeWrapper:0,processor:0,voidElements:["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]}},"./src/dom_components/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},o=t.components(),s=e.get("UndoManager"),a=e.handleUpdates.bind(e),l=this.handleChanges.bind(this),c=this.handleChangesColl.bind(this),u=this.handleRemoves.bind(this);s&&s.add(t),s&&o&&s.add(o);var d="change:style change:content change:attributes change:src";[[t,d,a],[t,"change:components",c],[o,"add",l],[o,"remove",u],[t.get("classes"),"add remove",a]].forEach(function(t){e.stopListening(t[0],t[1],t[2]),e.listenTo(t[0],t[1],t[2])}),!i.avoidStore&&a("","",i),o.each(function(e){return r.handleChanges(e,n,i)})},handleChangesColl:function(t,n){var r=e.get("UndoManager");if(r&&n instanceof u.a.Collection){var i=this.handleChanges.bind(this),o=this.handleRemoves.bind(this);r.add(n),[[n,"add",i],[n,"remove",o]].forEach(function(t){e.stopListening(t[0],t[1],t[2]),e.listenTo(t[0],t[1],t[2])})}},handleRemoves:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!r.avoidStore&&e.handleUpdates(t,n,r)},load:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.em,n="";!e&&r.stm&&(e=r.em.getCacheLoad());var i=e,o=i.components,s=i.html;if(o)if(Object(d.isObject)(o)||Object(d.isArray)(o))n=o;else try{n=JSON.parse(o)}catch(a){t&&t.logError(a)}else s&&(n=s);var l=n&&n.constructor===Object;return(n&&n.length||l)&&(this.clear(),l?this.getWrapper().set(n):this.getComponents().add(n)),n},store:function(e){if(r.stm){var t={},n=this.storageKey();if(n.indexOf("html")>=0&&(t.html=r.em.getHtml()),n.indexOf("components")>=0){var i=(this.em,r.storeWrapper),o=i?this.getWrapper():this.getComponents();t.components=JSON.stringify(o)}return e||r.stm.store(t),t}},getComponent:function(){return t},getWrapper:function(){return this.getComponent()},getComponents:function(){return this.getWrapper().get("components")},addComponent:function(e){return this.getComponents().add(e)},render:function(){return n.render().el},clear:function(){return this.getComponents().map(function(e){return e}).forEach(function(e){return e.remove()}),this},setComponents:function(e){this.clear().addComponent(e)},addType:function(e,t){var n=this.em,r=t.model,o=void 0===r?{}:r,l=t.view,c=void 0===l?{}:l,u=t.isComponent,h=t.extend,f=t.extendView,p=t.extendFn,g=void 0===p?[]:p,m=t.extendFnView,v=void 0===m?[]:m,b=this.getType(e),y=this.getType(h),w=this.getType(f),x=y?y:b?b:this.getType("default"),C=x.model,j=w?w.view:x.view,O=function(e,t,n){return e.reduce(function(e,r){var i=t[r],o=n.prototype[r];return i&&o&&(e[r]=function(){o.bind(this).apply(void 0,arguments),i.bind(this).apply(void 0,arguments)}),e},{})};"object"===s()(o)&&(t.model=C.extend(i({},o,{},O(g,o,C),{defaults:i({},C.prototype.defaults,{},Object(d.result)(o,"defaults")||{})}),{isComponent:!b||y||u?u||function(){return 0}:C.isComponent})),"object"===s()(c)&&(t.view=j.extend(i({},c,{},O(v,c,j)))),b?(b.model=t.model,b.view=t.view):(t.id=e,a.unshift(t));var k="component:type:".concat(b?"update":"add"); return n&&n.trigger(k,b||t),this},getType:function(e){for(var t=a,n=0;n1&&void 0!==arguments[1]?arguments[1]:{};e&&(e.set({status:"selected"}),["component:selected","component:toggled"].forEach(function(r){return t.em.trigger(r,e,n)}))},selectRemove:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){this.em;e.set({status:"",state:""}),["component:deselected","component:toggled"].forEach(function(r){return t.em.trigger(r,e,n)})}},componentHovered:function(){var e=r.em,t=e.get("componentHovered"),n=e.previous("componentHovered"),i="hovered";n&&n.get("status")==i&&n.set({status:"",state:""}),t&&Object(d.isEmpty)(t.get("status"))&&t.set("status",i)}}}},"./src/dom_components/model/Component.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.em,o=this.parent(),s=o&&o.attributes;if(s&&s.propagate){var a={},l=s.propagate;l.forEach(function(e){return a[e]=o.get(e)}),a.propagate=l,a=i({},a,{},t),this.set(a)}var u=this.get("propagate");u&&this.set("propagate",Object(c.isArray)(u)?u:[u]),n&&n.config&&n.config.voidElements.indexOf(this.get("tagName"))>=0&&this.set("void",!0),n.em=r,this.opt=n,this.em=r,this.frame=n.frame,this.config=n.config||{},this.set("attributes",i({},this.defaults.attributes||{},{},this.get("attributes")||{})),this.ccid=x.createId(this),this.initClasses(),this.initTraits(),this.initComponents(),this.initToolbar(),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.set("status",""),this.views=[],["classes","traits","components"].forEach(function(t){var n="add remove ".concat("components"!==t?"change":"");e.listenTo(e.get(t),n.trim(),function(){for(var n=arguments.length,r=new Array(n),i=0;i2&&void 0!==arguments[2]?arguments[2]:{},o=this.get("attributes"),s=o["class"];s&&this.setClass(s),delete o["class"];var a=o.style;a&&this.setStyle(a),delete o.style;var l=i({},this.previous("attributes")),d=Object(u.shallowDiff)(l,this.get("attributes"));Object(c.keys)(d).forEach(function(e){return n.trigger("change:attributes:".concat(e),n,d[e],r)})},setAttributes:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.set("attributes",i({},e),t),this},addAttributes:function(e){var t=i({},this.getAttributes(),{},e);return this.setAttributes(t),this},getStyle:function(){var e=this.em;if(e&&e.getConfig("avoidInlineStyle")){var t=e.get("state"),n=e.get("CssComposer"),r=n.getIdRule(this.getId(),{state:t});if(this.rule=r,r)return r.getStyle()}return d["default"].getStyle.call(this)},setStyle:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,o=this.opt;if(r&&r.getConfig("avoidInlineStyle")&&!o.temporary){var s=this.get("style")||{};t=Object(c.isString)(t)?this.parseStyle(t):t,t=i({},t,{},s);var a=r.get("state"),l=r.get("CssComposer"),h=this.getStyle();this.rule=l.setIdRule(this.getId(),t,i({},n,{state:a}));var f=Object(u.shallowDiff)(h,t);this.set("style",{},{silent:1}),Object(c.keys)(f).forEach(function(t){return e.trigger("change:style:".concat(t))})}else t=d["default"].setStyle.apply(this,arguments);return t},getAttributes:function(){var e=this.em,t=[],n=i({},this.get("attributes")),r=e&&e.get("SelectorManager"),o=this.getId();if(this.get("classes").forEach(function(e){return t.push(Object(c.isString)(e)?e:e.get("name"))}),t.length&&(n["class"]=t.join(" ")),!Object(c.has)(n,"id")){var s;y(e)?s=r&&r.get(o,r.Selector.TYPE_ID):Object(c.isEmpty)(this.getStyle())||(s=1),s&&(n.id=this.getId())}return n},addClass:function(e){var t=this.em.get("SelectorManager").addClass(e);return this.get("classes").add(t)},setClass:function(e){return this.get("classes").reset(),this.addClass(e)},removeClass:function(e){var t=[];e=Object(c.isArray)(e)?e:[e];var n=this.get("classes"),r=g["default"].TYPE_CLASS;return e.forEach(function(e){var i=e.split(" ");i.forEach(function(e){var i=n.where({name:e,type:r})[0];i&&t.push(n.remove(i))})}),t},getClasses:function(){var e=this.getAttributes(),t=e["class"];return t?t.split(" "):[]},initClasses:function(){var e="change:classes",t=[this,e,this.initClasses],n=this.get("classes")||[],r=Object(c.isString)(n)?n.split(" "):n;this.stopListening.apply(this,t);var i=this.normalizeClasses(r),o=new m["default"]([]);return this.set("classes",o),o.add(i),this.listenTo.apply(this,t),this},initComponents:function(){var e="change:components",t=[this,e,this.initComponents];this.stopListening.apply(this,t);var n=new p["default"](null,this.opt);n.parent=this;var r=this.get("components"),i=!this.opt.avoidChildren;return this.set("components",n),i&&n.add(Object(c.isFunction)(r)?r(this):r),this.listenTo.apply(this,t),this},initTraits:function(e){var t=this.em,n="change:traits",r=[this,n,this.initTraits];this.stopListening.apply(this,r),this.loadTraits();var o=i({},this.get("attributes")),s=this.get("traits");return s.each(function(e){if(!e.get("changeProp")){var t=e.get("name"),n=e.getInitValue();t&&n&&(o[t]=n)}}),s.length&&this.set("attributes",o),this.listenTo.apply(this,r),e&&t&&t.trigger("component:toggled"),this},append:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.components().add(e,t);return Object(c.isArray)(n)?n:[n]},components:function(e){var t=this.get("components");return Object(c.isUndefined)(e)?t:(t.reset(),e&&this.append(e))},parent:function(){var e=this.collection;return e&&e.parent},scriptUpdated:function(){this.set("scriptUpdated",1)},initToolbar:function(){var e=this.em,t=this,n=e&&e.getConfig("stylePrefix")||"";if(!t.get("toolbar")){var r=[];t.collection&&r.push({attributes:{"class":"fa fa-arrow-up"},command:function(e){return e.runCommand("core:component-exit",{force:1})}}),t.get("draggable")&&r.push({attributes:{"class":"fa fa-arrows ".concat(n,"no-touch-actions"),draggable:!0},command:"tlb-move"}),t.get("copyable")&&r.push({attributes:{"class":"fa fa-clone"},command:"tlb-clone"}),t.get("removable")&&r.push({attributes:{"class":"fa fa-trash-o"},command:"tlb-delete"}),t.set("toolbar",r)}},loadTraits:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=e||this.get("traits"),e=Object(c.isFunction)(e)?e(this):e,!(e instanceof v["default"])){var n=new v["default"]([],this.opt);n.setTarget(this),e.length&&(e.forEach(function(e){return e.attributes&&delete e.attributes.value}),n.add(e)),this.set("traits",n,t)}return this},getTrait:function(e){return this.get("traits").filter(function(t){return t.get("id")===e||t.get("name")===e})[0]},updateTrait:function(e,t){var n=this.em,r=this.getTrait(e);return r&&r.set(t),n&&n.trigger("component:toggled"),this},getTraitIndex:function(e){var t=this.getTrait(e);return t?this.get("traits").indexOf(t):t},removeTrait:function(e){var t=this,n=this.em,r=Object(c.isArray)(e)?e:[e],i=r.map(function(e){return t.getTrait(e)}),o=this.get("traits").remove(i);return n&&n.trigger("component:toggled"),o},addTrait:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.get("traits").add(e,t);return n&&n.trigger("component:toggled"),r},normalizeClasses:function(e){var t=[],n=this.em;if(n){var r=n.get("SelectorManager");if(r)return e.forEach(function(e){var n="";n="string"==typeof e?e:e.name;var i=r.add(n);t.push(i)}),t}},clone:function(){var e=this.em,t=this.getStyle(),n=i({},this.attributes),r=i({},this.opt);n.attributes=i({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.get("components").each(function(e,t){n.components[t]=e.clone()}),this.get("traits").each(function(e,t){n.traits[t]=e.clone()}),this.get("classes").each(function(e,t){n.classes[t]=e.get("name")}),n.status="",n.view="",r.collection=null,e&&e.getConfig("avoidInlineStyle")&&!Object(c.isEmpty)(t)&&(n.style=t);var o=new this.constructor(n,r),s="component:clone";return e&&e.trigger(s,o),this.trigger(s,o),o},getName:function(){var e=this.em,t=this.attributes,n=t.type,r=t.tagName,i=this.get("name"),o="div"==r,s=o?"box":r,a=n||s,l=!n&&r&&!o&&r,c="domComponents.names.",d=i&&e&&e.t("".concat(c).concat(i)),h=l&&e&&e.t("".concat(c).concat(l)),f=e&&(e.t("".concat(c).concat(n))||e.t("".concat(c).concat(r)));return this.get("custom-name")||d||i||h||Object(u.capitalize)(l)||f||Object(u.capitalize)(a)},getIcon:function(){var e=this.get("icon");return e?e+" ":""},toHTML:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,n=[],r=e.tag,i=r||t.get("tagName"),o=t.get("void"),s=e.attributes,a=this.getAttrToHTML();delete e.tag,s&&(Object(c.isFunction)(s)?a=s(t,a)||{}:Object(c.isObject)(s)&&(a=s));for(var l in a){var u=a[l],d=Object(c.isString)(u)?u.replace(/"/g,"""):u;Object(c.isUndefined)(d)||(Object(c.isBoolean)(d)?d&&n.push(l):n.push("".concat(l,'="').concat(d,'"')))}var h=n.length?" ".concat(n.join(" ")):"",f="<".concat(i).concat(h).concat(o?"/":"",">").concat(t.get("content"));return t.get("components").each(function(t){return f+=t.toHTML(e)}),!o&&(f+="")),f},getAttrToHTML:function(){var e=this.getAttributes();return delete e.style,e},toJSON:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},this.em),t=this.getId();if(t){var n=x.createId(this);this.setId(n);var r=e&&e.get("CssComposer").getIdRule(t),i=r&&r.get("selectors").at(0);return i&&i.set("name",n),this}},_getStyleRule:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id,n=this.em,r=t||this.getId();return n&&n.get("CssComposer").getIdRule(r)},_getStyleSelector:function(e){var t=this._getStyleRule(e);return t&&t.get("selectors").at(0)},_idUpdated:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.idUpdate){var r=this.ccid,i=this.get("attributes")||{},o=i.id,s=(this.previous("attributes")||{}).id||r,a=x.getList(this);if(a[o])return this.setId(s,{idUpdate:1});delete a[s],a[o]=this,this.ccid=o;var l=this._getStyleSelector({id:s});l&&l.set({name:o,label:o})}}},{isComponent:function(e){return{tagName:e.tagName?e.tagName.toLowerCase():""}},createId:function(e){var t,n=x.getList(e),r=e.get("attributes"),i=r.id;return i?(t=x.getIncrementId(i,n),e.setId(t)):t=x.getNewId(n),n[t]=e,t},getNewId:function(e){for(var t=Object.keys(e).length,n=t.toString().length+2,r=(Math.random()+1.1).toString(36).slice(-n),i="i".concat(r);e[i];)i=x.getNewId(e);return i},getIncrementId:function(e,t){for(var n=1,r=e;t[r];)n++,r="".concat(e,"-").concat(n);return r},getList:function(e){var t=e.opt&&e.opt.domc;return t?t.componentsById:{}},checkId:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object(c.isArray)(e)?e:[e];r.forEach(function(e){var r=e.attributes,i=void 0===r?{}:r,o=e.components,s=i.id;if(s&&n[s]){var a=x.getIncrementId(s,n);i.id=a,Object(c.isArray)(t)&&t.forEach(function(e){var t=e.selectors;t.forEach(function(e,n){e==="#".concat(s)&&(t[n]="#".concat(a))})})}o&&x.checkId(o,t,n)})}});t["default"]=x},"./src/dom_components/model/ComponentComment.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t")}},{isComponent:function(e){if(8==e.nodeType)return{tagName:"NULL",type:"comment",content:e.textContent}}})},"./src/dom_components/model/ComponentImage.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t\n \n '),fallback:"\n \n '),file:""}),initialize:function(e,t){l["default"].prototype.initialize.apply(this,arguments);var n=this.get("attributes");n.src&&this.set("src",n.src)},initToolbar:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this.get(e.fallback?"fallback":"src")||"",n=t;return t&&"/g,">").replace(/"/g,""").replace(/'/g,"'")}},{isComponent:function(e){var t="";return 3===e.nodeType&&(t={type:"textnode",content:e.textContent}),t}})},"./src/dom_components/model/ComponentVideo.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};this.opt=t,this.listenTo(this,"add",this.onAdd),this.config=t.config,this.em=t.em;var n=this.em;this.model=function(e,r){var i,o=t.em.get("DomComponents").componentTypes;r.em=t.em,r.config=t.config,r.componentTypes=o,r.domc=t.domc;for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,s=this.opt.domc,a=r.get("CssComposer"),l=r.get("Parser").parseHtml(e);return o||(o=n("./src/dom_components/model/Component.js")["default"]),o.checkId(l.html,l.css,s.componentsById),l.css&&a&&!t.temporary&&a.addCollection(l.css,i({},t,{extend:1})),l.html},add:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(h.isString)(e)?e=this.parseString(e,n):Object(h.isArray)(e)&&e.forEach(function(r,i){Object(h.isString)(r)&&(e[i]=t.parseString(r,n))});var r=Object(h.isArray)(e);return e=(r?e:[e]).filter(function(e){return e}).map(function(e){return t.processDef(e)}),e=r?e:e[0],d.a.Collection.prototype.add.apply(this,[e,n])},processDef:function(e){if(e.cid&&e.ccid)return e;var t=this.em,n=this.config,r=void 0===n?{}:n,o=r.processor,s=e;if(o){s=i({},s);var l=o(s);l&&(Object(h.each)(s,function(e,t){return delete s[t]}),Object(h.extend)(s,l))}if(s.$$typeof&&"object"==a()(s.props)){s=i({},s),s.props=i({},s.props);var c=t.get("DomComponents"),u=t.get("Parser"),d=u.parserHtml;Object(h.each)(s,function(e,t){Object(h.includes)(["props","type"],t)||delete s[t]});var f=s,p=f.props,g=p.children;delete p.children,delete s.props;var m=d.splitPropsFromAttr(p);s.attributes=m.attrs,g&&(s.components=g),s.type?c.getType(s.type)||(s.tagName=s.type,delete s.type):s.type="textnode",Object(h.extend)(s,m.props)}return s},onAdd:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.em,i=e.getStyle(),o=r&&r.getConfig("avoidInlineStyle");if(!Object(h.isEmpty)(i)&&!o&&r&&r.get&&r.getConfig("forceClass")&&!n.temporary){var s=e.cid;r.get("CssComposer").setClassRule(s,i);e.setStyle({}),e.addClass(s)}}})},"./src/dom_components/model/Toolbar.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/dom_components/model/ToolbarButton.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/dom_components/model/ToolbarButton.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{command:"",attributes:{}}})},"./src/dom_components/view/ComponentCommentView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentTextNodeView.js");t["default"]=r["default"].extend({_createElement:function(){return document.createComment(this.model.get("content"))}})},"./src/dom_components/view/ComponentImageView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/dom_components/view/ComponentView.js"));t["default"]=i["default"].extend({tagName:"img",events:{dblclick:"onActive",click:"initResize",error:"onError",dragstart:"noDrag"},initialize:function(e){var t=this.model;i["default"].prototype.initialize.apply(this,arguments),this.listenTo(t,"change:src",this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image");var n=this.config;n.modal&&(this.modal=n.modal),n.am&&(this.am=n.am),this.fetchFile()},fetchFile:function(){if(!this.modelOpt.temporary){var e=this.model,t=e.get("file");if(t){var n=this.em.get("AssetManager").FileUploader();n.uploadFile({dataTransfer:{files:[t]}},function(t){var n=t&&t.data&&t.data[0],i=n&&(Object(r.isString)(n)?n:n.src);i&&e.set({src:i})}),e.set("file","")}}},updateSrc:function(){var e=this.model,t=this.classEmpty,n=this.$el,r=e.getSrcResult(),i=r&&!e.isDefaultSrc();e.addAttributes({src:r}),n[i?"removeClass":"addClass"](t)},onActive:function(e){e&&e.stopPropagation();var t=this.opts.config.em,n=t?t.get("Editor"):"";n&&this.model.get("editable")&&n.runCommand("open-assets",{target:this.model,types:["image"],accept:"image/*",onSelect:function(){n.Modal.close(),n.AssetManager.setTarget(null)}})},onError:function(){var e=this.model.getSrcResult({fallback:1});e&&(this.el.src=e)},noDrag:function(e){return e.preventDefault(),!1},render:function(){this.renderAttributes(),this.updateSrc();var e=this.$el,t=this.model,n=e.attr("class")||"";return!t.get("src")&&e.attr("class","".concat(n," ").concat(this.classEmpty).trim()),this.postRender(),this}})},"./src/dom_components/view/ComponentLabelView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentLinkView.js");t["default"]=r["default"].extend({tagName:"span"})},"./src/dom_components/view/ComponentLinkView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentTextView.js");t["default"]=r["default"].extend({render:function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:{};!n.fromDisable&&this.disableEditing()},onActive:function(e){if(!this.rteEnabled&&this.model.get("editable")){e&&e.stopPropagation&&e.stopPropagation();var t=this.rte,n=this.em;if(t)try{this.activeRte=t.enable(this,this.activeRte)}catch(r){n.logError(r)}this.toggleEvents(1)}},onDisable:function(){this.disableEditing()},disableEditing:function(){var e=this.model,t=this.rte,n=this.activeRte,r=this.em,i=e.get("editable");if(t&&i){try{t.disable(this,n)}catch(o){r.logError(o)}this.syncContent()}this.toggleEvents()},getContent:function(){var e=this.rte,t=e||{},n=t.activeRte,r="";return r=n&&"function"==typeof n.getContent?n.getContent():this.getChildrenContainer().innerHTML},syncContent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.model,n=this.rte,r=this.rteEnabled;if(r||e.force){var o=this.getContent(),s=t.components(),a=i({fromDisable:1},e);if(s.length&&s.reset(null,e),t.set("content","",a),n.customRte)t.set("content",o,a);else{var l=function c(t){var n=!!t.get("textable"),r=!["text","default",""].some(function(e){return t.is(e)})||n;t.set(i({_innertext:!r,editable:r&&t.get("editable"),selectable:r,hoverable:r,removable:n,draggable:n,highlightable:0,copyable:n},!n&&{toolbar:""}),e),t.get("components").each(function(e){return c(e)})};!e.silent&&t.trigger("change:content",t,"",a),s.add(o,e),s.each(function(e){return l(e)}),s.trigger("resetNavigator")}}},onInput:function(){var e=this.em;e&&e.trigger("component:update",this.model)},disablePropagation:function(e){e.stopPropagation()},toggleEvents:function(e){var t=this.em,n={on:a.on,off:a.off},r=e?"on":"off";t.setEditing(e),this.rteEnabled=!!e;var i=[this.el.ownerDocument,document];if(n.off(i,"mousedown",this.disableEditing),n[r](i,"mousedown",this.disableEditing),t[r]("toolbar:run:before",this.disableEditing),this.$el.off("mousedown",this.disablePropagation),this.$el[r]("mousedown",this.disablePropagation),this.config.draggableComponents)for(var o=this.el;o;)o.draggable=!e,o=o.parentNode,o&&"BODY"==o.tagName&&(o=0)}})},"./src/dom_components/view/ComponentVideoView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/dom_components/view/ComponentImageView.js"),i=n("./src/dom_components/view/ComponentView.js");t["default"]=r["default"].extend({tagName:"div",events:{},initialize:function(e){i["default"].prototype.initialize.apply(this,arguments);var t=this.model,n=["loop","autoplay","controls","color","rel","modestbranding","poster"],r=n.map(function(e){return"change:".concat(e)}).join(" ");this.listenTo(t,"change:provider",this.updateProvider),this.listenTo(t,"change:src",this.updateSrc),this.listenTo(t,r,this.updateVideo)},updateProvider:function(){var e=this.model.get("provider");this.el.innerHTML="",this.el.appendChild(this.renderByProvider(e))},updateSrc:function(){var e=this.model,t=this.videoEl;if(t){var n=e.get("provider"),r=e.get("src");switch(n){case"yt":r=e.getYoutubeSrc();break;case"ytnc":r=e.getYoutubeNoCookieSrc();break;case"vi":r=e.getVimeoSrc()}t.src=r}},updateVideo:function(){var e=this.model.get("provider"),t=this.videoEl,n=this.model;switch(e){case"yt":case"ytnc":case"vi":this.model.trigger("change:videoId");break;default:t.loop=n.get("loop"),t.autoplay=n.get("autoplay"),t.controls=n.get("controls"),t.poster=n.get("poster")}},renderByProvider:function(e){var t;switch(e){case"yt":t=this.renderYoutube();break;case"ytnc":t=this.renderYoutubeNoCookie();break;case"vi":t=this.renderVimeo();break;default:t=this.renderSource()}return this.videoEl=t,t},renderSource:function(){var e=document.createElement("video");return e.src=this.model.get("src"),this.initVideoEl(e),e},renderYoutube:function(){var e=document.createElement("iframe");return e.src=this.model.getYoutubeSrc(),e.frameBorder=0,e.setAttribute("allowfullscreen",!0),this.initVideoEl(e),e},renderYoutubeNoCookie:function(){var e=document.createElement("iframe");return e.src=this.model.getYoutubeNoCookieSrc(),e.frameBorder=0,e.setAttribute("allowfullscreen",!0),this.initVideoEl(e),e},renderVimeo:function(){var e=document.createElement("iframe");return e.src=this.model.getVimeoSrc(),e.frameBorder=0,e.setAttribute("allowfullscreen",!0),this.initVideoEl(e),e},initVideoEl:function(e){e.className=this.ppfx+"no-pointer",e.style.height="100%",e.style.width="100%"},render:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=this.model,n=e.config||{},r=n.em,o=t.opt||{},s=this.$el,a=this.el,l=n.draggableComponents;this.opts=e,this.modelOpt=o,this.config=n,this.em=r||"",this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.attr=t.get("attributes"),this.classe=this.attr["class"]||[],this.listenTo(t,"change:style",this.updateStyle),this.listenTo(t,"change:attributes change:_innertext",this.renderAttributes),this.listenTo(t,"change:highlightable",this.updateHighlight),this.listenTo(t,"change:status",this.updateStatus),this.listenTo(t,"change:script",this.reset),this.listenTo(t,"change:content",this.updateContent),this.listenTo(t,"change",this.handleChange),this.listenTo(t,"active",this.onActive),this.listenTo(t,"disable",this.onDisable),s.data("model",t),Object(p.setViewEl)(a,this),t.view=this,this._getFrame()&&t.views.push(this),this.initClasses(),this.initComponents({avoidRender:1}),this.events=i({},this.events,{},l&&{dragstart:"handleDragStart"}),this.delegateEvents(),!o.temporary&&this.init(this._clbObj())},_clbObj:function(){var e=this.em,t=this.model,n=this.el;return{editor:e&&e.getEditor(),model:t,el:n}},init:function(){},removed:function(){},onActive:function(){},onDisable:function(){},remove:function(){l.a.View.prototype.remove.apply(this,arguments);var e=this.model,t=this._getFrame()||{},n=t.model;e.components().forEach(function(e){var t=e.getView(n);t&&t.remove()});var r=e.views;return r.splice(r.indexOf(this),1),this.removed(this._clbObj()),this},handleDragStart:function(e){e.preventDefault(),e.stopPropagation(),this.em.get("Commands").run("tlb-move",{target:this.model,event:e})},initClasses:function(){var e=this.model,t="change:classes",n=e.get("classes");n instanceof h["default"]&&(this.stopListening(e,t,this.initClasses),this.listenTo(e,t,this.initClasses),this.listenTo(n,"add remove change",this.updateClasses),n.length&&this.importClasses())},initComponents:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.model,n=this.$el,r=this.childrenView,i="change:components",o=t.get("components"),s=[t,i,this.initComponents];o instanceof u["default"]&&(n.data("collection",o),r&&r.remove(),this.stopListening.apply(this,s),!e.avoidRender&&this.renderChildren(),this.listenTo.apply(this,s))},handleChange:function(){var e=this.model,t=Object(c.keys)(e.changed);if(1!==t.length||"status"!==t[0]){e.emitUpdate();for(var n in e.changed)e.emitUpdate(n)}},importClasses:function(){var e=this.config.em.get("SelectorManager");e&&this.model.get("classes").each(function(t){e.add(t.get("name"))})},updateStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(this.em,this.el),n=this.model.get("status"),r=(this.pfx,this.ppfx),i="".concat(r,"selected"),o="".concat(i,"-parent"),s="".concat(r,"freezed"),a="".concat(r,"hovered"),l=[i,o,s,a];this.$el.removeClass(l.join(" "));var c=t.getAttribute("class")||"",u="";switch(n){case"selected":u="".concat(c," ").concat(i);break;case"selected-parent":u="".concat(c," ").concat(o);break;case"freezed":u="".concat(c," ").concat(s);break;case"freezed-selected":u="".concat(c," ").concat(s," ").concat(i);break;case"hovered":u=e.avoidHover?"":"".concat(c," ").concat(a)}u=u.trim(),u&&t.setAttribute("class",u)},updateHighlight:function(){var e=this.model.get("highlightable");this.setAttribute("data-highlightable",e?1:"")},updateStyle:function(){var e=this.model,t=this.em,n=this.el;if(t&&t.getConfig("avoidInlineStyle")){e.get("_innertext")?n.removeAttribute("id"):n.id=e.getId();var r=e.getStyle();!Object(c.isEmpty)(r)&&e.setStyle(r)}else this.setAttribute("style",e.styleToString())},updateClasses:function(){var e=this.model.get("classes").pluck("name").join(" ");this.setAttribute("class",e),this.updateStatus()},setAttribute:function(e,t){var n=this.$el;t?n.attr(e,t):n.removeAttr(e)},getClasses:function(){return this.model.getClasses().join(" ")},updateAttributes:function(){var e=[],t=this.model,n=this.$el,r=this.el,o=this.config,s=t.attributes,a=s.highlightable,l=s.textable,u=s.type,d=s._innertext,h=o.draggableComponents,f=i({"data-gjs-type":u||"default"},h&&!d?{draggable:!0}:{},{},a?{"data-highlightable":1}:{},{},l?{contenteditable:"false","data-gjs-textable":"true"}:{});Object(c.each)(r.attributes,function(t){return e.push(t.nodeName)}),e.forEach(function(e){return n.removeAttr(e)});var p=i({},f,{},t.getAttributes());Object(c.keys)(p).forEach(function(e){return p[e]===!1&&delete p[e]}),n.attr(p),this.updateStyle()},updateContent:function(){this.getChildrenContainer().innerHTML=this.model.get("content")},prevDef:function(e){e.preventDefault()},updateScript:function(){var e=this.model,t=this.em;e.get("script")&&t&&t.get("Canvas").getCanvasView().updateScript(this)},getChildrenContainer:function(){var e=this.el;return"function"==typeof this.getChildrenSelector?e=this.el.querySelector(this.getChildrenSelector()):"function"==typeof this.getTemplate,e},getOffsetRect:function(){var e={},t=this.el,n=0,r=0,i=function o(i){ var s=i.offsetParent;s?(n+=s.offsetTop,r+=s.offsetLeft,o(s)):(e.top=t.offsetTop+n,e.left=t.offsetLeft+r,e.bottom=e.top+t.offsetHeight,e.right=e.left+t.offsetWidth)};return i(t),e},isInViewport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rect,n=this.el,r=n.ownerDocument,i=r.body,o=r.defaultView.frameElement,s=t||this.getOffsetRect(),a=s.top,l=s.left,c=this._getFrame().getOffsetRect();return a>=c.scrollTop&&l>=c.scrollLeft&&a<=c.scrollBottom&&l<=o.offsetWidth+i.scrollLeft},scrollIntoView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getOffsetRect(),n=this.isInViewport({rect:t});if(!n||e.force){var r=this.el;"smooth"!==e.behavior?r.ownerDocument.defaultView.scrollTo(0,t.top):r.scrollIntoView(i({behavior:"smooth",block:"nearest"},e))}},reset:function(){var e=this.el;this.el="",this._ensureElement(),this._setData(),Object(f.replaceWith)(e,this.el),this.render()},_setData:function(){var e=this.model,t=e.components(),n=this;this.$el.data({model:e,collection:t,view:n})},_getFrame:function(){return this.config.frameView},renderChildren:function(){this.updateContent();var e=this.getChildrenContainer(),t=new d["default"]({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});t.render(e),this.childrenView=t;for(var n=Array.prototype.slice.call(t.el.childNodes),r=0,i=n.length;r2&&void 0!==arguments[2]?arguments[2]:{},i=this.config.em,o=r.temporary;if(e.views.forEach(function(e){if(e){e.remove.apply(e);var t=e.childrenView,n=e.scriptContainer;t&&t.stopListening(),n&&n.remove()}}),e.components().forEach(function(e){return n.removeChildren(e,t,r)}),i&&!o){var s=e.getId(),a=i.get("DomComponents");delete a.componentsById[s];var l=i.get("CssComposer").getAll();if(l.remove(l.filter(function(e){return e.getSelectors().getFullString()==="#".concat(s)})),!e.opt.temporary){var c=i.get("Commands"),u=e.get("style-signature"),d={target:e};u&&c.run("core:component-style-clear",d),e.removed(),i.trigger("component:remove",e)}}},addTo:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),n=this.config.em,r=this.collection.indexOf(e);if(this.addToCollection(e,null,r),n&&!t.temporary){var i=function o(e){n.trigger("component:add",e),e.components().forEach(function(e){return o(e)})};i(e)}},addToCollection:function(e,t,r){this.compView||(this.compView=n("./src/dom_components/view/ComponentView.js")["default"]);for(var i=this.config,s=this.opts,a=this.em,l=t||null,c=s.componentTypes||a&&a.get("DomComponents").getTypes(),u=e.get("type"),d=this.compView,h=0;h0&&void 0!==arguments[0]?arguments[0]:{},t=e.config,n=void 0===t?{}:t;this.em=n.em,this.editor=n.editor},handleClick:function(e){e.preventDefault(),e.stopPropagation();var t=this.editor,n=this.em,r=t.Canvas.getFrameEl().getBoundingClientRect(),o=r.left,s=r.top,a=i({},e,{clientX:e.clientX-o,clientY:e.clientY-s});n.trigger("toolbar:run:before"),this.execCommand(a)},execCommand:function(e){var t={event:e},n=this.model.get("command"),r=this.editor;"function"==typeof n&&n(r,null,t),"string"==typeof n&&r.runCommand(n,t)},render:function(){var e=this.editor,t=this.$el,n=this.model,r=n.get("id"),i=n.get("label"),o=e.getConfig("stylePrefix");return t.addClass("".concat(o,"toolbar-item")),r&&t.addClass("".concat(o,"toolbar-item__").concat(r)),i&&t.append(i),this}})},"./src/dom_components/view/ToolbarView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/domain_abstract/view/DomainViews.js"),i=n("./src/dom_components/view/ToolbarButtonView.js");t["default"]=r["default"].extend({itemView:i["default"],initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config={editor:e.editor||"",em:e.em},this.listenTo(this.collection,"reset",this.render)}})},"./src/domain_abstract/model/Styleable.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.isString)(t)&&(t=u(t));var r=this.getStyle(),o=i({},t);this.set("style",o,n);var s=Object(l.shallowDiff)(r,o);return Object(a.keys)(s).forEach(function(t){var n=e.em;e.trigger("change:style:".concat(t)),n&&(n.trigger("styleable:change",e,t),n.trigger("styleable:change:".concat(t),e,t))}),o},addStyle:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof e?e={prop:t}:n=t||{},e=this.extendStyle(e),this.setStyle(e,n)},removeStyle:function(e){var t=this.getStyle();delete t[e],this.setStyle(t)},styleToString:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[],n=this.getStyle();for(var r in n){var i=e.important,o=Object(a.isArray)(i)?i.indexOf(r)>=0:i,s="".concat(n[r]).concat(o?" !important":""),l="__"==r.substr(0,2);s&&!l&&t.push("".concat(r,":").concat(s,";"))}return t.join("")},getSelectors:function(){return this.get("selectors")||this.get("classes")},getSelectorsString:function(){return this.selectorsToString?this.selectorsToString():this.getSelectors().getFullString()}}},"./src/domain_abstract/model/TypeableCollection.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=o.a.Model,a=o.a.View;t["default"]={types:[],initialize:function(e,t){var n=this;this.model=function(){var e,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i&&i.type){var s=n.getBaseType();r=n.getType(i.type),e=r?r.model:s.model,t=r?r.view:s.view}else{var a=n.recognizeType(i);r=a.type,e=r.model,t=r.view,i=a.attributes}var l=new e(i,o);return l.typeView=t,l};var r=this.init&&this.init.bind(this);r&&r()},recognizeType:function(e){for(var t=this.getTypes(),n=0;n')},inputClass:function(){return"".concat(this.ppfx,"field")},holderClass:function(){return"".concat(this.ppfx,"input-holder")},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ppfx||"";this.opts=e,this.ppfx=t,this.em=e.target||{},this.listenTo(this.model,"change:value",this.handleModelChange)},elementUpdated:function(){this.model.trigger("el:change")},setValue:function(e){var t=this.model,n=e||t.get("defaults"),r=this.getInputEl();r&&(r.value=n)},handleModelChange:function(e,t,n){this.setValue(t,n)},handleChange:function(e){e.stopPropagation();var t=this.getInputEl().value;this.model.set({value:t},{fromInput:1}),this.elementUpdated()},getInputEl:function(){if(!this.inputEl){var e=this.model,t=e.get("placeholder")||e.get("defaults")||"";this.inputEl=o(''))}return this.inputEl.get(0)},render:function(){this.inputEl=null;var e=this.$el;return e.addClass(this.inputClass()),e.html(this.template()),e.find(".".concat(this.holderClass())).append(this.getInputEl()),this}})},"./src/domain_abstract/ui/InputColor.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t
\n
\n
\n
\n
\n
\n ')},inputClass:function(){var e=this.ppfx;return"".concat(e,"field ").concat(e,"field-color")},holderClass:function(){return"".concat(this.ppfx,"input-holder")},setValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=n.get("defaults"),i=Object(c.isUndefined)(e)?Object(c.isUndefined)(r)?"":r:e,o=this.getInputEl(),s=this.getColorEl(),a="none"!=i?i:"";o.value=i,s.get(0).style.backgroundColor=a,t.fromTarget&&(s.spectrum("set",a),this.noneColor="none"==i)},getColorEl:function(){if(!this.colorEl){var e,t=this,n=this.ppfx,r=this.model,o=h('
')),s=o.get(0).style,a=this.em&&this.em.config?this.em.config.el:"",l=this.em&&this.em.getConfig&&this.em.getConfig("colorPicker")||{},c=function(e){var t=1==e.getAlpha()?e.toHexString():e.toRgbString();return t.replace(/ /g,"")},u=0;this.$el.find("[data-colorp-c]").append(o),o.spectrum(i({containerClassName:"".concat(n,"one-bg ").concat(n,"two-color"),appendTo:a||"body",maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},l,{move:function(e){var t=c(e);s.backgroundColor=t,r.setValueFromInput(t,0)},change:function(e){u=1;var n=c(e);s.backgroundColor=n,r.setValueFromInput(0,0),r.setValueFromInput(n),t.noneColor=0},show:function(t){u=0,e=c(t)},hide:function(n){!u&&e&&(t.noneColor&&(e=""),s.backgroundColor=e,o.spectrum("set",e),r.setValueFromInput(e,0))}})),this.colorEl=o}return this.colorEl},render:function(){return d["default"].prototype.render.call(this),this.getColorEl(),this}})},"./src/domain_abstract/ui/InputNumber.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/utils/mixins.js")),a=n("./src/domain_abstract/ui/Input.js");i.a.$;t["default"]=a["default"].extend({events:{"change input":"handleChange","change select":"handleUnitChange","click [data-arrow-up]":"upArrowClick","click [data-arrow-down]":"downArrowClick","mousedown [data-arrows]":"downIncrement"},template:function(){var e=this.ppfx;return'\n \n \n
\n
\n
\n
\n ')},inputClass:function(){var e=this.ppfx;return this.opts.contClass||"".concat(e,"field ").concat(e,"field-integer")},initialize:function(){arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a["default"].prototype.initialize.apply(this,arguments),Object(o.bindAll)(this,"moveIncrement","upIncrement"),this.doc=document,this.listenTo(this.model,"change:unit",this.handleModelChange)},setValue:function(e,t){var n=t||{},r=this.validateInputValue(e,{deepCheck:1}),i={value:r.value};(r.unit||r.force)&&(i.unit=r.unit),this.model.set(i,n),n.silent&&this.handleModelChange()},handleChange:function(e){e.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},handleUnitChange:function(e){e.stopPropagation();var t=this.getUnitEl().value;this.model.set("unit",t),this.elementUpdated()},elementUpdated:function(){this.model.trigger("el:change")},handleModelChange:function(){var e=this.model;this.getInputEl().value=e.get("value");var t=this.getUnitEl();t&&(t.value=e.get("unit")||"")},getUnitEl:function(){if(!this.unitEl){var e=this.model,t=e.get("units")||[];if(t.length){var n=[];t.forEach(function(t){var r=t==e.get("unit")?"selected":"";n.push(""))});var r=document.createElement("div");r.innerHTML='"),this.unitEl=r.firstChild}}return this.unitEl},upArrowClick:function(){var e=this.model,t=e.get("step"),n=parseInt(e.get("value"),10);n=this.normalizeValue(n+t);var r=this.validateInputValue(n);e.set("value",r.value),this.elementUpdated()},downArrowClick:function(){var e=this.model,t=e.get("step"),n=parseInt(e.get("value"),10),r=this.normalizeValue(n-t),i=this.validateInputValue(r);e.set("value",i.value),this.elementUpdated()},downIncrement:function(e){e.preventDefault(),this.moved=0;var t=this.model.get("value");t=this.normalizeValue(t),this.current={y:e.pageY,val:t},Object(s.on)(this.doc,"mousemove",this.moveIncrement),Object(s.on)(this.doc,"mouseup",this.upIncrement)},moveIncrement:function(e){this.moved=1;var t=this.model,n=t.get("step"),r=this.current,i=this.normalizeValue(r.val+(r.y-e.pageY)*n);return this.prValue=this.validateInputValue(i).value,t.set("value",this.prValue,{avoidStore:1}),!1},upIncrement:function(){var e=this.model,t=e.get("step");if(Object(s.off)(this.doc,"mouseup",this.upIncrement),Object(s.off)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-t;e.set("value",n,{avoidStore:1}).set("value",n+t),this.elementUpdated()}},normalizeValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model,r=n.get("step"),i=0;if(isNaN(e))return t;if(e=parseFloat(e),Math.floor(e)!==e){var o=r.toString().split(".")[1];i=o?o.length:0}return i?parseFloat(e.toFixed(i)):e},validateInputValue:function(e,t){var n=0,r=t||{},i=this.model,s="",a=Object(o.isUndefined)(e)?s:e,l=i.get("units")||[],c=i.get("unit")||l.length&&l[0]||"",u=i.get("max"),d=i.get("min");if(r.deepCheck){var h=i.get("fixedValues")||[];if(a){var f=new RegExp("^"+h.join("|"),"g");if(h.length&&f.test(a))a=a.match(f)[0],c="",n=1;else{var p=a+"";a+="",a=parseFloat(a.replace(",",".")),a=isNaN(a)?s:a;var g=p.replace(a,"");Object(o.indexOf)(l,g)>=0&&(c=g)}}}return Object(o.isUndefined)(u)||""===u||(a=a>u?u:a),Object(o.isUndefined)(d)||""===d||(a=a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;this.config=t||e.config||{},this.autoAdd&&this.listenTo(this.collection,"add",this.addTo),this.init()},init:function(){},addTo:function(e){this.add(e)},itemViewNotFound:function(e){var t=this.config,n=this.ns,r=t.em,i="".concat(n?"[".concat(n,"]: "):"","'").concat(e,"' type not found");r&&r.logWarning(i)},add:function(e,t){var n,i=this.config,o=this.reuseView,s=this.itemsView,a=void 0===s?{}:s,l=["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"],c=t||null,u=this.itemView,d=e.get(this.itemType);a[d]?u=a[d]:!d||a[d]||Object(r.includes)(l,d)||this.itemViewNotFound(d),n=e.view&&o?e.view:new u({model:e,config:i},i);var h=n.render().el;c?c.appendChild(h):this.$el.append(h)},render:function(){var e=document.createDocumentFragment();return this.$el.empty(),this.collection.length&&this.collection.each(function(t){this.add(t,e)},this),this.$el.append(e),this.onRender(),this},onRender:function(){}})},"./src/editor/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"gjs-",components:"",style:"",fromElement:0,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:"900px",width:"100%",log:["warning","error"],baseCss:"\n * {\n box-sizing: border-box;\n }\n html, body, [data-gjs-type=wrapper] {\n min-height: 100%;\n }\n body {\n margin: 0;\n height: 100%;\n background-color: #fff\n }\n [data-gjs-type=wrapper] {\n overflow: auto;\n overflow-x: hidden;\n }\n\n * ::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.1)\n }\n\n * ::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.2)\n }\n\n * ::-webkit-scrollbar {\n width: 10px\n }\n ",protectedCss:"* { box-sizing: border-box; } body {margin: 0;}",canvasCss:"",defaultCommand:"select-comp",showToolbar:1,allowScripts:0,showDevices:1,devicePreviewMode:0,mediaCondition:"max-width",tagVarStart:"{[ ",tagVarEnd:" ]}",keepEmptyTextNodes:0,jsInHtml:!0,nativeDnD:1,multipleSelection:1,exportWrapper:0,wrapperIsBody:1,avoidInlineStyle:1,avoidDefaults:1,clearStyles:0,dragMode:0,cssIcons:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",el:"",i18n:{},undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{devices:[{id:"desktop",name:"Desktop",width:""},{id:"tablet",name:"Tablet",width:"768px",widthMedia:"992px"},{id:"mobileLandscape",name:"Mobile landscape",width:"568px",widthMedia:"768px"},{id:"mobilePortrait",name:"Mobile portrait",width:"320px",widthMedia:"480px"}]},styleManager:{sectors:[{name:"General",open:!1,buildProps:["float","display","position","top","right","left","bottom"]},{name:"Flex",open:!1,buildProps:["flex-direction","flex-wrap","justify-content","align-items","align-content","order","flex-basis","flex-grow","flex-shrink","align-self"]},{name:"Dimension",open:!1,buildProps:["width","height","max-width","min-height","margin","padding"]},{name:"Typography",open:!1,buildProps:["font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","text-shadow"],properties:[{property:"text-align",list:[{value:"left",className:"fa fa-align-left"},{value:"center",className:"fa fa-align-center"},{value:"right",className:"fa fa-align-right"},{value:"justify",className:"fa fa-align-justify"}]}]},{name:"Decorations",open:!1,buildProps:["border-radius-c","background-color","border-radius","border","box-shadow","background"]},{name:"Extra",open:!1,buildProps:["transition","perspective","transform"]}]},blockManager:{},traitManager:{},textViewCode:"Code",keepUnusedStyles:0,multiFrames:0}},"./src/editor/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=i({},l["default"],{},e);t.pStylePrefix=t.stylePrefix;var n=new c["default"](t),r=new u["default"]({model:n,config:t});return{$:a["default"],editor:n,I18n:n.get("I18n"),DomComponents:n.get("DomComponents"),LayerManager:n.get("LayerManager"),CssComposer:n.get("CssComposer"),StorageManager:n.get("StorageManager"),AssetManager:n.get("AssetManager"),BlockManager:n.get("BlockManager"),TraitManager:n.get("TraitManager"),SelectorManager:n.get("SelectorManager"),CodeManager:n.get("CodeManager"),Commands:n.get("Commands"),Keymaps:n.get("Keymaps"),Modal:n.get("Modal"),Panels:n.get("Panels"),StyleManager:n.get("StyleManager"),Canvas:n.get("Canvas"),UndoManager:n.get("UndoManager"),DeviceManager:n.get("DeviceManager"),RichTextEditor:n.get("RichTextEditor"),Parser:n.get("Parser"),Utils:n.get("Utils"),Config:n.get("Config"),init:function(){var e=this;return n.init(this),n.on("loaded",function(){e.UndoManager.clear(),n.get("modules").forEach(function(e){e.postRender&&e.postRender(r)})}),this},getConfig:function(e){return n.getConfig(e)},getHtml:function(e){return n.getHtml(e)},getCss:function(e){return n.getCss(e)},getJs:function(){return n.getJs()},getComponents:function(){return n.get("DomComponents").getComponents()},getWrapper:function(){return n.get("DomComponents").getWrapper()},setComponents:function(e){return n.setComponents(e),this},addComponents:function(e,t){return this.getWrapper().append(e,t)},getStyle:function(){return n.get("CssComposer").getAll()},setStyle:function(e){return n.setStyle(e),this},getSelected:function(){return n.getSelected()},getSelectedAll:function(){return n.getSelectedAll()},getSelectedToStyle:function(){var e=n.getSelected();if(e)return this.StyleManager.getModelToStyle(e)},select:function(e,t){return n.setSelected(e,t),this},selectAdd:function(e){return n.addSelected(e),this},selectRemove:function(e){return n.removeSelected(e),this},selectToggle:function(e){return n.toggleSelected(e),this},setDevice:function(e){return n.set("device",e),this},getDevice:function(){return n.get("device")},runCommand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.get("Commands").run(e,t)},stopCommand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.get("Commands").stop(e,t)},store:function(e){return n.store(e)},load:function(e){return n.load(e)},getContainer:function(){return t.el},getDirtyCount:function(){return n.getDirtyCount()},refresh:function(){n.refreshCanvas()},setCustomRte:function(e){this.RichTextEditor.customRte=e},setCustomParserCss:function(e){return this.Parser.getConfig().parserCss=e,this},setDragMode:function(e){return n.setDragMode(e),this},log:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.log(e,t),this},t:function(){return n.t.apply(n,arguments)},on:function(e,t){return n.on(e,t),this},once:function(e,t){return n.once(e,t),this},off:function(e,t){return n.off(e,t),this},trigger:function(e){return n.trigger.apply(n,arguments),this},destroy:function(){return n.destroyAll()},getEl:function(){return r.el},getModel:function(){return n},render:function(){return r.render(),r.el}}}},"./src/editor/model/Editor.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};this.config=t,this.set("Config",t),this.set("modules",[]),this.set("toLoad",[]),this.set("storables",[]),this.set("dmode",t.dragMode);var n=t.el,r=t.log,i=r===!0?Object(a.keys)(v):Object(a.isArray)(r)?r:[];Object(a.bindAll)(this,"initBaseColorPicker"),n&&t.fromElement&&(this.config.components=n.innerHTML),this.attrsOrig=n?Object(a.toArray)(n.attributes).reduce(function(e,t){return e[t.nodeName]=t.nodeValue,e},{}):"",g.forEach(function(t){return e.loadModule(t)}),this.on("change:componentHovered",this.componentHovered,this),this.on("change:changesCount",this.updateChanges,this),i.forEach(function(t){return e.listenLog(t)}),[{from:"change:selectedComponent",to:"component:toggled"}].forEach(function(t){var n=t.from,r=t.to;e.listenTo(e,n,function(){for(var t=arguments.length,i=new Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=this.get("StorageManager");this.get("toLoad").forEach(function(e){e.onLoad()});var r=function(){var n=e.get("modules");n.forEach(function(t){return t.postLoad&&t.postLoad(e)}),t&&t()};n&&n.canAutoload()?this.load(r):r()},updateChanges:function(){var e=this,t=this.get("StorageManager"),n=this.get("changesCount");p&&clearTimeout(p),p=setTimeout(function(){return e.trigger("update")}),this.config.noticeOnUnload&&(window.onbeforeunload=n?function(e){return 1}:null),t.isAutosave()&&n>=t.getStepsBeforeSave()&&this.store()},loadModule:function(e){var t=this.config,n=e["default"]||e,r=new n,o=r.name.charAt(0).toLowerCase()+r.name.slice(1),s=Object(a.isUndefined)(t[o])?t[r.name]:t[o],l=s||{},c=this.get("StorageManager");if(l.pStylePrefix=t.pStylePrefix||"",Object(a.isUndefined)(s)||s||(l._disable=1),r.storageKey&&r.store&&r.load&&c){l.stm=c;var u="domComponents"==o?"unshift":"push";this.get("storables")[u](r)}return l.em=this,r.init(i({},l)),!r["private"]&&this.set(r.name,r),r.onLoad&&this.get("toLoad").push(r),this.get("modules").push(r),this},init:function(e){this.set("Editor",e)},getEditor:function(){return this.get("Editor")},handleUpdates:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.temporary||(f&&clearInterval(f),f=setTimeout(function(){r.avoidStore||n.set("changesCount",n.get("changesCount")+1,r)},0))},componentHovered:function(e,t,n){var r=this.previous("componentHovered");r&&this.trigger("component:unhovered",r,n), t&&this.trigger("component:hovered",t,n)},getSelected:function(){return this.get("selected").last()},getSelectedAll:function(){return this.get("selected").models},setSelected:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Object(a.isArray)(e),o=i?e:[e],s=this.get("selected");i&&this.removeSelected(s.filter(function(e){return!Object(a.contains)(o,e)})),o.forEach(function(e){var o=Object(h.getModel)(e,l["default"]);o&&!o.get("selectable")||(!i&&n.removeSelected(s.filter(function(e){return e!==o})),n.addSelected(o,r),t=o)})},addSelected:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(h.getModel)(e,l["default"]),i=Object(a.isArray)(r)?r:[r];i.forEach(function(e){if(!e||e.get("selectable")){var r=t.get("selected");n.forceChange&&r.remove(e,n),r.push(e,n)}})},removeSelected:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.get("selected").remove(Object(h.getModel)(e,l["default"]),t)},toggleSelected:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(h.getModel)(e,l["default"]),i=Object(a.isArray)(r)?r:[r];i.forEach(function(e){t.get("selected").contains(e)?t.removeSelected(e,n):t.addSelected(e,n)})},setHovered:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object(h.getModel)(e,l["default"]);n&&!n.get("hoverable")||(t.forceChange&&this.set("componentHovered",""),this.set("componentHovered",n,t))},getHovered:function(){return this.get("componentHovered")},setComponents:function(e){return this.get("DomComponents").setComponents(e)},getComponents:function(){var e=this.get("DomComponents"),t=this.get("CodeManager");if(e&&t){var n=e.getComponents();return t.getCode(n,"json")}},setStyle:function(e){for(var t=this.get("CssComposer").getAll(),n=0,r=t.length;n".concat(r,""):""},getCss:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.config,n=t.wrapperIsBody,r=e.avoidProtected,i=Object(a.isUndefined)(e.keepUnusedStyles)?t.keepUnusedStyles:e.keepUnusedStyles,o=this.get("CssComposer"),s=this.get("DomComponents").getComponent(),l=r?"":t.protectedCss;return l+this.get("CodeManager").getCode(s,"css",{cssc:o,wrapperIsBody:n,keepUnusedStyles:i})},getJs:function(){var e=this.get("DomComponents").getWrapper();return this.get("CodeManager").getCode(e,"js").trim()},store:function b(e){var t=this,n=this.get("StorageManager"),b={};if(n)return this.get("storables").forEach(function(e){var t=e.store(1);for(var n in t)b[n]=t[n]}),n.store(b,function(n){e&&e(n),t.set("changesCount",0),t.trigger("storage:store",b)}),b},load:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.getCacheLoad(1,function(n){e.get("storables").forEach(function(e){return e.load(n)}),t&&t(n)})},getCacheLoad:function(e,t){var n=this;if(this.cacheLoad&&!e)return this.cacheLoad;var r=this.get("StorageManager"),i=[];return r?(this.get("storables").forEach(function(e){var t=e.storageKey;t=Object(a.isFunction)(t)?t():t;var n=Object(a.isArray)(t)?t:[t];n.forEach(function(e){return i.push(e)})}),void r.load(i,function(e){n.cacheLoad=e,t&&t(e),setTimeout(function(){return n.trigger("storage:load",e)})})):{}},getDeviceModel:function(){var e=this.get("device");return this.get("DeviceManager").get(e)},runDefault:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.get("Commands").get(this.config.defaultCommand);t&&!this.defaultRunning&&(t.stop(this,this,e),t.run(this,this,e),this.defaultRunning=1)},stopDefault:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.get("Commands").get(this.config.defaultCommand);t&&(t.stop(this,this,e),this.defaultRunning=0)},refreshCanvas:function(){this.set("canvasOffset",null),this.set("canvasOffset",this.get("Canvas").getOffset())},clearSelection:function(e){var t=e||window;t.getSelection().removeAllRanges()},getCurrentMedia:function(){var e=this.config,t=this.getDeviceModel(),n=e.mediaCondition,r=e.devicePreviewMode,i=t&&t.get("widthMedia");return t&&i&&!r?"(".concat(n,": ").concat(i,")"):""},getWrapper:function(){return this.get("DomComponents").getWrapper()},setCurrentFrame:function(e){return this.set("currentFrame",e)},getCurrentFrame:function(){return this.get("currentFrame")},getCurrentFrameModel:function(){return(this.getCurrentFrame()||{}).model},getDirtyCount:function(){return this.get("changesCount")},getZoomDecimal:function(){return this.get("Canvas").getZoomDecimal()},getZoomMultiplier:function(){return this.get("Canvas").getZoomMultiplier()},setDragMode:function(e){return this.set("dmode",e)},t:function(){var e;return(e=this.get("I18n")).t.apply(e,arguments)},inAbsoluteMode:function(){return"absolute"===this.get("dmode")},destroyAll:function(){var e=this.attributes,t=e.DomComponents,n=e.CssComposer,r=e.UndoManager,i=e.Panels,o=e.Canvas,s=e.Keymaps,a=e.RichTextEditor;t.clear(),n.clear(),r.clear().removeAll(),i.getPanels().reset(),o.getCanvasView().remove(),s.removeAll(),a.destroy(),this.view.remove(),this.stopListening(),Object(l["default"])(this.config.el).empty().attr(this.attrsOrig)},setEditing:function(e){return this.set("editing",e),this},isEditing:function(){return!!this.get("editing")},log:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.ns,r=t.level,i=void 0===r?"debug":r;if(this.trigger("log",e,t),i&&this.trigger("log:".concat(i),e,t),n){var o="log-".concat(n);this.trigger(o,e,t),i&&this.trigger("".concat(o,":").concat(i),e,t)}},logInfo:function(e,t){this.log(e,i({},t,{level:"info"}))},logWarning:function(e,t){this.log(e,i({},t,{level:"warning"}))},logError:function(e,t){this.log(e,i({},t,{level:"error"}))},initBaseColorPicker:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getConfig(),r=n.colorPicker,o=void 0===r?{}:r,s=n.el,a=n.stylePrefix;return Object(l["default"])(e).spectrum(i({containerClassName:"".concat(a,"one-bg ").concat(a,"two-color"),appendTo:s||"body",maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:"Ok",cancelText:"⨯"},t,{},o))},data:function(e,t,n){var r="_gjs-data";return e[r]||(e[r]={}),Object(a.isUndefined)(n)?e[r][t]:void(e[r][t]=n)}})},"./src/editor/view/EditorView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/utils/mixins.js"),s=i.a.$;t["default"]=i.a.View.extend({initialize:function(){var e=this,t=this.model;t.view=this,this.conf=t.config,this.pn=t.get("Panels"),this.cv=t.get("Canvas"),t.on("loaded",function(){e.pn.active(),e.pn.disableButtons(),setTimeout(function(){t.runDefault(),t.trigger("load",t.get("Editor"))})})},render:function(){var e=(this.model,this.$el),t=this.conf,n=t.stylePrefix,r=s(t.el||"body ".concat(t.container));return Object(o.appendStyles)(t.cssIcons,{unique:1,prepand:1}),e.empty(),t.width&&r.css("width",t.width),t.height&&r.css("height",t.height),e.append(this.cv.render()),e.append(this.pn.render()),e.attr("class","".concat(n,"editor ").concat(n,"one-bg ").concat(n,"two-color")),r.addClass("".concat(n,"editor-cont")).empty().append(e),this}})},"./src/i18n/config.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/i18n/locale/en.js");t["default"]={locale:"en",localeFallback:"en",detectLocale:1,debug:0,messages:{en:r["default"]}}},"./src/i18n/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return this.config=i({},u["default"],{},e,{messages:i({},u["default"].messages,{},e.messages||{})}),this.config.detectLocale&&(this.config.locale=this._localLang()),this.em=e.em,this},getConfig:function(){return this.config},setLocale:function(e){var t=this.em,n=this.config,r={value:e,valuePrev:n.locale};return t&&t.trigger("i18n:locale",r),n.locale=e,this},getLocale:function(){return this.config.locale},getMessages:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config.messages;return e&&!n[e]&&this._debug("'".concat(e,"' i18n lang not found"),t),e?n[e]:n},setMessages:function(e){var t=this.em,n=this.config;return n.messages=e,t&&t.trigger("i18n:update",e),this},addMessages:function(e){var t=this.em,n=this.config.messages;return t&&t.trigger("i18n:add",e),this.setMessages(h(n,e)),this},t:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config,r=t.params||{},i=t.l||this.getLocale(),o=t.lFlb||n.localeFallback,s=this._getMsg(e,i,t);return s||(s=this._getMsg(e,o,t)),!s&&this._debug("'".concat(e,"' i18n key not found in '").concat(i,"' lang"),t),s=s&&Object(c.isString)(s)?this._addParams(s,r):s},_localLang:function(){var e=window.navigator||{},t=e.language||e.userLanguage;return t?t.split("-")[0]:"en"},_addParams:function(e,t){var n=new RegExp("{([\\w\\d-]*)}","g");return e.replace(n,function(e,n){return t[n]||""}).trim()},_getMsg:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getMessages(t,n);if(r){var i=r[e];return!i&&e.indexOf(".")>0&&(i=e.split(".").reduce(function(e,t){if(!Object(c.isUndefined)(e))return e[t]},r)),i}},_debug:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.config;(t.debug||r.debug)&&n&&n.logWarning(e)}}}},"./src/i18n/locale/en.js":function(e,t,n){"use strict";n.r(t);var r={placeholder:"eg. Text here"};t["default"]={assetManager:{addButton:"Add image",inputPlh:"http://path/to/the/image.jpg",modalTitle:"Select Image",uploadTitle:"Drop files here or click to upload"},blockManager:{labels:{},categories:{}},domComponents:{names:{"":"Box",wrapper:"Body",text:"Text",comment:"Comment",image:"Image",video:"Video",label:"Label",link:"Link",map:"Map",tfoot:"Table foot",tbody:"Table body",thead:"Table head",table:"Table",row:"Table row",cell:"Table cell"}},deviceManager:{device:"Device",devices:{desktop:"Desktop",tablet:"Tablet",mobileLandscape:"Mobile Landscape",mobilePortrait:"Mobile Portrait"}},panels:{buttons:{titles:{preview:"Preview",fullscreen:"Fullscreen","sw-visibility":"View components","export-template":"View code","open-sm":"Open Style Manager","open-tm":"Settings","open-layers":"Open Layer Manager","open-blocks":"Open Blocks"}}},selectorManager:{label:"Classes",selected:"Selected",emptyState:"- State -",states:{hover:"Hover",active:"Click","nth-of-type(2n)":"Even/Odd"}},styleManager:{empty:"Select an element before using Style Manager",layer:"Layer",fileButton:"Images",sectors:{general:"General",layout:"Layout",typography:"Typography",decorations:"Decorations",extra:"Extra",flex:"Flex",dimension:"Dimension"},properties:{}},traitManager:{empty:"Select an element before using Trait Manager",label:"Component settings",traits:{labels:{},attributes:{id:r,alt:r,title:r,href:{placeholder:"eg. https://google.com"}},options:{target:{"false":"This window",_blank:"New window"}}}}}},"./src/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.container;if(!t)throw new Error("'container' is required");e=i({},p,{},e),e.el=Object(c.isElement)(t)?t:document.querySelector(t);var n=new l["default"](e).init();return e.plugins.forEach(function(t){var r=h.get(t),i=e.pluginsOpts[t]||{};if(!r){var o=window[t];r=o&&o["default"]?o["default"]:o}r?r(n,i):Object(c.isFunction)(t)?t(n,i):console.warn("Plugin ".concat(t," not found"))}),n.getModel().loadOnStart(),e.autorender&&n.render(),f.push(n),n}}},"./src/keymaps/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return t=i({},r,{},n),e=t.em,this.em=e,this},onLoad:function(){var e=t.defaults;for(var n in e){var r=e[n];this.add(n,r.keys,r.handler)}},add:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=this.em,a=o.get("Commands"),l=o.getEditor(),u=o.get("Canvas"),h={id:e,keys:t,handler:r},f=n[e];return f&&this.remove(e),n[e]=h,d()(t,function(t,n){var d={event:t,h:n};r=Object(c.isString)(r)?a.get(r):r,i.prevent&&u.getCanvasView().preventDefault(t);var h=!o.isEditing()&&!l.Canvas.isInputFocused();if(h||i.force){"object"==s()(r)?r.run(l,0,d):r(l,0,d);var f=[e,n.shortcut,t];o.trigger.apply(o,["keymap:emit"].concat(f)),o.trigger.apply(o,["keymap:emit:".concat(e)].concat(f))}}),o.trigger("keymap:add",h),h},get:function(e){return n[e]},getAll:function(){return n},remove:function(e){var t=this.em,r=this.get(e);if(r)return delete n[e],d.a.unbind(r.keys),t&&t.trigger("keymap:remove",r),r},removeAll:function(){var e=this;return Object.keys(n).forEach(function(t){return e.remove(t)}),this}}}},"./src/modal_dialog/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"mdl-",title:"",content:"",backdrop:!0}},"./src/modal_dialog/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};n=i({},a["default"],{},o);var s=n.em;this.em=s;var u=n.pStylePrefix;return u&&(n.stylePrefix=u+n.stylePrefix),e=new l["default"](n),e.on("change:open",function(e,t){return r(t,s)}),t=new c["default"]({model:e,config:n}),this},postRender:function(e){var t=e.model.getConfig().el||e.el;this.render().appendTo(t)},open:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.title&&this.setTitle(e.title),e.content&&this.setContent(e.content),t.show(),this},close:function(){return t.hide(),this},onceClose:function(e){return this.em.once("modal:close",e),this},onceOpen:function(e){return this.em.once("modal:open",e),this},isOpen:function(){return!!e.get("open")},setTitle:function(t){return e.set("title",t),this},getTitle:function(){return e.get("title")},setContent:function(t){return e.set("content"," "),e.set("content",t),this},getContent:function(){return e.get("content")},getContentEl:function(){return t.getContent().get(0)},getModel:function(){return e},render:function(){return t.render().$el}}}},"./src/modal_dialog/model/Modal.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{title:"",content:"",open:!1}})},"./src/modal_dialog/view/ModalView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.View.extend({template:function(e){var t=e.pfx,n=e.ppfx,r=e.content,i=e.title;return'
\n
\n
').concat(i,'
\n
\n
\n
\n
').concat(r,'
\n
\n
\n
\n ')},events:{click:"onClick","click [data-close-modal]":"hide"},initialize:function(e){var t=this.model,n=e.config||{},r=n.stylePrefix||"";this.config=n,this.pfx=r,this.ppfx=n.pStylePrefix||"",this.listenTo(t,"change:open",this.updateOpen),this.listenTo(t,"change:title",this.updateTitle),this.listenTo(t,"change:content",this.updateContent)},onClick:function(e){var t=this.config.backdrop;t&&e.target===this.el&&this.hide()},getCollector:function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},getContent:function(){var e=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(e,"content #").concat(e,"c"))),this.$content},getTitle:function(){return this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),this.$title.get(0)},updateContent:function(){var e=this.getContent(),t=e.children(),n=this.getCollector(),r=this.model.get("content");t.length&&n.append(t),e.empty().append(r)},updateTitle:function(){var e=this.getTitle();e&&(e.innerHTML=this.model.get("title"))},updateOpen:function(){this.el.style.display=this.model.get("open")?"":"none"},hide:function(){this.model.set("open",0)},show:function(){this.model.set("open",1)},render:function(){var e=this.$el,t=this.pfx,n=(this.ppfx,this.model.toJSON());return n.pfx=this.pfx,n.ppfx=this.ppfx,e.html(this.template(n)),e.attr("class","".concat(t,"container")),this.updateOpen(),this}})},"./src/navigator/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"",appendTo:"",sortable:1,hidable:1,hideTextnode:1,root:"",showWrapper:1,showHover:1,scrollCanvas:{behavior:"smooth",block:"nearest"},scrollLayers:{behavior:"auto",block:"nearest"},highlightHover:1}},"./src/navigator/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return n=i({},a["default"],{},t),n.stylePrefix=t.pStylePrefix,e=n.em,this},getConfig:function(){return n},onLoad:function(){t=new l["default"]({level:0,config:n,opened:n.opened||{},model:e.get("DomComponents").getWrapper()}),e&&e.on("component:selected",this.componentChanged),this.componentChanged()},postRender:function(){var e=n.appendTo,t=n.root;if(t&&this.setRoot(t),e){var r=Object(c.isElement)(e)?e:document.querySelector(e);r.appendChild(this.render())}},setRoot:function(e){return t.setRoot(e),this},getRoot:function(){return t.model},getAll:function(){return t},componentChanged:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r.fromLayers){var i=e.get("opened"),o=e.getSelected(),s=n.scrollLayers,a=o&&o.collection?o.collection.parent:null;for(var l in i)i[l].set("open",0);for(;a;)a.set("open",1),i[a.cid]=a,a=a.collection?a.collection.parent:null;if(o&&s){var c=o.viewLayer&&o.viewLayer.el;c&&c.scrollIntoView(s)}}},render:function(){return t.render().el}}}},"./src/navigator/view/ItemView.js":function(e,t,n){"use strict";n.r(t);var r,i=n("./node_modules/underscore/underscore.js"),o=(n.n(i),n("./src/utils/mixins.js")),s=n("./node_modules/backbone/backbone.js"),a=n.n(s),l=n("./src/dom_components/view/ComponentView.js"),c=n("./src/dom_components/model/Component.js"),u="contentEditable",d=a.a.$;t["default"]=a.a.View.extend({events:{"mousedown [data-toggle-move]":"startSort","touchstart [data-toggle-move]":"startSort","click [data-toggle-visible]":"toggleVisibility","click [data-toggle-select]":"handleSelect","mouseover [data-toggle-select]":"handleHover","click [data-toggle-open]":"toggleOpening","dblclick [data-name]":"handleEdit","focusout [data-name]":"handleEditEnd"},template:function(e){var t=this.pfx,n=this.ppfx,r=this.config,i=this.clsNoEdit,o=r.hidable,s=this.countChildren(e),a=s?"":this.clsNoChild,l="".concat(this.clsTitle," ").concat(a),c="".concat(this.clsTitleC," ").concat(n,"one-bg"),u="".concat(this.clsCaret," fa fa-chevron-right"),d="".concat(this.inputNameCls," ").concat(i," ").concat(n,"no-app"),h=this.level+1,f="".concat(30+10*h,"px"),p=e.getName(),g=e.getIcon(),m="".concat(t,"layer");return"\n ".concat(o?''):"",'\n
\n
\n
\n \n ').concat(g?'').concat(g,""):"",'\n ').concat(p,'\n
\n
\n
\n
').concat(s||"",'
\n
\n \n
\n
')},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=e,this.level=e.level,this.config=e.config,this.em=e.config.em,this.ppfx=this.em.get("Config").stylePrefix,this.sorter=e.sorter||"",this.pfx=this.config.stylePrefix,this.parentView=e.parentView;var t=this.pfx,n=this.ppfx,r=this.model,i=r.get("components"),o=r.get("type")||"default";r.set("open",!1),this.listenTo(i,"remove add reset",this.checkChildren),this.listenTo(r,"change:status",this.updateStatus),this.listenTo(r,"change:open",this.updateOpening),this.listenTo(r,"change:layerable",this.updateLayerable),this.listenTo(r,"change:style:display",this.updateVisibility),this.className="".concat(t,"layer ").concat(t,"layer__t-").concat(o," no-select ").concat(n,"two-color"),this.inputNameCls="".concat(n,"layer-name"),this.clsTitleC="".concat(t,"layer-title-c"),this.clsTitle="".concat(t,"layer-title"),this.clsCaret="".concat(t,"layer-caret"),this.clsCount="".concat(t,"layer-count"),this.clsMove="".concat(t,"layer-move"),this.clsChildren="".concat(t,"layer-children"),this.clsNoChild="".concat(t,"layer-no-chld"),this.clsEdit="".concat(this.inputNameCls,"--edit"),this.clsNoEdit="".concat(this.inputNameCls,"--no-edit"),this.$el.data("model",r),this.$el.data("collection",i),r.viewLayer=this},getVisibilityEl:function(){return this.eyeEl||(this.eyeEl=this.$el.children(".".concat(this.pfx,"layer-vis"))),this.eyeEl},updateVisibility:function(){var e=this.pfx,t=this.model,n="".concat(e,"layer-hidden"),r="fa-eye-slash",i="none"==t.getStyle().display,o=i?"addClass":"removeClass";this.$el[o](n),this.getVisibilityEl()[o](r)},toggleVisibility:function(e){e&&e.stopPropagation();var t=this.model,n="__prev-display",r=t.get(n),i=t.getStyle(),o=i.display,s="none"==o;s?(delete i.display,r&&(i.display=r,t.unset(n))):(o&&t.set(n,o),i.display="none"),t.setStyle(i)},handleEdit:function(e){e&&e.stopPropagation();var t=this.em,n=this.$el,r=this.clsNoEdit,i=this.clsEdit,o=this.getInputName();o[u]=!0,o.focus(),t&&t.setEditing(1),n.find(".".concat(this.inputNameCls)).removeClass(r).addClass(i)},handleEditEnd:function(e){e&&e.stopPropagation();var t=this.em,n=this.$el,r=this.clsNoEdit,i=this.clsEdit,o=this.getInputName(),s=o.textContent;o.scrollLeft=0,o[u]=!1,this.model.set({"custom-name":s}),t&&t.setEditing(0),n.find(".".concat(this.inputNameCls)).addClass(r).removeClass(i)},getInputName:function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},updateOpening:function(){var e=this.opt.opened||{},t=this.model,n="fa-chevron-down";t.get("open")?(this.$el.addClass("open"),this.getCaret().addClass(n),e[t.cid]=t):(this.$el.removeClass("open"),this.getCaret().removeClass(n),delete e[t.cid])},toggleOpening:function(e){e.stopPropagation(),this.model.get("components").length&&this.model.set("open",!this.model.get("open"))},handleSelect:function(e){e.stopPropagation();var t=this.em,n=this.config;if(t){var r=this.model;t.setSelected(r,{fromLayers:1});var i=n.scrollCanvas;i&&r.views.forEach(function(e){return e.scrollIntoView(i)})}},handleHover:function(e){e.stopPropagation();var t=this.em,n=this.config,r=this.model;t&&n.showHover&&t.setHovered(r,{fromLayers:1})},startSort:function(e){e.stopPropagation();var t=this.em,n=this.sorter;e.button&&0!==e.button||n&&(n.onStart=function(e){return t.trigger("".concat(c.eventDrag,":start"),e)},n.onMoveClb=function(e){return t.trigger(c.eventDrag,e)},n.startSort(e.target))},freeze:function(){this.$el.addClass(this.pfx+"opac50"),this.model.set("open",0)},unfreeze:function(){this.$el.removeClass(this.pfx+"opac50")},updateStatus:function(e){l["default"].prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover}])},isVisible:function(){var e=this.model.get("style"),t=e.display;if(!t||"none"!=t)return 1},checkChildren:function(){var e=this.model,t=this.clsNoChild,n=this.countChildren(e),r=this.$el.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)),i=this.cnt;i||(i=this.$el.children("[data-count]").get(0),this.cnt=i),r[n?"removeClass":"addClass"](t),i&&(i.innerHTML=n||""),!n&&e.set("open",0)},countChildren:function(e){var t=0;return e.get("components").each(function(e){var n=this.opt.isCountable,r=this.config.hideTextnode;n&&!n(e,r)||t++},this),t},getCaret:function(){if(!this.caret||!this.caret.length){this.pfx;this.caret=this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))}return this.caret},setRoot:function(e){e=Object(i.isString)(e)?this.em.getWrapper().find(e)[0]:e;var t=Object(o.getModel)(e,d);t&&(this.stopListening(),this.model=t,this.initialize(this.opt),this.render())},updateLayerable:function(){var e=this.parentView,t=e||this;t.render()},render:function(){var e=this.model,t=this.config,o=this.pfx,s=this.ppfx,a=this.opt,l=a.isCountable,c=l&&!l(e,t.hideTextnode),u=this.isVisible(),d=this.$el.empty(),h=this.level+1;Object(i.isUndefined)(r)&&(r=n("./src/navigator/view/ItemsView.js")["default"]);var f=new r({collection:e.get("components"),config:this.config,sorter:this.sorter,opened:this.opt.opened,parentView:this,parent:e,level:h}).render().$el;return this.config.showWrapper||1!==h?(d.html(this.template(e)),d.find(".".concat(this.clsChildren)).append(f)):d.append(f),e.get("draggable")&&this.config.sortable||d.children(".".concat(this.clsMove)).remove(),!u&&(this.className+=" ".concat(o,"hide")),c&&(this.className+=" ".concat(s,"hidden")),d.attr("class",this.className),this.updateOpening(),this.updateStatus(),this.updateVisibility(),this}})},"./src/navigator/view/ItemsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/navigator/view/ItemView.js"),s=n("./src/dom_components/model/Component.js");t["default"]=i.a.View.extend({initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=e;var t=e.config||{};this.level=e.level,this.config=t,this.preview=e.preview,this.ppfx=t.pStylePrefix||"",this.pfx=t.stylePrefix||"",this.parent=e.parent,this.parentView=e.parentView;var n=this.pfx,r=this.ppfx,i=this.parent,o=this.collection;this.listenTo(o,"add",this.addTo),this.listenTo(o,"reset resetNavigator",this.render),this.listenTo(o,"remove",this.removeChildren),this.className="".concat(n,"layers");var a=t.em;if(t.sortable&&!this.opt.sorter){var l=a.get("Utils");this.opt.sorter=new l.Sorter({container:t.sortContainer||this.el, containerSel:".".concat(this.className),itemSel:".".concat(n,"layer"),ignoreViewChildren:1,onEndMove:function(e,t,n){var r=t.getSourceModel();a.setSelected(r,{forceChange:1}),a.trigger("".concat(s.eventDrag,":end"),n)},avoidSelectOnEnd:1,nested:1,ppfx:r,pfx:n})}this.sorter=this.opt.sorter||"",this.$el.data("collection",o),i&&this.$el.data("model",i)},removeChildren:function(e){var t=e.viewLayer;t&&t.remove.apply(t)},addTo:function(e){var t=this.collection.indexOf(e);this.addToCollection(e,null,t)},addToCollection:function(e,t,n){var r=this.level,i=this.parentView,s=t||null,a=o["default"],l=new a({level:r,model:e,parentView:i,config:this.config,sorter:this.sorter,isCountable:this.isCountable,opened:this.opt.opened}),c=l.render().el;if(s)s.appendChild(c);else if("undefined"!=typeof n){var u="before";this.$el.children().length==n&&(n--,u="after"),n<0?this.$el.append(c):this.$el.children().eq(n)[u](c)}else this.$el.append(c);return c},isCountable:function(e,t){var n=e.get("type"),r=e.get("tagName");return!(("textnode"==n||"br"==r)&&t||!e.get("layerable"))},render:function(){var e=this,t=document.createDocumentFragment(),n=this.el;return n.innerHTML="",this.collection.each(function(n){return e.addToCollection(n,t)}),n.appendChild(t),n.className=this.className,this}})},"./src/panels/config/config.js":function(e,t,n){"use strict";n.r(t);var r="sw-visibility",i="export-template",o="open-sm",s="open-tm",a="open-layers",l="open-blocks",c="fullscreen",u="preview";t["default"]={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:r,className:"fa fa-square-o",command:r,context:r,attributes:{title:"View components"}},{id:u,className:"fa fa-eye",command:u,context:u,attributes:{title:"Preview"}},{id:c,className:"fa fa-arrows-alt",command:c,context:c,attributes:{title:"Fullscreen"}},{id:i,className:"fa fa-code",command:i,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:o,className:"fa fa-paint-brush",command:o,active:!0,togglable:0,attributes:{title:"Open Style Manager"}},{id:s,className:"fa fa-cog",command:s,togglable:0,attributes:{title:"Settings"}},{id:a,className:"fa fa-bars",command:a,togglable:0,attributes:{title:"Open Layer Manager"}},{id:l,className:"fa fa-th-large",command:l,togglable:0,attributes:{title:"Open Blocks"}}]}],em:null,delayBtnsShow:300}},"./src/panels/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/panels/config/config.js"),i=n("./src/panels/model/Panel.js"),o=n("./src/panels/model/Panels.js"),s=(n("./src/panels/view/PanelView.js"),n("./src/panels/view/PanelsView.js"));t["default"]=function(){var e,t,n={};return{name:"Panels",init:function(i){n=i||{};for(var a in r["default"])a in n||(n[a]=r["default"][a]);var l=n.pStylePrefix;return l&&(n.stylePrefix=l+n.stylePrefix),e=new o["default"](n.defaults),t=new s["default"]({collection:e,config:n}),this},getPanels:function(){return e},getPanelsEl:function(){return t.el},addPanel:function(t){return e.add(t)},removePanel:function(t){return e.remove(t)},getPanel:function(t){var n=e.where({id:t});return n.length?n[0]:null},addButton:function(e,t){var n=this.getPanel(e);return n?n.get("buttons").add(t):null},removeButton:function(e,t){var n=this.getPanel(e);return n&&n.get("buttons").remove(t)},getButton:function(e,t){var n=this.getPanel(e);if(n){var r=n.get("buttons").where({id:t});return r.length?r[0]:null}return null},render:function(){return t.render().el},active:function(){this.getPanels().each(function(e){e.get("buttons").each(function(e){e.get("active")&&e.trigger("updateActive")})})},disableButtons:function(){this.getPanels().each(function(e){e.get("buttons").each(function(e){e.get("disable")&&e.trigger("change:disable")})})},Panel:i["default"]}}},"./src/panels/model/Button.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r);t["default"]=i.a.Model.extend({defaults:{id:"",label:"",tagName:"span",className:"",command:"",context:"",buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1},initialize:function(e){if(this.get("buttons").length){var t=n("./src/panels/model/Buttons.js")["default"];this.set("buttons",new t(this.get("buttons")))}}})},"./src/panels/model/Buttons.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/model/Button.js");t["default"]=i.a.Collection.extend({model:o["default"],deactivateAllExceptOne:function(e,t){this.forEach(function(n,r){n!==e&&(n.set("active",!1),t&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(e,t))})},deactivateAll:function(e,t){var n=e||"";this.forEach(function(e){e.get("context")==n&&e!==t&&(e.set("active",!1,{silent:1}),e.trigger("updateActive",{fromCollection:1}))})},disableAllButtons:function(e){var t=e||"";this.forEach(function(e,n){e.get("context")==t&&e.set("disable",!0)})},disableAllButtonsExceptOne:function(e,t){this.forEach(function(n,r){n!==e&&(n.set("disable",!0),t&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(e,t))})}})},"./src/panels/model/Panel.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/model/Buttons.js");t["default"]=i.a.Model.extend({defaults:{id:"",content:"",visible:!0,buttons:[],attributes:{}},initialize:function(e){this.btn=this.get("buttons")||[],this.buttons=new o["default"](this.btn),this.set("buttons",this.buttons)}})},"./src/panels/model/Panels.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/model/Panel.js");t["default"]=i.a.Collection.extend({model:o["default"]})},"./src/panels/view/ButtonView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=this.model,n=this.commands,r=this.$el,o=this.activeCls,s=e.fromCollection,a=t.get("context"),l=t.get("options"),u=t.get("command"),d={};n&&Object(c.isString)(u)?d=n.get(u)||{}:Object(c.isFunction)(u)?d=n.create({run:u}):null!==u&&Object(c.isObject)(u)&&(d=n.create(u)),t.get("active")?(!s&&t.collection.deactivateAll(a,t),t.set("active",!0,{silent:!0}).trigger("checkActive"),n.runCommand(d,i({},l,{sender:t})),d.noStop&&t.set("active",!1)):(r.removeClass(o),n.stopCommand(d,i({},l,{sender:t,force:1})))},updateDisable:function(){var e=this.disableCls,t=this.model,n=t.get("disable");this.$el[n?"addClass":"removeClass"](e)},checkActive:function(){var e=this.model,t=this.$el,n=this.activeCls;e.get("active")?t.addClass(n):t.removeClass(n)},clicked:function(e){this.model.get("bntsVis")||this.model.get("disable")||this.toggleActive()},toggleActive:function(){var e=this.model,t=e.attributes,n=t.active,r=t.togglable;if(!n||r){e.set("active",!n);this.em.get("Commands").get("select-comp");n?e.get("runDefaultCommand")&&this.em.runDefault():e.get("stopDefaultCommand")&&this.em.stopDefault()}},render:function(){var e=this.model.get("label"),t=this.$el;return t.empty(),this.updateAttributes(),e&&t.append(e),this.checkActive(),this.updateDisable(),this}})},"./src/panels/view/ButtonsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/panels/view/ButtonView.js"),s=n("./node_modules/underscore/underscore.js");n.n(s);t["default"]=i.a.View.extend({initialize:function(e){this.opt=e||{},this.config=this.opt.config||{},this.pfx=this.config.stylePrefix||"",this.parentM=this.opt.parentM||null,this.listenTo(this.collection,"add",this.addTo),this.listenTo(this.collection,"reset remove",this.render),this.className=this.pfx+"buttons"},addTo:function(e){this.addToCollection(e)},addToCollection:function(e,t){var n=t||null,r=o["default"],i=new r({model:e,config:this.config,parentM:this.parentM}),s=i.render().el;return n?n.appendChild(s):this.$el.append(s),s},render:function(){var e=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(t){this.addToCollection(t,e)},this),this.$el.append(e),this.$el.attr("class",Object(s.result)(this,"className")),this}})},"./src/panels/view/PanelView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return n=i({},a["default"],{},r),n.Parser=this,e=new c["default"](n),t=new l["default"](n),this.em=n.em,this.parserCss=t,this.parserHtml=e,this},parseHtml:function(n){var r=this.em,i=this.compTypes;return e.compTypes=r?r.get("DomComponents").getTypes():i,e.parse(n,t)},parseCss:function(e){return t.parse(e)}}}},"./src/parser/model/BrowserParserCss.js":function(e,t,n){"use strict";n.r(t),n.d(t,"parseSelector",function(){return l}),n.d(t,"parseStyle",function(){return c}),n.d(t,"parseCondition",function(){return u}),n.d(t,"createNode",function(){return d}),n.d(t,"parseNode",function(){return h});var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),{4:"media",5:"font-face",6:"page",7:"keyframes",11:"counter-style",12:"supports",13:"document",14:"font-feature-values",15:"viewport"}),o=Object(r.keys)(i),s=["5","6","11","15"],a=["font-face","page","counter-style","viewport"],l=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[],n=[],r=e.split(","),i=0,o=r.length;i1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=e.length,o=e[i-1],s=o?o.split(/:(.+)/):[],l=s[1],c=n.atRule,u=n.selectorsAdd,d=n.mediaText,h=a.indexOf(c)>=0;return h&&(r.singleAtRule=1),c&&(r.atRuleType=c),u&&(r.selectorsAdd=u),d&&(r.mediaText=d),l&&(e[i-1]=s[0],r.state=l,s.splice(s.length-1,1)),r.selectors=e,r.style=t,r},h=function f(e){for(var t=[],n=e.cssRules||[],r=0,a=n.length;r=0;if(y)g=1,m=i[p],v=u(h);else if(o.indexOf(p)>=0){var w=f(h);v=u(h);for(var x=0,C=w.length;x0&&void 0!==arguments[0]?arguments[0]:{};return{parse:function(t){var n=this,r=[],o=e.parserCss,s=e.em,a=void 0===s?{}:s,l=a&&a.get&&a.get("Editor"),c=o?o(t,l):Object(i["default"])(t);return c.forEach(function(e){return r=r.concat(n.checkNode(e))}),r},checkNode:function(e){var t=e,n=t.selectors,o=t.style;if(Object(r.isString)(n)){var s=[],a=Object(i.parseSelector)(n),l=a.result,c=a.add.join(", "),u={atRule:e.atRule,mediaText:e.params};if(l.length?l.forEach(function(e){s.push(Object(i.createNode)(e,o,u))}):s.push(Object(i.createNode)([],o,u)),c){var d=s[s.length-1];d.selectorsAdd=c}e=s}return e}}}},"./src/parser/model/ParserHtml.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/typeof.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js");n.n(o);t["default"]=function(e){var t=e,n="data-gjs-";return{compTypes:"",modelAttrStart:n,splitPropsFromAttr:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},i={};return Object(o.each)(t,function(t,s){if(0===s.indexOf(e.modelAttrStart)){var a=s.replace(n,""),l=t.length,c=t&&Object(o.isString)(t),u=c&&t.substr(0,1),d=c&&t.substr(l-1);t="true"===t||t,t="false"!==t&&t;try{t="{"==u&&"}"==d||"["==u&&"]"==d?JSON.parse(t):t}catch(h){}r[a]=t}else i[s]=t}),{props:r,attrs:i}},parseStyle:function(e){for(var t={},n=e.split(";"),r=0,i=n.length;r0&&void 0!==arguments[0]?arguments[0]:{};a=i({},d["default"],{},n);var r=a.pStylePrefix;return r&&(a.stylePrefix=r+a.stylePrefix),this.pfx=a.stylePrefix,t=a.actions||[],e=document.createElement("div"),e.className="".concat(r,"rte-toolbar ").concat(r,"one-bg"),o=this.initRte(document.createElement("div")),Object(u.on)(e,"mousedown",function(e){return e.stopPropagation()}),this},destroy:function(){var t=this.customRte;o&&o.destroy(),t&&t.destroy&&t.destroy(),e=0,o=0,this.actionbar=0,this.actions=0},postRender:function(t){var n=t.model.get("Canvas");e.style.pointerEvents="all",l(),n.getToolsEl().appendChild(e)},initRte:function(t){var n=this.pfx,r=e,i=this.actionbar,l=this.actions||s()(a.actions),u={actionbar:"".concat(n,"actionbar"),button:"".concat(n,"action"),active:"".concat(n,"active"),inactive:"".concat(n,"inactive"),disabled:"".concat(n,"disabled")},d=new c["default"]({el:t,classes:u,actions:l,actionbar:i,actionbarContainer:r});return o&&o.setEl(t),d.actionbar&&(this.actionbar=d.actionbar),d.actions&&(this.actions=d.actions),d},add:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.name=e,o.addAction(t,{sync:1})},get:function(e){var t;return o.getActions().forEach(function(n){n.name==e&&(t=n)}),t},getAll:function(){return o.getActions()},remove:function(e){var t=this.getAll(),n=this.get(e);if(n){var r=n.btn,i=t.indexOf(n);r.parentNode.removeChild(r),t.splice(i,1)}return n},getToolbarEl:function(){return e},updatePosition:function(){var t="px",r=a.em.get("Canvas"),i=e,o=i.style,s=r.getTargetToElementFixed(n,e,{event:"rteToolbarPosUpdate"});o.top=s.top+t,o.left=0+t},enable:function(t,i){n=t.el;var o=a.em.get("Canvas"),s=a.em,l=t.getChildrenContainer(),c=this.customRte;if(r=o.getElementPos(n),e.style.display="",i=c?c.enable(l,i):this.initRte(l).enable(),s){setTimeout(this.updatePosition.bind(this),0);var u="change:canvasOffset canvasScroll frame:scroll component:update";s.off(u,this.updatePosition,this),s.on(u,this.updatePosition,this),s.trigger("rte:enable",t,i)}return i},disable:function(e,t){var n=a.em,r=this.customRte,i=e.getChildrenContainer();r?r.disable(i,t):t&&t.disable(),l(),n&&n.trigger("rte:disable",e,t)}}}},"./src/rich_text_editor/model/RichTextEditor.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;tB",attributes:{title:"Bold"},result:function(e){return e.exec("bold")}},italic:{name:"italic",icon:"I",attributes:{title:"Italic"},result:function(e){return e.exec("italic")}},underline:{name:"underline",icon:"U",attributes:{title:"Underline"},result:function(e){return e.exec("underline")}},strikethrough:{name:"strikethrough",icon:"S",attributes:{title:"Strike-through"},result:function(e){return e.exec("strikeThrough")}},link:{icon:'',name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},state:function(e,t){return e&&e.selection()&&p(e)?f.ACTIVE:f.INACTIVE},result:function(e){p(e)?e.exec("unlink"):e.insertHTML(''.concat(e.selection(),""))}}},m=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,e);var r=n.el;if(r[h])return r[h];r[h]=this,this.setEl(r),this.updateActiveActions=this.updateActiveActions.bind(this);var o=n.actions||[];o.forEach(function(e,t){"string"==typeof e?e=g[e]:g[e.name]&&(e=i({},g[e.name],{},e)),o[t]=e});var s=o.length?o:Object.keys(g).map(function(e){return g[e]});n.classes=i({},{actionbar:"actionbar",button:"action",active:"active",disabled:"disabled",inactive:"inactive"},{},n.classes);var a=n.classes,c=n.actionbar;if(this.actionbar=c,this.settings=n,this.classes=a,this.actions=s,!c){var u=n.actionbarContainer;c=document.createElement("div"),c.className=a.actionbar,u.appendChild(c),this.actionbar=c,s.forEach(function(e){return t.addAction(e)})}return n.styleWithCSS&&this.exec("styleWithCSS"),this.syncActions(),this}return u()(e,[{key:"destroy",value:function(){this.el=0,this.doc=0,this.actionbar=0,this.settings={},this.classes={},this.actions=[]}},{key:"setEl",value:function(e){this.el=e,this.doc=e.ownerDocument}},{key:"updateActiveActions",value:function(){var e=this;this.getActions().forEach(function(t){var n=t.btn,r=t.update,o=i({},e.classes),s=o.active,a=o.inactive,l=o.disabled,c=t.state,u=t.name,d=e.doc;if(n.className=n.className.replace(s,"").trim(),n.className=n.className.replace(a,"").trim(),n.className=n.className.replace(l,"").trim(),c)switch(c(e,d)){case f.ACTIVE:n.className+=" ".concat(s);break;case f.INACTIVE:n.className+=" ".concat(a);break;case f.DISABLED:n.className+=" ".concat(l)}else d.queryCommandSupported(u)&&d.queryCommandState(u)&&(n.className+=" ".concat(s));r&&r(e,t)})}},{key:"enable",value:function(){return this.enabled?this:(this.actionbarEl().style.display="",this.el.contentEditable=!0,Object(d.on)(this.el,"mouseup keyup",this.updateActiveActions),this.syncActions(),this.updateActiveActions(),this.el.focus(),this.enabled=1,this)}},{key:"disable",value:function(){return this.actionbarEl().style.display="none",this.el.contentEditable=!1,Object(d.off)(this.el,"mouseup keyup",this.updateActiveActions),this.enabled=0,this}},{key:"syncActions",value:function(){var e=this;this.getActions().forEach(function(t){if(e.settings.actionbar&&(!t.state||t.state&&t.state(e,e.doc)>=0)){var n=t.event||"click";t.btn["on".concat(n)]=function(n){t.result(e,t),e.updateActiveActions()}}})}},{key:"addAction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sync,r=document.createElement("span"),i=e.icon,o=e.attributes||{};r.className=this.classes.button,e.btn=r;for(var s in o)r.setAttribute(s,o[s]);"string"==typeof i?r.innerHTML=i:r.appendChild(i),this.actionbarEl().appendChild(r),n&&(this.actions.push(e),this.syncActions())}},{key:"getActions",value:function(){return this.actions}},{key:"selection",value:function(){return this.doc.getSelection()}},{key:"exec",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.doc.execCommand(e,!1,t)}},{key:"actionbarEl",value:function(){return this.actionbar}},{key:"insertHTML",value:function(e){var t,n=this.doc,r=n.getSelection();if(r&&r.rangeCount){var i=n.createElement("div"),o=r.getRangeAt(0);o.deleteContents(),i.innerHTML=e,Array.prototype.slice.call(i.childNodes).forEach(function(e){o.insertNode(e),t=e}),r.removeAllRanges(),r.addRange(o),this.el.focus()}}}]),e}()},"./src/selector_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"clm-",appendTo:"",selectors:[],states:[{name:"hover"},{name:"active"},{name:"nth-of-type(2n)"}],escapeName:0,selectedName:0,iconAdd:'',iconSync:'',iconTagOn:'',iconTagOff:'',iconTagRemove:'', render:0,componentFirst:0}},"./src/selector_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};n=i({},c["default"],{},e);var r=n.em,o=n.pStylePrefix;return this.em=r,o&&(n.stylePrefix=o+n.stylePrefix),this.selectorTags=new h["default"]({collection:new d["default"]([],{em:r,config:n}),config:n}),t=new d["default"](n.selectors),t.on("add",function(e){return r.trigger("selector:add",e)}),t.on("remove",function(e){return r.trigger("selector:remove",e)}),t.on("change",function(e){return r.trigger("selector:update",e,e.previousAttributes(),e.changedAttributes())}),r.on("change:state",function(e,t){return r.trigger("selector:state",t)}),this},postRender:function(){var e=this.getConfig().appendTo;if(e){var t=Object(a.isElement)(e)?e:document.querySelector(e);t.appendChild(this.render([]))}},select:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(e)?e:[e],r=this.em.get("StyleManager").setTarget(n,t),i=r.filter(function(e){return e}).map(function(e){return Object(l.isComponent)(e)?e:Object(l.isRule)(e)&&!e.get("selectorsAdd")?e:e.getSelectorsString()});return this.selectorTags.componentChanged({targets:i}),this},setState:function(e){return this.em.setState(e),this},getState:function(){return this.em.setState()},addSelector:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i({},r);Object(a.isObject)(e)?o=e:o.name=e,f(o.name)?(o.name=o.name.substr(1),o.type=u["default"].TYPE_ID):p(o.name)&&(o.name=o.name.substr(1)),o.label&&!o.name&&(o.name=this.escapeName(o.label));var s=o.name,l=s?this.get(s,o.type):t.where(o)[0];return l?l:t.add(o,{config:n})},getSelector:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u["default"].TYPE_CLASS;return f(e)?(e=e.substr(1),n=u["default"].TYPE_ID):p(e)&&(e=e.substr(1)),t.where({name:e,type:n})[0]},add:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(a.isArray)(e)?e.map(function(e){return t.addSelector(e,n)}):this.addSelector(e,n)},addClass:function(e){var t=this,n=[];return Object(a.isString)(e)&&(e=e.trim().split(" ")),e.forEach(function(e){return n.push(t.addSelector(e))}),n},get:function(e,t){var n=this;if(Object(a.isArray)(e)){var r=[],i=e.map(function(e){return n.getSelector(e)}).filter(function(e){return e});return i.forEach(function(e){return r.indexOf(e)<0&&r.push(e)}),r}return this.getSelector(e,t)},getAll:function(){return t},escapeName:function r(e){var t=n,r=t.escapeName;return r?r(e):u["default"].escapeName(e)},render:function(e){return e?(this.selectorTags=new h["default"]({collection:new d["default"](e),config:n}),this.selectorTags.render().el):this.selectorTags.render().el}}}},"./src/selector_manager/model/Selector.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=1,s=2,a=i.a.Model.extend({idAttribute:"name",defaults:{name:"",label:"",type:o,active:!0,"private":!1,"protected":!1},initialize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.config,r=void 0===n?{}:n,i=this.get("name"),o=this.get("label");i?o||this.set("label",i):this.set("name",o);var s=this.get("name"),l=r.escapeName,c=l?l(s):a.escapeName(s);this.set("name",c)},getFullName:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.escape,n=this.get("name"),r="";switch(this.get("type")){case o:r=".";break;case s:r="#"}return r+(t?t(n):n)}},{TYPE_CLASS:o,TYPE_ID:s,escapeName:function(e){return"".concat(e).trim().replace(/([^a-z0-9\w-\:]+)/gi,"-")}});t["default"]=a},"./src/selector_manager/model/Selectors.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/selector_manager/model/Selector.js");t["default"]=o.a.Collection.extend({model:s["default"],modelId:function(e){return"".concat(e.name,"_").concat(e.type||s["default"].TYPE_CLASS)},getStyleable:function(){return Object(r.filter)(this.models,function(e){return e.get("active")&&!e.get("private")})},getValid:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.noDisabled;return Object(r.filter)(this.models,function(e){return!e.get("private")}).filter(function(e){return t?e.get("active"):1})},getFullString:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=e||this;return r.forEach(function(e){return n.push(e.getFullName(t))}),n.join("").trim()}})},"./src/selector_manager/view/ClassTagView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o="contentEditable";t["default"]=i.a.View.extend({template:function(){var e=this.pfx,t=this.model,n=this.config,r=t.get("label")||"";return'\n \n ').concat(r,'\n \n ').concat(n.iconTagRemove,"\n \n ")},events:{"click [data-tag-remove]":"removeTag","click [data-tag-status]":"changeStatus","dblclick [data-tag-name]":"startEditTag","focusout [data-tag-name]":"endEditTag"},initialize:function(e){var t=e.config||{};this.config=t,this.coll=e.coll||null,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.em=t.em,this.listenTo(this.model,"change:active",this.updateStatus)},getInputEl:function(){return this.inputEl||(this.inputEl=this.el.querySelector("[data-tag-name]")),this.inputEl},startEditTag:function(){var e=this.em,t=this.getInputEl();t[o]=!0,t.focus(),e&&e.setEditing(1)},endEditTag:function(){var e=this.model,t=this.getInputEl(),n=t.textContent,r=this.em,i=r&&r.get("SelectorManager");if(t[o]=!1,r&&r.setEditing(0),i){var s=i.escapeName(n);i.get(s)?t.innerText=e.get("label"):e.set({name:s,label:n})}},changeStatus:function(){var e=this.model;e.set("active",!e.get("active"))},removeTag:function(){var e=this.em,t=this.model,n=e&&e.getSelectedAll();n.forEach(function(e){!t.get("protected")&&e&&e.getSelectors().remove(t)})},updateStatus:function(){var e=this.model,t=this.$el,n=this.config,r=n.iconTagOn,i=n.iconTagOff,o=t.find("[data-tag-status]");e.get("active")?(o.html(r),t.removeClass("opac50")):(o.html(i),t.addClass("opac50"))},render:function(){var e=this.pfx,t=this.ppfx;return this.$el.html(this.template()),this.$el.attr("class","".concat(e,"tag ").concat(t,"three-bg")),this.updateStatus(),this}})},"./src/selector_manager/view/ClassTagsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./node_modules/backbone/backbone.js")),a=n.n(s),l=n("./src/selector_manager/view/ClassTagView.js");t["default"]=a.a.View.extend({template:function(e){var t=e.labelInfo,n=e.labelStates,r=e.labelHead,i=e.iconSync,o=e.iconAdd,s=e.pfx,a=e.ppfx;return'\n
\n
').concat(r,'
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n ').concat(o,'\n \n \n
\n
\n
').concat(t,':
\n
\n
\n
')},events:{"change [data-states]":"stateChanged","click [data-add]":"startNewTag","focusout [data-input]":"endNewTag","keyup [data-input]":"onInputKeyUp","click [data-sync-style]":"syncStyle"},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=e.config||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.className=this.pfx+"tags",this.stateInputId=this.pfx+"states",this.stateInputC=this.pfx+"input-c",this.states=this.config.states||[];var t=this.config.em,n=this.getStyleEmitter(),r=this.collection;this.target=this.config.em,this.em=t;var i="component:toggled component:update:classes",o="component:update:classes change:state";this.listenTo(t,i,this.componentChanged),this.listenTo(n,"styleManager:update",this.componentChanged),this.listenTo(t,o,this.__handleStateChange),this.listenTo(t,"styleable:change change:device",this.checkSync),this.listenTo(r,"add",this.addNew),this.listenTo(r,"reset",this.renderClasses),this.listenTo(r,"remove",this.tagRemoved),this.delegateEvents()},syncStyle:function(){var e,t=this.em,n=this.getTarget(),r=t.get("CssComposer"),i={noDisabled:1},o=this.getCommonSelectors({opts:i}),s=t.get("state"),a=t.getCurrentMedia(),l=[],c=r.get(o,s,a)||r.add(o,s,a);this.getTargets().forEach(function(t){var n=r.getIdRule(t.getId(),{state:s,mediaText:a});e=n.getStyle(),n.setStyle({}),l.push(n)}),e&&c.addStyle(e),t.trigger("component:toggled"),t.trigger("component:sync-style",{component:n,selectors:o,mediaText:a,rule:c,ruleComponents:l,state:s})},getStyleEmitter:function(){var e=this.em,t=e&&e.get("StyleManager"),n=t&&t.getEmitter();return n||{}},tagRemoved:function(e){this.updateStateVis()},getStateOptions:function(){var e=this.states,t=this.em,n=[];return e.forEach(function(e){return n.push('"))}),n.join("")},addNew:function(e){this.addToClasses(e)},startNewTag:function(){this.$addBtn.css({display:"none"}),this.$input.show().focus()},endNewTag:function(){this.$addBtn.css({display:""}),this.$input.hide().val("")},onInputKeyUp:function(e){13===e.keyCode?this.addNewTag(this.$input.val()):27===e.keyCode&&this.endNewTag()},checkStates:function(){var e=this.em.getState(),t=this.getStates();t&&t.val(e)},componentChanged:Object(o.debounce)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.targets;this.updateSelection(t)}),updateSelection:function(e){var t=e||this.getTargets();t=Object(o.isArray)(t)?t:[t];var n=[];return t&&t.length&&(n=this.getCommonSelectors({targets:t}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(t),n},getCommonSelectors:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.targets,n=e.opts,r=void 0===n?{}:n,o=t||this.getTargets(),s=o.map(function(e){return e.getSelectors&&e.getSelectors().getValid(r)}).filter(function(e){return e});return this._commonSelectors.apply(this,i()(s))},_commonSelectors:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0}):n.slice(1).reduce(function(t,n){return e._commonSelectors(t,n)},n[0]):[]},checkSync:Object(o.debounce)(function(){var e,t=this.$btnSyncEl,n=this.config,r=this.collection,i=this.getTarget();if(i&&n.componentFirst&&r.length){var s=i.getStyle();e=!Object(o.isEmpty)(s)}t&&t[e?"show":"hide"]()}),getTarget:function(){return this.target.getSelected()},getTargets:function(){return this.target.getSelectedAll()},updateStateVis:function(e){var t=this.em,n=t&&t.getConfig("avoidInlineStyle"),r=this.collection.length||n?"":"none";this.getStatesC().css("display",r),this.updateSelector(e)},__handleStateChange:function(){this.updateSelector(this.getTargets())},updateSelector:function(e){var t=this,n=this.el.querySelector("[data-selected]"),r=[],i=e||this.getTargets();i=Object(o.isArray)(i)?i:[i],i.forEach(function(e){return r.push(t.__getName(e))}),n&&(n.innerHTML=r.join(", ")),this.checkStates()},__getName:function(e){var t,n=this.pfx,r=this.config,i=this.em,s=r.selectedName,a=r.componentFirst;if(Object(o.isString)(e))t='').concat(e,"");else{if(!e||!e.get)return;var l=e.getSelectors().getStyleable(),c=i.get("state"),u=e.getId?'').concat(e.getName(),'#').concat(e.getId(),""):"";t=this.collection.getFullString(l),t=t?'').concat(t,""):e.get("selectorsAdd")||u,t=a&&u?u:t,t+=c?':').concat(c,""):"",t=s?s({result:t,state:c,target:e}):t}return t&&'').concat(t,"")},stateChanged:function(e){var t=this.em,n=e.target.value;t.set("state",n)},addNewTag:function(e){var t=this,n=this.em;if(e.trim()){if(n){var r=n.get("SelectorManager"),i=r.add({label:e});this.getTargets().forEach(function(e){e.getSelectors().add(i),t.collection.add(i),t.updateStateVis()})}this.endNewTag()}},addToClasses:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t,r=this.getClasses(),i=new l["default"]({model:e,config:this.config,coll:this.collection}).render().el;return n?n.appendChild(i):r.append(i),i},renderClasses:function(){var e=this,t=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each(function(n){return e.addToClasses(n,t)}),n.append(t)},getClasses:function(){return this.$el.find("[data-selectors]")},getStates:function(){if(!this.$states){var e=this.$el.find("[data-states]");this.$states=e[0]&&e}return this.$states},getStatesC:function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},render:function c(){var e=this.em,t=this.pfx,n=this.ppfx,r=this.config,i=this.$el,o=this.el,c=r.render,s=r.iconSync,a=r.iconAdd,l={iconSync:s,iconAdd:a,labelHead:e.t("selectorManager.label"),labelStates:e.t("selectorManager.emptyState"),labelInfo:e.t("selectorManager.selected"),ppfx:n,pfx:t,el:o};i.html(this.template(l));var u=c&&c(l);u&&u!==o&&i.empty().append(u),this.$input=i.find("[data-input]"),this.$addBtn=i.find("[data-add]"),this.$classes=i.find("#"+t+"tags-c"),this.$btnSyncEl=i.find("[data-sync-style]"),this.$input.hide();var d=this.getStates();return d&&d.append(this.getStateOptions()),this.renderClasses(),i.attr("class","".concat(this.className," ").concat(n,"one-bg ").concat(n,"two-color")),this}})},"./src/storage_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={id:"gjs-",autosave:1,autoload:1,type:"local",stepsBeforeSave:1,storeComponents:1,storeStyles:1,storeHtml:1,storeCss:1,checkLocal:1,params:{},headers:{},urlStore:"",urlLoad:"",beforeSend:function(e,t){},onComplete:function(e,t){},contentTypeJson:!0,credentials:"include",fetchOptions:""}},"./src/storage_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return t=i({},a["default"],{},n),e=t.em,t._disable&&(t.type=0),r.remote=new c["default"](t),r.local=new l["default"](t),t.currentStorage=t.type,this.loadDefaultProviders().setCurrent(t.type),this},getConfig:function(){return t},isAutosave:function(){return!!t.autosave},setAutosave:function(e){return t.autosave=!!e,this},getStepsBeforeSave:function(){return t.stepsBeforeSave},setStepsBeforeSave:function(e){return t.stepsBeforeSave=e,this},add:function(e,t){return n[e]=t,this},get:function(e){return n[e]||null},getStorages:function(){return n},getCurrent:function(){return t.currentStorage},setCurrent:function(e){return t.currentStorage=e,this},store:function(e,n){var r=this,i=this.get(this.getCurrent()),o={};this.onStart("store",e);for(var s in e)o[t.id+s]=e[s];return i?i.store(o,function(e){n&&n(e),r.onEnd("store",e)},function(e){r.onError("store",e)}):null},load:function(e,n){var r=this,i=this.get(this.getCurrent()),o=[],s={};"string"==typeof e&&(e=[e]),this.onStart("load",e);for(var a=0,l=e.length;a1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,l=this.get("contentTypeJson"),c=this.get("headers")||{},d=this.get("params"),h="X-Requested-With",f="Content-Type",p=o.body||{};for(var g in d)p[g]=d[g];if(Object(u.isUndefined)(c[h])&&(c[h]="XMLHttpRequest"),Object(u.isUndefined)(c[f])&&l&&(c[f]="application/json; charset=utf-8"),l)n=JSON.stringify(p);else{n=new FormData;for(var m in p)n.append(m,p[m])}t={method:o.method||"post",credentials:this.get("credentials"),headers:c},"post"===t.method&&(t.body=n);var v=this.get("fetchOptions")||{},b=Object(u.isFunction)(v)?v(t):t;this.onStart(),this.fetch(e,i({},t,{},b||{})).then(function(e){return 1==(e.status/200|0)?e.text():e.text().then(function(e){return Promise.reject(e)})}).then(function(e){return r.onResponse(e,s)})["catch"](function(e){return r.onError(e,a)})}})},"./src/style_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"sm-",sectors:[],appendTo:"",hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:0,avoidComputed:["width","height"]}},"./src/style_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},i=this.getSector(e);return i||(n.id=e,i=t.add(n,r)),i},getSector:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.where({id:e})[0];return!r&&n.warn&&this._logNoSector(e),r},removeSector:function(e){return this.getSectors().remove(this.getSector(e,{warn:1}))},getSectors:function(){return t},addProperty:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getSector(e,{warn:1}),i=null;return r&&(i=r.get("properties").add(t,n)),i},getProperty:function(e,t){var n=this.getSector(e,{warn:1}),r=null;return n&&(r=n.get("properties").where({property:t}),r=1==r.length?r[0]:r),r},removeProperty:function(e,t){var n=this.getProperties(e);return n&&n.remove(this.getProperty(e,t))},getProperties:function(e){var t=null,n=this.getSector(e,{warn:1});return n&&(t=n.get("properties")),t},getModelToStyle:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.em,i=t.skipAdd,o=e.get("classes"),s=e.getId();if(n){var a,l=n.getConfig(),c=n.get("UndoManager"),u=n.get("CssComposer"),d=n.get("SelectorManager"),h=d?d.getConfig():{},f=l.devicePreviewMode?"":n.get("state"),p=o.getStyleable(),g=p.length,m=!h.componentFirst||t.useClasses,v={state:f};if(c.stop(),g&&m){var b=n.getCurrentMedia();a=u.get(p,f,b),a||i||(a=u.add(p,f,b))}else l.avoidInlineStyle&&(a=u.getIdRule(s,v),!a&&!i&&(a=u.setIdRule(s,{},v)),e.is("wrapper")&&a.set("wrapper",1));a&&(e=a),c.start()}return e},addType:function(t,n){e.addType(t,n)},getType:function(t){return e.getType(t)},getTypes:function(){return e.getTypes()},createType:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.model,o=void 0===n?{}:n,s=t.view,a=void 0===s?{}:s,l=this.getType(e);if(l)return new l.view(i({model:new l.model(o),config:r},a))},setTarget:function(e,t){return n.setTarget(e,t)},getEmitter:function(){return n.propTarget},render:function(){return n.render().el},_logNoSector:function(e){var t=this.em;t&&t.logWarning("'".concat(e,"' sector not found"))}}}},"./src/style_manager/model/Layer.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/style_manager/model/Properties.js");t["default"]=i.a.Model.extend({defaults:{index:"",value:"",values:{},active:!1,preview:!1,properties:[]},initialize:function(){var e=this.get("properties"),t=this.get("value");this.set("properties",e instanceof o["default"]?e:new o["default"](e));var n=this.get("properties");if(n.forEach(this.onPropAdd,this),this.listenTo(n,"add",this.onPropAdd),!t){var r="",i=this.get("values");for(var s in i)r+=" "+i[s];this.set("value",r.trim())}},onPropAdd:function(e){var t=this.collection;e.parent=t&&t.property},getPropertyAt:function(e){return this.get("properties").at(e)},getPropertyValue:function(e){var t="";return this.get("properties").each(function(n){n.get("property")==e&&(t=n.getFullValue())}),t},getFullValue:function(){var e=[];return this.get("properties").each(function(t){return e.push(t.getFullValue())}),e.join(" ").trim()}})},"./src/style_manager/model/Layers.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get("id")||"",r=this.get("name")||"";!this.get("property")&&this.set("property",(r||n).replace(/ /g,"-"));var i=this.get("property");!this.get("id")&&this.set("id",i),!r&&this.set("name",Object(u.capitalize)(i).replace(/-/g," ")),d.callInit(this,e,t)},init:function(){},clearValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,status:""},e),this},setValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parseValue(e);this.set(r,i({},n,{avoidStore:!t}))},setValueFromInput:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(e,t,i({},n,{fromInput:1}))},parseValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:e},r="!important";if(Object(c.isString)(e)&&e.indexOf(r)!==-1&&(n.value=e.replace(r,"").trim(),n.important=1),!this.get("functionName")&&!t.complete)return n;var i=[],o="".concat(n.value),s=o.indexOf("(")+1,a=o.lastIndexOf(")"),l=o.substring(0,s-1);if(l&&(n.functionName=l),i.push(s),a>=0&&i.push(a),n.value=String.prototype.substring.apply(o,i),t.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,""),n.value=u}return n},splitValues:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=[],r="(",i=")",o="",s=0;return(e||"").split("").forEach(function(e){e==r?(s++,o+=r):e==i&&s>0?(s--,o+=i):e===t&&0==s?(n.push(o),o=""):o+=e}),""!==o&&n.push(o),n.map(function(e){return e.trim()})},getDefaultValue:function(){return this.get("defaults")},getFullValue:function(e){var t=this.get("functionName"),n=this.getDefaultValue(),r=Object(c.isUndefined)(e)?this.get("value"):e,i=!Object(c.isUndefined)(r)&&""!==r;return r&&n&&r===n?n:(t&&i&&(r="".concat(t,"(").concat(r,")")),i&&this.get("important")&&(r="".concat(r," !important")),r||"")}},{callParentInit:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.prototype.initialize.apply(t,[n,i({},r,{skipInit:1})])},callInit:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&e.init(t,n)}});t["default"]=d},"./src/style_manager/model/PropertyComposite.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a["default"].callParentInit(a["default"],this,e,t);var r=this.get("properties")||[],i=n("./src/style_manager/model/Properties.js")["default"];this.set("properties",new i(r)),this.listenTo(this,"change:value",this.updateValues),a["default"].callInit(this,e,t)},clearValue:function(){arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.get("properties").each(function(e){return e.clearValue()}),a["default"].prototype.clearValue.apply(this,arguments)},updateValues:function(){var e=this.getFullValue().split(this.getSplitSeparator());this.get("properties").each(function(t,n){var r=e.length;e[n]||e[n%r+(1!=r&&r%2?1:0)]})},getSplitSeparator:function(){return new RegExp("".concat(this.get("separator"),"(?![^\\(]*\\))"))},getDefaultValue:function(e){var t=this.get("defaults");if(t&&!e)return t;t="";var n=this.get("properties");return n.each(function(e,n){return t+="".concat(e.getDefaultValue()," ")}),t.trim()},getFullValue:function(){return this.get("detached")?"":this.get("properties").getFullValue()},getPropertyAt:function(e){return this.get("properties").at(e)}})},"./src/style_manager/model/PropertyFactory.js":function(e,t,n){"use strict";n.r(t),t["default"]=function(){return{build:function(e){var t=[];"string"==typeof e&&(e=[e]);for(var n=0,r=e.length;n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l["default"].callParentInit(l["default"],this,e,t);var n=this.get("unit"),r=this.get("units");this.input=new c["default"]({model:this}),r.length&&!n&&this.set("unit",r[0]),l["default"].callInit(this,e,t)},clearValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,unit:void 0},e),this},parseValue:function(e){var t=l["default"].prototype.parseValue.apply(this,arguments),n=this.input.validateInputValue(t.value,{deepCheck:1}),r=n.value,i=n.unit;return t.value=r,t.unit=i,t},getFullValue:function(){var e=this.get("value"),t=this.get("unit");return e=Object(a.isUndefined)(e)?"":e,t=!Object(a.isUndefined)(t)&&e?t:"",e="".concat(e).concat(t),l["default"].prototype.getFullValue.apply(this,[e])}})},"./src/style_manager/model/PropertyRadio.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];return this.set("options",e),this},addOption:function(e){if(e){var t=this.getOptions();this.setOptions([].concat(s()(t),[e]))}return this}})},"./src/style_manager/model/PropertySelect.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a["default"].callParentInit(a["default"],this,e,t);var n=this.get("layers"),r=new l["default"](n);r.property=this,r.properties=this.get("properties"),this.set("layers",r),a["default"].callInit(this,e,t)},getLayers:function(){return this.get("layers")},getCurrentLayer:function(){return this.getLayers().filter(function(e){return e.get("active")})[0]},getFullValue:function(){return this.get("detached")?"":this.get("layers").getFullValue()},getValueFromStyle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.getLayers().getLayersFromStyle(e);return new l["default"](t).getFullValue()},clearValue:function(){return this.getLayers().reset(),a["default"].prototype.clearValue.apply(this,arguments)},getLayersFromTarget:function(e){}})},"./src/style_manager/model/Sector.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/style_manager/model/Properties.js")),a=n("./src/style_manager/model/PropertyFactory.js");t["default"]=i.a.Model.extend({defaults:{id:"",name:"",open:!0,buildProps:"",extendBuilded:1,properties:[]},initialize:function(e){var t=e||{},n=this.buildProperties(t.buildProps),r=this.get("name")||"",i=[];!this.get("id")&&this.set("id",r.replace(/ /g,"_").toLowerCase()),i=n?this.extendProperties(n):this.get("properties");var o=new s["default"](i);o.sector=this,this.set("properties",o)},extendProperties:function(e,t,n){for(var r=e.length,i=t||this.get("properties"),s=this.get("extendBuilded"),a=[],l=0,c=i.length;l\n \n
\n
').concat(i,'
\n
\n \t
\n
\n
\n ⨯\n
\n
\n
\n ')},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.model;this.stackModel=e.stackModel,this.config=e.config||{},this.em=this.config.em,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.sorter=e.sorter||null,this.propsConfig=e.propsConfig||{},this.customPreview=e.onPreview,this.listenTo(t,"destroy remove",this.remove),this.listenTo(t,"change:active",this.updateVisibility),this.listenTo(t.get("properties"),"change",this.updatePreview),t.view=this,t.set({droppable:0,draggable:1}),this.$el.data("model",t)},initSorter:function(e){this.sorter&&this.sorter.startSort(this.el)},remove:function(e){e&&e.stopPropagation&&e.stopPropagation();var t=this.model,n=t.collection,r=this.stackModel;o.a.View.prototype.remove.apply(this,arguments),n.contains(t)&&n.remove(t),r&&r.set&&(r.set({stackIndex:null},{silent:!0}),r.trigger("updateValue"))},onPreview:function(e){var t=this.stackModel,n=t&&t.get("detached"),r=e.split(" "),i=3,o=[],s={};return this.model.get("properties").each(function(e,t){var a=e.get("property"),l=n?e.getFullValue():r[t]||"";if(l&&"integer"==e.get("type")){var c=parseInt(l,10),u=l.replace(c,"");c=isNaN(c)?0:c,c=c>i?i:c,c=c<-i?-i:c,l=c+u}o.push(l),s[a]=l}),n?s:o.join(" ")},updatePreview:function(){var e=this.stackModel,t=this.customPreview,n=this.getPreviewEl(),i=this.model.getFullValue(),o=t?t(i):this.onPreview(i);if(o&&e&&n){var s=n.style;if(Object(r.isString)(o))s[e.get("property")]=o;else{var a=[];Object(r.each)(o,function(e,t){return a.push("".concat(t,":").concat(e))}),n.setAttribute("style",a.join(";"))}}},getPropertiesWrapper:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},getPreviewEl:function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},active:function(){var e=this.model,t=e.collection;t.active(t.indexOf(e))},updateVisibility:function(){var e=this.pfx,t=this.getPropertiesWrapper(),n=this.model.get("active");t.style.display=n?"":"none",this.$el[n?"addClass":"removeClass"]("".concat(e,"active"))},render:function(){var e=this.propsConfig,t=this.model,n=this.el,r=this.pfx,i=t.get("preview"),o=new s["default"]({collection:t.get("properties"),config:this.config,target:e.target,customValue:e.customValue,propTarget:e.propTarget,onChange:e.onChange}).render().el;return n.innerHTML=this.template(t),n.className="".concat(r,"layer").concat(i?"":" ".concat(r,"no-preview")),this.getPropertiesWrapper().appendChild(o),this.updateVisibility(),this.updatePreview(),this}})},"./src/style_manager/view/LayersView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/style_manager/view/LayerView.js");t["default"]=i.a.View.extend({initialize:function(e){this.config=e.config||{},this.stackModel=e.stackModel,this.preview=e.preview,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.propsConfig=e.propsConfig;var t=this.pfx,n=this.ppfx,r=this.collection;this.className="".concat(t,"layers ").concat(n,"field"),this.listenTo(r,"add",this.addTo),this.listenTo(r,"deselectAll",this.deselectAll),this.listenTo(r,"reset",this.render);var i=this.config.em||"",o=i?i.get("Utils"):"";this.sorter=o?new o.Sorter({container:this.el,ignoreViewChildren:1,containerSel:".".concat(t,"layers"),itemSel:".".concat(t,"layer"),pfx:this.config.pStylePrefix}):"",r.view=this,this.$el.data("model",r),this.$el.data("collection",r)},addTo:function(e){var t=this.collection.indexOf(e);this.addToCollection(e,null,t)},addToCollection:function(e,t,n){var r=t||null,i=this.stackModel,s=this.config,a=this.sorter,l=this.propsConfig;"undefined"!=typeof this.preview&&e.set("preview",this.preview);var c=new o["default"]({model:e,config:s,sorter:a,stackModel:i,propsConfig:l}),u=c.render().el;if(r)r.appendChild(u);else if("undefined"!=typeof n){var d="before";this.$el.children().length==n&&(n--,d="after"),n<0?this.$el.append(u):this.$el.children().eq(n)[d](u)}else this.$el.append(u);return u},deselectAll:function(){this.$el.find("."+this.pfx+"layer").removeClass(this.pfx+"active"); },render:function(){var e=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(t){this.addToCollection(t,e)},this),this.$el.append(e),this.$el.attr("class",this.className),this.sorter&&(this.sorter.plh=null),this}})},"./src/style_manager/view/PropertiesView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/utils/dom.js");t["default"]=i.a.View.extend({initialize:function(e){this.config=e.config||{},this.pfx=this.config.stylePrefix||"",this.target=e.target||{},this.propTarget=e.propTarget||{},this.onChange=e.onChange,this.onInputRender=e.onInputRender||{},this.customValue=e.customValue||{},this.properties=[];var t=this.collection;this.listenTo(t,"add",this.addTo),this.listenTo(t,"reset",this.render)},addTo:function(e,t,n){this.add(e,null,n)},add:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t||this.el,i=new e.typeView({model:e,name:e.get("name"),id:this.pfx+e.get("property"),target:this.target,propTarget:this.propTarget,onChange:this.onChange,onInputRender:this.onInputRender,config:this.config});"composite"!=e.get("type")&&(i.customValue=this.customValue),i.render();var s=i.el;this.properties.push(i),i.updateVisibility(),Object(o.appendAtIndex)(r,s,n.at)},render:function(){var e=this,t=this.$el;this.properties=[];var n=document.createDocumentFragment();return this.collection.each(function(t){return e.add(t,n)}),t.empty(),t.append(n),t.attr("class","".concat(this.pfx,"properties")),this}})},"./src/style_manager/view/PropertyColorView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};t=i({},t,{silent:1}),this.inputInst.setValue(e,t)},onRender:function(){if(!this.input){var e=this.ppfx,t=new l["default"]({target:this.target,model:this.model,ppfx:e}),n=t.render();this.el.querySelector(".".concat(e,"fields")).appendChild(n.el),this.$input=n.inputEl,this.$color=n.colorEl,this.input=this.$input.get(0),this.inputInst=n}}})},"./src/style_manager/view/PropertyCompositeView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t\n \n
\n ')},inputValueChanged:function(){if(!this.model.get("detached")){for(var e=arguments.length,t=new Array(e),n=0;n'),this.input=this.$input.get(0)),this.props||(this.props=e.get("properties")),!this.$props)){this.props.each(function(t,n){t&&"composite"==t.get("type")&&(this.props.remove(t),console.warn("Nested composite types not yet allowed.")),t.parent=e},this);var r=n("./src/style_manager/view/PropertiesView.js")["default"],i=new r(this.getPropsConfig());this.$props=i.render().$el,this.properties=i.properties,this.$el.find("#".concat(this.pfx,"input-holder")).append(this.$props)}},getPropsConfig:function(e){var t=this,n=this.model,r={config:i({},this.config,{highlightComputed:0}),collection:this.props,target:this.target,propTarget:this.propTarget,onChange:function(e,t,r){n.set("value",n.getFullValue(),r)},customValue:function(e,n){return t.valueOnIndex(n,e)}};return n.get("detached")&&delete r.onChange,r},valueOnIndex:function(e,t){var n,r=this.getTargetValue({ignoreDefault:1});if(r){var i=r.split(this.model.getSplitSeparator());n=i[e]}else n=t&&t.getTargetValue({ignoreCustomValue:1,ignoreDefault:1});return n},clearCached:function(){c["default"].prototype.clearCached.apply(this,arguments),this.$input=null,this.props=null,this.$props=null}})},"./src/style_manager/view/PropertyFileView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./node_modules/backbone/backbone.js")),o=n.n(i),s=n("./src/style_manager/view/PropertyView.js"),a=o.a.$;t["default"]=s["default"].extend({templateInput:function(){var e=this.pfx,t=this.em;return'\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n ')},init:function(){var e=this.em;this.modal=e.get("Modal"),this.am=e.get("AssetManager"),this.events["click #"+this.pfx+"close"]="removeFile",this.events["click #"+this.pfx+"images"]="openAssetManager",this.delegateEvents()},onRender:function(){if(!this.$input){var e=this.model.getDefaultValue();this.$input=a(''))}this.$preview||(this.$preview=this.$el.find("#"+this.pfx+"preview-file")),this.$previewBox||(this.$previewBox=this.$el.find("#"+this.pfx+"preview-box")),this.setValue(this.componentValue,0)},clearCached:function(){s["default"].prototype.clearCached.apply(this,arguments),this.$preview=null,this.$previewBox=null},setValue:function(e,t){s["default"].prototype.setValue.apply(this,arguments),this.setPreviewView(e&&e!=this.model.getDefaultValue()),this.setPreview(e)},setPreviewView:function(e){var t=this.$previewBox;t&&t[e?"addClass":"removeClass"]("".concat(this.pfx,"show")),t&&t.css({display:e?"block":"none"})},spreadUrl:function(e){this.model.set("value",e),this.setPreviewView(1)},setPreview:function(e){var t=this.$preview;e=e&&e.indexOf("url(")<0?"url(".concat(e,")"):e,t&&t.css("background-image",e)},cleanValue:function(){this.setPreviewView(0),this.model.set({value:""},{silent:!0})},removeFile:function(){this.model.set("value",this.model.getDefaultValue());for(var e=arguments.length,t=new Array(e),n=0;n\n \n ')},onRender:function(){var e=this.pfx,t=this.ppfx,n="".concat(t,"radio-item-label"),r=this.model,i=r.get("property"),o=r.get("list")||r.get("options")||[],s=r.cid,a="".concat(e,"radio ").concat(e,"radio-").concat(i);if(!this.input&&o&&o.length){var l="";o.forEach(function(r){var o=r.className?"".concat(r.className," ").concat(e,"icon ").concat(n):"",c="".concat(i,"-").concat(r.value,"-").concat(s),u=r.name||r.value,d=r.title?'title="'.concat(r.title,'"'):"";l+='\n
\n \n \n
\n ")});var c=this.el.querySelector(".".concat(t,"field"));c.innerHTML='
').concat(l,"
"),this.input=c.firstChild}},getInputValue:function(){var e=this.getCheckedEl();return e?e.value:""},getCheckedEl:function(){var e=this.getInputEl();return e?e.querySelector("input:checked"):""},setValue:function(e){var t=this.model,n=e||t.get("value")||t.getDefaultValue(),r=this.getInputEl(),i=r?r.querySelector('[value="'.concat(n,'"]')):"";if(i)i.checked=!0;else{var o=this.getCheckedEl();o&&(o.checked=!1)}}})},"./src/style_manager/view/PropertySelectView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./src/style_manager/view/PropertyView.js");i.a.$;t["default"]=o["default"].extend({templateInput:function(){var e=this.pfx,t=this.ppfx;return'\n
\n \n
\n
\n
\n
\n ')},initialize:function(){for(var e=arguments.length,t=new Array(e),n=0;n").concat(t,"")});var r=this.el.querySelector("#".concat(e,"input-holder"));r.innerHTML=""),this.input=r.firstChild}}})},"./src/style_manager/view/PropertySliderView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t\n \n \n ')},getSliderEl:function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},inputValueChanged:function(){var e=this.model,t=e.get("step");this.getInputEl().value=this.getSliderEl().value;var n=this.getInputValue()-t;e.set("value",n,{avoidStore:1}).set("value",n+t),this.elementUpdated()},inputValueChangedSoft:function(){this.getInputEl().value=this.getSliderEl().value,this.model.set("value",this.getInputValue(),{avoidStore:1}),this.elementUpdated()},setValue:function(e){var t=this.model.parseValue(e);this.getSliderEl().value=parseFloat(t.value),a["default"].prototype.setValue.apply(this,arguments)},onRender:function(){a["default"].prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},clearCached:function(){a["default"].prototype.clearCached.apply(this,arguments),this.slider=null}})},"./src/style_manager/view/PropertyStackView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t\n \n
\n \n ')},init:function(){var e=this.model;this.pfx;e.set("stackIndex",null),this.events["click [data-add-layer]"]="addLayer",this.listenTo(e,"change:stackIndex",this.indexChanged),this.listenTo(e,"updateValue",this.inputValueChanged),this.delegateEvents()},targetUpdated:function(){if(this.model.get("detached")){var e=this._getTargetData(),t=e.status;this.setStatus(t),this.checkVisibility()}else{for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},t=this.em,n=e.skipAdd,r=void 0===n?1:n,i=t.getSelected(),o=t.get("StyleManager").getModelToStyle(i,{skipAdd:r,useClasses:1});return o!==i&&o},_getParentTarget:function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=this.model,o=i.get("property"),s=n.isValid||function(e){return e.getStyle()[o]},a=r.get("CssComposer").getAll().filter(function(t){return t.selectorsToString()===e.getSelectorsString()}),l=a.reduce(function(e,t){return e[t.getAtRule()]=t,e},{}),c=d.sortMediaObject(l),u=c.map(function(e){return e.value}),h=u.indexOf(e),f=u.splice(0,h),p=f.length-1;p>-1;p--){var g=f[p];if(s(g)){t=g;break}}return t},refreshLayers:function(){var e,t,n,r,i,o,s=[],l=this.model,c=this.em,u=this.getLayers(),d=l.get("detached"),h=l.get("property"),f=this.getTarget(),p=this.getComputedValue(),g=c.getSelected();if(d){t=f?f.getStyle():{};var m=function(e){var t=l.get("properties").at(0).get("property");return e&&!Object(a.isUndefined)(e.getStyle()[t])};if(!Object(a.keys)(t).length&&p&&g){var v={isValid:function(e){return m(e)}};r=this._getParentTarget(f,v),r?t=r.getStyle():(n=this._getClassRule(),i=m(n)&&n.getStyle(),r=!i&&this._getParentTarget(this._getClassRule({skipAdd:0}),v),o=m(r)&&r.getStyle(),t=i||o||{})}e=t,s=u.getLayersFromStyle(t)}else{var b=this.getTargetValue({ignoreDefault:1}),y=b;!y&&p&&(r=this._getParentTarget(f),r?y=r.getStyle()[h]:(n=this._getClassRule(),i=n&&n.getStyle()[h],r=!i&&this._getParentTarget(this._getClassRule({skipAdd:0})),o=r&&r.getStyle()[h],y=i||o||p)),y=y==l.getDefaultValue()?"":y,e=y,s=u.getLayersFromValue(y)}var w=l.getLayersFromTarget(f,{resultValue:e,layersObj:s})||s;u.reset(),u.add(w),l.set({stackIndex:null},{silent:!0})},getTargetValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=l["default"].prototype.getTargetValue.call(this,e),n=this.model.attributes.detached;return Object(a.isUndefined)(t)&&!n&&(t=this.model.getValueFromStyle(this.getTarget().getStyle())),t},onRender:function(){var e=this,t=this.model,r=this.el.querySelector("[data-layers-wrapper]"),i=n("./src/style_manager/view/PropertiesView.js")["default"],o={target:this.target,propTarget:this.propTarget,onChange:function(n,r,i){var o=r.model;if(t.get("detached")){var s=o.get("property"),a=o.getDefaultValue(),l=e.getLayers().getPropertyValues(s,a);r.updateTargetStyle(l,null,i)}else if("updated"==t.get("status")){var c=t.getFullValue();t.set("value",c,i),!c&&r.updateTargetStyle(c,null,i)}}},s=new c["default"]({collection:this.getLayers(),stackModel:t,preview:t.get("preview"),config:this.config,propsConfig:o}).render().el;new i({target:this.target,collection:this.model.get("properties"),stackModel:t,config:this.config,onChange:o.onChange,propTarget:o.propTarget}).render(),r.appendChild(s)}})},"./src/style_manager/view/PropertyView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t\n ').concat(this.templateLabel(e),'\n \n
\n ').concat(this.templateInput(e),"\n
\n ")},templateLabel:function(e){var t=this.pfx,n=this.em,r=e.parent,i=e.attributes,o=i.icon,s=void 0===o?"":o,a=i.info,l=void 0===a?"":a,c=i.id,u=i.name,d=n&&n.t("styleManager.properties.".concat(c))||u;return'\n \n ').concat(d,"\n \n ").concat(r?"":'"),"\n ")},templateInput:function(e){return'\n
\n \n
\n ')},events:l()({change:"inputValueChanged"},"click [".concat(f,"]"),"clear"),initialize:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(d.bindAll)(this,"targetUpdated"),this.config=t.config||{};var n=this.config.em;this.em=n,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.onChange=t.onChange,this.onInputRender=t.onInputRender||{},this.customValue=t.customValue||{};var r=this.model;this.property=r.get("property"),this.input=null;var i=this.pfx;this.inputHolderId="#"+i+"input-holder",this.sector=r.collection&&r.collection.sector,r.view=this,r.get("value")||r.set("value",r.getDefaultValue()),n&&n.on("update:component:style:".concat(this.property),this.targetUpdated);var o=r.get("requires");o&&Object.keys(o).forEach(function(t){n&&n.on("component:styleUpdate:".concat(t),e.targetUpdated)}),this.listenTo(this.propTarget,"update styleManager:update",this.targetUpdated),this.listenTo(r,"destroy remove",this.remove),this.listenTo(r,"change:value",this.modelValueChanged),this.listenTo(r,"targetUpdated",this.targetUpdated),this.listenTo(r,"change:visible",this.updateVisibility),this.listenTo(r,"change:status",this.updateStatus),this.listenTo(r,"change:name change:className change:full",this.render);var s=this.init&&this.init.bind(this);s&&s()},updateStatus:function(){var e=this.model,t=e.get("status"),n=e.parent,r=this.pfx,i=this.ppfx,o=this.config,s="".concat(i,"four-color"),a="".concat(i,"color-warn"),l=this.$el.children(".".concat(r,"label")),c=this.getClearEl(),u=c?c.style:{};switch(l.removeClass("".concat(s," ").concat(a)),u.display="none",t){case"updated":!n&&l.addClass(s),o.clearProperties&&(u.display="inline");break;case"computed":l.addClass(a)}},clear:function(e){var t=this;e&&e.stopPropagation(),this.model.clearValue(),setTimeout(function(){return t.targetUpdated()})},getClearEl:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(f,"]"))),this.clearEl},getTarget:function(){return this.getTargetModel()},getTargets:function(){var e=this.propTarget.targets;return e||[this.getTarget()]},getTargetModel:function(){return this.propTarget&&this.propTarget.model},getHelperModel:function(){return this.propTarget&&this.propTarget.helper},inputValueChanged:function(e){e&&e.stopPropagation(),this.model.setValue(this.getInputValue(),1,{fromInput:1}),this.elementUpdated()},elementUpdated:function(){this.setStatus("updated")},setStatus:function(e){this.model.set("status",e);var t=this.model.parent;t&&"updated"==e&&t.set("status",e)},emitUpdateTarget:Object(d.debounce)(function(){var e=this.config.em;e&&e.trigger("styleManager:update:target",this.getTarget())}),_getTargetData:function(){var e=this.model,t=this.config,n=this.getTargetValue({ignoreDefault:1}),r=e.getDefaultValue(),i=this.getComputedValue(),o="",s="";return n?(o=n,t.highlightChanged&&(s="updated")):i&&t.showComputed&&i!=r?(o=i,t.highlightComputed&&(s="computed")):(o=r,s=""),{value:o,status:s,targetValue:n,defaultValue:r,computedValue:i}},targetUpdated:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.emitUpdateTarget(),this.checkVisibility()){var r=this.config,o=r.em,a=this.model,l=a.get("property"),c=this._getTargetData(),u=c.status,d=c.value,h=s()(c,["status","value"]);if(this.setStatus(u),a.setValue(d,0,i({fromTarget:1},n)),o){var f=i({status:u,value:d},h);o.trigger("styleManager:change",this,l,d,f),o.trigger("styleManager:change:".concat(l),this,d,f),this._emitUpdate(f)}}},_emitUpdate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.em,n=this.model;if(t){var r=n.get("property"),o=i({},this._getEventData(),{},e),s=o.id;t.trigger("style:update",o),t.trigger("style:update:".concat(r),o),r!==s&&t.trigger("style:update:".concat(s),o)}},_getEventData:function(){var e=this.model;return{propertyView:this,targets:this.getTargets(),value:e.getFullValue(),property:e,id:e.get("id"),name:e.get("property")}},checkVisibility:function(){var e=1;return this.config.hideNotStylable&&(this.isTargetStylable()&&this.isComponentStylable()?this.show():(this.hide(),e=0),this.sector&&this.sector.trigger("updateVisibility")),e},getTargetValue:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.model,r=this.getTargetModel(),i=this.customValue;if(!r)return e;if(e=r.getStyle()[n.get("property")],e||t.ignoreDefault||(e=n.getDefaultValue()),"function"==typeof i&&!t.ignoreCustomValue){var o=n.collection.indexOf(n),s=i(this,o,e);s&&(e=s)}return e},getComputedValue:function(){var e=this.propTarget,t=e.computed||{},n=e.computedDefault||{},r=this.config.avoidComputed||[],i=this.model.get("property"),o=r.indexOf(i)<0,s=t[i],a=n[Object(h.camelCase)(i)];return t&&o&&a!==s&&s||""},getInputValue:function(){var e=this.getInputEl();return e?e.value:""},modelValueChanged:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.model,o=i.getFullValue();r.fromInput||this.setValue(o),this.getTargets().forEach(function(e){return n.__updateTarget(e,r)})},__updateTarget:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=this.config.em,o=n.get("property"),s=n.getFullValue(),a=this.onChange;if(e&&this.isTargetStylable(e)&&this.isComponentStylable()){t.fromTarget||(a&&!t.fromParent?a(e,this,t):this.updateTargetStyle(s,null,i({},t,{target:e})));var l=r&&r.getSelected();r&&l&&(!t.noEmit&&r.trigger("component:update",l),r.trigger("component:styleUpdate",l,o),r.trigger("component:styleUpdate:".concat(o),l)),this._emitUpdate()}},updateTargetStyle:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t||this.model.get("property"),i=n.target||this.getTarget(),o=i.getStyle();e?o[r]=e:delete o[r],i.setStyle(o,n);var s=this.getHelperModel();s&&s.setStyle(o,n)},isTargetStylable:function(e){var t=e||this.getTarget(),n=this.model,r=n.get("id"),i=n.get("property"),o=n.get("toRequire"),s=t.get("unstylable"),a=t.get("stylable-require"),l=n.get("requires"),c=n.get("requiresParent"),u=this.sector?this.sector.collection:null,h=this.em?this.em.getSelected():null,f=t.get("stylable");if(Object(d.isArray)(f)&&(f=f.indexOf(i)>=0),Object(d.isArray)(s)&&(f=s.indexOf(i)<0),o&&(f=!e||a&&(a.indexOf(r)>=0||a.indexOf(i)>=0)),u&&l){var p=Object.keys(l);u.each(function(e){e.get("properties").each(function(e){if(Object(d.includes)(p,e.id)){var t=l[e.id];f=f&&Object(d.includes)(t,e.get("value"))}})})}if(c){var g=h&&h.parent(),m=g&&g.getEl();if(m){var v=window.getComputedStyle(m);Object(d.each)(c,function(e,t){f=f&&v[t]&&Object(d.includes)(e,v[t])})}else f=!1}return f},isComponentStylable:function(){var e=this.em,t=e&&e.getSelected();return!t||this.isTargetStylable(t)},setRawValue:function(e){this.setValue(this.model.parseValue(e))},setValue:function(e){var t=this.model,n=Object(d.isUndefined)(e)?t.getDefaultValue():e,r=this.getInputEl();r&&(r.value=n)},getInputEl:function(){return this.input||(this.input=this.el.querySelector("input")),this.input},updateVisibility:function(){this.el.style.display=this.model.get("visible")?"block":"none"},show:function(){this.model.set("visible",1)},hide:function(){this.model.set("visible",0)},cleanValue:function(){this.setValue("")},clearCached:function(){this.clearEl=null,this.input=null,this.$input=null},render:function(){this.clearCached();var e=this.pfx,t=this.model,n=this.el,r=t.get("property"),i=t.get("full"),o=t.get("className")||"",s="".concat(e,"property");n.innerHTML=this.template(t),n.className="".concat(s," ").concat(e).concat(t.get("type")," ").concat(s,"__").concat(r," ").concat(o).trim(),n.className+=i?" ".concat(s,"--full"):"",this.updateStatus();var a=this.onRender&&this.onRender.bind(this);a&&a(),this.setValue(t.get("value"),{targetUpdate:1})}})},"./src/style_manager/view/SectorView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/backbone/backbone.js"),i=n.n(r),o=n("./node_modules/underscore/underscore.js"),s=(n.n(o),n("./src/style_manager/view/PropertiesView.js"));t["default"]=i.a.View.extend({template:Object(o.template)('\n
\n \n <%= label %>\n
'),events:{"click [data-sector-title]":"toggle"},initialize:function(e){this.config=e.config||{},this.em=this.config.em,this.pfx=this.config.stylePrefix||"",this.target=e.target||{},this.propTarget=e.propTarget||{},this.caretR="fa-caret-right",this.caretD="fa-caret-down";var t=this.model;this.listenTo(t,"change:open",this.updateOpen),this.listenTo(t,"updateVisibility",this.updateVisibility),this.listenTo(t,"destroy remove",this.remove)},updateVisibility:function(){var e;this.model.get("properties").each(function(t){t.get("visible")&&(e=1)}),this.el.style.display=e?"block":"none"},updateOpen:function(){this.model.get("open")?this.show():this.hide()},show:function(){this.$el.addClass(this.pfx+"open"),this.getPropertiesEl().style.display="",this.$caret.removeClass(this.caretR).addClass(this.caretD)},hide:function(){this.$el.removeClass(this.pfx+"open"),this.getPropertiesEl().style.display="none",this.$caret.removeClass(this.caretD).addClass(this.caretR)},getPropertiesEl:function(){return this.$el.find(".".concat(this.pfx,"properties")).get(0)},toggle:function(e){var t=this.model.get("open")?0:1;this.model.set("open",t)},render:function(){var e=this.pfx,t=this.model,n=this.em,r=this.$el,i=t.attributes,o=i.id,s=i.name,a=n&&n.t("styleManager.sectors.".concat(o))||s;return r.html(this.template({pfx:e,label:a})),this.$caret=r.find("#".concat(e,"caret")),this.renderProperties(),r.attr("class","".concat(e,"sector ").concat(e,"sector__").concat(o," no-select")),this.updateOpen(),this},renderProperties:function(){var e=this.model.get("properties");if(e){var t=new s["default"]({collection:e,target:this.target,propTarget:this.propTarget,config:this.config});this.$el.append(t.render().el)}}})},"./src/style_manager/view/SectorsView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.config||{};this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.target=e.target||{},this.config=t;var n={};Object(c.extend)(n,l.a.Events);var r=document.body,o=document.createElement("el-".concat((new Date).getTime()));r.appendChild(o),n.computedDefault=i({},window.getComputedStyle(o)),r.removeChild(o),this.propTarget=n;var s=this.collection,a="component:toggled component:update:classes change:state change:device frame:resized";this.listenTo(s,"add",this.addTo),this.listenTo(s,"reset",this.render),this.listenTo(this.target,a,this.targetUpdated)},addTo:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.addToCollection(e,null,n)},toggleStateCls:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;e.forEach(function(e){var n=e.getEl();n&&n.classList[t?"add":"remove"](f)})},targetUpdated:function(e){var t=this.target,n=this.propTarget,r=t.getSelectedAll(),i=t.getSelected(),o=e&&e.toHTML?e:i;if(o&&this.toggleStateCls([o]),i){var s=t.get("Config"),a=s.devicePreviewMode?"":t.get("state"),l=t.get("SelectorManager").getConfig(),c=l.componentFirst,d=i.getEl();if(n.helper=null,n.targets=null,d&&Object(u.isTaggableNode)(d)){var h=a?":".concat(a):null;n.computed=window.getComputedStyle(d,h)}var p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.get("CssComposer"),i=r.getAll(),o=r.getClassRule(f);o?(i.remove(o),i.add(o)):o=r.setClassRule(f),o.set("important",1),o.setStyle(e),n.helper=o};i=t.get("StyleManager").getModelToStyle(i),a&&(p(i.getStyle()),this.toggleStateCls(r,1)),n.model=i,c&&(n.targets=r),n.trigger("update")}},setTarget:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=Object(c.isArray)(e)?e:[e],i=t.targetIsClass,o=t.stylable,s=[];r.forEach(function(e){var t=e;if(Object(c.isString)(e)){var r,a=n.get("CssComposer").getAll();i&&(r=a.filter(function(t){return t.get("selectors").getFullString()===e})[0]),r||(r=a.filter(function(t){return t.get("selectorsAdd")===e})[0]),r||(r=a.add({selectors:[],selectorsAdd:e})),o&&r.set({stylable:o}),t=r}s.push(t)});var a=this.propTarget;return a.targets=s,a.trigger("update"),s},addToCollection:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.pfx,i=this.target,o=this.propTarget,s=this.config,a=this.el,l=t||a,c=new h["default"]({model:e,id:"".concat(r).concat(e.get("id")),name:e.get("name"),properties:e.get("properties"),target:i,propTarget:o,config:s}).render().el;return Object(d.appendAtIndex)(l,c,n.at),c},render:function(){var e=this,t=document.createDocumentFragment(),n=this.$el,r=this.pfx,i=this.ppfx;return n.empty(),this.collection.each(function(n){return e.addToCollection(n,t)}),n.append(t),n.addClass("".concat(r,"sectors ").concat(i,"one-bg ").concat(i,"two-color")),this}})},"./src/trait_manager/config/config.js":function(e,t,n){"use strict";n.r(t),t["default"]={stylePrefix:"trt-",appendTo:"",optionsTarget:[{value:!1},{value:"_blank"}]}},"./src/trait_manager/index.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/trait_manager/config/config.js")),o=n("./src/trait_manager/view/TraitsView.js");t["default"]=function(){var e,t={};return{TraitsView:o["default"],name:"TraitManager",getConfig:function(){return t},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n,Object(r.defaults)(t,i["default"]);var s=t.pStylePrefix;return s&&(t.stylePrefix="".concat(s).concat(t.stylePrefix)),e=new o["default"]({collection:[],editor:t.em,config:t}),this},postRender:function(){var e=this.getConfig().appendTo;if(e){var t=Object(r.isElement)(e)?e:document.querySelector(e);t.appendChild(this.render())}},getTraitsViewer:function(){return e},addType:function(t,n){var r=e.itemView;e.itemsView[t]=r.extend(n)},getType:function(t){return e.itemsView[t]},render:function(){return e.render().el}}}},"./src/trait_manager/model/Trait.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=this.get("name");if(!Object(c.isUndefined)(e)){var o=e;if("false"===e?o=!1:"true"===e&&(o=!0),this.get("changeProp"))n.set(r,o,t);else{var s=i({},n.get("attributes"));s[r]=o,n.set("attributes",s,t)}}},setValueFromInput:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={value:e};this.set(r,i({},n,{avoidStore:1})),t&&(this.set("value","",n),this.set(r,n))},getInitValue:function(){var e,t=this.target,n=this.get("name");if(t){var r=t.get("attributes");e=this.get("changeProp")?t.get(n):r[n]}return e||this.get("value")||this.get("default")}})},"./src/trait_manager/model/TraitFactory.js":function(e,t,n){"use strict";n.r(t),t["default"]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(t){var n=[];"string"==typeof t&&(t=[t]);for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};this.em=t.em||"",this.listenTo(this,"add",this.handleAdd),this.listenTo(this,"reset",this.handleReset)},handleReset:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.previousModels,r=void 0===n?[]:n;r.forEach(function(e){return e.trigger("remove")})},handleAdd:function(e){var t=this.target;t&&(e.target=t)},setTarget:function(e){this.target=e},add:function(e,t){var n=this.em;if(Object(o.isString)(e)||Object(o.isArray)(e)){var r=n&&n.get&&n.get("TraitManager"),s=r&&r.getConfig(),l=Object(a["default"])(s);Object(o.isString)(e)&&(e=[e]);for(var c=0,u=e.length;c').concat(s,"");return l}})},"./src/trait_manager/view/TraitCheckboxView.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js"),i=(n.n(r),n("./src/trait_manager/view/TraitView.js"));t["default"]=i["default"].extend({appendInput:0,templateInput:function(){var e=this.ppfx,t=this.clsField;return'')},onChange:function(){var e=this.getInputElem().checked;this.model.set("value",this.getCheckedValue(e))},getCheckedValue:function(e){var t=e,n=this.model.attributes,i=n.valueTrue,o=n.valueFalse;return t&&!Object(r.isUndefined)(i)&&(t=i),t||Object(r.isUndefined)(o)||(t=o),t},getInputEl:function(){for(var e=!this.$input,t=arguments.length,n=new Array(t),o=0;o\n
\n
\n
\n
\n ')},getInputEl:function(){if(!this.$input){var e=this.model,t=this.em,n=e.get("name"),r=e.get("options")||[],i="",this.$input=a(i);var s=e.getTargetValue();!Object(o.isUndefined)(s)&&this.$input.val(s)}return this.$input.get(0)}})},"./src/trait_manager/view/TraitView.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t').concat(t,"")},templateInput:function(){var e=this.clsField;return'
')},initialize:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.config,r=void 0===n?{}:n,i=this.model,o=this.eventCapture,s=i.target,a=i.attributes.type;this.config=r,this.em=r.em,this.pfx=r.stylePrefix||"",this.ppfx=r.pStylePrefix||"",this.target=s;var c=this.ppfx;this.clsField="".concat(c,"field ").concat(c,"field-").concat(a),[["change:value",this.onValueChange],["remove",this.removeView]].forEach(function(t){var n=l()(t,2),r=n[0],o=n[1];i.off(r,o),e.listenTo(i,r,o)}),i.view=this,this.listenTo(i,"change:label",this.render),this.listenTo(i,"change:placeholder",this.rerender),o.forEach(function(t){return e.events[t]="onChange"}),this.delegateEvents(),this.init()},getClbOpts:function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},removeView:function(){this.remove(),this.removed()},init:function(){},removed:function(){},onRender:function(){},onUpdate:function(){},onEvent:function(){},onChange:function(e){var t=this.getInputElem();t&&!Object(d.isUndefined)(t.value)&&this.model.set("value",t.value),this.onEvent(i({},this.getClbOpts(),{event:e}))},getValueForTarget:function(){return this.model.get("value")},setInputValue:function(e){var t=this.getInputElem();t&&(t.value=e)},onValueChange:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.fromTarget)this.setInputValue(e.get("value")),this.postUpdate();else{var r=this.getValueForTarget();e.setTargetValue(r,n)}},renderLabel:function(){var e=this.$el,t=this.target,n=this.getLabel(),r=this.templateLabel(t);this.createLabel&&(r=this.createLabel({label:n,component:t,trait:this})||""),e.find("[data-label]").append(r)},getLabel:function(){var e=this.em,t=this.model.attributes,n=t.label,r=t.name;return e.t("traitManager.traits.labels.".concat(r))||Object(h.capitalize)(n||r).replace(/-/g," ")},getComponent:function(){return this.target},getInputEl:function(){if(!this.$input){var e=this.em,t=this.model,n=t,r=t.attributes.name,i=n.get("placeholder")||n.get("default")||"",o=n.get("type")||"text",s=n.get("min"),a=n.get("max"),l=this.getModelValue(),c=f('')),u=e.t("traitManager.traits.attributes.".concat(r))||{};c.attr(u),Object(d.isUndefined)(l)||(n.set({value:l},{silent:!0}),c.prop("value",l)),s&&c.prop("min",s),a&&c.prop("max",a),this.$input=c}return this.$input.get(0)},getInputElem:function(){var e=this.input,t=this.$input;return e||t&&t.get&&t.get(0)||this.getElInput()},getModelValue:function(){var e,t=this.model,n=this.target,r=t.get("name");if(t.get("changeProp"))e=n.get(r);else{var i=n.get("attributes");e=t.get("value")||i[r]}return Object(d.isUndefined)(e)?"":e},getElInput:function(){return this.elInput},renderField:function(){var e=this.$el,t=this.appendInput,n=this.model,r=e.find("[data-input]"),i=r[r.length-1],o=n.el;o||(o=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),Object(d.isString)(o)?(i.innerHTML=o,this.elInput=i.firstChild):(t?i.appendChild(o):i.insertBefore(o,i.firstChild),this.elInput=o),n.el=this.elInput},hasLabel:function(){var e=this.model.attributes.label;return!this.noLabel&&e!==!1},rerender:function(){this.model.el=null,this.render()},postUpdate:function(){this.onUpdate(this.getClbOpts())},render:function(){var e=this.$el,t=this.pfx,n=this.ppfx,r=this.model,i=r.attributes.type,o=this.hasLabel&&this.hasLabel(),s="".concat(t,"trait");this.$input=null;var a='
\n ').concat(o?'
'):"",'\n
\n ').concat(this.templateInput?Object(d.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"","\n
\n
");return e.empty().append(a),o&&this.renderLabel(),this.renderField(),this.el.className="".concat(s,"__wrp"),this.postUpdate(),this.onRender(this.getClbOpts()),this}})},"./src/trait_manager/view/TraitsView.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/domain_abstract/view/DomainViews.js"),i=n("./src/trait_manager/view/TraitView.js"),o=n("./src/trait_manager/view/TraitSelectView.js"),s=n("./src/trait_manager/view/TraitCheckboxView.js"),a=n("./src/trait_manager/view/TraitNumberView.js"),l=n("./src/trait_manager/view/TraitColorView.js"),c=n("./src/trait_manager/view/TraitButtonView.js");t["default"]=r["default"].extend({ns:"Traits",itemView:i["default"],reuseView:1,itemsView:{text:i["default"],number:a["default"],select:o["default"],checkbox:s["default"],color:l["default"],button:c["default"]},initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.config||{};this.config=t,this.em=e.editor,this.pfx=t.stylePrefix||"",this.ppfx=t.pStylePrefix||"",this.className=this.pfx+"traits";var n="component:toggled";this.listenTo(this.em,n,this.updatedCollection),this.updatedCollection()},updatedCollection:function(){var e=this.ppfx,t=this.em.getSelected();this.el.className="".concat(this.className," ").concat(e,"one-bg ").concat(e,"two-color"),this.collection=t?t.get("traits"):[],this.render()}})},"./src/undo_manager/index.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};n=i({},s,{},o),e=n.em,this.em=e,t=new l.a(i({track:!0,register:[]},n)),t.changeUndoType("change",{condition:!1}),t.changeUndoType("add",{on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:t,before:void 0,after:e,options:i({},n)}}}),t.changeUndoType("remove",{on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:t,before:e,after:void 0,options:i({},n)}}});var a={on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r&&(r=e.previousAttributes()),!n.avoidStore){var i={object:e,before:r,after:e.toJSON()};return r=null,i}},undo:function(e,t,n,r){e.set(t)},redo:function(e,t,n,r){e.set(n)}},c=["style","attributes","content","src"];return c.forEach(function(e){return t.addUndoType("change:".concat(e),a)}),t.on("undo redo",function(){return e.trigger("component:toggled change:canvasOffset")}),["undo","redo"].forEach(function(n){return t.on(n,function(){return e.trigger(n)})}),this},getConfig:function(){return n},add:function(e){return t.register(e),this},remove:function(e){return t.unregister(e),this},removeAll:function(){return t.unregisterAll(),this},start:function(){return t.startTracking(),this},stop:function(){return t.stopTracking(),this},undo:function(){return!e.isEditing()&&t.undo(1),this},undoAll:function(){return t.undoAll(),this},redo:function(){return!e.isEditing()&&t.redo(1),this},redoAll:function(){return t.redoAll(),this},hasUndo:function(){return t.isAvailable("undo")},hasRedo:function(){return t.isAvailable("redo")},getStack:function(){return t.stack},clear:function(){return t.clear(),this},getInstance:function(){return t}}}},"./src/utils/ColorPicker.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/@babel/runtime/helpers/typeof.js"),i=n.n(r);t["default"]=function(e,t){function n(t,n,r,i){for(var o=[],s=0;s')}else{var h="sp-clear-display";o.push(e("
").append(e('').attr("title",i.noColorSelectedText)).html())}}return"
"+o.join("")+"
"}function r(){for(var e=0;eMath.abs(t-i);we=o?"x":"y"}}else we=null;var s=!we||"x"===we,a=!we||"y"===we;s&&(de=parseFloat(e/te)),a&&(he=parseFloat((ne-t)/ne)),Xe=!1,z.showAlpha||(fe=1),D()},y,w),qe?(P(qe),M(),Ke=z.preferredFormat||le(qe).format,g(qe)):M(),B&&j();var r=Y?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Le.delegate(".sp-thumb-el",r,t),Ne.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},t)}function p(){if(W&&window.localStorage){try{var t=window.localStorage[W].split(",#");t.length>1&&(delete window.localStorage[W],e.each(t,function(e,t){g(t)}))}catch(n){}try{ve=window.localStorage[W].split(";")}catch(n){}}}function g(t){if($){var n=le(t).toRgbString();if(!me[n]&&e.inArray(n,ve)===-1)for(ve.push(n);ve.length>be;)ve.shift();if(W&&window.localStorage)try{window.localStorage[W]=ve.join(";")}catch(r){}}}function m(){var e=[];if(z.showPalette)for(var t=0;tf&&f>i?Math.abs(g.left+i-f):0),g.top-=Math.min(g.top,g.top+o>p&&p>o?Math.abs(o+s-r):r),g}function l(){}function c(e){e.stopPropagation()}function u(e,t){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}function d(t,n,r,i){function o(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1}function s(e){if(u){if(Y&&c.documentMode<9&&!e.button)return l();var r=e&&e.touches&&e.touches[0],i=r&&r.pageX||e.pageX,s=r&&r.pageY||e.pageY,a=Math.max(0,Math.min(i-d.left,f)),g=Math.max(0,Math.min(s-d.top,h));p&&o(e),n.apply(t,[a,g,e])}}function a(n){var i=n.which?3==n.which:2==n.button;i||u||r.apply(t,arguments)!==!1&&(u=!0,h=e(t).height(), f=e(t).width(),d=e(t).offset(),e(c).bind(g),e(c.body).addClass("sp-dragging"),s(n),o(n))}function l(){u&&(e(c).unbind(g),e(c.body).removeClass("sp-dragging"),setTimeout(function(){i.apply(t,arguments)},0)),u=!1}n=n||function(){},r=r||function(){},i=i||function(){};var c=document,u=!1,d={},h=0,f=0,p="ontouchstart"in window,g={};g.selectstart=o,g.dragstart=o,g["touchmove mousemove"]=s,g["touchend mouseup"]=l,e(t).bind("touchstart mousedown",a)}function h(e,t,n){var r;return function(){var i=this,o=arguments,s=function(){r=null,e.apply(i,o)};n&&clearTimeout(r),!n&&r||(r=setTimeout(s,t))}}function f(){return e.fn.spectrum.inputTypeColorSupport()}function p(e){var t={r:0,g:0,b:0},n=1,r=!1,o=!1;return"string"==typeof e&&(e=q(e)),"object"==i()(e)&&(e.hasOwnProperty("r")&&e.hasOwnProperty("g")&&e.hasOwnProperty("b")?(t=g(e.r,e.g,e.b),r=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("v")?(e.s=$(e.s),e.v=$(e.v),t=y(e.h,e.s,e.v),r=!0,o="hsv"):e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("l")&&(e.s=$(e.s),e.l=$(e.l),t=v(e.h,e.s,e.l),r=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=V(n),{ok:r,format:e.format||o,r:oe(255,se(t.r,0)),g:oe(255,se(t.g,0)),b:oe(255,se(t.b,0)),a:n}}function g(e,t,n){return{r:255*I(e,255),g:255*I(t,255),b:255*I(n,255)}}function m(e,t,n){e=I(e,255),t=I(t,255),n=I(n,255);var r,i,o=se(e,t,n),s=oe(e,t,n),a=(o+s)/2;if(o==s)r=i=0;else{var l=o-s;switch(i=a>.5?l/(2-o-s):l/(o+s),o){case e:r=(t-n)/l+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var i,o,s;if(e=I(e,360),t=I(t,100),n=I(n,100),0===t)i=o=s=n;else{var a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=r(l,a,e+1/3),o=r(l,a,e),s=r(l,a,e-1/3)}return{r:255*i,g:255*o,b:255*s}}function b(e,t,n){e=I(e,255),t=I(t,255),n=I(n,255);var r,i,o=se(e,t,n),s=oe(e,t,n),a=o,l=o-s;if(i=0===o?0:l/o,o==s)r=0;else{switch(o){case e:r=(t-n)/l+(t>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(le(r));return o}function L(e,t){t=t||6;for(var n=le(e).toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/t;t--;)s.push(le({h:r,s:i,v:o})),o=(o+a)%1;return s}function N(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function V(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function I(e,t){H(e)&&(e="100%");var n=z(e);return e=oe(t,se(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),re.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function F(e){return oe(1,se(0,e))}function R(e){return parseInt(e,16)}function H(e){return"string"==typeof e&&e.indexOf(".")!=-1&&1===parseFloat(e)}function z(e){return"string"==typeof e&&e.indexOf("%")!=-1}function B(e){return 1==e.length?"0"+e:""+e}function $(e){return e<=1&&(e=100*e+"%"),e}function W(e){return Math.round(255*parseFloat(e)).toString(16)}function U(e){return R(e)/255}function q(e){e=e.replace(ee,"").replace(te,"").toLowerCase();var t=!1;if(ce[e])e=ce[e],t=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=de.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=de.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=de.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=de.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=de.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=de.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=de.hex8.exec(e))?{a:U(n[1]),r:R(n[2]),g:R(n[3]),b:R(n[4]),format:t?"name":"hex8"}:(n=de.hex6.exec(e))?{r:R(n[1]),g:R(n[2]),b:R(n[3]),format:t?"name":"hex"}:!!(n=de.hex3.exec(e))&&{r:R(n[1]+""+n[1]),g:R(n[2]+""+n[2]),b:R(n[3]+""+n[3]),format:t?"name":"hex"}}var G={beforeShow:l,move:l,change:l,show:l,hide:l,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},K=[],Y=!!/msie/i.exec(window.navigator.userAgent),X=function(){function e(e,t){return!!~(""+e).indexOf(t)}var t=document.createElement("div"),n=t.style;return n.cssText="background-color:rgba(0,0,0,.5)",e(n.backgroundColor,"rgba")||e(n.backgroundColor,"hsla")}(),J=["
","
","
","
"].join(""),Z=function(){var e="";if(Y)for(var t=1;t<=6;t++)e+="
";return["
","
","
","
","","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
",e,"
","
","
","
","
","","
","
","
","","","
","
","
"].join("")}(),Q="spectrum.id";e.fn.spectrum=function(t,n){if("string"==typeof t){var r=this,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=K[e(this).data(Q)];if(n){var o=n[t];if(!o)throw new Error("Spectrum: no such method: '"+t+"'");"get"==t?r=n.get():"container"==t?r=n.container:"option"==t?r=n.option.apply(n,i):"destroy"==t?(n.destroy(),e(this).removeData(Q)):o.apply(n,i)}}),r}return this.spectrum("destroy").each(function(){var n=e.extend({},t,e(this).data()),r=s(this,n);e(this).data(Q,r.id)})},e.fn.spectrum.load=!0,e.fn.spectrum.loadOpts={},e.fn.spectrum.draggable=d,e.fn.spectrum.defaults=G,e.fn.spectrum.inputTypeColorSupport=function he(){if("undefined"==typeof he._cachedResult){var t=e("")[0];he._cachedResult="color"===t.type&&""!==t.value}return he._cachedResult},e.spectrum={},e.spectrum.localization={},e.spectrum.palettes={},e.fn.spectrum.processNativeColorInputs=function(){var t=e("input[type=color]");t.length&&!f()&&t.spectrum({preferredFormat:"hex6"})};var ee=/^[\s,#]+/,te=/\s+$/,ne=0,re=Math,ie=re.round,oe=re.min,se=re.max,ae=re.random,le=function fe(e,t){if(e=e?e:"",t=t||{},e instanceof fe)return e;if(!(this instanceof fe))return new fe(e,t);var n=p(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=ie(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=ie(this._r)),this._g<1&&(this._g=ie(this._g)),this._b<1&&(this._b=ie(this._b)),this._ok=n.ok,this._tc_id=ne++};le.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},setAlpha:function(e){return this._a=V(e),this._roundA=ie(100*this._a)/100,this},toHsv:function(){var e=b(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=b(this._r,this._g,this._b),t=ie(360*e.h),n=ie(100*e.s),r=ie(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=m(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=m(this._r,this._g,this._b),t=ie(360*e.h),n=ie(100*e.s),r=ie(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return w(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(){return x(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:ie(this._r),g:ie(this._g),b:ie(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+ie(this._r)+", "+ie(this._g)+", "+ie(this._b)+")":"rgba("+ie(this._r)+", "+ie(this._g)+", "+ie(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:ie(100*I(this._r,255))+"%",g:ie(100*I(this._g,255))+"%",b:ie(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+ie(100*I(this._r,255))+"%, "+ie(100*I(this._g,255))+"%, "+ie(100*I(this._b,255))+"%)":"rgba("+ie(100*I(this._r,255))+"%, "+ie(100*I(this._g,255))+"%, "+ie(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ue[w(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+x(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=le(e);n=i.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0,i=!t&&r&&("hex"===e||"hex6"===e||"hex3"===e||"name"===e);return i?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(k,arguments)},brighten:function(){return this._applyModification(S,arguments)},darken:function(){return this._applyModification(T,arguments)},desaturate:function(){return this._applyModification(C,arguments)},saturate:function(){return this._applyModification(j,arguments)},greyscale:function(){return this._applyModification(O,arguments)},spin:function(){return this._applyModification(P,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(L,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(D,arguments)}},le.fromRatio=function(e,t){if("object"==i()(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&("a"===r?n[r]=e[r]:n[r]=$(e[r]));e=n}return le(e,t)},le.equals=function(e,t){return!(!e||!t)&&le(e).toRgbString()==le(t).toRgbString()},le.random=function(){return le.fromRatio({r:ae(),g:ae(),b:ae()})},le.mix=function(e,t,n){n=0===n?0:n||50;var r,i=le(e).toRgb(),o=le(t).toRgb(),s=n/100,a=2*s-1,l=o.a-i.a;r=a*l==-1?a:(a+l)/(1+a*l),r=(r+1)/2;var c=1-r,u={r:o.r*r+i.r*c,g:o.g*r+i.g*c,b:o.b*r+i.b*c,a:o.a*s+i.a*(1-s)};return le(u)},le.readability=function(e,t){var n=le(e),r=le(t),i=n.toRgb(),o=r.toRgb(),s=n.getBrightness(),a=r.getBrightness(),l=Math.max(i.r,o.r)-Math.min(i.r,o.r)+Math.max(i.g,o.g)-Math.min(i.g,o.g)+Math.max(i.b,o.b)-Math.min(i.b,o.b);return{brightness:Math.abs(s-a),color:l}},le.isReadable=function(e,t){var n=le.readability(e,t);return n.brightness>125&&n.color>500},le.mostReadable=function(e,t){for(var n=null,r=0,i=!1,o=0;o125&&s.color>500,l=3*(s.brightness/125)+s.color/500;(a&&!i||a&&i&&l>r||!a&&!i&&l>r)&&(i=a,r=l,n=le(t[o]))}return n};var ce=le.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ue=le.hexNames=N(ce),de=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();window.tinycolor=le,e(function(){e.fn.spectrum.load&&e.fn.spectrum.processNativeColorInputs()})}},"./src/utils/Dragger.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return l()(this,e),this.opts={container:null,onStart:null,onDrag:null,onEnd:null,setPosition:null,getPosition:null,guidesStatic:null,guidesTarget:null,snapOffset:5,doc:0,scale:1},Object(d.bindAll)(this,"drag","stop","keyHandle","handleScroll"),this.setOptions(t),this.delta=f(),this}return u()(e,[{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=i({},this.opts,{},e)}},{key:"toggleDrag",value:function(e){var t=this.getDocumentEl(),n=this.getContainerEl(),r=this.getWindowEl(),i=e?"on":"off",o={on:h.on,off:h.off};o[i](n,"mousemove dragover",this.drag),o[i](t,"mouseup dragend touchend",this.stop),o[i](t,"keydown",this.keyHandle),o[i](r,"scroll",this.handleScroll)}},{key:"handleScroll",value:function(){var e=this.lastScroll,t=this.delta,n=this.getScrollInfo(),r={x:n.x-e.x,y:n.y-e.y};this.move(t.x+r.x,t.y+r.y),this.lastScrollDiff=r}},{key:"start",value:function(e){var t=this.opts,n=t.onStart;this.toggleDrag(1),this.startPointer=this.getPointerPos(e),this.guidesStatic=Object(d.result)(t,"guidesStatic")||[],this.guidesTarget=Object(d.result)(t,"guidesTarget")||[],Object(d.isFunction)(n)&&n(e,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff=f(),this.globScrollDiff=f(),this.drag(e)}},{key:"drag",value:function(e){var t=this,n=this.opts,r=this.lastScrollDiff,o=this.globScrollDiff,s=n.onDrag,a=this.startPointer,l=this.getPointerPos(e),c={x:o.x+r.x,y:o.y+r.y};this.globScrollDiff=c;var u={x:l.x-a.x+c.x,y:l.y-a.y+c.y};this.lastScrollDiff=f();var h=this.lockedAxis;h=e.shiftKey?!h&&this.detectAxisLock(u.x,u.y):null,"x"===h?u.x=a.x:"y"===h&&(u.y=a.y);var p=function(r){["x","y"].forEach(function(e){return r[e]=r[e]*Object(d.result)(n,"scale")}),t.delta=r,t.move(r.x,r.y),Object(d.isFunction)(s)&&s(e,t)},g=i({},u);if(this.currentPointer=l,this.lockedAxis=h,this.lastScroll=this.getScrollInfo(),p(u),this.guidesTarget.length){var m=this.snapGuides(g),v=m.newDelta,b=m.trgX,y=m.trgY;(b||y)&&p(v)}0===e.which&&this.stop(e)}},{key:"snapGuides",value:function(e){var t=this,n=e,r=this.trgX,i=this.trgY;return this.guidesTarget.forEach(function(n){n.x&&t.trgX||n.y&&t.trgY||(n.active=0,t.guidesStatic.forEach(function(o){if(!(n.y&&o.x||n.x&&o.y)){var s=n.y&&o.y,a=s?"y":"x",l=n[a],c=o[a],u=e[a],h=s?i:r;if(t.isPointIn(l,c)&&Object(d.isUndefined)(h)){var f=u-(l-c);t.setGuideLock(n,f)}}}))}),r=this.trgX,i=this.trgY,["x","y"].forEach(function(r){var i=r.toUpperCase(),o=t["trg".concat(i)];o&&!t.isPointIn(e[r],o.lock)&&(t.setGuideLock(o,null),o=null),o&&!Object(d.isUndefined)(o.lock)&&(n[r]=o.lock)}),{newDelta:n,trgX:this.trgX,trgY:this.trgY}}},{key:"isPointIn",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.offset,i=r||this.opts.snapOffset;return e>=t&&e<=t+i||e<=t&&e>=t-i}},{key:"setGuideLock",value:function(e,t){var n=Object(d.isUndefined)(e.x)?"Y":"X",r="trg".concat(n);return null!==t?(e.active=1,e.lock=t,this[r]=e):(delete e.active,delete e.lock,delete this[r]),e}},{key:"stop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.delta,r=t.cancel,i=r?0:n.x,o=r?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,o,1);var s=this.opts.onEnd;Object(d.isFunction)(s)&&s(e,this,{cancelled:r})}},{key:"keyHandle",value:function(e){Object(h.isEscKey)(e)&&this.stop(e,{cancel:1})}},{key:"move",value:function(e,t,n){var r=this.el,i=this.opts,o=this.startPosition;if(o){var s=i.setPosition,a=o.x+e,l=o.y+t;this.position={x:a,y:l,end:n},Object(d.isFunction)(s)&&s(this.position),r&&(r.style.left="".concat(a,"px"),r.style.top="".concat(l,"px"))}}},{key:"getContainerEl",value:function(){var e=this.opts.container;return e?[e]:this.getDocumentEl()}},{key:"getWindowEl",value:function(){var e=this.getContainerEl();return e.map(function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow})}},{key:"getDocumentEl",value:function(e){var t=this.opts.doc;if(e=e||this.el,!this.docs){var n=[document];e&&n.push(e.ownerDocument),t&&n.push(t),this.docs=n}return this.docs}},{key:"getPointerPos",value:function(e){var t=this.opts.getPointerPosition,n=Object(h.getPointerEvent)(e);return t?t(e):{x:n.clientX,y:n.clientY}}},{key:"getStartPosition",value:function(){var e=this.el,t=this.opts,n=t.getPosition,r=f();return Object(d.isFunction)(n)?r=n():e&&(r={x:parseFloat(e.style.left),y:parseFloat(e.style.top)}),r}},{key:"getScrollInfo",value:function(){var e=this.opts.doc,t=e&&e.body;return{y:t?t.scrollTop:0,x:t?t.scrollLeft:0}}},{key:"detectAxisLock",value:function(e,t){var n=e,r=t,i=Math.abs(n),o=Math.abs(r);return r>=i||r<=-i?"x":n>o||n<-o?"y":void 0}}]),e}()},"./src/utils/Droppable.js":function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return c});var r=n("./node_modules/@babel/runtime/helpers/classCallCheck.js"),i=n.n(r),o=n("./node_modules/@babel/runtime/helpers/createClass.js"),s=n.n(o),a=n("./src/utils/mixins.js"),l=n("./node_modules/underscore/underscore.js"),c=(n.n(l),function(){function e(t,n){var r=this;i()(this,e),this.em=t;var o=n||t.get("Canvas").getFrames().map(function(e){return e.get("root").getEl()}),s=Array.isArray(o)?o:[o];return this.el=o,this.counter=0,Object(l.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave"),s.forEach(function(e){return r.toggleEffects(e,1)}),this}return s()(e,[{key:"toggleEffects",value:function(e,t){var n={on:a.on,off:a.off},r=t?"on":"off";n[r](e,"dragenter",this.handleDragEnter),n[r](e,"dragover",this.handleDragOver),n[r](e,"drop",this.handleDrop),n[r](e,"dragleave",this.handleDragLeave)}},{key:"endDrop",value:function(e,t){var n=this.em,r=this.dragStop;this.counter=0,this.over=0,r&&r(e),n.runDefault({preserveSelected:1}),n.trigger("canvas:dragend",t)}},{key:"handleDragLeave",value:function(e){this.updateCounter(-1,e)}},{key:"updateCounter",value:function(e,t){this.counter+=e,0===this.counter&&this.endDrop(1,t)}},{key:"handleDragEnter",value:function(e){var t=this,n=this.em,r=e.dataTransfer;if(this.updateCounter(1,e),!this.over){this.over=1;var i,o,s=n.get("Utils"),a=n.get("Canvas"),l=a.getBody(),c=n.get("dragContent")||"
";if(n.stopDefault(),n.inAbsoluteMode()){var u=n.get("DomComponents").getWrapper(),d=u.append({})[0],h=n.get("Commands").run("core:component-drag",{event:e,guidesInfo:1,center:1,target:d,onEnd:function(e,n,i){var o=i.cancelled;if(!o){var s=u.append(c)[0],a=d.getStyle(),l=a.left,h=a.top,f=a.position;s.addStyle({left:l,top:h,position:f}),t.handleDragEnd(s,r)}d.remove()}});i=function(t){return h.stop(e,{cancel:t})},o=function(e){return c=e}}else{var f=new s.Sorter({em:n,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:l,placer:a.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(e){return t.handleDragEnd(e,r)},document:a.getFrameEl().contentDocument});f.setDropContent(c),f.startSort(),this.sorter=f,i=function(e){e&&(f.moved=0),f.endMove()},o=function(e){return f.setDropContent(e)}}this.dragStop=i,this.dragContent=o,n.trigger("canvas:dragenter",r,c)}}},{key:"handleDragEnd",value:function(e,t){if(e){var n=this.em;n.set("dragResult",e),n.trigger("canvas:drop",t,e)}}},{key:"handleDragOver",value:function(e){e.preventDefault(),this.em.trigger("canvas:dragover",e)}},{key:"handleDrop",value:function(e){e.preventDefault();var t=this.dragContent,n=e.dataTransfer,r=this.getContentByData(n).content;e.target.style.border="",r&&t&&t(r),this.endDrop(!r,e)}},{key:"getContentByData",value:function(e){var t=this.em,n=e.types,r=e.files||[],i=t.get("dragContent"),o=e.getData("text");if(r.length){o=[];for(var s=0;s=0)o=e.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if(Object(l.indexOf)(n,"text/uri-list")>=0)o={type:"link",attributes:{href:o},content:o};else if(Object(l.indexOf)(n,"text/json")>=0){var u=e.getData("text/json");u&&(o=JSON.parse(u))}var d={content:o};return t.trigger("canvas:dragdata",e,d),d}}]),e}())},"./src/utils/Resizer.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return l()(this,e),this.setOptions(t),Object(d.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop"),this}return u()(e,[{key:"getConfig",value:function(){return this.opts}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=Object(d.defaults)(e,f),this.setup()}},{key:"setup",value:function(){var e=this.opts,t=e.prefix||"",n=e.appendTo||document.body,r=this.container;for(r||(r=document.createElement("div"),r.className="".concat(t,"resizer-c"),n.appendChild(r),this.container=r);r.firstChild;)r.removeChild(r.firstChild);var i={};["tl","tc","tr","cl","cr","bl","bc","br"].forEach(function(t){return i[t]=e[t]?p(t,e):""});for(var o in i){var s=i[o];s&&r.appendChild(s)}this.handlers=i,this.mousePosFetcher=e.mousePosFetcher,this.updateTarget=e.updateTarget,this.posFetcher=e.posFetcher,this.onStart=e.onStart,this.onMove=e.onMove,this.onEnd=e.onEnd,this.onUpdateContainer=e.onUpdateContainer}},{key:"toggleFrames",value:function(e){if(this.opts.silentFrames){var t=document.querySelectorAll("iframe");Object(d.each)(t,function(t){return t.style.pointerEvents=e?"none":""})}}},{key:"isHandler",value:function(e){var t=this.handlers;for(var n in t)if(t[n]===e)return!0;return!1}},{key:"getFocusedEl",value:function(){return this.el}},{key:"getDocumentEl",value:function(){return[this.el.ownerDocument,document]}},{key:"getElementPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.posFetcher||"";return n?n(e,t):g(e)}},{key:"focus",value:function(e){e&&e===this.el||(this.el=e,this.updateContainer({forceShow:1}),Object(h.on)(this.getDocumentEl(),"mousedown",this.handleMouseDown))}},{key:"blur",value:function(){this.container.style.display="none",this.el&&(Object(h.off)(this.getDocumentEl(),"mousedown",this.handleMouseDown),this.el=null)}},{key:"start",value:function(e){if(0===e.button){e.preventDefault(),e.stopPropagation();var t=this.el,n=this,r=this.opts||{},i="data-"+r.prefix+"handler",o=this.getElementPos(t,{target:"el"});this.handlerAttr=e.target.getAttribute(i),this.clickedHandler=e.target,this.startDim={t:o.top,l:o.left,w:o.width,h:o.height},this.rectDim={t:o.top,l:o.left,w:o.width,h:o.height},this.startPos={x:e.clientX,y:e.clientY};var s=this.getDocumentEl();Object(h.on)(s,"mousemove",this.move),Object(h.on)(s,"keydown",this.handleKeyDown),Object(h.on)(s,"mouseup",this.stop),Object(d.isFunction)(this.onStart)&&this.onStart(e,{docs:s,config:r,el:t,resizer:n}),this.toggleFrames(1),this.move(e)}}},{key:"move",value:function(e){var t=this.onMove,n=this.mousePosFetcher,r=n?n(e):{x:e.clientX,y:e.clientY};this.currentPos=r,this.delta={x:r.x-this.startPos.x,y:r.y-this.startPos.y},this.keys={shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey},this.rectDim=this.calc(this),this.updateRect(0),t&&t(e),0===e.which&&this.stop(e)}},{key:"stop",value:function(e){var t=this.opts,n=this.getDocumentEl();Object(h.off)(n,"mousemove",this.move),Object(h.off)(n,"keydown",this.handleKeyDown),Object(h.off)(n,"mouseup",this.stop),this.updateRect(1),this.toggleFrames(),Object(d.isFunction)(this.onEnd)&&this.onEnd(e,{docs:n,config:t})}},{key:"updateRect",value:function(e){var t=this.el,n=this,r=this.opts,i=this.rectDim,o=this.updateTarget,s=this.getSelectedHandler(),a=r.unitHeight,l=r.unitWidth,c=r.keyWidth,u=r.keyHeight;if(Object(d.isFunction)(o))o(t,i,{store:e,selectedHandler:s,resizer:n,config:r});else{var h=t.style;h[c]=i.w+l, h[u]=i.h+a}this.updateContainer()}},{key:"updateContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.opts,n=this.container,r=this.el,o=n.style;!t.avoidContainerUpdate&&r&&e.forceShow&&(o.display="block"),this.onUpdateContainer({el:n,resizer:this,opts:i({},t,{},e)})}},{key:"getSelectedHandler",value:function(){var e=this.handlers;if(this.selectedHandler)for(var t in e)if(e[t]===this.selectedHandler)return t}},{key:"handleKeyDown",value:function(e){27===e.keyCode&&(this.rectDim=this.startDim,this.stop(e))}},{key:"handleMouseDown",value:function(e){var t=e.target;this.isHandler(t)?(this.selectedHandler=t,this.start(e)):t!==this.el&&(this.selectedHandler="",this.blur())}},{key:"calc",value:function(e){var t,n=this.opts||{},r=n.step,i=this.startDim,o=n.minDim,s=n.maxDim,a=e.delta.x,l=e.delta.y,c=i.w,u=i.h,d={t:0,l:0,w:c,h:u};if(e){var f=e.handlerAttr;~f.indexOf("r")&&(t=Object(h.normalizeFloat)(c+a*r,r),t=Math.max(o,t),s&&(t=Math.min(s,t)),d.w=t),~f.indexOf("b")&&(t=Object(h.normalizeFloat)(u+l*r,r),t=Math.max(o,t),s&&(t=Math.min(s,t)),d.h=t),~f.indexOf("l")&&(t=Object(h.normalizeFloat)(c-a*r,r),t=Math.max(o,t),s&&(t=Math.min(s,t)),d.w=t),~f.indexOf("t")&&(t=Object(h.normalizeFloat)(u-l*r,r),t=Math.max(o,t),s&&(t=Math.min(s,t)),d.h=t);var p=n.ratioDefault?!e.keys.shift:e.keys.shift;if(f.indexOf("c")<0&&p){var g=i.w/i.h;d.w/d.h>g?d.h=Math.round(d.w/g):d.w=Math.round(d.h*g)}return~f.indexOf("l")&&(d.l=i.w-d.w),~f.indexOf("t")&&(d.t=i.h-d.h),d}}}]),e}();t["default"]={init:function(e){return new m(e)}}},"./src/utils/Sorter.js":function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=this.itemSel,o=this.containerSel,s=this.getContainerEl(n.container),a=this.getDocuments(e),l=this.onStart,c=this.plh;this.dropModel=null,this.target=null,this.prevTarget=null,this.moved=0,e&&!this.matches(e,"".concat(i,", ").concat(o))&&(e=this.closest(e,i)),this.eV=e,c||(c=this.createPlaceholder(),s.appendChild(c),this.plh=c),e&&(t=this.getSourceModel(e),t&&t.set&&t.set("status","freezed"),this.srcModel=t),Object(u.on)(s,"mousemove dragover",this.onMove),Object(u.on)(a,"mouseup dragend touchend",this.endMove),Object(u.on)(a,"keydown",this.rollback),l&&l({target:t,parent:t&&t.parent(),index:t&&t.index()}),r&&r.clearSelection(),this.toggleSortCursor(1),r&&r.trigger("sorter:drag:start",e,t)},getTargetModel:function(e){var t=e||this.target;return d(t).data("model")},getSourceModel:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.target,o=n.avoidChildren,s=void 0===o?1:o,a=this.em,l=this.eV,c=e||l,u=this.dropModel,h=this.dropContent,f=function(e){return e&&r&&e.opt&&e.opt.avoidChildren&&t.isTextableActive(e,r)};if(h&&a){if(f(u)&&(u=null),!u){var p=a.get("DomComponents").getComponents(),g={avoidChildren:s,avoidStore:1,avoidUpdateStyle:1},m=p.add(h,i({},g,{temporary:1}));if(u=p.remove(m,g),u=u instanceof Array?u[0]:u,this.dropModel=u,f(u))return this.getSourceModel(c,{target:r,avoidChildren:0})}return u}return c&&d(c).data("model")},selectTargetModel:function(e){if(!(e instanceof l.a.Collection)){var t=this.targetModel;t&&t!==this.srcModel&&t.set("status",""),e&&e.set&&(e.set("status","selected-parent"),this.targetModel=e)}},onMove:function(e){var t=e,n=this.em,r=this.onMoveClb,i=this.plh;this.moved=1;var o=i.style.display;o&&"none"!==o||(i.style.display="block");var s=this.offset(this.el);this.elT=this.wmargin?Math.abs(s.top):s.top,this.elL=this.wmargin?Math.abs(s.left):s.left;var a=e.pageY-this.elT+this.el.scrollTop,l=e.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&n){var u=n.get("Canvas").getMouseRelativeCanvas(e,{noScroll:1});l=u.x,a=u.y}this.rX=l,this.rY=a,this.eventMove=e;var h=this.getSourceModel(),f=this.dimsFromTarget(e.target,l,a),p=this.target,g=p&&this.getTargetModel(p);if(this.selectTargetModel(g),g||(i.style.display="none"),p){this.lastDims=f;var m=this.findPosition(f,l,a);this.isTextableActive(h,g)?(this.activeTextModel=g,this.setContentEditable(g,!0),i.style.display="none",this.lastPos=m,this.updateTextViewCursorPosition(t)):(this.disableTextable(),this.activeTextModel=null,this.lastPos&&this.lastPos.index==m.index&&this.lastPos.method==m.method||(this.movePlaceholder(this.plh,f,m,this.prevTargetDim),this.$plh||(this.$plh=d(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css("top","+="+this.offTop+"px"),this.offLeft&&this.$plh.css("left","+="+this.offLeft+"px")),this.lastPos=m)),Object(c.isFunction)(r)&&r({event:e,target:h,parent:g,index:m.index+("after"==m.method?1:0)}),n&&n.trigger("sorter:drag",{target:p,targetModel:g,sourceModel:h,dims:f,pos:m,x:l,y:a})}},isTextableActive:function(e,t){return e&&e.get&&e.get("textable")&&t&&t.is("text")},disableTextable:function(){var e=this.activeTextModel;e&&e.getView().disableEditing()},isInFlow:function(e,t){if(!e)return!1;t=t||document.body;var n,r=e;return n=r.offsetHeight,!!this.styleInFlow(r,t)},styleInFlow:function(e,t){if(!Object(u.isTextNode)(e)){var n=e.style||{},r=d(e),i=t&&d(t);if(!(n.overflow&&"visible"!==n.overflow||"none"!==r.css("float")||i&&"flex"==i.css("display")&&"column"!==i.css("flex-direction"))){switch(n.position){case"static":case"relative":case"":break;default:return}switch(e.tagName){case"TR":case"TBODY":case"THEAD":case"TFOOT":return!0}switch(r.css("display")){case"block":case"list-item":case"table":case"flex":return!0}}}},validTarget:function(e,t){var n=this.getTargetModel(e),r=this.getSourceModel(t,{target:n});t=r&&r.view&&r.view.el,e=n&&n.view&&n.view.el;var i={valid:!0,src:t,srcModel:r,trg:e,trgModel:n};if(!t||!e)return i.valid=!1,i;var o=r.get("draggable");o=o instanceof Array?o.join(", "):o,i.dragInfo=o,o=Object(c.isString)(o)?this.matches(e,o):o,i.draggable=o;var s=n.get("droppable");return s=s instanceof l.a.Collection?1:s,s=s instanceof Array?s.join(", "):s,i.dropInfo=s,s=Object(c.isString)(s)?this.matches(t,s):s,s=o&&this.isTextableActive(r,n)?1:s,i.droppable=s,s&&o||(i.valid=!1),i},dimsFromTarget:function(e,t,n){var r=this.em,i=[];if(!e)return i;if(this.matches(e,"".concat(this.itemSel,", ").concat(this.containerSel))||(e=this.closest(e,this.itemSel)),this.draggable instanceof Array&&(e=this.closest(e,this.draggable.join(","))),!e)return i;if(this.prevTarget&&this.prevTarget!=e&&(this.prevTarget=null),!this.prevTarget){this.targetP=this.closest(e,this.containerSel);var o=this.validTarget(e);if(r&&r.trigger("sorter:drag:validation",o),!o.valid&&this.targetP)return this.dimsFromTarget(this.targetP,t,n);this.prevTarget=e,this.prevTargetDim=this.getDim(e),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(e)}if(this.prevTarget==e&&(i=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,t,n)||!this.nested&&!this.cacheDims.length){var s=this.targetP;s&&this.validTarget(s).valid&&(i=this.cacheDimsP,this.target=s)}return this.lastPos=null,i},getTargetFromEl:function(e){var t,n=e,r=this.targetPrev,i=this.em,o=this.containerSel,s=this.itemSel;if(this.matches(n,"".concat(s,", ").concat(o))||(n=this.closest(n,s)),this.draggable instanceof Array&&(n=this.closest(n,this.draggable.join(","))),r&&r!=n&&(this.targetPrev=""),!this.targetPrev){t=this.closest(n,o);var a=this.validTarget(n);if(i&&i.trigger("sorter:drag:validation",a),!a.valid&&t)return this.getTargetFromEl(t);this.targetPrev=n}return this.nearElBorders(n)&&(t=this.closest(n,o),t&&this.validTarget(t).valid&&(n=t)),n},nearElBorders:function(e){var t=10,n=e.getBoundingClientRect(),r=e.ownerDocument.body,i=this.getCurrentPos(),o=i.x,s=i.y,a=n.top+r.scrollTop,l=n.left+r.scrollLeft,c=n.width,u=n.height;if(sa+u-t||ol+c-t)return 1},getCurrentPos:function(){var e=this.eventMove,t=e.pageX||0,n=e.pageY||0;return{x:t,y:n}},getDim:function(e){var t,n,r,i,o=this.em,s=this.canvasRelative;if(s&&o){var a=o.get("Canvas"),l=a.getElementPos(e,{noScroll:1}),c=a.getElementOffsets(e);t=l.top-c.marginTop,n=l.left-c.marginLeft,r=l.height+c.marginTop+c.marginBottom,i=l.width+c.marginLeft+c.marginRight}else{var u=this.offset(e);t=this.relative?e.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?e.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=e.offsetHeight,i=e.offsetWidth}return[t,n,r,i]},getChildrenDim:function(e){var t=this,n=[];if(!e)return n;var r=this.getTargetModel(e);if(r&&r.view&&!this.ignoreViewChildren){var i=r.getCurrentView?r.getCurrentView():r.view;e=i.getChildrenContainer()}return Object(c.each)(e.children,function(r,i){var o=Object(u.getModel)(r,d),s=o&&o.index?o.index():i;if(Object(u.isTextNode)(r)||t.matches(r,t.itemSel)){var a=t.getDim(r),l=t.direction;l="v"==l||"h"!=l&&t.isInFlow(r,e),a.push(l,r,s),n.push(a)}}),n},nearBorders:function(e,t,n){var r=0,i=this.borderOffset,o=t||0,s=n||0,a=e[0],l=e[1],c=e[2],u=e[3];return(a+i>s||s>a+c-i||l+i>o||o>l+u-i)&&(r=1),!!r},findPosition:function(e,t,n){for(var r={index:0,indexEl:0,method:"before"},i=0,o=0,s=0,a=0,l=0,c=0,u=0,d=0,h=0,f=e.length;ho||a&&c>=a||i&&s=o?e.appendChild(t):e.insertBefore(t,i[s])},u=function(e,t){return c(e,t)},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=document.createElement(e);return t&&Object(r.each)(t,function(e,t){return i.setAttribute(t,e)}),n&&(Object(r.isString)(n)?i.innerHTML=n:i.appendChild(n)),i},h=function(e,t){var n;try{n=new window[t](e.type,e)}catch(e){n=document.createEvent(t),n.initEvent(e.type,!0,!0)}return n.keyCodeVal=e.keyCode,n._parentEvent=e,["keyCode","which"].forEach(function(e){Object.defineProperty(n,e,{get:function(){return this.keyCodeVal}})}),n},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(t)?t:[t];n.forEach(function(t){var n=t[i]||"div",s=t[o]||{},a=document.createElement(n);Object(r.each)(s,function(e,t){a.setAttribute(t,e)}),e.appendChild(a)})}},"./src/utils/extender.js":function(e,t,n){"use strict";n.r(t);var r=n("./node_modules/underscore/underscore.js");n.n(r);t["default"]=function(e){var t=e.$;if(t&&"jQuery"!==t.prototype.constructor.name){var n=t.fn;n.hide=function(){return this.css("display","none")},n.show=function(){return this.css("display","block")},n.focus=function(){var e=this.get(0);return e&&e.focus(),this},n.bind=function(e,t){return this.on(e,t)},n.unbind=function(e,t){if(Object(r.isObject)(e)){for(var n in e)e.hasOwnProperty(n)&&this.off(n,e[n]);return this}return this.off(e,t)},n.click=function(e){return e?this.on("click",e):this.trigger("click")},n.change=function(e){return e?this.on("change",e):this.trigger("change")},n.keydown=function(e){return e?this.on("keydown",e):this.trigger("keydown")},n.delegate=function(e,t,n,r){return r||(r=n),this.on(t,e,function(e){e.data=n,r(e)})},n.scrollLeft=function(){var e=this.get(0);e=9==e.nodeType?e.defaultView:e;var t=e instanceof Window?e:null;return t?t.pageXOffset:e.scrollLeft||0},n.scrollTop=function(){var e=this.get(0);e=9==e.nodeType?e.defaultView:e;var t=e instanceof Window?e:null;return t?t.pageYOffset:e.scrollTop||0};var i=t.prototype.offset;n.offset=function(e){var t,n;return e&&(t=e.top,n=e.left),"undefined"!=typeof t&&this.css("top","".concat(t,"px")),"undefined"!=typeof n&&this.css("left","".concat(n,"px")),i.call(this)},t.map=function(e,t){for(var n=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=Object(o.isArray)(e)?i()(e):[e];if(n.length){var r=n.shift();if(r&&(!t.unique||!document.querySelector('link[href="'.concat(r,'"]')))){var s=document,a=s.head,l=document.createElement("link");l.href=r,l.rel="stylesheet",t.prepand?a.insertBefore(l,a.firstChild):a.appendChild(l)}M(n)}},c=function(e,t){var n={},r=Object(o.keys)(t);for(var i in e)if(e.hasOwnProperty(i)){var s=e[i],a=t[i];r.indexOf(i)>=0?s!==a&&(n[i]=a):n[i]=null}for(var l in t)t.hasOwnProperty(l)&&Object(o.isUndefined)(e[l])&&(n[l]=t[l]);return n},u=function(e,t,n){t=t.split(/\s+/),e=e instanceof Array?e:[e];for(var r=function(r){e.forEach(function(e){return e.addEventListener(t[r],n)})},i=0;i1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0;if(isNaN(e))return n;if(e=parseFloat(e),Math.floor(e)!==e){var i=t.toString().split(".")[1];r=i?i.length:0}return r?parseFloat(e.toFixed(r)):e},m=function(e){return"draggable"in document.createElement("i")&&(e?e.get("Config").nativeDnD:1)},v=function(e){return Object(o.isElement)(e)||b(e)?e:e&&e.getEl?e.getEl():void 0},b=function(e){return e&&3===e.nodeType},y=function(e){return e&&8===e.nodeType},w=function(e){return e&&!b(e)&&!y(e)},x=function(e,t){var n=e;return Object(o.isElement)(e)&&(n=t(e).data("model")),n},C=function(e){var t={top:0,left:0,width:0,height:0};if(!e)return t;var n;if(b(e)){var r=document.createRange();r.selectNode(e),n=r.getBoundingClientRect(),r.detach()}return n||(e.getBoundingClientRect?e.getBoundingClientRect():t)},j=function(e){return e.touches&&e.touches[0]?e.touches[0]:e},O=function(e){return e.which||e.keyCode},k=function(e){return String.fromCharCode(O(e))},S=function(e){return 27===O(e)},T=function(e){return e&&e.charAt(0).toUpperCase()+e.substring(1)},P=function(e){return e&&e.toHTML},E=function(e){return e&&e.toCSS},_=function(e){return e.__gjsv},D=function(e,t){e.__gjsv=t}},"./src/utils/polyfills.js":function(e,t,n){"use strict";n.r(t),t["default"]=function(){var e=function(){for(var e,t=window.navigator.userAgent,n=[["edge",/Edge\/([0-9\._]+)/],["ie",/MSIE\s(7\.0)/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]],r=0;r