From 46a41cb509e969f9e4d1381b817eba4a1849799e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 1 Dec 2018 22:43:34 +0100 Subject: [PATCH] Update whatwg-fetch --- dist/grapes.js | 2 +- dist/grapes.min.js | 4 ++-- package-lock.json | 8 ++++---- package.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dist/grapes.js b/dist/grapes.js index af17a112b8..9c2a4ab354 100644 --- a/dist/grapes.js +++ b/dist/grapes.js @@ -38217,7 +38217,7 @@ module.exports = function () { plugins: plugins, // Will be replaced on build - version: '0.14.45', + version: '0.14.46', /** * Initialize the editor with passed options diff --git a/dist/grapes.min.js b/dist/grapes.min.js index a1ec1636cc..ecd4d9e41d 100644 --- a/dist/grapes.min.js +++ b/dist/grapes.min.js @@ -1,6 +1,6 @@ -/*! grapesjs - 0.14.45 */ +/*! grapesjs - 0.14.46 */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.grapesjs=e():t.grapesjs=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=87)}([function(t,e,n){(function(i){var r,o,s;s="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i,r=[n(1),n(13),e],void 0===(o=function(t,e,n){s.Backbone=function(t,e,n,i){var r=t.Backbone,o=Array.prototype.slice;e.VERSION="1.3.3",e.$=i,e.noConflict=function(){return t.Backbone=r,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=function(t,e,i){n.each(e,function(e,r){n[r]&&(t.prototype[r]=function(t,e,i){switch(t){case 1:return function(){return n[e](this[i])};case 2:return function(t){return n[e](this[i],t)};case 3:return function(t,r){return n[e](this[i],a(t,this),r)};case 4:return function(t,r,o){return n[e](this[i],a(t,this),r,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[i]),n[e].apply(n,t)}}}(e,r,i))})},a=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?l(t):n.isString(t)?function(e){return e.get(t)}:t},l=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},c=e.Events={},u=/\s+/,h=function(t,e,i,r,o){var s,a=0;if(i&&"object"==typeof i){void 0!==r&&"context"in o&&void 0===o.context&&(o.context=r);for(s=n.keys(i);athis.length&&(r=this.length),r<0&&(r+=this.length+1);var o,s,a=[],l=[],c=[],u=[],h={},d=e.add,f=e.merge,p=e.remove,g=!1,v=this.comparator&&null==r&&!1!==e.sort,m=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(D,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+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 i=document.body,r=i.insertBefore(this.iframe,i.firstChild).contentWindow;r.document.open(),r.document.close(),r.location.hash="#"+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};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 t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),_.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!_.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var i=n+t;if(t=this.decodeFragment(t.replace(I,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var r=this.iframe.contentWindow;e.replace||(r.document.open(),r.document.close()),this._updateHash(r.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var i=t.href.replace(/(javascript:|#).*$/,"");t.replace(i+"#"+e)}else t.hash="#"+e}}),e.history=new _,y.extend=b.extend=M.extend=k.extend=_.extend=function(t,e){var i,r=this;return i=t&&n.has(t,"constructor")?t.constructor:function(){return r.apply(this,arguments)},n.extend(i,r,e),i.prototype=n.create(r.prototype,t),i.prototype.constructor=i,i.__super__=r.prototype,i};var F=function(){throw new Error('A "url" property or function must be specified')},j=function(t,e){var n=e.error;e.error=function(i){n&&n.call(e.context,t,i,e),t.trigger("error",t,i,e)}};return e}(s,n,t,e)}.apply(e,r))||(t.exports=o)}).call(this,n(8))},function(t,e,n){(function(t,n){var i;!function(){var r="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=r._,s=Array.prototype,a=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=s.push,u=s.slice,h=a.toString,d=a.hasOwnProperty,f=Array.isArray,p=Object.keys,g=Object.create,v=function(){},m=function(t){return t instanceof m?t:this instanceof m?void(this._wrapped=t):new m(t)};e.nodeType?r._=m:(!n.nodeType&&n.exports&&(e=n.exports=m),e._=m),m.VERSION="1.9.1";var y,b=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,i,r){return t.call(e,n,i,r)};case 4:return function(n,i,r,o){return t.call(e,n,i,r,o)}}return function(){return t.apply(e,arguments)}},x=function(t,e,n){return m.iteratee!==y?m.iteratee(t,e):null==t?m.identity:m.isFunction(t)?b(t,e,n):m.isObject(t)&&!m.isArray(t)?m.matcher(t):m.property(t)};m.iteratee=y=function(t,e){return x(t,e,1/0)};var w=function(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),i=Array(n),r=0;r=0&&e<=E};m.each=m.forEach=function(t,e,n){var i,r;if(e=b(e,n),A(t))for(i=0,r=t.length;i=3;return function(e,n,i,r){var o=!A(e)&&m.keys(e),s=(o||e).length,a=t>0?0:s-1;for(r||(i=e[o?o[a]:a],a+=t);a>=0&&a=0},m.invoke=w(function(t,e,n){var i,r;return m.isFunction(e)?r=e:m.isArray(e)&&(i=e.slice(0,-1),e=e[e.length-1]),m.map(t,function(t){var o=r;if(!o){if(i&&i.length&&(t=T(t,i)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)})}),m.pluck=function(t,e){return m.map(t,m.property(e))},m.where=function(t,e){return m.filter(t,m.matcher(e))},m.findWhere=function(t,e){return m.find(t,m.matcher(e))},m.max=function(t,e,n){var i,r,o=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=A(t)?t:m.values(t)).length;ao&&(o=i);else e=x(e,n),m.each(t,function(t,n,i){((r=e(t,n,i))>s||r===-1/0&&o===-1/0)&&(o=t,s=r)});return o},m.min=function(t,e,n){var i,r,o=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=A(t)?t:m.values(t)).length;ai||void 0===n)return 1;if(n0?0:r-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 i[o=n(i,r)]===r?o:-1;if(r!=r)return(o=e(u.call(i,s,a),m.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(i&&(clearTimeout(i),i=null),a=c,s=t.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(l,u)),s};return c.cancel=function(){clearTimeout(i),a=0,i=r=o=null},c},m.debounce=function(t,e,n){var i,r,o=function(e,n){i=null,n&&(r=t.apply(e,n))},s=w(function(s){if(i&&clearTimeout(i),n){var a=!i;i=setTimeout(o,e),a&&(r=t.apply(this,s))}else i=m.delay(o,e,this,s);return r});return s.cancel=function(){clearTimeout(i),i=null},s},m.wrap=function(t,e){return m.partial(e,t)},m.negate=function(t){return function(){return!t.apply(this,arguments)}},m.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}},m.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},m.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},m.once=m.partial(m.before,2),m.restArguments=w;var F=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],R=function(t,e){var n=j.length,i=t.constructor,r=m.isFunction(i)&&i.prototype||a,o="constructor";for(S(t,o)&&!m.contains(e,o)&&e.push(o);n--;)(o=j[n])in t&&t[o]!==r[o]&&!m.contains(e,o)&&e.push(o)};m.keys=function(t){if(!m.isObject(t))return[];if(p)return p(t);var e=[];for(var n in t)S(t,n)&&e.push(n);return F&&R(t,e),e},m.allKeys=function(t){if(!m.isObject(t))return[];var e=[];for(var n in t)e.push(n);return F&&R(t,e),e},m.values=function(t){for(var e=m.keys(t),n=e.length,i=Array(n),r=0;r1&&(i=b(i,e[1])),e=m.allKeys(t)):(i=$,e=_(e,!1,!1),t=Object(t));for(var r=0,o=e.length;r1&&(n=e[1])):(e=m.map(_(e,!1,!1),String),i=function(t,n){return!m.contains(e,n)}),m.pick(t,i,n)}),m.defaults=z(m.allKeys,!0),m.create=function(t,e){var n=C(t);return e&&m.extendOwn(n,e),n},m.clone=function(t){return m.isObject(t)?m.isArray(t)?t.slice():m.extend({},t):t},m.tap=function(t,e){return e(t),t},m.isMatch=function(t,e){var n=m.keys(e),i=n.length;if(null==t)return!i;for(var r=Object(t),o=0;o":">",'"':""","'":"'","`":"`"},U=m.invert(W),q=function(t){var e=function(e){return t[e]},n="(?:"+m.keys(t).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(r,e):t}};m.escape=q(W),m.unescape=q(U),m.result=function(t,e,n){m.isArray(e)||(e=[e]);var i=e.length;if(!i)return m.isFunction(n)?n.call(t):n;for(var r=0;r/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Y=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},X=/\\|'|\r|\n|\u2028|\u2029/g,J=function(t){return"\\"+G[t]};m.template=function(t,e,n){!e&&n&&(e=n),e=m.defaults({},e,m.templateSettings);var i,r=RegExp([(e.escape||Y).source,(e.interpolate||Y).source,(e.evaluate||Y).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(r,function(e,n,i,r,a){return s+=t.slice(o,a).replace(X,J),o=a+e.length,n?s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":r&&(s+="';\n"+r+"\n__p+='"),e}),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{i=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return i.call(this,t,m)},l=e.variable||"obj";return a.source="function("+l+"){\n"+s+"}",a},m.chain=function(t){var e=m(t);return e._chain=!0,e};var Z=function(t,e){return t._chain?m(e).chain():e};m.mixin=function(t){return m.each(m.functions(t),function(e){var n=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),Z(this,n.apply(m,t))}}),m},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=s[t];m.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],Z(this,n)}}),m.each(["concat","join","slice"],function(t){var e=s[t];m.prototype[t]=function(){return Z(this,e.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return String(this._wrapped)},void 0===(i=function(){return m}.apply(e,[]))||(n.exports=i)}()}).call(this,n(8),n(91)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getUnitFromValue=e.normalizeFloat=e.shallowDiff=e.getElement=e.camelCase=e.getModel=e.matches=e.upFirst=e.hasDnd=e.off=e.on=void 0;var i=n(1),r=window.Element.prototype,o=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector,s=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)};e.on=function(t,e,n){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var i=function(i){t.forEach(function(t){return t.addEventListener(e[i],n)})},r=0;r=0?s!==a&&(n[o]=a):n[o]=null}for(var l in e)e.hasOwnProperty(l)&&(0,i.isUndefined)(t[l])&&(n[l]=e[l]);return n},e.normalizeFloat=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var r=e.toString().split(".")[1];i=r?r.length:0}return i?parseFloat(t.toFixed(i)):t},e.getUnitFromValue=function(t){return t.replace(parseFloat(t),"")}},function(t,e,n){"use strict";var i,r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.em,s=this.parent(),a=s&&s.attributes;if(a&&a.propagate){var l={},c=a.propagate;c.forEach(function(t){return l[t]=s.get(t)}),l.propagate=c,l=r({},l,e),this.set(l)}var u=this.get("propagate");u&&this.set("propagate",(0,o.isArray)(u)?u:[u]),n&&n.config&&n.config.voidElements.indexOf(this.get("tagName"))>=0&&this.set("void",!0),n.em=i,this.opt=n,this.em=i,this.config=n.config||{},this.ccid=m.createId(this),this.set("attributes",this.get("attributes")||{}),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.set("status",""),["classes","traits","components"].forEach(function(e){var n="add remove "+("components"!==e?"change":"");t.listenTo(t.get(e),n.trim(),function(){for(var n=arguments.length,i=Array(n),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},i=(t=r({},t)).class;i&&this.setClass(i),delete t.class;var a=t.style;a&&this.setStyle(a),delete t.style,this.set("attributes",t,n);var l=r({},this.previous("attributes")),c=(0,s.shallowDiff)(l,t);return(0,o.keys)(c).forEach(function(t){return e.trigger("change:attributes:"+t)}),this},addAttributes:function(t){var e=r({},this.getAttributes(),t);return this.setAttributes(e),this},getStyle:function(){var t=this.em;if(t&&t.getConfig("avoidInlineStyle")){var e=this.get("state"),n=t.get("CssComposer").getIdRule(this.getId(),{state:e});if(this.rule=n,n)return n.getStyle()}return l.default.getStyle.call(this)},setStyle:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,a=this.opt;if(i&&i.getConfig("avoidInlineStyle")&&!a.temporary){e=(0,o.isString)(e)?this.parseStyle(e):e,e=r({},e,this.get("style"));var c=this.get("state"),u=i.get("CssComposer"),h=this.getStyle();this.rule=u.setIdRule(this.getId(),e,r({},n,{state:c}));var d=(0,s.shallowDiff)(h,e);this.set("style",{},{silent:1}),(0,o.keys)(d).forEach(function(e){return t.trigger("change:style:"+e)})}else e=l.default.setStyle.apply(this,arguments);return e},getAttributes:function(){var t=this.em,e=[],n=r({},this.get("attributes")),i=t&&t.get("SelectorManager"),s=this.getId();if(this.get("classes").forEach(function(t){return e.push((0,o.isString)(t)?t:t.get("name"))}),e.length&&(n.class=e.join(" ")),!(0,o.has)(n,"id")){var a=void 0;!function(t){return t&&t.getConfig("avoidInlineStyle")}(t)?(0,o.isEmpty)(this.getStyle())||(a=1):a=i&&i.get(s,i.Selector.TYPE_ID),a&&(n.id=this.getId())}return n},addClass:function(t){var e=this.em.get("SelectorManager").addClass(t);return this.get("classes").add(e)},setClass:function(t){return this.get("classes").reset(),this.addClass(t)},removeClass:function(t){var e=[];t=(0,o.isArray)(t)?t:[t];var n=this.get("classes"),i=h.TYPE_CLASS;return t.forEach(function(t){t.split(" ").forEach(function(t){var r=n.where({name:t,type:i})[0];r&&e.push(n.remove(r))})}),e},getClasses:function(){var t=this.getAttributes().class;return t?t.split(" "):[]},initClasses:function(){var t=[this,"change:classes",this.initClasses];this.stopListening.apply(this,t);var e=this.normalizeClasses(this.get("classes")||[]),n=new d([]);return this.set("classes",n),n.add(e),this.listenTo.apply(this,t),this},initComponents:function(){var t=[this,"change:components",this.initComponents];this.stopListening.apply(this,t);var e=new u(null,this.opt);e.parent=this;var n=this.get("components"),i=!this.opt.avoidChildren;return this.set("components",e),i&&e.add(n),this.listenTo.apply(this,t),this},initTraits:function(){var t=[this,"change:traits",this.initTraits];this.stopListening.apply(this,t),this.loadTraits();var e=r({},this.get("attributes")),n=this.get("traits");return n.each(function(t){if(!t.get("changeProp")){var n=t.get("name"),i=t.getInitValue();n&&i&&(e[n]=i)}}),n.length&&this.set("attributes",e),this.listenTo.apply(this,t),this},init:function(){},append:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.components().add(t,e);return(0,o.isArray)(n)?n:[n]},components:function(t){var e=this.get("components");return(0,o.isUndefined)(t)?e:(e.reset(),t&&this.append(t))},parent:function(){var t=this.collection;return t&&t.parent},scriptUpdated:function(){this.set("scriptUpdated",1)},initToolbar:function(){var t=this.em,e=t&&t.getConfig("stylePrefix")||"";if(!this.get("toolbar")){var n=[];this.collection&&n.push({attributes:{class:"fa fa-arrow-up"},command:"select-parent"}),this.get("draggable")&&n.push({attributes:{class:"fa fa-arrows "+e+"no-touch-actions",draggable:!0},command:"tlb-move"}),this.get("copyable")&&n.push({attributes:{class:"fa fa-clone"},command:"tlb-clone"}),this.get("removable")&&n.push({attributes:{class:"fa fa-trash-o"},command:"tlb-delete"}),this.set("toolbar",n)}},loadTraits:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!((t=t||this.get("traits"))instanceof f)){var n=new f([],this.opt);n.setTarget(this),t.length&&(t.forEach(function(t){return t.attributes&&delete t.attributes.value}),n.add(t)),this.set("traits",n,e)}return this},getTrait:function(t){return this.get("traits").filter(function(e){return e.get("id")===t||e.get("name")===t})[0]},normalizeClasses:function(t){var e=[],n=this.em;if(n){var i=n.get("SelectorManager");if(i)return t.forEach(function(t){var n="";n="string"==typeof t?t:t.name;var r=i.add(n);e.push(r)}),e}},clone:function(){var t=this.em,e=this.getStyle(),n=r({},this.attributes),i=r({},this.opt);return n.attributes=r({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.get("components").each(function(t,e){n.components[e]=t.clone()}),this.get("traits").each(function(t,e){n.traits[e]=t.clone()}),this.get("classes").each(function(t,e){n.classes[e]=t.get("name")}),n.status="",n.view="",i.collection=null,t&&t.getConfig("avoidInlineStyle")&&!(0,o.isEmpty)(e)&&(n.style=e),new this.constructor(n,i)},getName:function(){var t=this.get("name")||this.get("custom-name"),e=this.get("tagName");e="div"==e?"box":e;var n=this.get("type")||e;return n=n.charAt(0).toUpperCase()+n.slice(1),t||n},getIcon:function(){var t=this.get("icon");return t?t+" ":""},toHTML:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.get("tagName"),i=this.get("void"),r=t.attributes,s=this.getAttrToHTML();for(var a in r&&((0,o.isFunction)(r)?s=r(this,s)||{}:(0,o.isObject)(r)&&(s=r)),s){var l=s[a],c=(0,o.isString)(l)?l.replace(/"/g,"""):l;(0,o.isUndefined)(c)||((0,o.isBoolean)(c)?c&&e.push(a):e.push(a+'="'+c+'"'))}var u="<"+n+(e.length?" "+e.join(" "):"")+(i?"/":"")+">"+this.get("content");return this.get("components").each(function(e){return u+=e.toHTML(t)}),!i&&(u+=""),u},getAttrToHTML:function(){var t=this.getAttributes();return delete t.style,t},toJSON:function(){for(var t=arguments.length,e=Array(t),n=0;n1?i-1:0),o=1;o0&&void 0!==arguments[0]&&arguments[0];var t=this.em,e=this.getId();if(e){var n=m.createId(this);this.setId(n);var i=t&&t.get("CssComposer").getIdRule(e),r=i&&i.get("selectors").at(0);return r&&r.set("name",n),this}}},{isComponent:function(t){return{tagName:t.tagName?t.tagName.toLowerCase():""}},createId:function(t){var e=(++g).toString().length+2,n="i"+(Math.random()+1.1).toString(36).slice(-e);return p[n]=t,n},getList:function(){return p}});t.exports=m},function(t,e,n){"use strict";var i,r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{},i=n.em;this.opts=t,this.config=n,this.em=i||"",this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.attr=e.get("attributes"),this.classe=this.attr.class||[];var r=this.$el;this.listenTo(e,"change:style",this.updateStyle),this.listenTo(e,"change:attributes",this.renderAttributes),this.listenTo(e,"change:highlightable",this.updateHighlight),this.listenTo(e,"change:status",this.updateStatus),this.listenTo(e,"change:state",this.updateState),this.listenTo(e,"change:script",this.render),this.listenTo(e,"change:content",this.updateContent),this.listenTo(e,"change",this.handleChange),this.listenTo(e,"active",this.onActive),r.data("model",e),e.view=this,this.initClasses(),this.initComponents({avoidRender:1}),this.init()},init:function(){},onActive:function(){},initClasses:function(){var t=this.model,e=t.get("classes");e instanceof u&&(this.stopListening(t,"change:classes",this.initClasses),this.listenTo(t,"change:classes",this.initClasses),this.listenTo(e,"add remove change",this.updateClasses),e.length&&this.importClasses())},initComponents:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.$el,i=this.childrenView,r=e.get("components"),o=[e,"change:components",this.initComponents];r instanceof l&&(n.data("collection",r),i&&i.remove(),this.stopListening.apply(this,o),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,o))},handleChange:function(){var t=this.model;for(var e in t.emitUpdate(),t.changed)t.emitUpdate(e)},importClasses:function(){var t=this.config.em.get("SelectorManager");t&&this.model.get("classes").each(function(e){t.add(e.get("name"))})},updateState:function(t){var e="hc-state";this.model.get("state")?this.$el.addClass(e):this.$el.removeClass(e)},updateStatus:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(this.em,this.el),n=this.model.get("status"),i=this.pfx,r=this.ppfx,o=i+"selected",s=o+"-parent",a=r+"freezed",l=r+"hovered",c=[o,s,a,l];this.$el.removeClass(c.join(" "));var u=e.getAttribute("class")||"",h="";switch(n){case"selected":h=u+" "+o;break;case"selected-parent":h=u+" "+s;break;case"freezed":h=u+" "+a;break;case"freezed-selected":h=u+" "+a+" "+o;break;case"hovered":h=t.avoidHover?"":u+" "+l}(h=h.trim())&&e.setAttribute("class",h)},updateHighlight:function(){var t=this.model.get("highlightable");this.setAttribute("data-highlightable",t?1:"")},updateStyle:function(){var t=this.em,e=this.model;if(t&&t.get("avoidInlineStyle")){this.el.id=e.getId();var n=e.getStyle();!(0,a.isEmpty)(n)&&e.setStyle(n)}else this.setAttribute("style",e.styleToString())},updateClasses:function(){var t=this.model.get("classes").pluck("name").join(" ");this.setAttribute("class",t),this.updateStatus()},setAttribute:function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)},getClasses:function(){return this.model.getClasses().join(" ")},updateAttributes:function(){var t=this.model,e={"data-gjs-type":t.get("type")||"default"};t.get("highlightable")&&(e["data-highlightable"]=1),this.$el.attr(r({},e,t.getAttributes())),this.updateStyle()},updateContent:function(){this.getChildrenContainer().innerHTML=this.model.get("content")},prevDef:function(t){t.preventDefault()},updateScript:function(){if(this.model.get("script")){var t=this.em;if(t)t.get("Canvas").getCanvasView().updateScript(this)}},getChildrenContainer:function(){var t=this.el;return"function"==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t},renderChildren:function(){this.updateContent();var t=this.getChildrenContainer(),e=new c({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),i=0,r=n.length;i\n '+this.templateLabel(t)+'\n \n
\n '+this.templateInput(t)+"\n
\n "},templateLabel:function(t){var e=this.pfx;return'\n \n '+t.get("name")+'\n \n \n '},templateInput:function(t){return'\n
\n \n
\n '},events:function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({change:"inputValueChanged"},"click [data-clear-style]","clear"),initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.bindAll)(this,"targetUpdated"),this.config=t.config||{};var e=this.config.em;this.em=e,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 n=this.model;this.property=n.get("property"),this.input=null;var i=this.pfx;this.inputHolderId="#"+i+"input-holder",this.sector=n.collection&&n.collection.sector,n.view=this,n.get("value")||n.set("value",n.getDefaultValue()),e&&e.on("update:component:style:"+this.property,this.targetUpdated),this.listenTo(this.propTarget,"update styleManager:update",this.targetUpdated),this.listenTo(n,"destroy remove",this.remove),this.listenTo(n,"change:value",this.modelValueChanged),this.listenTo(n,"targetUpdated",this.targetUpdated),this.listenTo(n,"change:visible",this.updateVisibility),this.listenTo(n,"change:status",this.updateStatus);var r=this.init&&this.init.bind(this);r&&r()},updateStatus:function(){var t=this.model.get("status"),e=this.pfx,n=this.ppfx,i=this.config,r=n+"four-color",o=n+"color-warn",s=this.$el.children("."+e+"label"),a=this.getClearEl().style;switch(s.removeClass(r+" "+o),a.display="none",t){case"updated":s.addClass(r),i.clearProperties&&(a.display="inline");break;case"computed":s.addClass(o)}},clear:function(t){t&&t.stopPropagation(),this.model.clearValue(),this.targetUpdated()},getClearEl:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[data-clear-style]")),this.clearEl},getTarget:function(){return this.getTargetModel()},getTargetModel:function(){return this.propTarget&&this.propTarget.model},getHelperModel:function(){return this.propTarget&&this.propTarget.helper},inputValueChanged:function(t){t&&t.stopPropagation(),this.model.setValue(this.getInputValue(),1,{fromInput:1}),this.elementUpdated()},elementUpdated:function(){this.setStatus("updated")},setStatus:function(t){this.model.set("status",t);var e=this.model.parent;e&&e.set("status",t)},emitUpdateTarget:(0,s.debounce)(function(){var t=this.config.em;t&&t.trigger("styleManager:update:target",this.getTarget())}),targetUpdated:function(){if(this.emitUpdateTarget(),this.checkVisibility()){var t=this.config,e=t.em,n=this.model,i="",r="",o=this.getTargetValue({ignoreDefault:1}),s=n.getDefaultValue(),a=this.getComputedValue();o?(i=o,t.highlightChanged&&(r="updated")):a&&t.showComputed&&a!=s?(i=a,t.highlightComputed&&(r="computed")):(i=s,r=""),n.setValue(i,0,{fromTarget:1}),this.setStatus(r),e&&(e.trigger("styleManager:change",this),e.trigger("styleManager:change:"+n.get("property"),this))}},checkVisibility:function(){var t=1;return this.config.hideNotStylable&&(this.isTargetStylable()&&this.isComponentStylable()?this.show():(this.hide(),t=0),this.sector&&this.sector.trigger("updateVisibility")),t},getTargetValue:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.model,i=this.getTargetModel(),r=this.customValue;if(!i)return t;if((t=i.getStyle()[n.get("property")])||e.ignoreDefault||(t=n.getDefaultValue()),"function"==typeof r&&!e.ignoreCustomValue){var o=r(this,n.collection.indexOf(n));o&&(t=o)}return t},getComputedValue:function(){var t=this.propTarget,e=t.computed||{},n=t.computedDefault||{},i=this.config.avoidComputed||[],r=this.model.get("property"),o=i.indexOf(r)<0,s=e[r],l=n[(0,a.camelCase)(r)];return e&&o&&l!==s&&s},getInputValue:function(){var t=this.getInputEl();return t?t.value:""},modelValueChanged:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.config.em,r=this.model,o=r.getFullValue(),s=this.getTarget(),a=r.get("property"),l=this.onChange;if(n.fromInput||this.setValue(o),s&&this.isTargetStylable()&&this.isComponentStylable()){n.fromTarget||(l&&!n.fromParent?l(s,this,n):this.updateTargetStyle(o,null,n));var c=i&&i.getSelected();i&&c&&(i.trigger("component:update",c),i.trigger("component:styleUpdate",c,a),i.trigger("component:styleUpdate:"+a,c))}},updateTargetStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e||this.model.get("property"),r=this.getTarget(),o=r.getStyle();t?o[i]=t:delete o[i],r.setStyle(o,n);var s=this.getHelperModel();s&&s.setStyle(o,n)},isTargetStylable:function(t){var e=t||this.getTarget(),n=this.model,i=n.get("id"),r=n.get("property"),o=n.get("toRequire"),a=e.get("unstylable"),l=e.get("stylable-require"),c=e.get("stylable");return(0,s.isArray)(c)&&(c=c.indexOf(r)>=0),(0,s.isArray)(a)&&(c=a.indexOf(r)<0),o&&(c=!t||l&&(l.indexOf(i)>=0||l.indexOf(r)>=0)),c},isComponentStylable:function(){var t=this.em,e=t&&t.getSelected();return!e||this.isTargetStylable(e)},setRawValue:function(t){this.setValue(this.model.parseValue(t))},setValue:function(t){var e=this.model,n=(0,s.isUndefined)(t)?e.getDefaultValue():t,i=this.getInputEl();i&&(i.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 t=this.pfx,e=this.model,n=this.el,i=e.get("property"),r=e.get("full"),o=t+"property";n.innerHTML=this.template(e),n.className=o+" "+t+e.get("type")+" "+o+"__"+i,n.className+=r?" "+o+"--full":"",this.updateStatus();var s=this.onRender&&this.onRender.bind(this);s&&s(),this.setValue(e.get("value"),{targetUpdate:1})}})},function(t,e,n){t.exports=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),i=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),s=i||r||o,a=s&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\//.test(t),h=/Opera\//.test(t),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),g=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),v=/Android/.test(t),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),x=/win/i.test(e),w=h&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(h=!1,l=!0);var C=y&&(c||h&&(null==w||w<12.11)),k=n||s&&a>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var T,E=function(t,e){var n=t.className,i=S(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function M(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function A(t,e){return M(t).appendChild(e)}function O(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}g?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(I=function(t){try{t.select()}catch(t){}});var z=function(){this.id=null};function V(t,e){for(var n=0;n=e)return i+Math.min(s,e-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=e)return i}}var K=[""];function Y(t){for(;K.length<=t;)K.push(G(K)+" ");return K[t]}function G(t){return t[t.length-1]}function X(t,e){for(var n=[],i=0;i"€"&&(t.toUpperCase()!=t.toLowerCase()||Q.test(t))}function et(t,e){return e?!!(e.source.indexOf("\\w")>-1&&tt(t))||e.test(t):tt(t)}function nt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var it=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function rt(t){return t.charCodeAt(0)>=768&&it.test(t)}function ot(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var r=(e+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+i}}function at(t,e,i){var r=this;this.input=i,r.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=P("div",null,"CodeMirror-code"),r.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=O("div",null,"CodeMirror-cursors"),r.measure=O("div",null,"CodeMirror-measure"),r.lineMeasure=O("div",null,"CodeMirror-measure"),r.lineSpace=P("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var o=P("div",[r.lineSpace],"CodeMirror-lines");r.mover=O("div",[o],null,"position: relative"),r.sizer=O("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=O("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),r.gutters=O("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=O("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=O("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),s&&a<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),l||n&&m||(r.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(r.wrapper):t(r.wrapper)),r.viewFrom=r.viewTo=e.first,r.reportedViewFrom=r.reportedViewTo=e.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,i.init(r)}function lt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e=t.first&&en?vt(n,lt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?vt(t.line,e):n<0?vt(t.line,0):t}(e,lt(t,e.line).text.length)}function St(t,e){for(var n=[],i=0;i=e:o.to>e);(i||(i=[])).push(new Mt(s,o.from,l?null:o.to))}}return i}(n,r,s),l=function(t,e,n){var i;if(t)for(var r=0;r=e:o.to>e);if(a||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=e:o.from0&&a)for(var x=0;xe)&&(!n||Ft(n,o.marker)<0)&&(n=o.marker)}return n}function Ht(t,e,n,i,r){var o=lt(t,e),s=Et&&o.markedSpans;if(s)for(var a=0;a=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?mt(c.to,n)>=0:mt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?mt(c.from,i)<=0:mt(c.from,i)<0)))return!0}}}function $t(t){for(var e;e=Rt(t);)t=e.find(-1,!0).line;return t}function Bt(t,e){var n=lt(t,e),i=$t(n);return n==i?e:dt(i)}function Wt(t,e){if(e>t.lastLine())return e;var n,i=lt(t,e);if(!Ut(t,i))return e;for(;n=zt(i);)i=n.find(1,!0).line;return dt(i)+1}function Ut(t,e){var n=Et&&e.markedSpans;if(n)for(var i=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}var Xt=null;function Jt(t,e,n){var i;Xt=null;for(var r=0;re)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:Xt=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:Xt=r)}return null!=i?i:Xt}var Zt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,r=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function a(t,e,n){this.level=t,this.from=e,this.to=n}return function(l,c){var u,h="ltr"==c?"L":"R";if(0==l.length||"ltr"==c&&!n.test(l))return!1;for(var d=l.length,f=[],p=0;p-1&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function re(t,e){var n=ne(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function le(t){t.prototype.on=function(t,e){ee(this,t,e)},t.prototype.off=function(t,e){ie(this,t,e)}}function ce(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function ue(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function he(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function de(t){ce(t),ue(t)}function fe(t){return t.target||t.srcElement}function pe(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var ge,ve,me=function(){if(s&&a<9)return!1;var t=O("div");return"draggable"in t||"dragDrop"in t}();function ye(t){if(null==ge){var e=O("span","​");A(t,O("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(ge=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=ge?O("span","​"):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function be(t){if(null!=ve)return ve;var e=A(t,document.createTextNode("AخA")),n=T(e,0,1).getBoundingClientRect(),i=T(e,1,2).getBoundingClientRect();return M(t),!(!n||n.left==n.right)&&(ve=i.right-n.right<3)}var xe,we=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],i=t.length;e<=i;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var o=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Ce=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},ke="oncopy"in(xe=O("div"))||(xe.setAttribute("oncopy","return;"),"function"==typeof xe.oncopy),Se=null,Te={},Ee={};function Me(t){if("string"==typeof t&&Ee.hasOwnProperty(t))t=Ee[t];else if(t&&"string"==typeof t.name&&Ee.hasOwnProperty(t.name)){var e=Ee[t.name];"string"==typeof e&&(e={name:e}),(t=Z(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Me("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Me("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ae(t,e){e=Me(e);var n=Te[e.name];if(!n)return Ae(t,"text/plain");var i=n(t,e);if(Oe.hasOwnProperty(e.name)){var r=Oe[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)i[s]=e.modeProps[s];return i}var Oe={};function Pe(t,e){var n=Oe.hasOwnProperty(t)?Oe[t]:Oe[t]={};j(e,n)}function Le(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function _e(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Ne(t,e,n){return!t.startState||t.startState(e,n)}var De=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};De.prototype.eol=function(){return this.pos>=this.string.length},De.prototype.sol=function(){return this.pos==this.lineStart},De.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},De.prototype.next=function(){if(this.pose},De.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},De.prototype.skipToEnd=function(){this.pos=this.string.length},De.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},De.prototype.backUp=function(t){this.pos-=t},De.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(r(o)==r(t))return!1!==e&&(this.pos+=t.length),!0},De.prototype.current=function(){return this.string.slice(this.start,this.pos)},De.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},De.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},De.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var Ie=function(t,e){this.state=t,this.lookAhead=e},Fe=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function je(t,e,n,i){var r=[t.state.modeGen],o={};qe(t,e.text,t.doc.mode,n,function(t,e){return r.push(t,e)},o,i);for(var s=n.state,a=function(i){n.baseTokens=r;var a=t.state.overlays[i],l=1,c=0;n.state=!0,qe(t,e.text,a.mode,n,function(t,e){for(var n=l;ct&&r.splice(l,1,t,r[l+1],i),l+=2,c=Math.min(t,i)}if(e)if(a.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Le(t.doc.mode,i.state),o=je(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function ze(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new Fe(i,!0,e);var o=function(t,e,n){for(var i,r,o=t.doc,s=n?-1:e-(t.doc.mode.innerMode?1e3:100),a=e;a>s;--a){if(a<=o.first)return o.first;var l=lt(o,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof Ie?c.lookAhead:0)<=o.modeFrontier))return a;var u=R(l.text,null,t.options.tabSize);(null==r||i>u)&&(r=a-1,i=u)}return r}(t,e,n),s=o>i.first&<(i,o-1).stateAfter,a=s?Fe.fromSaved(i,s,o):new Fe(i,Ne(i.mode),o);return i.iter(o,e,function(n){Ve(t,n.text,a);var i=a.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&ie.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}Fe.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},Fe.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},Fe.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Fe.fromSaved=function(t,e,n){return e instanceof Ie?new Fe(t,Le(t.mode,e.state),n,e.lookAhead):new Fe(t,Le(t.mode,e),n)},Fe.prototype.save=function(t){var e=!1!==t?Le(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ie(e,this.maxLookAhead):e};var Be=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function We(t,e,n,i){var r,o=t.doc,s=o.mode;e=kt(o,e);var a,l=lt(o,e.line),c=ze(t,e.line,n),u=new De(l.text,t.options.tabSize,c);for(i&&(a=[]);(i||u.post.options.maxHighlightLength?(a=!1,s&&Ve(t,e,i,h.pos),h.pos=e.length,l=null):l=Ue($e(n,h,i.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;c1&&!/ /.test(t))return t;for(var n=e,i="",r=0;rc&&h.from<=c);d++);if(h.to>=u)return t(n,i,r,o,s,a,l);t(n,i.slice(0,h.to-c),r,o,null,a,l),o=null,i=i.slice(h.to-c),c=h.to}}}function nn(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function rn(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var s,a,l,c,u,h,d,f=r.length,p=0,g=1,v="",m=0;;){if(m==p){l=c=u=a="",d=null,h=null,m=1/0;for(var y=[],b=void 0,x=0;xp||C.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&m>w.to&&(m=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&w.from==p&&(u+=" "+C.startStyle),C.endStyle&&w.to==m&&(b||(b=[])).push(C.endStyle,w.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var k in C.attributes)(d||(d={}))[k]=C.attributes[k];C.collapsed&&(!h||Ft(h.marker,C)<0)&&(h=w)}else w.from>p&&m>w.from&&(m=w.from)}if(b)for(var S=0;S=f)break;for(var E=Math.min(f,m);;){if(v){var M=p+v.length;if(!h){var A=M>E?v.slice(0,E-p):v;e.addToken(e,A,s?s+l:l,u,p+A.length==m?c:"",a,d)}if(M>=E){v=v.slice(E-p),p=E;break}p=M,u=""}v=r.slice(o,o=n[g++]),s=Je(n[g++],e.cm.options)}}else for(var O=1;On)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function Ln(t,e,n,i){return Dn(t,Nn(t,e),n,i)}function _n(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&e2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,n,i){var r,o=jn(e.map,n,i),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&rt(e.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*i,bottom:e.bottom*i}}(t.display.measure,r))}else{var f;c>0&&(h=i="right"),r=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==i?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!c&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+ii(t.display),top:p.top,bottom:p.bottom}:Fn}for(var g=r.top-e.rect.top,v=r.bottom-e.rect.top,m=(g+v)/2,y=e.view.measure.heights,b=0;be)&&(r=(o=l-a)-1,e>=l&&(s="right")),null!=r){if(i=t[c+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)i=t[2+(c-=3)],s="left";if("right"==n&&r==l-a)for(;c=0&&(n=t[r]).left==n.right;r--);return n}function zn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return s("before"==c?l-1:l,"before"==c);function u(t,e,n){var i=a[e],r=1==i.level;return s(n?t-1:t,r!=n)}var h=Jt(a,l,c),d=Xt,f=u(l,h,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function Gn(t,e){var n=0;e=kt(t.doc,e),t.options.lineWrapping||(n=ii(t.display)*e.ch);var i=lt(t.doc,e.line),r=Kt(i)+Sn(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Xn(t,e,n,i,r){var o=vt(t,e,n);return o.xRel=r,i&&(o.outside=!0),o}function Jn(t,e,n){var i=t.doc;if((n+=t.display.viewOffset)<0)return Xn(i.first,0,null,!0,-1);var r=ft(i,n),o=i.first+i.size-1;if(r>o)return Xn(i.first+i.size-1,lt(i,o).text.length,null,!0,1);e<0&&(e=0);for(var s=lt(i,r);;){var a=ei(t,s,r,e,n),l=Vt(s,a.ch+(a.xRel>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==r)return c;s=lt(i,r=c.line)}}function Zn(t,e,n,i){i-=Wn(e);var r=e.text.length,o=st(function(e){return Dn(t,n,e-1).bottom<=i},r,0);return r=st(function(e){return Dn(t,n,e).top>i},o,r),{begin:o,end:r}}function Qn(t,e,n,i){n||(n=Nn(t,e));var r=Un(t,e,Dn(t,n,i),"line").top;return Zn(t,e,n,r)}function ti(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function ei(t,e,n,i,r){r-=Kt(e);var o=Nn(t,e),s=Wn(e),a=0,l=e.text.length,c=!0,u=Qt(e,t.doc.direction);if(u){var h=(t.options.lineWrapping?function(t,e,n,i,r,o,s){var a=Zn(t,e,i,s),l=a.begin,c=a.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d=c||f.to<=l)){var p=1!=f.level,g=Dn(t,i,p?Math.min(c,f.to)-1:Math.max(l,f.from)).right,v=gv)&&(u=f,h=v)}}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}:function(t,e,n,i,r,o,s){var a=st(function(a){var l=r[a],c=1!=l.level;return ti(Yn(t,vt(n,c?l.to:l.from,c?"before":"after"),"line",e,i),o,s,!0)},0,r.length-1),l=r[a];if(a>0){var c=1!=l.level,u=Yn(t,vt(n,c?l.from:l.to,c?"after":"before"),"line",e,i);ti(u,o,s,!0)&&u.top>s&&(l=r[a-1])}return l})(t,e,n,o,u,i,r);c=1!=h.level,a=c?h.from:h.to-1,l=c?h.to:h.from-1}var d,f,p=null,g=null,v=st(function(e){var n=Dn(t,o,e);return n.top+=s,n.bottom+=s,!!ti(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(p=e,g=n),!0)},a,l),m=!1;if(g){var y=i-g.left=x.bottom}return v=ot(e.text,v,1),Xn(n,v,f,m,i-d)}function ni(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==In){In=O("pre");for(var e=0;e<49;++e)In.appendChild(document.createTextNode("x")),In.appendChild(O("br"));In.appendChild(document.createTextNode("x"))}A(t.measure,In);var n=In.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),M(t.measure),n||1}function ii(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=O("span","xxxxxxxxxx"),n=O("pre",[e]);A(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function ri(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s)n[t.options.gutters[s]]=o.offsetLeft+o.clientLeft+r,i[t.options.gutters[s]]=o.clientWidth;return{fixedPos:oi(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function oi(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function si(t){var e=ni(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/ii(t.display)-3);return function(r){if(Ut(t.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,i=0;i=t.display.viewTo||a.to().linee||e==n&&s.to==e)&&(i(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),r=!0)}r||i(e,n,"ltr")}(g,n||0,null==i?d:i,function(t,e,r,h){var v="ltr"==r,m=f(t,v?"left":"right"),y=f(e-1,v?"right":"left"),b=null==n&&0==t,x=null==i&&e==d,w=0==h,C=!g||h==g.length-1;if(y.top-m.top<=3){var k=(c?b:x)&&w,S=(c?x:b)&&C,T=k?a:(v?m:y).left,E=S?l:(v?y:m).right;u(T,m.top,E-T,m.bottom)}else{var M,A,O,P;v?(M=c&&b&&w?a:m.left,A=c?l:p(t,r,"before"),O=c?a:p(e,r,"after"),P=c&&x&&C?l:y.right):(M=c?p(t,r,"before"):a,A=!c&&b&&w?l:m.right,O=!c&&x&&C?a:y.left,P=c?p(e,r,"after"):l),u(M,m.top,A-M,m.bottom),m.bottom0?e.blinker=setInterval(function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function vi(t){t.state.focused||(t.display.input.focus(),yi(t))}function mi(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,bi(t))},100)}function yi(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(re(t,"focus",t,e),t.state.focused=!0,N(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),gi(t))}function bi(t,e){t.state.delayingBlurEvent||(t.state.focused&&(re(t,"blur",t,e),t.state.focused=!1,E(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function xi(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=0;i.005||d<-.005)&&(ht(r.line,l),wi(r.line),r.rest))for(var f=0;ft.display.sizerWidth){var p=Math.ceil(c/ii(t.display));p>t.display.maxLineLength&&(t.display.maxLineLength=p,t.display.maxLine=r.line,t.display.maxLineChanged=!0)}}}}function wi(t){if(t.widgets)for(var e=0;e=s&&(o=ft(e,Kt(lt(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function ki(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=oi(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",s=0;so&&(e.bottom=e.top+o);var a=t.doc.height+Tn(n),l=e.topa-i;if(e.topr+o){var u=Math.min(e.top,(c?a:e.bottom)-o);u!=r&&(s.scrollTop=u)}var h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,d=An(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),f=e.right-e.left>d;return f&&(e.right=e.left+d),e.left<10?s.scrollLeft=0:e.leftd+h-3&&(s.scrollLeft=e.right+(f?0:10)-d),s}function Ei(t,e){null!=e&&(Oi(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Mi(t){Oi(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Ai(t,e,n){null==e&&null==n||Oi(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Oi(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Gn(t,e.from),i=Gn(t,e.to);Pi(t,n,i,e.margin)}}function Pi(t,e,n,i){var r=Ti(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});Ai(t,r.scrollLeft,r.scrollTop)}function Li(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||lr(t,{top:e}),_i(t,e,!0),n&&lr(t),ir(t,100))}function _i(t,e,n){e=Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Ni(t,e,n,i){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,ki(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Di(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Tn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Mn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Ii=function(t,e,n){this.cm=n;var i=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,t(i),t(r),ee(i,"scroll",function(){i.clientHeight&&e(i.scrollTop,"vertical")}),ee(r,"scroll",function(){r.clientWidth&&e(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ii.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},Ii.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ii.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ii.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},Ii.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,function i(){var r=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);o!=t?t.style.pointerEvents="none":e.set(1e3,i)})},Ii.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Fi=function(){};function ji(t,e){e||(e=Di(t));var n=t.display.barWidth,i=t.display.barHeight;Ri(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&xi(t),Ri(t,Di(t)),n=t.display.barWidth,i=t.display.barHeight}function Ri(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Fi.prototype.update=function(){return{bottom:0,right:0}},Fi.prototype.setScrollLeft=function(){},Fi.prototype.setScrollTop=function(){},Fi.prototype.clear=function(){};var zi={native:Ii,null:Fi};function Vi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&E(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new zi[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ee(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?Ni(t,e):Li(t,e)},t),t.display.scrollbars.addClass&&N(t.display.wrapper,t.display.scrollbars.addClass)}var Hi=0;function $i(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Hi},e=t.curOp,an?an.ops.push(e):e.ownsGroup=an={ops:[e],delayedCallbacks:[]}}function Bi(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new or(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Ui(t){var e=t.cm,n=e.display;t.updatedDisplay&&xi(e),t.barMeasure=Di(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=Ln(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Mn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-An(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function qi(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft1&&(s=!0)),null!=c.scrollLeft&&(Ni(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return r}(e,kt(i,t.scrollToPos.from),kt(i,t.scrollToPos.to),t.scrollToPos.margin);!function(t,e){if(!oe(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null;if(e.top+i.top<0?r=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!p){var o=O("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Sn(t.display))+"px;\n height: "+(e.bottom-e.top+Mn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(r),t.display.lineSpace.removeChild(o)}}}(e,r)}var o=t.maybeHiddenMarkers,s=t.maybeUnhiddenMarkers;if(o)for(var a=0;ae)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)Et&&Bt(t.doc,e)r.viewFrom?tr(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)tr(t);else if(e<=r.viewFrom){var o=er(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):tr(t)}else if(n>=r.viewTo){var s=er(t,e,e,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):tr(t)}else{var a=er(t,e,e,-1),l=er(t,n,n+i,1);a&&l?(r.view=r.view.slice(0,a.index).concat(sn(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):tr(t)}var c=r.externalMeasured;c&&(n=r.lineN&&e=i.viewTo)){var o=i.view[ci(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==V(s,n)&&s.push(n)}}}function tr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function er(t,e,n,i){var r,o=ci(t,e),s=t.display.view;if(!Et||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l0){if(o==s.length-1)return null;r=a+s[o].size-e,o++}else r=a-e;e+=r,n+=r}for(;Bt(t.doc,n)!=n;){if(o==(i<0?0:s.length-1))return null;n+=i*s[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function nr(t){for(var e=t.display.view,n=0,i=0;i=t.display.viewTo)){var n=+new Date+t.options.workTime,i=ze(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(i.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?Le(e.mode,i.state):null,l=je(t,o,i,!0);a&&(i.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&dn)return ir(t,t.options.workDelay),!0}),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&Yi(t,function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==nr(t))return!1;Si(t)&&(tr(t),e.dims=ri(t));var r=i.first+i.size,o=Math.max(e.visible.from-t.options.viewportMargin,i.first),s=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),Et&&(o=Bt(t.doc,o),s=Wt(t.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;!function(t,e,n){var i=t.display;0==i.view.length||e>=i.viewTo||n<=i.viewFrom?(i.view=sn(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=sn(t,e,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,ci(t,n)))),i.viewTo=n}(t,o,s),n.viewOffset=Kt(lt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var c=nr(t);if(!a&&0==c&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(t){if(t.hasFocus())return null;var e=_();if(!e||!L(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&L(t.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(t);return c>4&&(n.lineDiv.style.display="none"),function(t,e,n){var i=t.display,r=t.options.lineNumbers,o=i.lineDiv,s=o.firstChild;function a(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=i.view,u=i.viewFrom,h=0;h-1&&(f=!1),hn(t,d,u,n)),f&&(M(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(gt(t.options,u)))),s=d.node.nextSibling}else{var p=yn(t,d,u,n);o.insertBefore(p,s)}u+=d.size}for(;s;)s=a(s)}(t,n.updateLineNumbers,e.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=_()&&(t.activeElt.focus(),t.anchorNode&&L(document.body,t.anchorNode)&&L(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(u),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,ir(t,400)),n.updateLineNumbers=null,!0}function ar(t,e){for(var n=e.viewport,i=!0;(i&&t.options.lineWrapping&&e.oldDisplayWidth!=An(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Tn(t.display)-On(t),n.top)}),e.visible=Ci(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&sr(t,e);i=!1){xi(t);var r=Di(t);ui(t),ji(t,r),ur(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function lr(t,e){var n=new or(t,e);if(sr(t,n)){xi(t),ar(t,n);var i=Di(t);ui(t),ji(t,i),ur(t,i),n.finish()}}function cr(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function ur(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Mn(t)+"px"}function hr(t){var e=t.display.gutters,n=t.options.gutters;M(e);for(var i=0;i-1&&!t.lineNumbers&&(t.gutters=t.gutters.slice(0),t.gutters.splice(e,1))}or.prototype.signal=function(t,e){ae(t,e)&&this.events.push(arguments)},or.prototype.finish=function(){for(var t=0;ta.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&c||o&&u){if(o&&y&&l)t:for(var d=e.target,f=s.view;d!=a;d=d.parentNode)for(var p=0;p=0&&mt(t,i.to())<=0)return n}return-1};var br=function(t,e){this.anchor=t,this.head=e};function xr(t,e,n){var i=t&&t.options.selectionsMayTouch,r=e[n];e.sort(function(t,e){return mt(t.from(),e.from())}),n=V(e,r);for(var o=1;o0:l>=0){var c=wt(a.from(),s.from()),u=xt(a.to(),s.to()),h=a.empty()?s.from()==s.head:a.from()==a.head;o<=n&&--n,e.splice(--o,2,new br(h?u:c,h?c:u))}}return new yr(e,n)}function wr(t,e){return new yr([new br(t,e||t)],0)}function Cr(t){return t.text?vt(t.from.line+t.text.length-1,G(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function kr(t,e){if(mt(t,e.from)<0)return t;if(mt(t,e.to)<=0)return Cr(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=Cr(e).ch-e.to.ch),vt(n,i)}function Sr(t,e){for(var n=[],i=0;i1&&t.remove(a.line+1,p-1),t.insert(a.line+1,m)}cn(t,"change",t,e)}function Pr(t,e,n){!function t(i,r,o){if(i.linked)for(var s=0;sa-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(Ir(t.done),G(t.done)):t.done.length&&!G(t.done).ranges?G(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),G(t.done)):void 0}(r,r.lastOp==i)))s=G(o.changes),0==mt(e.from,e.to)&&0==mt(e.from,s.to)?s.to=Cr(e):o.changes.push(Dr(t,e));else{var l=G(r.done);for(l&&l.ranges||Rr(t.sel,r.done),o={changes:[Dr(t,e)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,s||re(t,"historyAdded")}function jr(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,G(r.done),e))?r.done[r.done.length-1]=e:Rr(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&Ir(r.undone)}function Rr(t,e){var n=G(e);n&&n.ranges&&n.equals(t)||e.push(t)}function zr(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o})}function Vr(t){if(!t)return null;for(var e,n=0;n-1&&(G(a)[h]=c[h],delete c[h])}}}return i}function Br(t,e,n,i){if(i){var r=t.anchor;if(n){var o=mt(e,r)<0;o!=mt(n,r)<0?(r=e,e=n):o!=mt(e,n)<0&&(e=n)}return new br(r,e)}return new br(n||e,e)}function Wr(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),Gr(t,new yr([Br(t.sel.primary(),e,n,r)],0),i)}function Ur(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:a.to>e.ch))){if(r&&(re(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var c=l.find(i<0?1:-1),u=void 0;if((i<0?l.inclusiveRight:l.inclusiveLeft)&&(c=no(t,c,-i,c&&c.line==e.line?o:null)),c&&c.line==e.line&&(u=mt(c,n))&&(i<0?u<0:u>0))return to(t,c,e,i,r)}var h=l.find(i<0?-1:1);return(i<0?l.inclusiveLeft:l.inclusiveRight)&&(h=no(t,h,i,h.line==e.line?o:null)),h?to(t,h,e,i,r):null}}return e}function eo(t,e,n,i,r){var o=i||1,s=to(t,e,n,o,r)||!r&&to(t,e,n,o,!0)||to(t,e,n,-o,r)||!r&&to(t,e,n,-o,!0);return s||(t.cantEdit=!0,vt(t.first,0))}function no(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?kt(t,vt(e.line-1)):null:n>0&&e.ch==(i||lt(t,e.line)).text.length?e.line0)){var u=[l,1],h=mt(c.from,a.from),d=mt(c.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&u.push({from:c.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&u.push({from:a.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}(t,e.from,e.to);if(i)for(var r=i.length-1;r>=0;--r)so(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else so(t,e)}}function so(t,e){if(1!=e.text.length||""!=e.text[0]||0!=mt(e.from,e.to)){var n=Sr(t,e);Fr(t,e,n,t.cm?t.cm.curOp.id:NaN),co(t,e,n,Pt(t,e));var i=[];Pr(t,function(t,n){n||-1!=V(i,t.history)||(po(t.history,e),i.push(t.history)),co(t,e,null,Pt(t,e))})}}function ao(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,o=t.history,s=t.sel,a="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,c=0;c=0;--f){var p=d(f);if(p)return p.v}}}}function lo(t,e){if(0!=e&&(t.first+=e,t.sel=new yr(X(t.sel.ranges,function(t){return new br(vt(t.anchor.line+e,t.anchor.ch),vt(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){Zi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;it.lastLine())){if(e.from.lineo&&(e={from:e.from,to:vt(o,lt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=ct(t,e.from,e.to),n||(n=Sr(t,e)),t.cm?function(t,e,n){var i=t.doc,r=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=dt($t(lt(i,o.line))),i.iter(l,s.line+1,function(t){if(t==r.maxLine)return a=!0,!0})),i.sel.contains(e.from,e.to)>-1&&se(t),Or(i,e,n,si(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,function(t){var e=Yt(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)}),a&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;i--){var r=lt(t,i).stateAfter;if(r&&(!(r instanceof Ie)||i+r.lookAhead1||!(this.children[0]instanceof vo))){var a=[];this.collapse(a),this.children=[new vo(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var s=r.lines.length%25+25,a=s;a10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ht(t,e.line,e,n,o)||e.line!=n.line&&Ht(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Et=!0}o.addToHistory&&Fr(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,c=t.cm;if(t.iter(l,n.line+1,function(t){c&&o.collapsed&&!c.options.lineWrapping&&$t(t)==c.display.maxLine&&(a=!0),o.collapsed&&l!=e.line&&ht(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new Mt(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&t.iter(e.line,n.line+1,function(e){Ut(t,e)&&ht(e,0)}),o.clearOnEnter&&ee(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Tt=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++xo,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)Zi(c,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)Qi(c,u,"text");o.atomic&&Zr(c.doc),cn(c,"markerAdded",c,o)}return o}wo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&$i(t),ae(this,"clear")){var n=this.find();n&&cn(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Zi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Zr(t.doc)),t&&cn(t,"markerCleared",t,this,i,r),e&&Bi(t),this.parent&&this.parent.clear()}},wo.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)oo(this,i[l]);a?Yr(this,a):this.cm&&Mi(this.cm)}),undo:Ji(function(){ao(this,"undo")}),redo:Ji(function(){ao(this,"redo")}),undoSelection:Ji(function(){ao(this,"undo",!0)}),redoSelection:Ji(function(){ao(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=kt(this,t),e=kt(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r}),i},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var i=0;it)return e=t,!0;t-=o,++n}),kt(this,vt(n,e))},indexFromPos:function(t){var e=(t=kt(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var u=t.dataTransfer.getData("Text");if(u){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),Xr(e.doc,wr(n,n)),h)for(var d=0;d=0;e--)uo(t.doc,"",i[e].from,i[e].to,"+delete");Mi(t)})}function Yo(t,e,n){var i=ot(t.text,e+n,n);return i<0||i>t.text.length?null:i}function Go(t,e,n){var i=Yo(t,e.ch,n);return null==i?null:new vt(e.line,i,n<0?"after":"before")}function Xo(t,e,n,i,r){if(t){var o=Qt(n,e.doc.direction);if(o){var s,a=r<0?G(o):o[0],l=r<0==(1==a.level),c=l?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var u=Nn(e,n);s=r<0?n.text.length-1:0;var h=Dn(e,u,s).top;s=st(function(t){return Dn(e,u,t).top==h},r<0==(1==a.level)?a.from:a.to-1,s),"before"==c&&(s=Yo(n,s,1))}else s=r<0?a.to:a.from;return new vt(i,s,c)}}return new vt(i,r<0?n.text.length:0,r<0?"before":"after")}zo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},zo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},zo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},zo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},zo.default=y?zo.macDefault:zo.pcDefault;var Jo={selectAll:io,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),B)},killLine:function(t){return Ko(t,function(e){if(e.empty()){var n=lt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new vt(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),vt(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var s=lt(t.doc,r.line-1).text;s&&(r=new vt(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),vt(r.line-1,s.length-1),r,"+transpose"))}n.push(new br(r,r))}t.setSelections(n)})},newlineAndIndent:function(t){return Yi(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;i-1&&(mt((r=c.ranges[r]).from(),e)<0||e.xRel>0)&&(mt(r.to(),e)>0||e.xRel<0)?function(t,e,n,i){var r=t.display,o=!1,c=Gi(t,function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,ie(r.wrapper.ownerDocument,"mouseup",c),ie(r.wrapper.ownerDocument,"mousemove",u),ie(r.scroller,"dragstart",h),ie(r.scroller,"drop",c),o||(ce(e),i.addNew||Wr(t.doc,n,null,null,i.extend),l||s&&9==a?setTimeout(function(){r.wrapper.ownerDocument.body.focus(),r.input.focus()},20):r.input.focus())}),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ee(r.wrapper.ownerDocument,"mouseup",c),ee(r.wrapper.ownerDocument,"mousemove",u),ee(r.scroller,"dragstart",h),ee(r.scroller,"drop",c),mi(t),setTimeout(function(){return r.input.focus()},20)}(t,i,e,o):function(t,e,n,i){var r=t.display,o=t.doc;ce(e);var s,a,l=o.sel,c=l.ranges;if(i.addNew&&!i.extend?(a=o.sel.contains(n),s=a>-1?c[a]:new br(n,n)):(s=o.sel.primary(),a=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(s=new br(n,n)),n=li(t,e,!0,!0),a=-1;else{var u=fs(t,n,i.unit);s=i.extend?Br(s,u.anchor,u.head,i.extend):u}i.addNew?-1==a?(a=c.length,Gr(o,xr(t,c.concat([s]),a),{scroll:!1,origin:"*mouse"})):c.length>1&&c[a].empty()&&"char"==i.unit&&!i.extend?(Gr(o,xr(t,c.slice(0,a).concat(c.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):qr(o,a,s,W):(a=0,Gr(o,new yr([s],0),W),l=o.sel);var h=n;function d(e){if(0!=mt(h,e))if(h=e,"rectangle"==i.unit){for(var r=[],c=t.options.tabSize,u=R(lt(o,n.line).text,n.ch,c),d=R(lt(o,e.line).text,e.ch,c),f=Math.min(u,d),p=Math.max(u,d),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=lt(o,g).text,y=q(m,f,c);f==p?r.push(new br(vt(g,y),vt(g,y))):m.length>y&&r.push(new br(vt(g,y),vt(g,q(m,p,c))))}r.length||r.push(new br(n,n)),Gr(o,xr(t,l.ranges.slice(0,a).concat(r),a),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,x=s,w=fs(t,e,i.unit),C=x.anchor;mt(w.anchor,C)>0?(b=w.head,C=wt(x.from(),w.anchor)):(b=w.anchor,C=xt(x.to(),w.head));var k=l.ranges.slice(0);k[a]=function(t,e){var n=e.anchor,i=e.head,r=lt(t.doc,n.line);if(0==mt(n,i)&&n.sticky==i.sticky)return e;var o=Qt(r);if(!o)return e;var s=Jt(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,c=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==o.length)return e;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=Jt(o,i.ch,i.sticky),h=u-s||(i.ch-n.ch)*(1==a.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=o[c+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new br(new vt(n.line,p,g),i)}(t,new br(kt(o,C),b)),Gr(o,xr(t,k,a),W)}}var f=r.wrapper.getBoundingClientRect(),p=0;function g(e){t.state.selectingText=!1,p=1/0,ce(e),r.input.focus(),ie(r.wrapper.ownerDocument,"mousemove",v),ie(r.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var v=Gi(t,function(e){0!==e.buttons&&pe(e)?function e(n){var s=++p,a=li(t,n,!0,"rectangle"==i.unit);if(a)if(0!=mt(a,h)){t.curOp.focus=_(),d(a);var l=Ci(r,o);(a.line>=l.to||a.linef.bottom?20:0;c&&setTimeout(Gi(t,function(){p==s&&(r.scroller.scrollTop+=c,e(n))}),50)}}(e):g(e)}),m=Gi(t,g);t.state.selectingText=m,ee(r.wrapper.ownerDocument,"mousemove",v),ee(r.wrapper.ownerDocument,"mouseup",m)}(t,i,e,o)}(e,i,o,t):fe(t)==n.scroller&&ce(t):2==r?(i&&Wr(e.doc,i),setTimeout(function(){return n.input.focus()},20)):3==r&&(k?e.display.input.onContextMenu(t):mi(e)))}}function fs(t,e,n){if("char"==n)return new br(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new br(vt(e.line,0),kt(t.doc,vt(e.line+1,0)));var i=n(t,e);return new br(i.from,i.to)}function ps(t,e,n,i){var r,o;if(e.touches)r=e.touches[0].clientX,o=e.touches[0].clientY;else try{r=e.clientX,o=e.clientY}catch(e){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&ce(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!ae(t,n))return he(e);o-=a.top-s.viewOffset;for(var l=0;l=r){var u=ft(t.doc,o),h=t.options.gutters[l];return re(t,n,t,u,h,e),he(e)}}}function gs(t,e){return ps(t,e,"gutterClick",!0)}function vs(t,e){kn(t.display,e)||function(t,e){return!!ae(t,"gutterContextMenu")&&ps(t,e,"gutterContextMenu",!1)}(t,e)||oe(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function ms(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hn(t)}hs.prototype.compare=function(t,e,n){return this.time+400>t&&0==mt(e,this.pos)&&n==this.button};var ys={toString:function(){return"CodeMirror.Init"}},bs={},xs={};function ws(t){hr(t),Zi(t),ki(t)}function Cs(t,e,n){var i=n&&n!=ys;if(!e!=!i){var r=t.display.dragFunctions,o=e?ee:ie;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function ks(t){t.options.lineWrapping?(N(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(E(t.display.wrapper,"CodeMirror-wrap"),Gt(t)),ai(t),Zi(t),Hn(t),setTimeout(function(){return ji(t)},100)}function Ss(t,e){var n=this;if(!(this instanceof Ss))return new Ss(t,e);this.options=e=e?j(e):{},j(bs,e,!1),dr(e);var i=e.value;"string"==typeof i?i=new Mo(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Ss.inputStyles[e.inputStyle](this),o=this.display=new at(t,i,r);for(var c in o.wrapper.CodeMirror=this,hr(this),ms(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vi(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 z,keySeq:null,specialChars:null},e.autofocus&&!m&&o.input.focus(),s&&a<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(t){var e=t.display;ee(e.scroller,"mousedown",Gi(t,ds)),ee(e.scroller,"dblclick",s&&a<11?Gi(t,function(e){if(!oe(t,e)){var n=li(t,e);if(n&&!gs(t,e)&&!kn(t.display,e)){ce(e);var i=t.findWordAt(n);Wr(t.doc,i.anchor,i.head)}}}):function(e){return oe(t,e)||ce(e)}),ee(e.scroller,"contextmenu",function(e){return vs(t,e)});var n,i={end:0};function r(){e.activeTouch&&(n=setTimeout(function(){return e.activeTouch=null},1e3),(i=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var n=e.left-t.left,i=e.top-t.top;return n*n+i*i>400}ee(e.scroller,"touchstart",function(r){if(!oe(t,r)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(r)&&!gs(t,r)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}}),ee(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),ee(e.scroller,"touchend",function(n){var i=e.activeTouch;if(i&&!kn(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var s,a=t.coordsChar(e.activeTouch,"page");s=!i.prev||o(i,i.prev)?new br(a,a):!i.prev.prev||o(i,i.prev.prev)?t.findWordAt(a):new br(vt(a.line,0),kt(t.doc,vt(a.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),ce(n)}r()}),ee(e.scroller,"touchcancel",r),ee(e.scroller,"scroll",function(){e.scroller.clientHeight&&(Li(t,e.scroller.scrollTop),Ni(t,e.scroller.scrollLeft,!0),re(t,"scroll",t))}),ee(e.scroller,"mousewheel",function(e){return mr(t,e)}),ee(e.scroller,"DOMMouseScroll",function(e){return mr(t,e)}),ee(e.wrapper,"scroll",function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(e){oe(t,e)||de(e)},over:function(e){oe(t,e)||(function(t,e){var n=li(t,e);if(n){var i=document.createDocumentFragment();di(t,n,i),t.display.dragCursor||(t.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),A(t.display.dragCursor,i)}}(t,e),de(e))},start:function(e){return function(t,e){if(s&&(!t.state.draggingText||+new Date-Ao<100))de(e);else if(!oe(t,e)&&!kn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!d)){var n=O("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(t,e)},drop:Gi(t,Oo),leave:function(e){oe(t,e)||Po(t)}};var l=e.input.getField();ee(l,"keyup",function(e){return as.call(t,e)}),ee(l,"keydown",Gi(t,ss)),ee(l,"keypress",Gi(t,ls)),ee(l,"focus",function(e){return yi(t,e)}),ee(l,"blur",function(e){return bi(t,e)})}(this),No(),$i(this),this.curOp.forceUpdate=!0,Lr(this,i),e.autofocus&&!m||this.hasFocus()?setTimeout(F(yi,this),20):bi(this),xs)xs.hasOwnProperty(c)&&xs[c](n,e[c],ys);Si(this),e.finishInit&&e.finishInit(this);for(var u=0;u150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?R(lt(o,e-1).text,null,s):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/s);f;--f)d+=s,h+="\t";if(d1)if(Ms&&Ms.text.join("\n")==e){if(i.ranges.length%Ms.text.length==0){c=[];for(var u=0;u=0;h--){var d=i.ranges[h],f=d.from(),p=d.to();d.empty()&&(n&&n>0?f=vt(f.line,f.ch-n):t.state.overwrite&&!a?p=vt(p.line,Math.min(lt(o,p.line).text.length,p.ch+G(l).length)):a&&Ms&&Ms.lineWise&&Ms.text.join("\n")==e&&(f=p=vt(f.line,0))),s=t.curOp.updateInput;var g={from:f,to:p,text:c?c[h%c.length]:l,origin:r||(a?"paste":t.state.cutIncoming?"cut":"+input")};oo(t.doc,g),cn(t,"inputRead",t,g)}e&&!a&&Ls(t,e),Mi(t),t.curOp.updateInput=s,t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function Ps(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Yi(e,function(){return Os(e,n,0,null,"paste")}),!0}function Ls(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a-1){s=Es(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(lt(t.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Es(t,r.head.line,"smart"));s&&cn(t,"electricInput",t,r.head.line)}}}function _s(t){for(var e=[],n=[],i=0;i=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Jt(r,n.ch,n.sticky),s=r[o];if("ltr"==t.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from=s.from&&d>=u.begin)){var f=h?"before":"after";return new vt(n.line,d,f)}}var p=function(t,e,i){for(var o=function(t,e){return e?new vt(n.line,l(t,1),"before"):new vt(n.line,t,"after")};t>=0&&t0==(1!=s.level),c=a?i.begin:l(i.end,-1);if(s.from<=c&&c0?u.end:l(u.begin,-1);return null==v||i>0&&v==e.text.length||!(g=p(i>0?0:r.length-1,i,c(v)))?null:g}(t.cm,a,e,n):Go(a,e,n))){if(i||((s=e.line+n)=t.first+t.size||(e=new vt(s,e.ch,e.sticky),!(a=lt(t,s)))))return!1;e=Xo(r,t.cm,a,e.line,n)}else e=o;return!0}if("char"==i)l();else if("column"==i)l(!0);else if("word"==i||"group"==i)for(var c=null,u="group"==i,h=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||l(!d);d=!1){var f=a.text.charAt(e.ch)||"\n",p=et(f,h)?"w":u&&"\n"==f?"n":!u||/\s/.test(f)?null:"p";if(!u||d||p||(p="s"),c&&c!=p){n<0&&(n=1,l(),e.sticky="after");break}if(p&&(c=p),n>0&&!l(!d))break}var g=eo(t,e,o,s,!0);return yt(o,g)&&(g.hitSide=!0),g}function Fs(t,e,n,i){var r,o,s=t.doc,a=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ni(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;(o=Jn(t,a,r)).outside;){if(n<0?r<=0:r>=s.height){o.hitSide=!0;break}r+=5*n}return o}var js=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Rs(t,e){var n=_n(t,e.line);if(!n||n.hidden)return null;var i=lt(t.doc,e.line),r=Pn(n,i,e.line),o=Qt(i,t.doc.direction),s="left";if(o){var a=Jt(o,e.ch);s=a%2?"right":"left"}var l=jn(r.map,e.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function zs(t,e){return e&&(t.bad=!0),t}function Vs(t,e,n){var i;if(e==t.display.lineDiv){if(!(i=t.display.lineDiv.childNodes[n]))return zs(t.clipPos(vt(t.display.viewTo-1)),!0);e=null,n=0}else for(i=e;;i=i.parentNode){if(!i||i==t.display.lineDiv)return null;if(i.parentNode&&i.parentNode==t.display.lineDiv)break}for(var r=0;r=e.display.viewTo||o.line=e.display.viewFrom&&Rs(e,r)||{node:l[0].measure.map[2],offset:0},u=o.linei.firstLine()&&(s=vt(s.line-1,lt(i.doc,s.line-1).length)),a.ch==lt(i.doc,a.line).text.length&&a.liner.viewTo-1)return!1;s.line==r.viewFrom||0==(t=ci(i,s.line))?(e=dt(r.view[0].line),n=r.view[0].node):(e=dt(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=ci(i,a.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=dt(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(function(t,e,n,i,r){var o="",s=!1,a=t.doc.lineSeparator(),l=!1;function c(){s&&(o+=a,l&&(o+=a),s=l=!1)}function u(t){t&&(c(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void u(n);var o,d=e.getAttribute("cm-marker");if(d){var f=t.findMarks(vt(i,0),vt(r+1,0),(v=+d,function(t){return t.id==v}));return void(f.length&&(o=f[0].find(0))&&u(ct(t.doc,o.from,o.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;p&&c();for(var g=0;g1&&d.length>1;)if(G(h)==G(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),e++}for(var f=0,p=0,g=h[0],v=d[0],m=Math.min(g.length,v.length);fs.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var w=vt(e,f),C=vt(l,d.length?G(d).length-p:0);return h.length>1||h[0]||mt(w,C)?(uo(i.doc,h,w,C,"+input"),!0):void 0},js.prototype.ensurePolled=function(){this.forceCompositionEnd()},js.prototype.reset=function(){this.forceCompositionEnd()},js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},js.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},js.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Yi(this.cm,function(){return Zi(t.cm)})},js.prototype.setUneditable=function(t){t.contentEditable="false"},js.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Gi(this.cm,Os)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},js.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},js.prototype.onContextMenu=function(){},js.prototype.resetPosition=function(){},js.prototype.needsContentAttribute=!0;var $s=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};$s.prototype.init=function(t){var e=this,n=this,i=this.cm;this.createField(t);var r=this.textarea;function o(t){if(!oe(i,t)){if(i.somethingSelected())As({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=_s(i);As({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,B):(n.prevInput="",r.value=e.text.join("\n"),I(r))}"cut"==t.type&&(i.state.cutIncoming=!0)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(r.style.width="0px"),ee(r,"input",function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()}),ee(r,"paste",function(t){oe(i,t)||Ps(t,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),ee(r,"cut",o),ee(r,"copy",o),ee(t.scroller,"paste",function(e){kn(t,e)||oe(i,e)||(i.state.pasteIncoming=!0,n.focus())}),ee(t.lineSpace,"selectstart",function(e){kn(t,e)||ce(e)}),ee(r,"compositionstart",function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ee(r,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},$s.prototype.createField=function(t){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},$s.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=hi(t);if(t.options.moveInputWithCursor){var r=Yn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},$s.prototype.showSelection=function(t){var e=this.cm,n=e.display;A(n.cursorDiv,t.cursors),A(n.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},$s.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},$s.prototype.getField=function(){return this.textarea},$s.prototype.supportsTouch=function(){return!1},$s.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||_()!=this.textarea))try{this.textarea.focus()}catch(t){}},$s.prototype.blur=function(){this.textarea.blur()},$s.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$s.prototype.receivedFocus=function(){this.slowPoll()},$s.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},$s.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,function n(){var i=e.poll();i||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))})},$s.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||Ce(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,r.length);l1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},$s.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$s.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},$s.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea,o=li(n,t),c=i.scroller.scrollTop;if(o&&!h){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&Gi(n,Gr)(n.doc,wr(o),B);var d=r.style.cssText,f=e.wrapper.style.cssText;e.wrapper.style.cssText="position: absolute";var p,g=e.wrapper.getBoundingClientRect();if(r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-g.top-5)+"px; left: "+(t.clientX-g.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(p=window.scrollY),i.input.focus(),l&&window.scrollTo(null,p),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=!0,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),s&&a>=9&&m(),k){de(t);var v=function(){ie(window,"mouseup",v),setTimeout(y,20)};ee(window,"mouseup",v)}else setTimeout(y,50)}function m(){if(null!=r.selectionStart){var t=n.somethingSelected(),o="​"+(t?r.value:"");r.value="⇚",r.value=o,e.prevInput=t?"":"​",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function y(){if(e.contextMenuPending=!1,e.wrapper.style.cssText=f,r.style.cssText=d,s&&a<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart){(!s||s&&a<9)&&m();var t=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==e.prevInput?Gi(n,io)(n):t++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},$s.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},$s.prototype.setUneditable=function(){},$s.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,i,r,o){t.defaults[n]=i,r&&(e[n]=o?function(t,e,n){n!=ys&&r(t,e,n)}:r)}t.defineOption=n,t.Init=ys,n("value","",function(t,e){return t.setValue(e)},!0),n("mode",null,function(t,e){t.doc.modeOption=e,Er(t)},!0),n("indentUnit",2,Er,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(t){Mr(t),Hn(t),Zi(t)},!0),n("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter(function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(-1==o)break;r=o+e.length,n.push(vt(i,o))}i++});for(var r=n.length-1;r>=0;r--)uo(t.doc,e,n[r],vt(n[r].line,n[r].ch+e.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=ys&&t.refresh()}),n("specialCharPlaceholder",Qe,function(t){return t.refresh()},!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",function(t){ms(t),ws(t)},!0),n("keyMap","default",function(t,e,n){var i=qo(e),r=n!=ys&&qo(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ks,!0),n("gutters",[],function(t){dr(t.options),ws(t)},!0),n("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?oi(t.display)+"px":"0",t.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(t){return ji(t)},!0),n("scrollbarStyle","native",function(t){Vi(t),ji(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),n("lineNumbers",!1,function(t){dr(t.options),ws(t)},!0),n("firstLineNumber",1,ws,!0),n("lineNumberFormatter",function(t){return t},ws,!0),n("showCursorWhenSelecting",!1,ui,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(t,e){"nocursor"==e&&(bi(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),n("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),n("dragDrop",!0,Cs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ui,!0),n("singleCursorHeightPerLine",!0,ui,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Mr,!0),n("addModeClass",!1,Mr,!0),n("pollInterval",100),n("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),n("historyEventDelay",1250),n("viewportMargin",10,function(t){return t.refresh()},!0),n("maxHighlightLength",1e4,Mr,!0),n("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),n("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),n("autofocus",null),n("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0),n("phrases",null)}(Ss),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var i=this.options,r=i[t];i[t]==n&&"mode"!=t||(i[t]=n,e.hasOwnProperty(t)&&Gi(this,e[t])(this,n,r),re(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](qo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nn&&(Es(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&Mi(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&qr(this.doc,i,new br(o,c[i].to()),B)}}}),getTokenAt:function(t,e){return We(this,t,e)},getLineTokens:function(t,e){return We(this,vt(t),e,!0)},getTokenTypeAt:function(t){t=kt(this.doc,t);var e,n=Re(this,lt(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]o&&(t=o,r=!0),i=lt(this.doc,t)}else i=t;return Un(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-Kt(i):0)},defaultTextHeight:function(){return ni(this.display)},defaultCharWidth:function(){return ii(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o,s,a,l=this.display,c=(t=Yn(this,kt(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==i)c=t.top;else if("above"==i||"near"==i){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>h)&&t.top>e.offsetHeight?c=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=h&&(c=t.bottom),u+e.offsetWidth>d&&(u=d-e.offsetWidth)}e.style.top=c+"px",e.style.left=e.style.right="","right"==r?(u=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?u=0:"middle"==r&&(u=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(o=this,s={left:u,top:c,right:u+e.offsetWidth,bottom:c+e.offsetHeight},null!=(a=Ti(o,s)).scrollTop&&Li(o,a.scrollTop),null!=a.scrollLeft&&Ni(o,a.scrollLeft))},triggerOnKeyDown:Xi(ss),triggerOnKeyPress:Xi(ls),triggerOnKeyUp:as,triggerOnMouseDown:Xi(ds),execCommand:function(t){if(Jo.hasOwnProperty(t))return Jo[t].call(null,this)},triggerElectric:Xi(function(t){Ls(this,t)}),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var o=kt(this.doc,t),s=0;s0&&a(n.charAt(i-1));)--i;for(;r.5)&&ai(this),re(this,"refresh",this)}),swapDoc:Xi(function(t){var e=this.doc;return e.cm=null,Lr(this,t),Hn(this),this.display.input.reset(),Ai(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,e),e}),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},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}},le(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}}(Ss);var Bs="iter insert remove copy getEditor constructor".split(" ");for(var Ws in Mo.prototype)Mo.prototype.hasOwnProperty(Ws)&&V(Bs,Ws)<0&&(Ss.prototype[Ws]=function(t){return function(){return t.apply(this.doc,arguments)}}(Mo.prototype[Ws]));return le(Mo),Ss.inputStyles={textarea:$s,contenteditable:js},Ss.defineMode=function(t){Ss.defaults.mode||"null"==t||(Ss.defaults.mode=t),function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Te[t]=e}.apply(this,arguments)},Ss.defineMIME=function(t,e){Ee[t]=e},Ss.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Ss.defineMIME("text/plain","null"),Ss.defineExtension=function(t,e){Ss.prototype[t]=e},Ss.defineDocExtension=function(t,e){Mo.prototype[t]=e},Ss.fromTextArea=function(t,e){if((e=e?j(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=_();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=a.getValue()}var r;if(t.form&&(ee(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var o=t.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(t){}}e.finishInit=function(e){e.save=i,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,i(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(ie(t.form,"submit",i),"function"==typeof t.form.submit&&(t.form.submit=r))}},t.style.display="none";var a=Ss(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return a},function(t){t.off=ie,t.on=ee,t.wheelEventPixels=vr,t.Doc=Mo,t.splitLines=we,t.countColumn=R,t.findColumn=q,t.isWordChar=tt,t.Pass=$,t.signal=re,t.Line=Ke,t.changeEnd=Cr,t.scrollbarModel=zi,t.Pos=vt,t.cmpPos=mt,t.modes=Te,t.mimeModes=Ee,t.resolveMode=Me,t.getMode=Ae,t.modeExtensions=Oe,t.extendMode=Pe,t.copyState=Le,t.startState=Ne,t.innerMode=_e,t.commands=Jo,t.keyMap=zo,t.keyName=Uo,t.isModifierKey=Bo,t.lookupKey=$o,t.normalizeKeyMap=Ho,t.StringStream=De,t.SharedTextMarker=ko,t.TextMarker=wo,t.LineWidget=yo,t.e_preventDefault=ce,t.e_stopPropagation=ue,t.e_stop=de,t.addClass=N,t.contains=L,t.rmClass=E,t.keyNames=Io}(Ss),Ss.version="5.42.0",Ss}()},function(t,e,n){"use strict";var i=n(1),r=n(0),o=r.$;t.exports=r.View.extend({events:{change:"onChange"},attributes:function(){return this.model.get("attributes")},initialize:function(t){var e=this.model,n=(e.get("name"),e.target);this.config=t.config||{},this.em=this.config.em,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=n,this.className=this.pfx+"trait",this.labelClass=this.ppfx+"label",this.fieldClass=this.ppfx+"field "+this.ppfx+"field-"+e.get("type"),this.inputhClass=this.ppfx+"input-holder",e.off("change:value",this.onValueChange),this.listenTo(e,"change:value",this.onValueChange),e.view=this,this.tmpl='
'},onChange:function(){this.model.set("value",this.getInputEl().value)},getValueForTarget:function(){return this.model.get("value")},setInputValue:function(t){this.getInputEl().value=t},onValueChange:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.model;this.target,i.get("name");if(n.fromTarget)this.setInputValue(i.get("value"));else{var r=this.getValueForTarget();i.setTargetValue(r,n)}},renderLabel:function(){var t=this.getLabel();this.$el.html('
'+t+"
")},getLabel:function(){var t=this.model,e=t.get("label")||t.get("name");return e.charAt(0).toUpperCase()+e.slice(1).replace(/-/g," ")},getInputEl:function(){if(!this.$input){var t=this.model,e=t.get("placeholder")||t.get("default")||"",n=t.get("type")||"text",i=t.get("min"),r=t.get("max"),s=this.getModelValue(),a=o('');s&&(t.set({value:s},{silent:!0}),a.prop("value",s)),i&&a.prop("min",i),r&&a.prop("max",r),this.$input=a}return this.$input.get(0)},getModelValue:function(){var t=void 0,e=this.model,n=this.target,r=e.get("name");if(e.get("changeProp"))t=n.get(r);else{var o=n.get("attributes");t=e.get("value")||o[r]}return(0,i.isUndefined)(t)?"":t},renderField:function(){if(!this.$input){this.$el.append(this.tmpl);var t=this.getInputEl(),e=this.el.querySelector("."+this.inputhClass);e.insertBefore(t,e.childNodes[0])}},render:function(){return this.renderLabel(),this.renderField(),this.el.className=this.className,this}})},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var i=n(0),r=i.Model.extend({idAttribute:"name",defaults:{name:"",label:"",type:1,active:!0,private:!1,protected:!1},initialize:function(){var t=this.get("name"),e=this.get("label");t?e||this.set("label",t):this.set("name",e),this.set("name",r.escapeName(this.get("name")))},getFullName:function(){var t="";switch(this.get("type")){case 1:t=".";break;case 2:t="#"}return t+this.get("name")}},{TYPE_CLASS:1,TYPE_ID:2,escapeName:function(t){return(""+t).trim().replace(/([^a-z0-9\w-\:]+)/gi,"-")}});t.exports=r},function(t,e,n){"use strict";var i=n(1),r=n(9);t.exports=n(0).Collection.extend({model:r,getStyleable:function(){return(0,i.filter)(this.models,function(t){return t.get("active")&&!t.get("private")})},getValid:function(){return(0,i.filter)(this.models,function(t){return!t.get("private")})},getFullString:function(t){var e=[];return(t||this).forEach(function(t){return e.push(t.getFullName())}),e.join("").trim()}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};if(t){var n=e.ctrlKey||e.metaKey,i=e.shiftKey,r=this.editor,s=r.getConfig("multipleSelection"),a=this.em;if(n&&s)r.selectToggle(t);else if(i&&s){a.clearSelection(r.Canvas.getWindow());var l=t.collection,c=l.indexOf(t),u=(r.getSelectedAll(),void 0),h=void 0;if(r.getSelectedAll().forEach(function(t){var e=t.collection,n=e.indexOf(t);e===l&&(nc&&(h=(0,o.isUndefined)(h)?n:Math.min(h,n)))}),!(0,o.isUndefined)(u))for(;u!==c;)r.selectAdd(l.at(u)),u++;if(!(0,o.isUndefined)(h))for(;h!==c;)r.selectAdd(l.at(h)),h--;r.selectAdd(t)}else r.select(t);this.initResize(t)}},updateBadge:function(t,e){var n=c(t),i=this.canvas,r=i.getConfig().customBadgeLabel;this.cacheEl=t;var o=n.data("model");if(o&&o.get("badgable")){var s=this.getBadge(),a=o.getIcon()+o.getName();a=r?r(o):a,s.innerHTML=a;var l=s.style;l.display="block";var u=i.getCanvasView().getPosition();if(u){var h=s?s.offsetHeight:0,d=s?s.offsetWidth:0,f=e.top-h1&&void 0!==arguments[1]?arguments[1]:{},i=n.el,r=n.config,o=n.resizer,a=r.keyHeight,l=r.keyWidth,h=r.currentUnit,d=r.keepAutoHeight,f=r.keepAutoWidth;g("add",0,n),p=e.get("StyleManager").getModelToStyle(c);var v=getComputedStyle(i),m=p.getStyle(),y=m[l];r.autoWidth=f&&"auto"===y,isNaN(parseFloat(y))&&(y=v[l]);var b=m[a];r.autoHeight=d&&"auto"===b,isNaN(parseFloat(b))&&(b=v[a]),o.startDim.w=parseFloat(y),o.startDim.h=parseFloat(b),u=0,h&&(r.unitHeight=(0,s.getUnitFromValue)(b),r.unitWidth=(0,s.getUnitFromValue)(y))},onMove:function(){n.trigger("change:canvasOffset")},onEnd:function(t,e){g("remove",0,e),n.trigger("change:canvasOffset"),u=1},updateTarget:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(p){var r=i.store,o=i.selectedHandler,s=i.config,a=s.keyHeight,l=s.keyWidth,c=s.autoHeight,u=s.autoWidth,h=s.unitWidth,d=s.unitHeight,f=["tc","bc"].indexOf(o)>=0,g=["cl","cr"].indexOf(o)>=0,v=p.getStyle();f||(v[l]=u?"auto":""+n.w+h),g||(v[a]=c?"auto":""+n.h+d),p.setStyle(v,{avoidStore:1});e&&e.trigger("update:component:style:"+a+" update:component:style:"+l),r&&p.trigger("change:style",p,v,{})}}},"object"==(void 0===h?"undefined":r(h))&&(f=i({},f,h)),n.runCommand("resize",{el:d,options:f})):n.stopCommand("resize")},updateToolbar:function(t){var e=this,n=this.config.em,i=t==n?n.getSelected():t,r=this.canvas.getToolbarEl(),o=r.style;if(i){var s=i.get("toolbar");this.ppfx;if(n.get("Config").showToolbar&&s&&s.length){if(o.opacity="",o.display="",!this.toolbar){r.innerHTML="",this.toolbar=new l(s);var c=new a({collection:this.toolbar,editor:this.editor});r.appendChild(c.render().el)}this.toolbar.reset(s);var u=i.view;o.top="-100px",o.left=0,setTimeout(function(){return u&&e.updateToolbarPos(u.el)},0)}else o.display="none"}else o.opacity=0},updateToolbarPos:function(t,e){var n=this.canvas.getToolbarEl(),i=n.style;i.opacity=0;var r=this.canvas.getTargetToElementDim(n,t,{elPos:e,event:"toolbarPosUpdate"});if(r){var o=r.left+r.elementWidth-r.targetWidth;i.top=r.top+"px",i.left=(o<0?0:o)+"px",i.opacity=""}},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},clean:function(){this.selEl&&this.selEl.removeClass(this.hoverClass)},getBadge:function(){return this.canvas.getBadgeEl()},onFrameScroll:function(t){var e=this.cacheEl;if(e){var n=this.getElementPos(e);this.updateBadge(e,n);var i=this.em.getSelected();i&&this.updateToolbarPos(i.view.el)}},updateAttached:function(t){var e=this.em.getSelected(),n=e&&e.view;if(n){var i=n.el;this.updateToolbarPos(i),this.showFixedElementOffset(i)}},getElementPos:function(t,e){return this.canvas.getCanvasView().getElementPos(t)},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(t){t&&t.set({status:"",state:""})},getContentWindow:function(){return this.frameEl.contentWindow},run:function(t){this.editor=t&&t.get("Editor"),this.enable(),this.onSelect()},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.em;this.stopSelectComponent(),!n.preserveSelected&&i.setSelected(null),this.clean(),this.hideBadge(),this.hideFixedElementOffset(),this.canvas.getToolbarEl().style.display="none",i.off("component:update",this.updateAttached,this),i.off("change:canvasOffset",this.updateAttached,this)}}},function(t,e,n){"use strict";var i=o(n(1)),r=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var s=n(19),a=r.default.$;t.exports=i.default.extend({},s,{init:function(t){i.default.bindAll(this,"startDraw","draw","endDraw","rollback"),this.config=t||{},this.hType=this.config.newFixedH?"height":"min-height",this.allowDraw=1},enable:function(){for(var t=arguments.length,e=Array(t),n=0;n/,f=/^\w+$/;function p(t,n){n=n||e;var i=h.test(t)?n.getElementsByClassName(t.slice(1)):f.test(t)?n.getElementsByTagName(t):n.querySelectorAll(t);return i}function g(n){if(!t){var i=(t=e.implementation.createHTMLDocument(null)).createElement("base");i.href=e.location.href,t.head.appendChild(i)}return t.body.innerHTML=n,t.body.childNodes}function v(t){"loading"!==e.readyState?setTimeout(t):e.addEventListener("DOMContentLoaded",t)}function m(t,i){if(!t)return this;if(t.cash&&t!==n)return t;var r,o=t,s=0;if(c(t))o=u.test(t)?e.getElementById(t.slice(1)):d.test(t)?g(t):p(t,i);else if(l(t))return v(t),this;if(!o)return this;if(o.nodeType||o===n)this[0]=o,this.length=1;else for(r=this.length=o.length;s=0&&o.splice(i,1)):(x(o,function(n){t.removeEventListener(e,n)}),o=[]))}function z(t,e){return"&"+encodeURIComponent(t)+"="+encodeURIComponent(e).replace(/%20/g,"+")}function V(t){var e=t.type;if(!e)return null;switch(e.toLowerCase()){case"select-one":return function(t){var e=t.selectedIndex;return e>=0?t.options[e].value:null}(t);case"select-multiple":return function(t){var e=[];return x(t.options,function(t){t.selected&&e.push(t.value)}),e.length?e:null}(t);case"radio":case"checkbox":return t.checked?t.value:null;default:return t.value?t.value:null}}function H(t,e,n){var i=c(e);i||!e.length?x(t,i?function(t){return t.insertAdjacentHTML(n?"afterbegin":"beforeend",e)}:function(t,i){return function(t,e,n){if(n){var i=t.childNodes[0];t.insertBefore(e,i)}else t.appendChild(e)}(t,0===i?e:e.cloneNode(!0),n)}):x(e,function(e){return H(t,e,n)})}y.prefixedProp=F,y.camelCase=I,b.extend({css:function(t,e){if(c(t))return t=F(t),arguments.length>1?this.each(function(n){return n.style[t]=e}):n.getComputedStyle(this[0])[t];for(var i in t)this.css(i,t[i]);return this}}),x(["Width","Height"],function(t){var e=t.toLowerCase();b[e]=function(){return this[0].getBoundingClientRect()[e]},b["inner"+t]=function(){return this[0]["client"+t]},b["outer"+t]=function(e){return this[0]["offset"+t]+(e?j(this,"margin"+("Width"===t?"Left":"Top"))+j(this,"margin"+("Width"===t?"Right":"Bottom")):0)}}),b.extend({off:function(t,e){return this.each(function(n){return R(n,t,e)})},on:function(t,e,n,i){var r;if(!c(t)){for(var o in t)this.on(o,e,t[o]);return this}return l(e)&&(n=e,e=null),"ready"===t?(v(n),this):(e&&(r=n,n=function(t){for(var n=t.target;!w(n,e);){if(n===this)return n=!1;n=n.parentNode}n&&r.call(n,t)}),this.each(function(e){var r=n;i&&(r=function(){n.apply(this,arguments),R(e,t,r)}),function(t,e,n){var i=M(t,"_cashEvents")||E(t,"_cashEvents",{});i[e]=i[e]||[],i[e].push(n),t.addEventListener(e,n)}(e,t,r)}))},one:function(t,e,n){return this.on(t,e,n,!0)},ready:v,trigger:function(t,n){var i=e.createEvent("HTMLEvents");return i.data=n,i.initEvent(t,!0,!1),this.each(function(t){return t.dispatchEvent(i)})}}),b.extend({serialize:function(){var t="";return x(this[0].elements||this,function(e){if(!e.disabled&&"FIELDSET"!==e.tagName){var n=e.name;switch(e.type.toLowerCase()){case"file":case"reset":case"submit":case"button":break;case"select-multiple":var i=V(e);null!==i&&x(i,function(e){t+=z(n,e)});break;default:var r=V(e);null!==r&&(t+=z(n,r))}}}),t.substr(1)},val:function(t){return void 0===t?V(this[0]):this.each(function(e){return e.value=t})}}),b.extend({after:function(t){return y(t).insertAfter(this),this},append:function(t){return H(this,t),this},appendTo:function(t){return H(y(t),this),this},before:function(t){return y(t).insertBefore(this),this},clone:function(){return y(this.map(function(t){return t.cloneNode(!0)}))},empty:function(){return this.html(""),this},html:function(t){if(void 0===t)return this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each(function(t){return t.innerHTML=e})},insertAfter:function(t){var e=this;return y(t).each(function(t,n){var i=t.parentNode,r=t.nextSibling;e.each(function(t){i.insertBefore(0===n?t:t.cloneNode(!0),r)})}),this},insertBefore:function(t){var e=this;return y(t).each(function(t,n){var i=t.parentNode;e.each(function(e){i.insertBefore(0===n?e:e.cloneNode(!0),t)})}),this},prepend:function(t){return H(this,t,!0),this},prependTo:function(t){return H(y(t),this,!0),this},remove:function(){return this.each(function(t){return t.parentNode.removeChild(t)})},text:function(t){return void 0===t?this[0].textContent:this.each(function(e){return e.textContent=t})}});var $=e.documentElement;return b.extend({position:function(){var t=this[0];return{left:t.offsetLeft,top:t.offsetTop}},offset:function(){var t=this[0].getBoundingClientRect();return{top:t.top+n.pageYOffset-$.clientTop,left:t.left+n.pageXOffset-$.clientLeft}},offsetParent:function(){return y(this[0].offsetParent)}}),b.extend({children:function(t){var e=[];return this.each(function(t){s.apply(e,t.children)}),e=k(e),t?e.filter(function(e){return w(e,t)}):e},closest:function(t){return!t||this.length<1?y():this.is(t)?this.filter(t):this.parent().closest(t)},is:function(t){if(!t)return!1;var e=!1,n=C(t);return this.each(function(i){return!(e=n(i,t))}),e},find:function(t){if(!t||t.nodeType)return y(t&&this.has(t).length?t:null);var e=[];return this.each(function(n){s.apply(e,p(t,n))}),k(e)},has:function(t){var e=c(t)?function(e){return 0!==p(t,e).length}:function(e){return e.contains(t)};return this.filter(e)},next:function(){return y(this[0].nextElementSibling)},not:function(t){if(!t)return this;var e=C(t);return this.filter(function(n){return!e(n,t)})},parent:function(){var t=[];return this.each(function(e){e&&e.parentNode&&t.push(e.parentNode)}),k(t)},parents:function(t){var n,i=[];return this.each(function(r){for(n=r;n&&n.parentNode&&n!==e.body.parentNode;)n=n.parentNode,(!t||t&&w(n,t))&&i.push(n)}),k(i)},prev:function(){return y(this[0].previousElementSibling)},siblings:function(){var t=this.parent().children(),e=this[0];return t.filter(function(t){return t!==e})}}),y})?i.call(e,n,e,t):i)||(t.exports=r)},function(t,e,n){"use strict";var i,r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get("name"),i=this.get("property");!this.get("id")&&this.set("id",i),n||this.set("name",i.charAt(0).toUpperCase()+i.slice(1).replace(/-/g," ")),o.callInit(this,t,e)},init:function(){},clearValue:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0},t),this},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parseValue(t);this.set(r,i({},n,{avoidStore:1})),e&&(this.set("value","",n),this.set(r,n))},setValueFromInput:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,i({},n,{fromInput:1}))},parseValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:t},i="!important";if((0,r.isString)(t)&&-1!==t.indexOf(i)&&(n.value=t.replace(i,"").trim(),n.important=1),!this.get("functionName")&&!e.complete)return n;var o=[],s=""+n.value,a=s.indexOf("(")+1,l=s.lastIndexOf(")"),c=s.substring(0,a-1);if(c&&(n.functionName=c),o.push(a),l>=0&&o.push(l),n.value=String.prototype.substring.apply(s,o),e.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,""),n.value=u}return n},getDefaultValue:function(){return this.get("defaults")},getFullValue:function(t){var e=this.get("functionName"),n=(0,r.isUndefined)(t)?this.get("value"):t;return e&&!(0,r.isUndefined)(n)&&(n=e+"("+n+")"),this.get("important")&&(n+=" !important"),n||""}},{callParentInit:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.prototype.initialize.apply(e,[n,i({},r,{skipInit:1})])},callInit:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&t.init(e,n)}});t.exports=o},function(t,e,n){"use strict";var i,r=n(0),o=(i=r)&&i.__esModule?i:{default:i};n(5),n(17),n(54),n(55),n(56),n(58),n(21),n(52);t.exports=o.default.View.extend({initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.onChange=t.onChange,this.onInputRender=t.onInputRender||{},this.customValue=t.customValue||{},this.properties=[];var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.render)},addTo:function(t){this.add(t)},add:function(t,e){var n=new t.typeView({model:t,name:t.get("name"),id:this.pfx+t.get("property"),target:this.target,propTarget:this.propTarget,onChange:this.onChange,onInputRender:this.onInputRender,config:this.config});"composite"!=t.get("type")&&(n.customValue=this.customValue),n.render();var i=n.el;this.properties.push(n),e?e.appendChild(i):this.el.appendChild(i)},render:function(){var t=this;this.properties=[];var e=document.createDocumentFragment();return this.collection.each(function(n){return t.add(n,e)}),this.$el.append(e),this.$el.attr("class",this.pfx+"properties"),this}})},function(t,e,n){"use strict";var i,r=n(0),o=(i=r)&&i.__esModule?i:{default:i};n(22);var s=n(5),a=o.default.$;t.exports=s.extend({templateInput:function(){return""},init:function(){var t=this.model;this.listenTo(t,"change:unit",this.modelValueChanged),this.listenTo(t,"el:change",this.elementUpdated),this.listenTo(t,"change:units",this.render)},setValue:function(t){var e=this.model.parseValue(t);t=""+e.value+e.unit,this.inputInst.setValue(t,{silent:1})},onRender:function(){var t=this.ppfx;if(!this.input){var e=this.model.input;e.ppfx=t,e.render(),this.el.querySelector("."+t+"fields").appendChild(e.el),this.$input=e.inputEl,this.unit=e.unitEl,this.$unit=a(this.unit),this.input=this.$input.get(0),this.inputInst=e}},clearCached:function(){s.prototype.clearCached.apply(this,arguments),this.unit=null,this.$unit=null}})},function(t,e,n){"use strict";var i=n(1),r=n(4);t.exports=r.extend({tagName:"img",events:{dblclick:"onActive",click:"initResize"},initialize:function(t){var e=this.model;r.prototype.initialize.apply(this,arguments),this.listenTo(e,"change:src",this.updateSrc),this.classEmpty=this.ppfx+"plh-image";var n=this.config;n.modal&&(this.modal=n.modal),n.am&&(this.am=n.am),this.fetchFile()},fetchFile:function(){var t=this.model,e=t.get("file");e&&(this.em.get("AssetManager").FileUploader().uploadFile({dataTransfer:{files:[e]}},function(e){var n=e&&e.data&&e.data[0],r=n&&((0,i.isString)(n)?n:n.src);r&&t.set({src:r})}),t.set("file",""))},updateSrc:function(){var t=this.model,e=this.classEmpty,n=this.$el,i=t.get("src");t.addAttributes({src:i}),n[i?"removeClass":"addClass"](e)},onActive:function(t){t&&t.stopPropagation();var e=this.opts.config.em,n=e?e.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)}})},render:function(){this.renderAttributes();var t=this.$el,e=this.model,n=t.attr("class")||"";return!e.get("src")&&t.attr("class",(n+" "+this.classEmpty).trim()),t.attr("onmousedown","return false"),this.postRender(),this}})},function(t,e,n){"use strict";var i,r=n(0);var o=((i=r)&&i.__esModule?i:{default:i}).default.$;t.exports={startSelectPosition:function(t,e){this.isPointed=!1;var n=this.editorModel.get("Utils");n&&!this.sorter&&(this.sorter=new n.Sorter({container:this.getCanvasBody(),placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:e,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1})),t&&this.sorter.startSort(t)},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},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(t,e,n){var i=t||0,r=e||"before",o=n.length,s=0!==o&&"after"==r&&i==o;return 0!==o&&(!s&&!n[i][4]||n[i-1]&&!n[i-1][4]||s&&!n[i-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},function(t,e,n){"use strict";var i=r(n(1));r(n(0));function r(t){return t&&t.__esModule?t:{default:t}}var o=n(12);t.exports=i.default.extend({},o,{init:function(){for(var t=arguments.length,e=Array(t),n=0;n\n \n \n '},inputValueChanged:function(){if(!this.model.get("detached")){for(var t=arguments.length,e=Array(t),n=0;n'),this.input=this.$input.get(0)),this.props||(this.props=t.get("properties")),!this.$props)){this.props.each(function(e,n){e&&"composite"==e.get("type")&&(this.props.remove(e),console.warn("Nested composite types not yet allowed.")),e.parent=t},this);var i=new(n(16))(this.getPropsConfig());this.$props=i.render().$el,this.properties=i.properties,this.$el.find("#"+this.pfx+"input-holder").append(this.$props)}},getPropsConfig:function(t){var e=this,n=this.model,i={config:this.config,collection:this.props,target:this.target,propTarget:this.propTarget,onChange:function(t,e,i){n.set("value",n.getFullValue(),i)},customValue:function(t,n){return e.valueOnIndex(n,t)}};return n.get("detached")&&delete i.onChange,i},valueOnIndex:function(t,e){var n=void 0,i=this.getTargetValue({ignoreDefault:1});i?n=i.split(this.model.getSplitSeparator())[t]:n=e&&e.getTargetValue({ignoreCustomValue:1,ignoreDefault:1});return e&&(n=e.model.parseValue(n).value),n},clearCached:function(){s.prototype.clearCached.apply(this,arguments),this.$input=null,this.props=null,this.$props=null}})},function(t,e,n){"use strict";(function(e){var i=n(1),r=n(2),o=n(53);n(0).$;t.exports=o.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 t=this.ppfx;return'\n \n \n
\n
\n
\n
\n '},inputClass:function(){var t=this.ppfx;return this.opts.contClass||t+"field "+t+"field-integer"},initialize:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];o.prototype.initialize.apply(this,arguments),(0,i.bindAll)(this,"moveIncrement","upIncrement"),this.doc=document,this.listenTo(this.model,"change:unit",this.handleModelChange)},setValue:function(t,e){var n=e||{},i=this.validateInputValue(t,{deepCheck:1}),r={value:i.value};(i.unit||i.force)&&(r.unit=i.unit),this.model.set(r,n),n.silent&&this.handleModelChange()},handleChange:function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},handleUnitChange:function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set("unit",e),this.elementUpdated()},elementUpdated:function(){this.model.trigger("el:change")},handleModelChange:function(){var t=this.model;this.getInputEl().value=t.get("value");var e=this.getUnitEl();e&&(e.value=t.get("unit")||"")},getUnitEl:function(){if(!this.unitEl){var t=this.model,e=t.get("units")||[];if(e.length){var n=[];e.forEach(function(e){var i=e==t.get("unit")?"selected":"";n.push("")});var i=document.createElement("div");i.innerHTML='",this.unitEl=i.firstChild}}return this.unitEl},upArrowClick:function(){var t=this.model,e=t.get("step"),n=parseInt(t.get("value"),10);n=this.normalizeValue(n+e);var i=this.validateInputValue(n);t.set("value",i.value),this.elementUpdated()},downArrowClick:function(){var t=this.model,e=t.get("step"),n=parseInt(t.get("value"),10),i=this.normalizeValue(n-e),r=this.validateInputValue(i);t.set("value",r.value),this.elementUpdated()},downIncrement:function(t){t.preventDefault(),this.moved=0;var e=this.model.get("value");e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,r.on)(this.doc,"mousemove",this.moveIncrement),(0,r.on)(this.doc,"mouseup",this.upIncrement)},moveIncrement:function(t){this.moved=1;var e=this.model,n=e.get("step"),i=this.current,r=this.normalizeValue(i.val+(i.y-t.pageY)*n);return this.prValue=this.validateInputValue(r).value,e.set("value",this.prValue,{avoidStore:1}),!1},upIncrement:function(){var t=this.model,e=t.get("step");if((0,r.off)(this.doc,"mouseup",this.upIncrement),(0,r.off)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set("value",n,{avoidStore:1}).set("value",n+e),this.elementUpdated()}},normalizeValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model.get("step"),i=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var r=n.toString().split(".")[1];i=r?r.length:0}return i?parseFloat(t.toFixed(i)):t},validateInputValue:function(t,n){var r=0,o=n||{},s=this.model,a=(0,i.isUndefined)(t)?"":t,l=s.get("units")||[],c=s.get("unit")||l.length&&l[0]||"",u=s.get("max"),h=s.get("min");if(o.deepCheck){var d=s.get("fixedValues")||[];if(a){var f=new RegExp("^"+d.join("|"),"g");if(d.length&&f.test(a))a=a.match(f)[0],c="",r=1;else{var p=a+"";a+="",a=parseFloat(a.replace(",",".")),a=isNaN(a)?"":a;var g=p.replace(a,"");e.indexOf(l,g)>=0&&(c=g)}}}return(0,i.isUndefined)(u)||""===u||(a=a>u?u:a),(0,i.isUndefined)(h)||""===h||(a=a1&&void 0!==arguments[1]?arguments[1]:{};this.listenTo(this,"add",this.onAdd),this.config=e.config,this.em=e.em,this.model=function(t,n){var i,r=e.componentTypes;n.em=e.em,n.config=e.config,n.componentTypes=r;for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=n.get("CssComposer"),o=n.get("Parser").parseHtml(t);return o.css&&r&&!e.temporary&&r.addCollection(o.css,i({},e,{extend:1})),o.html},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.isString)(t)?t=this.parseString(t,n):(0,r.isArray)(t)&&t.forEach(function(n,i){(0,r.isString)(n)&&(t[i]=e.parseString(n))}),o.Collection.prototype.add.apply(this,[t,n])},onAdd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.em,o=t.getStyle(),s=i&&i.getConfig("avoidInlineStyle");if(!(0,r.isEmpty)(o)&&!s&&i&&i.get&&i.getConfig("forceClass")&&!n.temporary){var a=t.cid;i.get("CssComposer").setClassRule(a,o);t.setStyle({}),t.addClass(a)}}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=this.id;if(t.trigger("run:"+n+":before",e),!e||!e.abort){var i=e.sender||t,r=this.run(t,i,e);return t.trigger("run:"+n,r,e),r}t.trigger("abort:"+n,e)},callStop:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id,i=e.sender||t;t.trigger("stop:"+n+":before",e);var r=this.stop(t,i,e);return t.trigger("stop:"+n,r,e),r},run:function(t,e){},stop:function(t,e){}})},function(t,e,n){"use strict";var i,r=n(0);var o=((i=r)&&i.__esModule?i:{default:i}).default.$;t.exports={run:function(t,e){var n=this;arguments.length>2&&void 0!==arguments[2]&&arguments[2];e&&e.set&&e.set("active",0);var i=t.getConfig(),r=t.Modal,s=i.stylePrefix;if(this.cm=t.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}r.open({title:i.textViewCode,content:this.$editors}).getModel().once("change:open",function(){return t.stopCommand(n.id)}),this.htmlEditor.setContent(t.getHtml()),this.cssEditor.setContent(t.getCss())},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var i=document.createElement("textarea");!this.codeMirror&&(this.codeMirror=this.cm.getViewer("CodeMirror"));var r=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:i}),o=new this.cm.EditorView({model:r,config:this.cm.getConfig()}).render().$el;return r.init(i),{el:r,$el:o}}}},function(t,e,n){"use strict";var i=o(n(1)),r=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var s=n(11),a=r.default.$;t.exports=i.default.extend({},s,{init:function(t){i.default.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(t){t.stopPropagation();var e=a(t.target);e.data("model").get("removable")&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation(),a(t.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=a(t.target);e.data("model").get("removable")&&(e.data("model").destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html("Remove "+t.getName())}})},function(t,e,n){"use strict";var i=r(n(1));r(n(0));function r(t){return t&&t.__esModule?t:{default:t}}var o=n(20);t.exports=i.default.extend({},o,{beforeInsert:function(t){t.type="image",t.style={},t.attributes={},t.attributes.onmousedown="return false",this.config.firstCentered&&this.getCanvasWrapper()==this.sorter.target&&(t.style.margin="0 auto")},afterInsert:function(t){t.trigger("dblclick"),this.sender&&this.sender.set("active",!1)}})},function(t,e,n){"use strict";var i=s(n(1)),r=s(n(0)),o=n(2);function s(t){return t&&t.__esModule?t:{default:t}}var a=n(11),l=n(19),c=r.default.$;t.exports=i.default.extend({},l,a,{init:function(t){a.init.apply(this,arguments),i.default.bindAll(this,"initSorter","rollback","onEndMove"),this.opt=t,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var t=arguments.length,e=Array(t),n=0;n"),this.$cn2=s("
"),this.$cn.append(this.$cn2);var r=t.DeviceManager;if(r&&n.showDevices)i.addPanel({id:"devices-c"}).set("appendContent",r.render()).trigger("change:appendContent");var o=t.SelectorManager;o&&this.$cn2.append(o.render([])),this.$cn2.append(t.StyleManager.render());var a=t.StyleManager.getConfig(),l=a.stylePrefix;this.$header=s('
'+a.textNoElement+"
"),this.$cn.append(this.$header),i.getPanel("views-container")?this.panel=i.getPanel("views-container"):this.panel=i.addPanel({id:"views-container"}),this.panel.set("appendContent",this.$cn).trigger("change:appendContent"),this.target=t.editor,this.listenTo(this.target,"component:toggled",this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this.target,e=this.sender;e&&e.get&&!e.get("active")||(1===t.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()}}},function(t,e,n){"use strict";var i=n(0).$;t.exports={run:function(t,e){this.sender=e;var n=t.Config.stylePrefix,r=t.TraitManager;if(!this.$cn){var o=r.getTraitsViewer(),s=r.getConfig();this.$cn=i("
"),this.$cn2=i("
"),this.$cn.append(this.$cn2),this.$header=i("
").append('
'+s.textNoElement+"
"),this.$cn.append(this.$header),this.$cn2.append('
'+s.labelContainer+"
"),this.$cn2.append(o.render().el);var a=t.Panels;(a.getPanel("views-container")?a.getPanel("views-container"):a.addPanel({id:"views-container"})).set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=t.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()},toggleTm:function(){var t=this.sender;t&&t.get&&!t.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()}}},function(t,e,n){"use strict";t.exports={run:function(t,e){var n=t.BlockManager,i=t.Panels;if(!this.blocks){n.render();var r="views-container",o=document.createElement("div"),s=i.getPanel(r)||i.addPanel({id:r});o.appendChild(n.getContainer()),s.set("appendContent",o).trigger("change:appendContent"),this.blocks=o}this.blocks.style.display="block"},stop:function(){var t=this.blocks;t&&(t.style.display="none")}}},function(t,e,n){"use strict";t.exports={run:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.Modal,o=t.AssetManager,s=o.getConfig(),a=o.getContainer(),l=i.modalTitle||s.modalTitle||"",c=i.types,u=i.accept;if(o.setTarget(i.target),o.onClick(i.onClick),o.onDblClick(i.onDblClick),o.onSelect(i.onSelect),!this.rendered||c){var h=o.getAll().filter(function(t){return 1});c&&c.length&&(h=h.filter(function(t){return-1!==c.indexOf(t.get("type"))})),o.render(h),this.rendered=1}if(u){var d=a.querySelector("input#"+s.stylePrefix+"uploadFile");d&&d.setAttribute("accept",u)}return r.open({title:l,content:a}).getModel().once("change:open",function(){return t.stopCommand(n.id)}),this},stop:function(t){return t.Modal.close(),this}}},function(t,e,n){"use strict";var i,r=n(0);var o=((i=r)&&i.__esModule?i:{default:i}).default.$;t.exports={getOffsetMethod:function(t){return"get"+(t||"")+"OffsetViewerEl"},run:function(t,e,n){var i=n||{},r=i.state||"",s=t.getConfig();if(s.showOffsets&&(s.showOffsetsSelected||"Fixed"!=r)){var a=t.Canvas,l=i.el||"",c=i.elPos||a.getElementPos(l),u=window.getComputedStyle(l),h=this.ppfx,d=r+"State",f=a[this.getOffsetMethod(r)]();f.style.display="block";var p=this["marginT"+r],g=this["marginB"+r],v=this["marginL"+r],m=this["marginR"+r],y=this["padT"+r],b=this["padB"+r],x=this["padL"+r],w=this["padR"+r];if(!this[d]){var C=r.toLowerCase(),k=C+"margin-v",S=C+"padding-v",T=o('
').get(0),E=o('
').get(0),M=h+k+"-el"+" "+(h+k),A=h+S+"-el"+" "+(h+S);p=o('
').get(0),g=o('
').get(0),v=o('
').get(0),m=o('
').get(0),y=o('
').get(0),b=o('
').get(0),x=o('
').get(0),w=o('
').get(0),this["marginT"+r]=p,this["marginB"+r]=g,this["marginL"+r]=v,this["marginR"+r]=m,this["padT"+r]=y,this["padB"+r]=b,this["padL"+r]=x,this["padR"+r]=w,T.appendChild(p),T.appendChild(g),T.appendChild(v),T.appendChild(m),E.appendChild(y),E.appendChild(b),E.appendChild(x),E.appendChild(w),f.appendChild(T),f.appendChild(E),this[d]="1"}var O=u.marginLeft.replace("px",""),P=parseInt(u.marginTop.replace("px","")),L=parseInt(u.marginBottom.replace("px","")),_=p.style,N=g.style,D=v.style,I=m.style,F=y.style,j=b.style,R=x.style,z=w.style,V=parseInt(c.left);_.height=u.marginTop,_.width=u.width,_.top=c.top-u.marginTop.replace("px","")+"px",_.left=V+"px",N.height=u.marginBottom,N.width=u.width,N.top=c.top+c.height+"px",N.left=V+"px";var H=c.height+P+L+"px",$=c.top-P+"px";D.height=H,D.width=u.marginLeft,D.top=$,D.left=V-O+"px",I.height=H,I.width=u.marginRight,I.top=$,I.left=V+c.width+"px";var B=parseInt(u.paddingTop.replace("px",""));F.height=u.paddingTop,F.width=u.width,F.top=c.top+"px",F.left=V+"px";var W=parseInt(u.paddingBottom.replace("px",""));j.height=u.paddingBottom,j.width=u.width,j.top=c.top+c.height-W+"px",j.left=V+"px";var U=c.height-W-B+"px",q=c.top+B+"px";R.height=U,R.width=u.paddingLeft,R.top=q,R.left=c.left+"px";var K=parseInt(u.paddingRight.replace("px",""));z.height=U,z.width=u.paddingRight,z.top=q,z.left=c.left+c.width-K+"px"}},stop:function(t,e,n){var i=(n||{}).state||"",r=this.getOffsetMethod(i);t.Canvas[r]().style.display="none"}}},function(t,e,n){"use strict";t.exports={run:function(t){for(var e=t.getSelected(),n=e&&e.parent();n&&!n.get("selectable");)n=n.parent();n&&t.select(n)}}},function(t,e,n){"use strict";var i=n(1);t.exports={isEnabled:function(){var t=document;return t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement?1:0},enable:function(t){var e="";return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e="webkit",t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e="moz",t.mozRequestFullScreen()):t.msRequestFullscreen?t.msRequestFullscreen():console.warn("Fullscreen not supported"),e},disable:function(){var t=document;t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen()},fsChanged:function(t,e){document;var n=(t||"")+"fullscreenchange";this.isEnabled()||(this.stop(null,this.sender),document.removeEventListener(n,this.fsChanged))},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sender=e;var r=n.target,o=(0,i.isElement)(r)?r:document.querySelector(r),s=this.enable(o||t.getContainer());this.fsChanged=this.fsChanged.bind(this,s),document.addEventListener(s+"fullscreenchange",this.fsChanged),t.trigger("change:canvasOffset")},stop:function(t,e){e&&e.set&&e.set("active",!1),this.disable(),t&&t.trigger("change:canvasOffset")}}},function(t,e,n){"use strict";var i,r=n(1),o=(i=r)&&i.__esModule?i:{default:i};t.exports={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanelsEl()),this.panels},tglPointers:function(t,e){var n=t.Canvas.getBody().querySelectorAll("."+this.ppfx+"no-pointer");o.default.each(n,function(t){t.style.pointerEvents=e?"":"all"})},run:function(t,e){e&&e.set&&e.set("active",!1),t.stopCommand("sw-visibility"),t.getModel().stopDefault();var n=this.getPanels(t),i=t.Canvas.getElement(),r=t.getEl(),o=t.Config.stylePrefix;this.helper||(this.helper=document.createElement("span"),this.helper.className=o+"off-prv fa fa-eye-slash",r.appendChild(this.helper),this.helper.onclick=function(){t.stopCommand("preview")}),this.helper.style.display="inline-block",this.tglPointers(t),n.style.display="none";var s=i.style;s.width="100%",s.height="100%",s.top="0",s.left="0",s.padding="0",s.margin="0",t.trigger("change:canvasOffset")},stop:function(t,e){var n=this.getPanels(t);t.runCommand("sw-visibility"),t.getModel().runDefault(),n.style.display="block",t.Canvas.getElement().setAttribute("style",""),this.helper&&(this.helper.style.display="none"),t.trigger("change:canvasOffset"),this.tglPointers(t,1)}}},function(t,e,n){"use strict";t.exports={run:function(t,e,n){var i=n||{},r=i.el||"",o=t.Canvas,s=this.canvasResizer,a=i.options||{},l=o.getCanvasView();return a.ratioDefault=1,a.appendTo=o.getResizerEl(),a.prefix=t.getConfig().stylePrefix,a.posFetcher=l.getElementPos.bind(l),a.mousePosFetcher=o.getMouseRelativePos,s&&!i.forceNew||(this.canvasResizer=t.Utils.Resizer.init(a),s=this.canvasResizer),s.setOptions(a),s.blur(),s.focus(r),s},stop:function(){var t=this.canvasResizer;t&&t.blur()}}},function(t,e,n){"use strict";t.exports={run:function(t,e,n){var i=n&&n.el||"",r=t.Canvas,o=this.dragger,s=n.options||{},a=r.getCanvasView();return s.prefix=t.getConfig().stylePrefix,s.mousePosFetcher=r.getMouseRelativePos,s.posFetcher=a.getElementPos.bind(a),o||(o=t.Utils.Dragger.init(s),this.dragger=o),o.setOptions(s),o.focus(i),s.event&&o.start(s.event),o},stop:function(){this.canvasResizer&&this.canvasResizer.blur()}}},function(t,e,n){!function(e){var n,i={},r={16:!1,18:!1,17:!1,91:!1},o="all",s={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},a={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},l=function(t){return a[t]||t.toUpperCase().charCodeAt(0)},c=[];for(n=1;n<20;n++)a["f"+n]=111+n;function u(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function h(t,e){if(t.length!=e.length)return!1;for(var n=0;n1&&(o=m(t),t=[t[t.length-1]]),t=t[0],(t=l(t))in i||(i[t]=[]),i[t].push({shortcut:r[s],scope:e,method:n,key:r[s],mods:o})}for(n in s)p[n]=!1;function g(){return o||"all"}function v(t){var e;return""==(e=(t=t.replace(/\s/g,"")).split(","))[e.length-1]&&(e[e.length-2]+=","),e}function m(t){for(var e=t.slice(0,t.length-1),n=0;n0,r)(!r[o]&&u(n.mods,+o)>-1||r[o]&&-1==u(n.mods,+o))&&(l=!1);(0!=n.mods.length||r[16]||r[18]||r[17]||r[91])&&!l||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)}),y(document,"keyup",function(t){var e,n=t.keyCode,i=u(c,n);if(i>=0&&c.splice(i,1),93!=n&&224!=n||(n=91),n in r)for(e in r[n]=!1,s)s[e]==n&&(p[e]=!1)}),y(window,"focus",function(){for(n in r)r[n]=!1;for(n in s)p[n]=!1});var b=e.key;e.key=p,e.key.setScope=function(t){o=t||"all"},e.key.getScope=g,e.key.deleteScope=function(t){var e,n,r;for(e in i)for(n=i[e],r=0;r1&&(c=m(r),t=r[r.length-1]),t=l(t),void 0===e&&(e=g()),!i[t])return;for(o=0;o=0&&e<=k};function E(t){return function(e,n,i,r){n=y(n,r,4);var o=!T(e)&&m.keys(e),s=(o||e).length,a=t>0?0:s-1;return arguments.length<3&&(i=e[o?o[a]:a],a+=t),function(e,n,i,r,o,s){for(;o>=0&&o=0},m.invoke=function(t,e){var n=c.call(arguments,2),i=m.isFunction(e);return m.map(t,function(t){var r=i?e:t[e];return null==r?r:r.apply(t,n)})},m.pluck=function(t,e){return m.map(t,m.property(e))},m.where=function(t,e){return m.filter(t,m.matcher(e))},m.findWhere=function(t,e){return m.find(t,m.matcher(e))},m.max=function(t,e,n){var i,r,o=-1/0,s=-1/0;if(null==e&&null!=t)for(var a=0,l=(t=T(t)?t:m.values(t)).length;ao&&(o=i);else e=b(e,n),m.each(t,function(t,n,i){((r=e(t,n,i))>s||r===-1/0&&o===-1/0)&&(o=t,s=r)});return o},m.min=function(t,e,n){var i,r,o=1/0,s=1/0;if(null==e&&null!=t)for(var a=0,l=(t=T(t)?t:m.values(t)).length;ai||void 0===n)return 1;if(n0?0:r-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 i[o=n(i,r)]===r?o:-1;if(r!=r)return(o=e(c.call(i,s,a),m.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(s&&(clearTimeout(s),s=null),a=c,o=t.apply(i,r),s||(i=r=null)):s||!1===n.trailing||(s=setTimeout(l,u)),o}},m.debounce=function(t,e,n){var i,r,o,s,a,l=function(){var c=m.now()-s;c=0?i=setTimeout(l,e-c):(i=null,n||(a=t.apply(o,r),i||(o=r=null)))};return function(){o=this,r=arguments,s=m.now();var c=n&&!i;return i||(i=setTimeout(l,e)),c&&(a=t.apply(o,r),o=r=null),a}},m.wrap=function(t,e){return m.partial(e,t)},m.negate=function(t){return function(){return!t.apply(this,arguments)}},m.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}},m.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},m.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},m.once=m.partial(m.before,2);var _=!{toString:null}.propertyIsEnumerable("toString"),N=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function D(t,e){var n=N.length,i=t.constructor,r=m.isFunction(i)&&i.prototype||s,o="constructor";for(m.has(t,o)&&!m.contains(e,o)&&e.push(o);n--;)(o=N[n])in t&&t[o]!==r[o]&&!m.contains(e,o)&&e.push(o)}m.keys=function(t){if(!m.isObject(t))return[];if(f)return f(t);var e=[];for(var n in t)m.has(t,n)&&e.push(n);return _&&D(t,e),e},m.allKeys=function(t){if(!m.isObject(t))return[];var e=[];for(var n in t)e.push(n);return _&&D(t,e),e},m.values=function(t){for(var e=m.keys(t),n=e.length,i=Array(n),r=0;r":">",'"':""","'":"'","`":"`"},j=m.invert(F),R=function(t){var e=function(e){return t[e]},n="(?:"+m.keys(t).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(r,e):t}};m.escape=R(F),m.unescape=R(j),m.result=function(t,e,n){var i=null==t?void 0:t[e];return void 0===i&&(i=n),m.isFunction(i)?i.call(t):i};var z=0;m.uniqueId=function(t){var e=++z+"";return t?t+e:e},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var V=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},$=/\\|'|\r|\n|\u2028|\u2029/g,B=function(t){return"\\"+H[t]};m.template=function(t,e,n){!e&&n&&(e=n),e=m.defaults({},e,m.templateSettings);var i=RegExp([(e.escape||V).source,(e.interpolate||V).source,(e.evaluate||V).source].join("|")+"|$","g"),r=0,o="__p+='";t.replace(i,function(e,n,i,s,a){return o+=t.slice(r,a).replace($,B),r=a+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?o+="'+\n((__t=("+i+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.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";try{var s=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var a=function(t){return s.call(this,t,m)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},m.chain=function(t){var e=m(t);return e._chain=!0,e};var W=function(t,e){return t._chain?m(e).chain():e};m.mixin=function(t){m.each(m.functions(t),function(e){var n=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),W(this,n.apply(m,t))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];m.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],W(this,n)}}),m.each(["concat","join","slice"],function(t){var e=o[t];m.prototype[t]=function(){return W(this,e.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},void 0===(i=function(){return m}.apply(e,[]))||(t.exports=i)}).call(this)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(104),o=(i=r)&&i.__esModule?i:{default:i};window.Promise=window.Promise||o.default,e.default="function"==typeof fetch?fetch.bind():function(t,e){return new o.default(function(n,i){var r=new XMLHttpRequest;for(var s in r.open(e.method||"get",t),r.withCredentials="include"==e.credentials,e.headers||{})r.setRequestHeader(s,e.headers[s]);r.onload=function(t){return n({status:r.status,statusText:r.statusText,text:function(){return o.default.resolve(r.responseText)}})},r.onerror=i,r.upload&&e.onProgress&&(r.upload.onprogress=e.onProgress),e.body?r.send(e.body):r.send()})}},function(t,e,n){"use strict";t.exports=function(t){var e=t;return{compTypes:"",parseStyle:function(t){for(var e={},n=t.split(";"),i=0,r=n.length;i1&&void 0!==arguments[1]?arguments[1]:{},n=e.model,r=void 0===n?{}:n,s=e.view,a=void 0===s?{}:s,l=this.getType(t);if(l)return new l.view(i({model:new l.model(r),config:o},a))},setTarget:function(t,n){return e.setTarget(t,n)},getEmitter:function(){return e.propTarget},render:function(){return e.render().el}}}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=t.Model,o=t.View;e.default={types:[],initialize:function(t,e){var n=this;this.model=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,r=void 0,o=void 0;if(t&&t.type){var s=n.getBaseType();i=(o=n.getType(t.type))?o.model:s.model,r=o?o.view:s.view}else{var a=n.recognizeType(t);i=(o=a.type).model,r=o.view,t=a.attributes}var l=new i(t,e);return l.typeView=r,l};var i=this.init&&this.init.bind(this);i&&i()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.callParentInit(r,this,t,e);var i=this.get("properties")||[],o=n(14);this.set("properties",new o(i)),this.listenTo(this,"change:value",this.updateValues),r.callInit(this,t,e)},clearValue:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.get("properties").each(function(t){return t.clearValue()}),r.prototype.clearValue.apply(this,arguments)},updateValues:function(){var t=this.getFullValue().split(this.getSplitSeparator());this.get("properties").each(function(e,n){var i=t.length;t[n]||t[n%i+(1!=i&&i%2?1:0)]})},getSplitSeparator:function(){return new RegExp(this.get("separator")+"(?![^\\(]*\\))")},getDefaultValue:function(t){var e=this.get("defaults");return e&&!t?e:(e="",this.get("properties").each(function(t,n){return e+=t.getDefaultValue()+" "}),e.trim())},getFullValue:function(){return this.get("detached")?"":this.get("properties").getFullValue()},getPropertyAt:function(t){return this.get("properties").at(t)}})},function(t,e,n){"use strict";var i=n(21),r=n(125);t.exports=i.extend({templateInput:function(){var t=this.pfx;this.ppfx;return'\n
\n \n
\n
\n '},init:function(){var t=this.model;this.pfx;t.set("stackIndex",null),this.events["click [data-add-layer]"]="addLayer",this.listenTo(t,"change:stackIndex",this.indexChanged),this.listenTo(t,"updateValue",this.inputValueChanged),this.delegateEvents()},clear:function(t){t&&t.stopPropagation(),this.model.get("layers").reset(),this.model.clearValue(),this.targetUpdated()},targetUpdated:function(){if(this.model.get("detached"))this.checkVisibility();else{for(var t=arguments.length,e=Array(t),n=0;n'},inputClass:function(){return this.ppfx+"field"},holderClass:function(){return this.ppfx+"input-holder"},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ppfx||"";this.opts=t,this.ppfx=e,this.em=t.target||{},this.listenTo(this.model,"change:value",this.handleModelChange)},elementUpdated:function(){this.model.trigger("el:change")},setValue:function(t){var e=this.model,n=t||e.get("defaults"),i=this.getInputEl();i&&(i.value=n)},handleModelChange:function(t,e,n){this.setValue(e,n)},handleChange:function(t){t.stopPropagation();var e=this.getInputEl().value;this.model.set({value:e},{fromInput:1}),this.elementUpdated()},getInputEl:function(){if(!this.inputEl){var t=this.model.get("defaults")||"";this.inputEl=r('')}return this.inputEl.get(0)},render:function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find("."+this.holderClass()).append(this.getInputEl()),this}})},function(t,e,n){"use strict";t.exports=n(5).extend({templateInput:function(){this.pfx;var t=this.ppfx;return'\n
\n
\n '},onRender:function(){var t=this.pfx,e=this.ppfx,n=e+"radio-item-label",i=this.model,r=i.get("property"),o=i.get("list")||i.get("options")||[];if(!this.input&&o&&o.length){var s="";o.forEach(function(i){var o=i.className?i.className+" "+t+"icon "+n:"",a=r+"-"+i.value,l=i.name||i.value,c=i.title?'title="'+i.title+'"':"";s+='\n
\n \n \n
\n "});var a=this.el.querySelector("."+e+"field");a.innerHTML='
'+s+"
",this.input=a.firstChild}},getInputValue:function(){var t=this.getCheckedEl();return t?t.value:""},getCheckedEl:function(){var t=this.getInputEl();return t?t.querySelector("input:checked"):""},setValue:function(t){var e=this.model,n=t||e.get("value")||e.getDefaultValue(),i=this.getInputEl(),r=i?i.querySelector('[value="'+n+'"]'):"";if(r)r.checked=!0;else{var o=this.getCheckedEl();o&&(o.checked=!1)}}})},function(t,e,n){"use strict";var i=o(n(0)),r=o(n(5));function o(t){return t&&t.__esModule?t:{default:t}}i.default.$;t.exports=r.default.extend({templateInput:function(){var t=this.pfx,e=this.ppfx;return'\n
\n \n
\n
\n
\n
\n '},initialize:function(){for(var t=arguments.length,e=Array(t),n=0;n"+e+""});var i=this.el.querySelector("#"+t+"input-holder");i.innerHTML="",this.input=i.firstChild}}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};e=i({},e,{silent:1}),this.inputInst.setValue(t,e)},onRender:function(){if(!this.input){var t=this.ppfx,e=new r({target:this.target,model:this.model,ppfx:t}).render();this.el.querySelector("."+t+"fields").appendChild(e.el),this.$input=e.inputEl,this.$color=e.colorEl,this.input=this.$input.get(0),this.inputInst=e}}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e
\n
\n
\n
\n
\n
\n '},inputClass:function(){var t=this.ppfx;return t+"field "+t+"field-color"},holderClass:function(){return this.ppfx+"input-holder"},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model.get("defaults"),i=(0,o.isUndefined)(t)?(0,o.isUndefined)(n)?"":n:t,r=this.getInputEl(),s=this.getColorEl(),a="none"!=i?i:"";r.value=i,s.get(0).style.backgroundColor=a,e.fromTarget&&(s.spectrum("set",a),this.noneColor="none"==i)},getColorEl:function(){if(!this.colorEl){var t=this,e=this.ppfx,n=this.model,r=c('
'),o=r.get(0).style,s=this.em&&this.em.config?this.em.config.el:"",a=this.em&&this.em.getConfig&&this.em.getConfig("colorPicker")||{},l=function(t){return(1==t.getAlpha()?t.toHexString():t.toRgbString()).replace(/ /g,"")},u=0,h=void 0;this.$el.find("[data-colorp-c]").append(r),r.spectrum(i({containerClassName:e+"one-bg "+e+"two-color",appendTo:s||"body",maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},a,{move:function(t){var e=l(t);o.backgroundColor=e,n.setValueFromInput(e,0)},change:function(e){u=1;var i=l(e);o.backgroundColor=i,n.setValueFromInput(i),t.noneColor=0},show:function(t){u=0,h=l(t)},hide:function(e){!u&&h&&(t.noneColor&&(h=""),o.backgroundColor=h,r.spectrum("set",h),n.setValueFromInput(h,0))}})),this.colorEl=r}return this.colorEl},render:function(){return l.prototype.render.call(this),this.getColorEl(),this}})},function(t,e,n){"use strict";var i,r=n(1),o=n(0),s=(i=o)&&i.__esModule?i:{default:i};var a=n(5),l=s.default.$;t.exports=a.extend({templateInput:function(){var t=this.pfx;this.ppfx;return'\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n '},init:function(){var t=this.em;this.modal=t.get("Modal"),this.am=t.get("AssetManager"),this.events["click #"+this.pfx+"close"]="removeFile",this.events["click #"+this.pfx+"images"]="openAssetManager",this.delegateEvents()},onRender:function(){if(!this.$input){var t=this.model.getDefaultValue();this.$input=l('')}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(){a.prototype.clearCached.apply(this,arguments),this.$preview=null,this.$previewBox=null},setValue:function(t,e){a.prototype.setValue.apply(this,arguments),this.setPreviewView(t&&t!=this.model.getDefaultValue()),this.setPreview(t)},setPreviewView:function(t){var e=this.$previewBox;e&&e[t?"addClass":"removeClass"](this.pfx+"show")},spreadUrl:function(t){this.model.set("value",t),this.setPreviewView(1)},setPreview:function(t){var e=this.$preview;t=t&&t.indexOf("url(")<0?"url("+t+")":t,e&&e.css("background-image",t)},cleanValue:function(){this.setPreviewView(0),this.model.set({value:""},{silent:!0})},removeFile:function(){this.model.set("value",this.model.getDefaultValue());for(var t=arguments.length,e=Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return this.set("options",t),this},addOption:function(t){if(t){var e=this.getOptions();this.setOptions([].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,unit:void 0},t),this},parseValue:function(t){var e=o.prototype.parseValue.apply(this,arguments),n=this.input.validateInputValue(e.value,{deepCheck:1}),i=n.value,r=n.unit;return e.value=i,e.unit=r,e},getFullValue:function(){var t=this.get("value"),e=this.get("unit");return t=""+(t=(0,r.isUndefined)(t)?"":t)+(e=!(0,r.isUndefined)(e)&&t?e:""),o.prototype.getFullValue.apply(this,[t])}})},function(t,e,n){!function(t){"use strict";function e(t){for(var e={},n=0;n0;r--)n.context=n.context.prev;return M(t,e,n)}function O(t){var e=t.current().toLowerCase();o=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var P={top:function(t,e,n){if("{"==t)return T(n,e,"block");if("}"==t&&n.context.prev)return E(n);if(x&&/@component/i.test(t))return T(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return T(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return T(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return T(n,e,"at");if("hash"==t)o="builtin";else if("word"==t)o="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return T(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return T(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var i=e.current().toLowerCase();return d.hasOwnProperty(i)?(o="property","maybeprop"):f.hasOwnProperty(i)?(o="string-2","maybeprop"):y?(o=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?P.top(t,e,n):(o="error","block")},maybeprop:function(t,e,n){return":"==t?T(n,e,"prop"):M(t,e,n)},prop:function(t,e,n){if(";"==t)return E(n);if("{"==t&&y)return T(n,e,"propBlock");if("}"==t||"{"==t)return A(t,e,n);if("("==t)return T(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())){if("word"==t)O(e);else if("interpolation"==t)return T(n,e,"interpolation")}else o+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?E(n):"word"==t?(o="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?A(t,e,n):")"==t?E(n):"("==t?T(n,e,"parens"):"interpolation"==t?T(n,e,"interpolation"):("word"==t&&O(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(o="variable-3",n.context.type):M(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(o="tag",n.context.type):P.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return T(n,e,"atBlock_parens");if("}"==t||";"==t)return A(t,e,n);if("{"==t)return E(n)&&T(n,e,y?"block":"top");if("interpolation"==t)return T(n,e,"interpolation");if("word"==t){var i=e.current().toLowerCase();o="only"==i||"not"==i||"and"==i||"or"==i?"keyword":c.hasOwnProperty(i)?"attribute":u.hasOwnProperty(i)?"property":h.hasOwnProperty(i)?"keyword":d.hasOwnProperty(i)?"property":f.hasOwnProperty(i)?"string-2":m.hasOwnProperty(i)?"atom":v.hasOwnProperty(i)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?A(t,e,n):"{"==t?E(n)&&T(n,e,y?"block":"top",!1):("word"==t&&(o="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?E(n):"{"==t||"}"==t?A(t,e,n,2):P.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?T(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):M(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,E(n)):"word"==t?(o="@font-face"==n.stateArg&&!p.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(o="variable","keyframes"):"{"==t?T(n,e,"top"):M(t,e,n)},at:function(t,e,n){return";"==t?E(n):"{"==t||"}"==t?A(t,e,n):("word"==t?o="tag":"hash"==t&&(o="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?E(n):"{"==t||";"==t?A(t,e,n):("word"==t?o="variable":"variable"!=t&&"("!=t&&")"!=t&&(o="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:i?"block":"top",stateArg:null,context:new S(i?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||function(t,e){var n=t.next();if(a[n]){var i=a[n](t,e);if(!1!==i)return i}return"@"==n?(t.eatWhile(/[\w\\\-]/),w("def",t.current())):"="==n||("~"==n||"|"==n)&&t.eat("=")?w(null,"compare"):'"'==n||"'"==n?(e.tokenize=C(n),e.tokenize(t,e)):"#"==n?(t.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==n?(t.match(/^\s*\w*/),w("keyword","important")):/\d/.test(n)||"."==n&&t.eat(/\d/)?(t.eatWhile(/[\w.%]/),w("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?w(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?w(null,n):("u"==n||"U"==n)&&t.match(/rl(-prefix)?\(/i)||("d"==n||"D"==n)&&t.match("omain(",!0,!0)||("r"==n||"R"==n)&&t.match("egexp(",!0,!0)?(t.backUp(1),e.tokenize=k,w("property","word")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),w("number","unit")):t.match(/^-[\w\\\-]+/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):t.match(/^\w+-/)?w("meta","meta"):void 0})(t,e);return n&&"object"==typeof n&&(r=n[1],n=n[0]),o=n,"comment"!=r&&(e.state=P[e.state](r,t,e)),o},indent:function(t,e){var n=t.context,i=e&&e.charAt(0),r=n.indent;return"prop"!=n.type||"}"!=i&&")"!=i||(n=n.prev),n.prev&&("}"!=i||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=i||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=i||"at"!=n.type&&"atBlock"!=n.type)||(r=Math.max(0,n.indent-s)):(n=n.prev,r=n.indent)),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=e(n),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(r),s=["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"],a=e(s),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],c=e(l),u=["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=e(u),d=["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"],f=e(d),p=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["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"],m=e(v),y=["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"],b=e(y),x=n.concat(r).concat(s).concat(l).concat(u).concat(d).concat(v).concat(y);function w(t,e){for(var n,i=!1;null!=(n=t.next());){if(i&&"/"==n){e.tokenize=null;break}i="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",x),t.defineMIME("text/css",{documentTypes:i,mediaTypes:o,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:f,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=w,w(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=w,w(t,e)):["operator","operator"]},":":function(t){return!!t.match(/\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=w,w(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:o,mediaFeatures:a,propertyKeywords:h,nonStandardPropertyKeywords:f,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=w,w(t,e))}},name:"css",helperType:"gss"})}(n(6))},function(t,e,n){"use strict";var i=n(0),r=n(63);t.exports=i.Model.extend({defaults:{id:"",content:"",visible:!0,buttons:[],attributes:{}},initialize:function(t){this.btn=this.get("buttons")||[],this.buttons=new r(this.btn),this.set("buttons",this.buttons)}})},function(t,e,n){"use strict";var i=n(0),r=n(155);t.exports=i.Collection.extend({model:r,deactivateAllExceptOne:function(t,e){this.forEach(function(n,i){n!==t&&(n.set("active",!1),e&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(t,e))})},deactivateAll:function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&(t.set("active",!1),t.get("buttons").length&&t.get("buttons").deactivateAll(e))})},disableAllButtons:function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&(t.set("disable",!0),t.get("buttons").length&&t.get("buttons").disableAllButtons(e))})},disableAllButtonsExceptOne:function(t,e){this.forEach(function(n,i){n!==t&&(n.set("disable",!0),e&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(t,e))})}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e
\n
\n '},getInfo:function(){var t=this.pfx,e=this.model,n=e.get("name"),i=e.get("width"),r=e.get("height"),o=e.get("unitDim"),s=i&&r?i+"x"+r+o:"";return'\n
'+(n=n||e.getFilename())+'
\n
'+s+"
\n "},init:function(t){var e=this.pfx;this.className+=" "+e+"asset-image"},onClick:function(){var t=this.config.onClick,e=this.model;this.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),(0,i.isFunction)(t)?t(e):this.updateTarget(this.collection.target)},onDblClick:function(){var t=this.em,e=this.model,n=this.config.onDblClick;(0,i.isFunction)(n)?n(e):(this.updateTarget(this.collection.target),t&&t.get("Modal").close());var r=this.collection.onSelect;(0,i.isFunction)(r)&&r(e)},onRemove:function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)}})},function(t,e,n){"use strict";(function(e){var i,r=n(0),o=(i=r)&&i.__esModule?i:{default:i};t.exports=o.default.View.extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t,this.collection=t.collection;var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.em=e.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(t)},template:function(){var t=this.pfx;return'\n
\n '+this.getPreview()+'\n
\n
\n '+this.getInfo()+'\n
\n
\n ⨯\n
\n '},updateTarget:function(t){t&&t.set&&(t.set("attributes",e.clone(t.get("attributes"))),t.set("src",this.model.get("src")))},getPreview:function(){return""},getInfo:function(){return""},render:function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this}})}).call(this,n(1))},function(t,e,n){"use strict";var i=s(n(1)),r=s(n(0)),o=s(n(47));function s(t){return t&&t.__esModule?t:{default:t}}t.exports=r.default.View.extend({template:i.default.template('\n
\n
<%= title %>
\n <%= multiUpload ? \'multiple\' : \'\' %>/>\n
\n
\n '),events:{},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.target=this.options.globalCollection||{},this.uploadId=this.pfx+"uploadFile",this.disabled=void 0!==e.disableUpload?e.disableUpload:!e.upload&&!e.embedAsBase64,this.multiUpload=void 0===e.multiUpload||e.multiUpload,this.events["change #"+this.uploadId]="uploadFile";var n=e.uploadFile;n?this.uploadFile=n.bind(this):e.embedAsBase64&&(this.uploadFile=this.constructor.embedAsBase64),this.delegateEvents()},onUploadStart:function(){var t=this.config.em;t&&t.trigger("asset:upload:start")},onUploadEnd:function(t){var e=this.config.em;e&&e.trigger("asset:upload:end",t)},onUploadError:function(t){var e=this.config.em;console.error(t),this.onUploadEnd(t),e&&e.trigger("asset:upload:error",t)},onUploadResponse:function(t,e){var n=this.config.em,i=this.config,r=this.target,o=void 0;try{o="string"==typeof t?JSON.parse(t):t}catch(e){o=t}n&&n.trigger("asset:upload:response",o),i.autoAdd&&r&&r.add(o.data,{at:0}),this.onUploadEnd(t),e&&e(o)},uploadFile:function(t,e){var n=this,i=t.dataTransfer?t.dataTransfer.files:t.target.files,r=new FormData,s=this.config,a=s.params;for(var l in a)r.append(l,a[l]);if(this.multiUpload)for(var c=0;c'+i.dropzoneContent+"
"),h(),"draggable"in o&&[o,a].forEach(function(t){t.ondragover=d,t.ondragleave=f,t.ondrop=p})},render:function(){return this.$el.html(this.template({title:this.config.uploadText,uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:this.pfx})),this.initDrop(),this.$el.attr("class",this.pfx+"file-uploader"),this}},{embedAsBase64:function(t,e){var n=this,i=t.dataTransfer?t.dataTransfer.files:t.target.files,r={data:[]};if(FileReader){var o=[],s=/^(.+)\/(.+)$/,a=function(t){var e=new Promise(function(e,n){var i=new FileReader;i.addEventListener("load",function(r){var o=void 0,a=t.name,l=s.exec(t.type);if("image"===(o=l?l[1]:t.type)){var c={src:i.result,name:a,type:o,height:0,width:0},u=new Image;u.addEventListener("error",function(t){n(t)}),u.addEventListener("load",function(){c.height=u.height,c.width=u.width,e(c)}),u.src=c.src}else e(o?{src:i.result,name:a,type:o}:i.result)}),i.addEventListener("error",function(t){n(t)}),i.addEventListener("abort",function(t){n("Aborted")}),i.readAsDataURL(t)});o.push(e)},l=!0,c=!1,u=void 0;try{for(var h,d=i[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){a(h.value)}}catch(t){c=!0,u=t}finally{try{!l&&d.return&&d.return()}finally{if(c)throw u}}Promise.all(o).then(function(t){r.data=t,n.onUploadResponse(r,e)},function(t){n.onUploadError(t)})}else this.onUploadError(new Error("Unsupported platform, FileReader is not defined"))}})},function(t,e,n){"use strict";var i=n(1),r=a(i),o=a(n(0)),s=a(n(69));function a(t){return t&&t.__esModule?t:{default:t}}var l=n(10);t.exports=o.default.Model.extend(s.default).extend({defaults:{selectors:{},selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:0,important:0},initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t||{};var n=e.em,i=this.config.selectors||[];if(this.em=n,n){var r=n.get("SelectorManager"),o=[];i.forEach(function(t){o.push(r.add(t))}),i=o}this.set("selectors",new l(i))},getAtRule:function(){var t=this.get("atRuleType"),e=this.get("mediaText"),n=t?"@"+t:e?"@media":"";return n+(e&&n?" "+e:"")},selectorsToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.em,i=this.get("state"),r=this.get("wrapper"),o=this.get("selectorsAdd"),s=r&&n&&n.getConfig("wrappesIsBody")?"body":this.get("selectors").getFullString(),a=i?":"+i:"";return s&&e.push(""+s+a),o&&!t.skipAdd&&e.push(o),e.join(", ")},getDeclaration:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n=this.selectorsToString(),i=this.styleToString(t),r=this.get("singleAtRule");return(n||r)&&i&&(e=r?i:n+"{"+i+"}"),e},toCSS:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n=this.getAtRule(),i=this.getDeclaration(t);return i&&(e=i),n&&e&&(e=n+"{"+e+"}"),e},toJSON:function(){for(var t=arguments.length,e=Array(t),n=0;n3&&void 0!==arguments[3]?arguments[3]:{},o=e||"",s=n||"",a=i.selectorsAdd||"",l=i.atRuleType||"";t instanceof Array||t.models||(t=[t]);var c=r.default.map(t.models||t,function(t){return t.get("name")}),u=r.default.map(this.get("selectors").models,function(t){return t.get("name")});if(c.length!==u.length)return!1;for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.isString)(e)&&(e=l(e));var i=this.getStyle(),a=r({},e);this.set("style",a,n);var c=(0,s.shallowDiff)(i,a);return(0,o.keys)(c).forEach(function(e){var n=t.em;t.trigger("change:style:"+e),n&&(n.trigger("styleable:change",t,e),n.trigger("styleable:change:"+e,t,e))}),a},addStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof t?t={prop:e}:n=e||{},t=this.extendStyle(t),this.setStyle(t,n)},removeStyle:function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},styleToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.getStyle();for(var i in n){var r=t.important,s=(0,o.isArray)(r)?r.indexOf(i)>=0:r,a=n[i]+(s?" !important":"");a&&e.push(i+":"+a+";")}return e.join("")},getSelectors:function(){return this.get("selectors")||this.get("classes")}}},function(t,e,n){"use strict";t.exports=n(0).View.extend({tagName:"style",initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{};var e=this.model;this.listenTo(e,"change:style change:state change:mediaText",this.render),this.listenTo(e,"destroy remove",this.remove),this.listenTo(e.get("selectors"),"change",this.render)},render:function(){var t=this.model.get("important");return this.el.innerHTML=this.model.toCSS({important:t}),this}})},function(t,e,n){"use strict";var i=n(0);t.exports=i.View.extend({itemView:"",itemsView:"",itemType:"type",initialize:function(t,e){this.config=e||{}},addTo:function(t){this.add(t)},add:function(t,e){var n=e||null,i=this.itemView,r=t.get(this.itemType);this.itemsView&&this.itemsView[r]&&(i=this.itemsView[r]);var o=new i({model:t,config:this.config},this.config).render().el;n?n.appendChild(o):this.$el.append(o)},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.length&&this.collection.each(function(e){this.add(e,t)},this),this.$el.append(t),this}})},function(t,e,n){"use strict";var i,r=n(0),o=(i=r)&&i.__esModule?i:{default:i},s=n(1);t.exports=o.default.View.extend({initialize:function(t){this.opts=t||{},this.config=t.config||{};var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.resetChildren),this.listenTo(e,"remove",this.removeChildren)},removeChildren:function(t){var e=this.config.em,n=t.view;if(n){n.remove.apply(n);var i=n.childrenView;i&&i.stopListening(),e&&(t.get("style-signature")&&e.get("Commands").run("core:component-style-clear",{target:t}),e.trigger("component:remove",t))}},addTo:function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.config.em,i=this.collection.indexOf(t);this.addToCollection(t,null,i),n&&!e.temporary&&n.trigger("component:add",t)},addToCollection:function(t,e,i){this.compView||(this.compView=n(4));for(var r=e||null,o=this.compView,a=this.opts.componentTypes,l=t.get("type"),c=0;c2&&void 0!==arguments[2]?arguments[2]:{}).fromDisable&&this.disableEditing()},onActive:function(t){if(!this.rteEnabled&&this.model.get("editable")){t&&t.stopPropagation&&t.stopPropagation();var e=this.rte;if(e)try{this.activeRte=e.enable(this,this.activeRte)}catch(t){console.error(t)}this.rteEnabled=1,this.toggleEvents(1)}},disableEditing:function(){var t=this.model,e=t.get("editable"),n=this.rte,i={fromDisable:1};if(n&&e){try{n.disable(this,this.activeRte)}catch(t){console.error(t)}var r=this.getChildrenContainer().innerHTML,o=t.get("components");if(o.length&&o.reset(),t.set("content","",i),n.customRte)t.set("content",r,i);else{t.trigger("change:content",t,"",i),o.add(r),o.each(function(t){return function t(e){var n=!["text","default",""].some(function(t){return e.is(t)});e.set({editable:n&&e.get("editable"),highlightable:0,removable:0,draggable:0,copyable:0,selectable:n,hoverable:n,toolbar:""}),e.get("components").each(function(e){return t(e)})}(t)}),o.trigger("resetNavigator")}}this.rteEnabled=0,this.toggleEvents()},onInput:function(t){var e=this.em;e&&e.trigger("change:canvasOffset")},disablePropagation:function(t){t.stopPropagation()},toggleEvents:function(t){var e=t?"on":"off",n={on:i.on,off:i.off};this.em.setEditing(t);var r=[this.el.ownerDocument,document];n.off(r,"mousedown",this.disableEditing),n[e](r,"mousedown",this.disableEditing),this.$el.off("mousedown",this.disablePropagation),this.$el[e]("mousedown",this.disablePropagation)}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return(n=i({},r.default,e)).stylePrefix=e.pStylePrefix,t=n.em,this},getConfig:function(){return n},onLoad:function(){e=new o.default({level:0,config:n,opened:n.opened||{},model:t.get("DomComponents").getWrapper()}),t&&t.on("component:selected",this.componentChanged),this.componentChanged()},postRender:function(){var t=n.appendTo,e=n.root;(e&&this.setRoot(e),t)&&((0,s.isElement)(t)?t:document.querySelector(t)).appendChild(this.render())},setRoot:function(t){return e.setRoot(t),this},getRoot:function(){return e.model},getAll:function(){return e},componentChanged:function(e){if(!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).fromLayers){var i=t.get("opened"),r=t.getSelected(),o=n.scrollLayers,s=r&&r.collection?r.collection.parent:null;for(var a in i)i[a].set("open",0);for(;s;)s.set("open",1),i[s.cid]=s,s=s.collection?s.collection.parent:null;if(r&&o){var l=r.viewLayer&&r.viewLayer.el;l&&l.scrollIntoView(o)}}},render:function(){return e.render().el}}}},function(t,e,n){"use strict";var i,r=n(1),o=n(2),s=n(0),a=(i=s)&&i.__esModule?i:{default:i};var l=n(4),c=a.default.$,u=void 0;t.exports=a.default.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(t){var e=this.pfx,n=this.ppfx,i=this.config.hidable,r=this.countChildren(t),o=r?"":this.clsNoChild,s=this.clsTitle+" "+o,a=this.clsTitleC+" "+n+"one-bg",l=this.clsCaret+" fa fa-chevron-right",c=this.inputNameCls+" "+n+"no-app",u=30+10*(this.level+1)+"px",h=t.getName();return"\n "+(i?'':"")+'\n
\n
\n
\n \n '+t.getIcon()+'\n '+h+'\n
\n
\n
\n
'+(r||"")+'
\n
\n \n
\n
'},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=t,this.level=t.level,this.config=t.config,this.em=t.config.em,this.ppfx=this.em.get("Config").stylePrefix,this.sorter=t.sorter||"",this.pfx=this.config.stylePrefix;var e=this.pfx,n=this.ppfx,i=this.model,r=i.get("components");i.set("open",!1),this.listenTo(r,"remove add reset",this.checkChildren),this.listenTo(i,"change:status",this.updateStatus),this.listenTo(i,"change:open",this.updateOpening),this.listenTo(i,"change:style:display",this.updateVisibility),this.className=e+"layer no-select "+n+"two-color",this.inputNameCls=n+"layer-name",this.clsTitleC=e+"layer-title-c",this.clsTitle=e+"layer-title",this.clsCaret=e+"layer-caret",this.clsCount=e+"layer-count",this.clsMove=e+"layer-move",this.clsChildren=e+"layer-children",this.clsNoChild=e+"layer-no-chld",this.$el.data("model",i),this.$el.data("collection",r),i.viewLayer=this},getVisibilityEl:function(){return this.eyeEl||(this.eyeEl=this.$el.children("."+this.pfx+"layer-vis")),this.eyeEl},updateVisibility:function(){var t=this.pfx+"layer-hidden",e="none"==this.model.getStyle().display?"addClass":"removeClass";this.$el[e](t),this.getVisibilityEl()[e]("fa-eye-slash")},toggleVisibility:function(t){t&&t.stopPropagation();var e=this.model,n=e.getStyle();"none"==n.display?delete n.display:n.display="none",e.setStyle(n)},handleEdit:function(t){t&&t.stopPropagation();var e=this.em,n=this.getInputName();n.contentEditable=!0,n.focus(),e&&e.setEditing(1)},handleEditEnd:function(t){t&&t.stopPropagation();var e=this.em,n=this.getInputName(),i=n.textContent;n.contentEditable=!1,this.model.set({name:i}),e&&e.setEditing(0)},getInputName:function(){return this.inputName||(this.inputName=this.el.querySelector("."+this.inputNameCls)),this.inputName},updateOpening:function(){var t=this.opt.opened||{},e=this.model;e.get("open")?(this.$el.addClass("open"),this.getCaret().addClass("fa-chevron-down"),t[e.cid]=e):(this.$el.removeClass("open"),this.getCaret().removeClass("fa-chevron-down"),delete t[e.cid])},toggleOpening:function(t){t.stopPropagation(),this.model.get("components").length&&this.model.set("open",!this.model.get("open"))},handleSelect:function(t){t.stopPropagation();var e=this.em,n=this.config;if(e){var i=this.model;e.setSelected(i,{fromLayers:1});var r=n.scrollCanvas;r&&e.get("Canvas").scrollTo(i,r)}},handleHover:function(t){t.stopPropagation();var e=this.em,n=this.config,i=this.model;e&&n.showHover&&e.setHovered(i,{fromLayers:1})},startSort:function(t){t.stopPropagation();var e=this.sorter;t.button&&0!==t.button||e&&e.startSort(t.target)},freeze:function(){this.$el.addClass(this.pfx+"opac50"),this.model.set("open",0)},unfreeze:function(){this.$el.removeClass(this.pfx+"opac50")},updateStatus:function(t){l.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover}])},isVisible:function(){var t=this.model.get("style").display;if(!t||"none"!=t)return 1},checkChildren:function(){var t=this.model,e=this.countChildren(t),n=(this.pfx,this.clsNoChild),i=this.$el.children("."+this.clsTitleC).children("."+this.clsTitle);this.cnt||(this.cnt=this.$el.children("."+this.clsCount)),e?(i.removeClass(n),this.cnt.html(e)):(i.addClass(n),this.cnt.empty(),t.set("open",0))},countChildren:function(t){var e=0;return t.get("components").each(function(t){var n=this.opt.isCountable,i=this.config.hideTextnode;n&&!n(t,i)||e++},this),e},getCaret:function(){if(!this.caret||!this.caret.length){this.pfx;this.caret=this.$el.children("."+this.clsTitleC).find("."+this.clsCaret)}return this.caret},setRoot:function(t){t=(0,r.isString)(t)?this.em.getWrapper().find(t)[0]:t;var e=(0,o.getModel)(t,c);e&&(this.stopListening(),this.model=e,this.initialize(this.opt),this.render())},render:function(){var t=this.model,e=this.pfx,i=this.isVisible(),o=this.$el.empty(),s=this.level+1;(0,r.isUndefined)(u)&&(u=n(213));var a=new u({collection:t.get("components"),config:this.config,sorter:this.sorter,opened:this.opt.opened,parent:t,level:s}).render().$el;return this.config.showWrapper||1!==s?(o.html(this.template(t)),o.find("."+this.clsChildren).append(a)):o.append(a),t.get("draggable")&&this.config.sortable||o.children("."+this.clsMove).remove(),!i&&(this.className+=" "+e+"hide"),o.attr("class",this.className),this.updateOpening(),this.updateStatus(),this.updateVisibility(),this}})},function(t,e,n){"use strict";t.exports={run:function(t){t.DomComponents.clear(),t.CssComposer.clear()}}},function(t,e,n){"use strict";var i=n(1);t.exports={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.getModel().isEditing()&&!t.Canvas.isInputFocused()){var r=n.component||t.getSelectedAll();return r=(0,i.isArray)(r)?[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=0?r:t)}),e.length&&t.select(e)}}}},function(t,e,n){"use strict";var i=n(1);t.exports={run:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).target,r=t.DomComponents,o=n.get("type"),s=r.getWrapper().find('[data-gjs-type="'+o+'"]').length,a=[];if(!s){var l=t.CssComposer.getAll(),c=n.get("style-signature");c=(0,i.isArray)(c)?c:[c],l.forEach(function(t){var e=t.selectorsToString();c.forEach(function(n){n&&e.indexOf(n)>=0&&a.push(t)})}),l.remove(a)}return a}}},function(t,e,n){"use strict";t.exports={run:function(t){var e=t.getModel(),n=[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{},e=t.container;if(!e)throw new Error("'container' is required");(t=s({},o,t)).el=(0,c.isElement)(e)?e:document.querySelector(e);var n=new l.default(t).init();return t.plugins.forEach(function(e){var r=i.get(e),o=t.pluginsOpts[e]||{};if(!r){var s=window[e];r=s&&s.default?s.default:s}r?r(n,o):(0,c.isFunction)(e)?e(n,o):console.warn("Plugin "+e+" not found")}),n.getModel().loadOnStart(),t.autorender&&n.render(),r.push(n),n}})},function(t,e,n){"use strict";var i,r=n(13),o=(i=r)&&i.__esModule?i:{default:i};t.exports=function(t){var e=t||{},i=n(89),r=n(90),s=n(237);for(var a in i)a in e||(e[a]=i[a]);e.pStylePrefix=e.stylePrefix;var l=new r(e),c=new s({model:l,config:e});return{$:o.default,editor:l,DomComponents:l.get("DomComponents"),LayerManager:l.get("LayerManager"),CssComposer:l.get("CssComposer"),StorageManager:l.get("StorageManager"),AssetManager:l.get("AssetManager"),BlockManager:l.get("BlockManager"),TraitManager:l.get("TraitManager"),SelectorManager:l.get("SelectorManager"),CodeManager:l.get("CodeManager"),Commands:l.get("Commands"),Keymaps:l.get("Keymaps"),Modal:l.get("Modal"),Panels:l.get("Panels"),StyleManager:l.get("StyleManager"),Canvas:l.get("Canvas"),UndoManager:l.get("UndoManager"),DeviceManager:l.get("DeviceManager"),RichTextEditor:l.get("RichTextEditor"),Parser:l.get("Parser"),Utils:l.get("Utils"),Config:l.get("Config"),init:function(){return l.init(this),this},getConfig:function(t){return l.getConfig(t)},getHtml:function(t){return l.getHtml(t)},getCss:function(t){return l.getCss(t)},getJs:function(){return l.getJs()},getComponents:function(){return l.get("DomComponents").getComponents()},getWrapper:function(){return l.get("DomComponents").getWrapper()},setComponents:function(t){return l.setComponents(t),this},addComponents:function(t,e){return this.getComponents().add(t,e)},getStyle:function(){return l.get("CssComposer").getAll()},setStyle:function(t){return l.setStyle(t),this},getSelected:function(){return l.getSelected()},getSelectedAll:function(){return l.getSelectedAll()},getSelectedToStyle:function(){var t=l.getSelected();if(t)return this.StyleManager.getModelToStyle(t)},select:function(t){return l.setSelected(t),this},selectAdd:function(t){return l.addSelected(t),this},selectRemove:function(t){return l.removeSelected(t),this},selectToggle:function(t){return l.toggleSelected(t),this},setDevice:function(t){return l.set("device",t),this},getDevice:function(){return l.get("device")},runCommand:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l.get("Commands").run(t,e)},stopCommand:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l.get("Commands").stop(t,e)},store:function(t){return l.store(t)},load:function(t){return l.load(t)},getContainer:function(){return e.el},getDirtyCount:function(){return l.getDirtyCount()},refresh:function(){l.refreshCanvas()},setCustomRte:function(t){this.RichTextEditor.customRte=t},setCustomParserCss:function(t){return this.Parser.getConfig().parserCss=t,this},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l.log(t,e),this},on:function(t,e){return l.on(t,e),this},once:function(t,e){return l.once(t,e),this},off:function(t,e){return l.off(t,e),this},trigger:function(t){return l.trigger.apply(l,arguments),this},destroy:function(){return l.destroyAll()},getEl:function(){return c.el},getModel:function(){return l},render:function(){var t=this;return l.on("loaded",function(){t.UndoManager.clear(),l.get("modules").forEach(function(t){t.postRender&&t.postRender(c)})}),c.render(),c.el}}}},function(t,e,n){"use strict";t.exports={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, #wrapper {\n min-height: 100%;\n }\n body {\n margin: 0;\n height: 100%;\n background-color: #fff\n }\n #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,wrappesIsBody:1,avoidInlineStyle:0,avoidDefaults:0,clearStyles:0,el:"",undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},rte:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{devices:[{name:"Desktop",width:""},{name:"Tablet",width:"768px",widthMedia:"992px"},{name:"Mobile landscape",width:"568px",widthMedia:"768px"},{name:"Mobile portrait",width:"320px",widthMedia:"480px"}]},styleManager:{sectors:[{name:"General",open:!1,buildProps:["float","display","position","top","right","left","bottom"]},{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}},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.config=e,this.set("Config",e),this.set("modules",[]),this.set("toLoad",[]),this.set("storables",[]);var n=e.el,i=e.log,o=!0===i?(0,r.keys)(h):(0,r.isArray)(i)?i:[];n&&e.fromElement&&(this.config.components=n.innerHTML),this.attrsOrig=n?(0,r.toArray)(n.attributes).reduce(function(t,e){return t[e.nodeName]=e.nodeValue,t},{}):"",s.forEach(function(e){return t.loadModule(e)}),this.on("change:componentHovered",this.componentHovered,this),this.on("change:changesCount",this.updateChanges,this),o.forEach(function(e){return t.listenLog(e)}),[{from:"change:selectedComponent",to:"component:toggled"}].forEach(function(e){var n=e.from,i=e.to;t.listenTo(t,n,function(){for(var e=arguments.length,r=Array(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=this.get("StorageManager");this.get("toLoad").forEach(function(t){t.onLoad()});var i=function(){t.get("modules").forEach(function(e){return e.postLoad&&e.postLoad(t)}),e&&e()};n&&n.canAutoload()?this.load(i):i()},updateChanges:function(){var t=this.get("StorageManager"),e=this.get("changesCount");this.config.noticeOnUnload&&(window.onbeforeunload=e?function(t){return 1}:null),t.isAutosave()&&e>=t.getStepsBeforeSave()&&this.store()},loadModule:function(t){var e=this.config,n=new t,r=e[n.name.charAt(0).toLowerCase()+n.name.slice(1)]||e[n.name]||{};r.pStylePrefix=e.pStylePrefix||"";var o=this.get("StorageManager");if(n.storageKey&&n.store&&n.load&&o){r.stm=o;var s=this.get("storables");s.push(n),this.set("storables",s)}return r.em=this,n.init(i({},r)),!n.private&&this.set(n.name,n),n.onLoad&&this.get("toLoad").push(n),this.get("modules").push(n),this},init:function(t){this.set("Editor",t)},getEditor:function(){return this.get("Editor")},handleUpdates:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.temporary||(c&&clearInterval(c),c=setTimeout(function(){i.avoidStore||n.set("changesCount",n.get("changesCount")+1,i)},0))},componentHovered:function(t,e,n){var i=this.previous("componentHovered");i&&this.trigger("component:unhovered",i,n),e&&this.trigger("component:hovered",e,n)},getSelected:function(){return this.get("selected").last()},getSelectedAll:function(){return this.get("selected").models},setSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,r.isArray)(t),s=i?t:[t],a=this.get("selected");i&&this.removeSelected(a.filter(function(t){return!(0,r.contains)(s,t)})),s.forEach(function(t){var r=(0,o.getModel)(t,u);r&&!r.get("selectable")||(!i&&e.removeSelected(a.filter(function(t){return t!==r})),e.addSelected(r,n))})},addSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,o.getModel)(t,u);((0,r.isArray)(i)?i:[i]).forEach(function(t){if(!t||t.get("selectable")){var i=e.get("selected");n.forceChange&&i.remove(t,n),i.push(t,n)}})},removeSelected:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.get("selected").remove((0,o.getModel)(t,u),e)},toggleSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,o.getModel)(t,u);((0,r.isArray)(i)?i:[i]).forEach(function(t){e.get("selected").contains(t)?e.removeSelected(t,n):e.addSelected(t,n)})},setHovered:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,o.getModel)(t,u);n&&!n.get("hoverable")||(e.forceChange&&this.set("componentHovered",""),this.set("componentHovered",n,e))},setComponents:function(t){return this.get("DomComponents").setComponents(t)},getComponents:function(){var t=this.get("DomComponents"),e=this.get("CodeManager");if(t&&e){var n=t.getComponents();return e.getCode(n,"json")}},setStyle:function(t){for(var e=this.get("CssComposer").getAll(),n=0,i=e.length;n"+i+"<\/script>":""},getCss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.config,n=e.wrappesIsBody,i=t.avoidProtected,o=(0,r.isUndefined)(t.keepUnusedStyles)?e.keepUnusedStyles:t.keepUnusedStyles,s=this.get("CssComposer"),a=this.get("DomComponents").getComponent();return(i?"":e.protectedCss)+this.get("CodeManager").getCode(a,"css",{cssc:s,wrappesIsBody:n,keepUnusedStyles:o})},getJs:function(){var t=this.get("DomComponents").getWrapper();return this.get("CodeManager").getCode(t,"js").trim()},store:function(t){var e=this,n=this.get("StorageManager"),i={};if(n)return this.get("storables").forEach(function(t){var e=t.store(1);for(var n in e)i[n]=e[n]}),n.store(i,function(n){t&&t(n),e.set("changesCount",0),e.trigger("storage:store",i)}),i},load:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.getCacheLoad(1,function(n){t.get("storables").forEach(function(t){return t.load(n)}),e&&e(n)})},getCacheLoad:function(t,e){var n=this,i=t?1:0;if(this.cacheLoad&&!i)return this.cacheLoad;var r=this.get("StorageManager"),o=[];if(!r)return{};this.get("storables").forEach(function(t){var e=t.storageKey;((e="function"==typeof e?e():e)instanceof Array?e:[e]).forEach(function(t){o.push(t)})}),r.load(o,function(t){n.cacheLoad=t,e&&e(t),setTimeout(function(){return n.trigger("storage:load",t)},0)})},getDeviceModel:function(){var t=this.get("device");return this.get("DeviceManager").get(t)},runDefault:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get("Commands").get(this.config.defaultCommand);e&&!this.defaultRunning&&(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=1)},stopDefault:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get("Commands").get(this.config.defaultCommand);e&&(e.stop(this,this,t),this.defaultRunning=0)},refreshCanvas:function(){this.set("canvasOffset",this.get("Canvas").getOffset())},clearSelection:function(t){(t||window).getSelection().removeAllRanges()},getCurrentMedia:function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,i=t.devicePreviewMode,r=e&&e.get("widthMedia");return e&&r&&!i?"("+n+": "+r+")":""},getWrapper:function(){return this.get("DomComponents").getWrapper()},getDirtyCount:function(){return this.get("changesCount")},destroyAll:function(){var t=this.attributes,e=t.DomComponents,n=t.CssComposer,i=t.UndoManager,r=t.Panels,o=t.Canvas,s=t.Keymaps;e.clear(),n.clear(),i.clear().removeAll(),r.getPanels().reset(),o.getCanvasView().remove(),s.removeAll(),this.view.remove(),this.stopListening(),u(this.config.el).empty().attr(this.attrsOrig)},setEditing:function(t){return this.set("editing",t),this},isEditing:function(){return!!this.get("editing")},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.ns,i=e.level,r=void 0===i?"debug":i;if(this.trigger("log",t,e),r&&this.trigger("log:"+r,t,e),n){var o="log-"+n;this.trigger(o,t,e),r&&this.trigger(o+":"+r,t,e)}},logInfo:function(t,e){this.log(t,i({},e,{level:"info"}))},logWarning:function(t,e){this.log(t,i({},e,{level:"warning"}))},logError:function(t,e){this.log(t,i({},e,{level:"error"}))},data:function(t,e,n){if(t["_gjs-data"]||(t["_gjs-data"]={}),(0,r.isUndefined)(n))return t["_gjs-data"][e];t["_gjs-data"][e]=n}})},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";t.exports=function(){return{name:"Utils",init:function(){return this},Sorter:n(93),Resizer:n(94),Dragger:n(95)}}},function(t,e,n){"use strict";(function(e){var i,r=Object.assign||function(t){for(var e=1;es+c-10||ra+l-10)return 1},getCurrentPos:function(){var t=this.eventMove;return{x:t.pageX||0,y:t.pageY||0}},getDim:function(t){var e,n,i,r;if(this.canvasRelative&&this.em){var o=this.em.get("Canvas").getElementPos(t),s=window.getComputedStyle(t),a=parseFloat(s.marginTop),l=parseFloat(s.marginBottom),c=parseFloat(s.marginRight),u=parseFloat(s.marginLeft);e=o.top-a,n=o.left-u,i=o.height+a+l,r=o.width+u+c}else{var h=this.offset(t);e=this.relative?t.offsetTop:h.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:h.left-(this.wmargin?-1:1)*this.elL,i=t.offsetHeight,r=t.offsetWidth}return[e,n,i,r]},getChildrenDim:function(t){var e=[];if(!t)return e;var n=this.getTargetModel(t);n&&n.view&&!this.ignoreViewChildren&&(t=n.view.getChildrenContainer());for(var i=t.children,r=0,o=i.length;rs||s>a+c-r||l+r>o||o>l+u-r)&&(i=1),!!i},findPosition:function(t,e,n){for(var i={index:0,method:"before"},r=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=t.length;do||a&&c>=a||r&&s0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setOptions(e),(0,r.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop"),this}return i(t,[{key:"getConfig",value:function(){return this.opts}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=(0,r.defaults)(t,s),this.setup()}},{key:"setup",value:function(){var t=this.opts,e=t.prefix||"",n=t.appendTo||document.body,i=this.container;for(i||((i=document.createElement("div")).className=e+"resizer-c",n.appendChild(i),this.container=i);i.firstChild;)i.removeChild(i.firstChild);var r={};for(var o in["tl","tc","tr","cl","cr","bl","bc","br"].forEach(function(e){return r[e]=t[e]?function(t,e){var n=e.prefix||"",i=document.createElement("i");return i.className=n+"resizer-h "+n+"resizer-h-"+t,i.setAttribute("data-"+n+"handler",t),i}(e,t):""}),r){var s=r[o];s&&i.appendChild(s)}this.handlers=r,this.mousePosFetcher=t.mousePosFetcher,this.updateTarget=t.updateTarget,this.posFetcher=t.posFetcher,this.onStart=t.onStart,this.onMove=t.onMove,this.onEnd=t.onEnd}},{key:"toggleFrames",value:function(t){if(this.opts.silentFrames){var e=document.querySelectorAll("iframe");(0,r.each)(e,function(e){return e.style.pointerEvents=t?"none":""})}}},{key:"isHandler",value:function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1}},{key:"getFocusedEl",value:function(){return this.el}},{key:"getDocumentEl",value:function(){return[this.el.ownerDocument,document]}},{key:"getElementPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.posFetcher||"";return n?n(t,e):function(t,e){var n=e||window,i=t.getBoundingClientRect();return{left:i.left+n.pageXOffset,top:i.top+n.pageYOffset,width:i.width,height:i.height}}(t)}},{key:"focus",value:function(t){if(!t||t!==this.el){this.el=t;var e=this.opts,n=this.getElementPos(t,{target:"container"}),i=this.container.style;e.avoidContainerUpdate||(i.left=n.left+"px",i.top=n.top+"px",i.width=n.width+"px",i.height=n.height+"px",i.display="block"),(0,o.on)(this.getDocumentEl(),"mousedown",this.handleMouseDown)}}},{key:"blur",value:function(){this.container.style.display="none",this.el&&((0,o.off)(this.getDocumentEl(),"mousedown",this.handleMouseDown),this.el=null)}},{key:"start",value:function(t){if(0===t.button){t.preventDefault(),t.stopPropagation();var e=this.el,n=this.opts||{},i="data-"+n.prefix+"handler",s=this.getElementPos(e,{target:"el"});this.handlerAttr=t.target.getAttribute(i),this.clickedHandler=t.target,this.startDim={t:s.top,l:s.left,w:s.width,h:s.height},this.rectDim={t:s.top,l:s.left,w:s.width,h:s.height},this.startPos={x:t.clientX,y:t.clientY};var a=this.getDocumentEl();(0,o.on)(a,"mousemove",this.move),(0,o.on)(a,"keydown",this.handleKeyDown),(0,o.on)(a,"mouseup",this.stop),(0,r.isFunction)(this.onStart)&&this.onStart(t,{docs:a,config:n,el:e,resizer:this}),this.toggleFrames(1),this.move(t)}}},{key:"move",value:function(t){var e=this.onMove,n=this.mousePosFetcher,i=n?n(t):{x:t.clientX,y:t.clientY};this.currentPos=i,this.delta={x:i.x-this.startPos.x,y:i.y-this.startPos.y},this.keys={shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey},this.rectDim=this.calc(this),this.updateRect(0),e&&e(t),0===t.which&&this.stop(t)}},{key:"stop",value:function(t){var e=this.opts,n=this.getDocumentEl();(0,o.off)(n,"mousemove",this.move),(0,o.off)(n,"keydown",this.handleKeyDown),(0,o.off)(n,"mouseup",this.stop),this.updateRect(1),this.toggleFrames(),(0,r.isFunction)(this.onEnd)&&this.onEnd(t,{docs:n,config:e})}},{key:"updateRect",value:function(t){var e=this.el,n=this.opts,i=this.rectDim,o=this.container.style,s=this.updateTarget,a=this.getSelectedHandler(),l=n.unitHeight,c=n.unitWidth,u=n.keyWidth,h=n.keyHeight;if((0,r.isFunction)(s))s(e,i,{store:t,selectedHandler:a,resizer:this,config:n});else{var d=e.style;d[u]=i.w+c,d[h]=i.h+l}var f=this.getElementPos(e,{target:"container"});n.avoidContainerUpdate||(o.left=f.left+"px",o.top=f.top+"px",o.width=f.width+"px",o.height=f.height+"px")}},{key:"getSelectedHandler",value:function(){var t=this.handlers;if(this.selectedHandler)for(var e in t)if(t[e]===this.selectedHandler)return e}},{key:"handleKeyDown",value:function(t){27===t.keyCode&&(this.rectDim=this.startDim,this.stop(t))}},{key:"handleMouseDown",value:function(t){var e=t.target;this.isHandler(e)?(this.selectedHandler=e,this.start(t)):e!==this.el&&(this.selectedHandler="",this.blur())}},{key:"calc",value:function(t){var e=void 0,n=this.opts||{},i=n.step,r=this.startDim,s=n.minDim,a=n.maxDim,l=t.delta.x,c=t.delta.y,u=r.w,h=r.h,d={t:0,l:0,w:u,h:h};if(t){var f=t.handlerAttr;~f.indexOf("r")&&(e=(0,o.normalizeFloat)(u+l*i,i),e=Math.max(s,e),a&&(e=Math.min(a,e)),d.w=e),~f.indexOf("b")&&(e=(0,o.normalizeFloat)(h+c*i,i),e=Math.max(s,e),a&&(e=Math.min(a,e)),d.h=e),~f.indexOf("l")&&(e=(0,o.normalizeFloat)(u-l*i,i),e=Math.max(s,e),a&&(e=Math.min(a,e)),d.w=e),~f.indexOf("t")&&(e=(0,o.normalizeFloat)(h-c*i,i),e=Math.max(s,e),a&&(e=Math.min(a,e)),d.h=e);var p=n.ratioDefault?!t.keys.shift:t.keys.shift;if(f.indexOf("c")<0&&p){var g=r.w/r.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=r.w-d.w),~f.indexOf("t")&&(d.t=r.h-d.h),d}}}]),t}();t.exports={init:function(t){return new a(t)}}},function(t,e,n){"use strict";var i,r=n(0);var o=((i=r)&&i.__esModule?i:{default:i}).default.$;t.exports={setKey:function(t,e){},getElementRect:function(t){var e=this.opts.posFetcher||"";return e?e(t,{avoidFrameOffset:1}):function(t,e){var n=e||window,i=t.getBoundingClientRect();return{left:i.left+n.pageXOffset,top:i.top+n.pageYOffset,width:i.width,height:i.height}}(t)},init:function(t){return this.setOptions(t),this.handleMouseDown=this.handleMouseDown.bind(this),this.drag=this.drag.bind(this),this.move=this.move.bind(this),this.stop=this.stop.bind(this),this.setKey("up, right, down, left",this.handleKey),this},setOptions:function(t){this.opts=t||{}},focus:function(t){if(!t||t!==this.el){this.getDocumentEl(t),this.blur(),this.el=t,this.handlers=this.opts.dragHandlers||[t];var e=this.getElementRect(t);this.elRect=e,this.startTop=e.top,this.startLeft=e.left,this.getDocumentEl().on("mousedown",this.handleMouseDown)}},blur:function(){this.getDocumentEl().off("mousedown",this.handleMouseDown),this.el=null},start:function(t){this.startPos=this.getMousePos(t);var e=this.getDocumentEl();e.on("mousemove",this.drag),e.on("mouseup",this.stop);var n=this.opts.onStart;"function"==typeof n&&n(t,{docs:e,el:this.el,start:this.startPos,elRect:this.elRect}),this.drag(t)},stop:function(t){var e=this.getDocumentEl();e.off("mousemove",this.drag),e.off("mouseup",this.stop),this.lockedAxis=null;var n=this.opts.onEnd;"function"==typeof n&&n(t,{docs:e,delta:this.delta,end:{x:this.startLeft+this.delta.x,y:this.startTop+this.delta.y}})},handleMouseDown:function(t){var e=t.target;this.isHandler(e)&&this.start(t)},isHandler:function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1},handleKey:function(t,e){switch(e.shortcut){case"up":this.move(0,-1);break;case"right":this.move(1,0);break;case"down":this.move(0,1);break;case"left":this.move(-1,0)}},getDocumentEl:function(t){t=t||this.el;if(!this.$doc){var e=[document];t&&e.push(t.ownerDocument),this.$doc=o(e)}return this.$doc},getMousePos:function(t){var e=this.opts.mousePosFetcher;return e?e(t):{x:t.clientX,y:t.clientY}},drag:function(t){var e=this.lockedAxis,n=this.getMousePos(t),i={x:n.x-this.startPos.x,y:n.y-this.startPos.y};if(t.shiftKey){if(!e){var r=i.x,o=i.y,s=Math.abs(r),a=Math.abs(o);o>=s||o<=-s?e="x":(r>a||r<-a)&&(e="y")}}else e=null;"x"===e&&(i.x=this.startPos.x),"y"===e&&(i.y=this.startPos.y),this.lockedAxis=e,this.delta=i,this.move(i.x,i.y);var l=this.opts.onDrag;"function"==typeof l&&l(t,{delta:i,current:{x:this.startLeft+i.x,y:this.startTop+i.y},lockedAxis:e}),0===t.which&&this.stop(t)},move:function(t,e){this.moveX(t),this.moveY(e)},moveX:function(t){var e=this.el,n=(this.opts,this.startLeft+t),i=this.opts.setX;"function"==typeof i?i(n,{el:e,start:this.startLeft,delta:t}):e.style.left=n+"px"},moveY:function(t){var e=this.el,n=(this.opts,this.startTop+t),i=this.opts.setY;"function"==typeof i?i(n,{el:e,start:this.startTop,delta:t}):e.style.top=n+"px"}}},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return e=r({},a,n),t=e.em,this.em=t,this},onLoad:function(){var t=e.defaults;for(var n in t){var i=t[n];this.add(n,i.keys,i.handler)}},add:function(t,e,r){var a=this.em,l=a.get("Commands"),c=a.getEditor(),u={id:t,keys:e,handler:r};return n[t]&&this.remove(t),n[t]=u,s(e,function(e,n){"object"==(void 0===(r=(0,o.isString)(r)?l.get(r):r)?"undefined":i(r))?r.run(c):r(c);var s=[t,n.shortcut,e];a.trigger.apply(a,["keymap:emit"].concat(s)),a.trigger.apply(a,["keymap:emit:"+t].concat(s))}),a.trigger("keymap:add",u),u},get:function(t){return n[t]},getAll:function(){return n},remove:function(t){var e=this.em,i=this.get(t);if(i)return delete n[t],s.unbind(i.keys),e&&e.trigger("keymap:remove",i),i},removeAll:function(){var t=this;return Object.keys(n).forEach(function(e){return t.remove(e)}),this}}}},function(t,e,n){"use strict";var i,r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};n=r({},a,o),t=n.em,this.em=t,(e=new s.default({track:!0,register:[]})).changeUndoType("change",{condition:!1}),e.changeUndoType("add",{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:e,before:void 0,after:t,options:r({},n)}}}),e.changeUndoType("remove",{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:e,before:t,after:void 0,options:r({},n)}}});var l={on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!i&&(i=t.previousAttributes()),!n.avoidStore){var r={object:t,before:i,after:t.toJSON()};return i=null,r}},undo:function(t,e,n,i){t.set(e)},redo:function(t,e,n,i){t.set(n)}};return["style","attributes","content","src"].forEach(function(t){return e.addUndoType("change:"+t,l)}),e.on("undo redo",function(){return t.trigger("component:toggled change:canvasOffset")}),["undo","redo"].forEach(function(n){return e.on(n,function(){return t.trigger(n)})}),this},getConfig:function(){return n},add:function(t){return e.register(t),this},remove:function(t){return e.unregister(t),this},removeAll:function(){return e.unregisterAll(),this},start:function(){return e.startTracking(),this},stop:function(){return e.stopTracking(),this},undo:function(){return!t.isEditing()&&e.undo(1),this},undoAll:function(){return e.undoAll(),this},redo:function(){return!t.isEditing()&&e.redo(1),this},redoAll:function(){return e.redoAll(),this},hasUndo:function(){return e.isAvailable("undo")},hasRedo:function(){return e.isAvailable("redo")},getStack:function(){return e.stack},clear:function(){return e.clear(),this},getInstance:function(){return e}}}},function(t,e,n){var i,r,o; +/*! cash-dom 1.3.7, https://github.com/kenwheeler/cash @license MIT */void 0===(r="function"==typeof(i=function(){var t,e=document,n=window,i=Array.prototype,r=i.slice,o=i.filter,s=i.push,a=function(){},l=function(t){return"function"==typeof t&&t.call},c=function(t){return"string"==typeof t},u=/^#[\w-]*$/,h=/^\.[\w-]*$/,d=/<.+>/,f=/^\w+$/;function p(t,n){n=n||e;var i=h.test(t)?n.getElementsByClassName(t.slice(1)):f.test(t)?n.getElementsByTagName(t):n.querySelectorAll(t);return i}function g(n){if(!t){var i=(t=e.implementation.createHTMLDocument(null)).createElement("base");i.href=e.location.href,t.head.appendChild(i)}return t.body.innerHTML=n,t.body.childNodes}function v(t){"loading"!==e.readyState?setTimeout(t):e.addEventListener("DOMContentLoaded",t)}function m(t,i){if(!t)return this;if(t.cash&&t!==n)return t;var r,o=t,s=0;if(c(t))o=u.test(t)?e.getElementById(t.slice(1)):d.test(t)?g(t):p(t,i);else if(l(t))return v(t),this;if(!o)return this;if(o.nodeType||o===n)this[0]=o,this.length=1;else for(r=this.length=o.length;s=0&&o.splice(i,1)):(x(o,function(n){t.removeEventListener(e,n)}),o=[]))}function z(t,e){return"&"+encodeURIComponent(t)+"="+encodeURIComponent(e).replace(/%20/g,"+")}function V(t){var e=t.type;if(!e)return null;switch(e.toLowerCase()){case"select-one":return function(t){var e=t.selectedIndex;return e>=0?t.options[e].value:null}(t);case"select-multiple":return function(t){var e=[];return x(t.options,function(t){t.selected&&e.push(t.value)}),e.length?e:null}(t);case"radio":case"checkbox":return t.checked?t.value:null;default:return t.value?t.value:null}}function H(t,e,n){var i=c(e);i||!e.length?x(t,i?function(t){return t.insertAdjacentHTML(n?"afterbegin":"beforeend",e)}:function(t,i){return function(t,e,n){if(n){var i=t.childNodes[0];t.insertBefore(e,i)}else t.appendChild(e)}(t,0===i?e:e.cloneNode(!0),n)}):x(e,function(e){return H(t,e,n)})}y.prefixedProp=F,y.camelCase=I,b.extend({css:function(t,e){if(c(t))return t=F(t),arguments.length>1?this.each(function(n){return n.style[t]=e}):n.getComputedStyle(this[0])[t];for(var i in t)this.css(i,t[i]);return this}}),x(["Width","Height"],function(t){var e=t.toLowerCase();b[e]=function(){return this[0].getBoundingClientRect()[e]},b["inner"+t]=function(){return this[0]["client"+t]},b["outer"+t]=function(e){return this[0]["offset"+t]+(e?j(this,"margin"+("Width"===t?"Left":"Top"))+j(this,"margin"+("Width"===t?"Right":"Bottom")):0)}}),b.extend({off:function(t,e){return this.each(function(n){return R(n,t,e)})},on:function(t,e,n,i){var r;if(!c(t)){for(var o in t)this.on(o,e,t[o]);return this}return l(e)&&(n=e,e=null),"ready"===t?(v(n),this):(e&&(r=n,n=function(t){for(var n=t.target;!w(n,e);){if(n===this)return n=!1;n=n.parentNode}n&&r.call(n,t)}),this.each(function(e){var r=n;i&&(r=function(){n.apply(this,arguments),R(e,t,r)}),function(t,e,n){var i=M(t,"_cashEvents")||E(t,"_cashEvents",{});i[e]=i[e]||[],i[e].push(n),t.addEventListener(e,n)}(e,t,r)}))},one:function(t,e,n){return this.on(t,e,n,!0)},ready:v,trigger:function(t,n){var i=e.createEvent("HTMLEvents");return i.data=n,i.initEvent(t,!0,!1),this.each(function(t){return t.dispatchEvent(i)})}}),b.extend({serialize:function(){var t="";return x(this[0].elements||this,function(e){if(!e.disabled&&"FIELDSET"!==e.tagName){var n=e.name;switch(e.type.toLowerCase()){case"file":case"reset":case"submit":case"button":break;case"select-multiple":var i=V(e);null!==i&&x(i,function(e){t+=z(n,e)});break;default:var r=V(e);null!==r&&(t+=z(n,r))}}}),t.substr(1)},val:function(t){return void 0===t?V(this[0]):this.each(function(e){return e.value=t})}}),b.extend({after:function(t){return y(t).insertAfter(this),this},append:function(t){return H(this,t),this},appendTo:function(t){return H(y(t),this),this},before:function(t){return y(t).insertBefore(this),this},clone:function(){return y(this.map(function(t){return t.cloneNode(!0)}))},empty:function(){return this.html(""),this},html:function(t){if(void 0===t)return this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each(function(t){return t.innerHTML=e})},insertAfter:function(t){var e=this;return y(t).each(function(t,n){var i=t.parentNode,r=t.nextSibling;e.each(function(t){i.insertBefore(0===n?t:t.cloneNode(!0),r)})}),this},insertBefore:function(t){var e=this;return y(t).each(function(t,n){var i=t.parentNode;e.each(function(e){i.insertBefore(0===n?e:e.cloneNode(!0),t)})}),this},prepend:function(t){return H(this,t,!0),this},prependTo:function(t){return H(y(t),this,!0),this},remove:function(){return this.each(function(t){return t.parentNode.removeChild(t)})},text:function(t){return void 0===t?this[0].textContent:this.each(function(e){return e.textContent=t})}});var $=e.documentElement;return b.extend({position:function(){var t=this[0];return{left:t.offsetLeft,top:t.offsetTop}},offset:function(){var t=this[0].getBoundingClientRect();return{top:t.top+n.pageYOffset-$.clientTop,left:t.left+n.pageXOffset-$.clientLeft}},offsetParent:function(){return y(this[0].offsetParent)}}),b.extend({children:function(t){var e=[];return this.each(function(t){s.apply(e,t.children)}),e=k(e),t?e.filter(function(e){return w(e,t)}):e},closest:function(t){return!t||this.length<1?y():this.is(t)?this.filter(t):this.parent().closest(t)},is:function(t){if(!t)return!1;var e=!1,n=C(t);return this.each(function(i){return!(e=n(i,t))}),e},find:function(t){if(!t||t.nodeType)return y(t&&this.has(t).length?t:null);var e=[];return this.each(function(n){s.apply(e,p(t,n))}),k(e)},has:function(t){var e=c(t)?function(e){return 0!==p(t,e).length}:function(e){return e.contains(t)};return this.filter(e)},next:function(){return y(this[0].nextElementSibling)},not:function(t){if(!t)return this;var e=C(t);return this.filter(function(n){return!e(n,t)})},parent:function(){var t=[];return this.each(function(e){e&&e.parentNode&&t.push(e.parentNode)}),k(t)},parents:function(t){var n,i=[];return this.each(function(r){for(n=r;n&&n.parentNode&&n!==e.body.parentNode;)n=n.parentNode,(!t||t&&w(n,t))&&i.push(n)}),k(i)},prev:function(){return y(this[0].previousElementSibling)},siblings:function(){var t=this.parent().children(),e=this[0];return t.filter(function(t){return t!==e})}}),y})?i.call(e,n,e,t):i)||(t.exports=r)},function(t,e,n){"use strict";var i,r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get("name"),i=this.get("property");!this.get("id")&&this.set("id",i),n||this.set("name",i.charAt(0).toUpperCase()+i.slice(1).replace(/-/g," ")),o.callInit(this,t,e)},init:function(){},clearValue:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0},t),this},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parseValue(t);this.set(r,i({},n,{avoidStore:1})),e&&(this.set("value","",n),this.set(r,n))},setValueFromInput:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,i({},n,{fromInput:1}))},parseValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:t},i="!important";if((0,r.isString)(t)&&-1!==t.indexOf(i)&&(n.value=t.replace(i,"").trim(),n.important=1),!this.get("functionName")&&!e.complete)return n;var o=[],s=""+n.value,a=s.indexOf("(")+1,l=s.lastIndexOf(")"),c=s.substring(0,a-1);if(c&&(n.functionName=c),o.push(a),l>=0&&o.push(l),n.value=String.prototype.substring.apply(s,o),e.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,""),n.value=u}return n},getDefaultValue:function(){return this.get("defaults")},getFullValue:function(t){var e=this.get("functionName"),n=(0,r.isUndefined)(t)?this.get("value"):t;return e&&!(0,r.isUndefined)(n)&&(n=e+"("+n+")"),this.get("important")&&(n+=" !important"),n||""}},{callParentInit:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.prototype.initialize.apply(e,[n,i({},r,{skipInit:1})])},callInit:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&t.init(e,n)}});t.exports=o},function(t,e,n){"use strict";var i,r=n(0),o=(i=r)&&i.__esModule?i:{default:i};n(5),n(17),n(54),n(55),n(56),n(58),n(21),n(52);t.exports=o.default.View.extend({initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.onChange=t.onChange,this.onInputRender=t.onInputRender||{},this.customValue=t.customValue||{},this.properties=[];var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.render)},addTo:function(t){this.add(t)},add:function(t,e){var n=new t.typeView({model:t,name:t.get("name"),id:this.pfx+t.get("property"),target:this.target,propTarget:this.propTarget,onChange:this.onChange,onInputRender:this.onInputRender,config:this.config});"composite"!=t.get("type")&&(n.customValue=this.customValue),n.render();var i=n.el;this.properties.push(n),e?e.appendChild(i):this.el.appendChild(i)},render:function(){var t=this;this.properties=[];var e=document.createDocumentFragment();return this.collection.each(function(n){return t.add(n,e)}),this.$el.append(e),this.$el.attr("class",this.pfx+"properties"),this}})},function(t,e,n){"use strict";var i,r=n(0),o=(i=r)&&i.__esModule?i:{default:i};n(22);var s=n(5),a=o.default.$;t.exports=s.extend({templateInput:function(){return""},init:function(){var t=this.model;this.listenTo(t,"change:unit",this.modelValueChanged),this.listenTo(t,"el:change",this.elementUpdated),this.listenTo(t,"change:units",this.render)},setValue:function(t){var e=this.model.parseValue(t);t=""+e.value+e.unit,this.inputInst.setValue(t,{silent:1})},onRender:function(){var t=this.ppfx;if(!this.input){var e=this.model.input;e.ppfx=t,e.render(),this.el.querySelector("."+t+"fields").appendChild(e.el),this.$input=e.inputEl,this.unit=e.unitEl,this.$unit=a(this.unit),this.input=this.$input.get(0),this.inputInst=e}},clearCached:function(){s.prototype.clearCached.apply(this,arguments),this.unit=null,this.$unit=null}})},function(t,e,n){"use strict";var i=n(1),r=n(4);t.exports=r.extend({tagName:"img",events:{dblclick:"onActive",click:"initResize"},initialize:function(t){var e=this.model;r.prototype.initialize.apply(this,arguments),this.listenTo(e,"change:src",this.updateSrc),this.classEmpty=this.ppfx+"plh-image";var n=this.config;n.modal&&(this.modal=n.modal),n.am&&(this.am=n.am),this.fetchFile()},fetchFile:function(){var t=this.model,e=t.get("file");e&&(this.em.get("AssetManager").FileUploader().uploadFile({dataTransfer:{files:[e]}},function(e){var n=e&&e.data&&e.data[0],r=n&&((0,i.isString)(n)?n:n.src);r&&t.set({src:r})}),t.set("file",""))},updateSrc:function(){var t=this.model,e=this.classEmpty,n=this.$el,i=t.get("src");t.addAttributes({src:i}),n[i?"removeClass":"addClass"](e)},onActive:function(t){t&&t.stopPropagation();var e=this.opts.config.em,n=e?e.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)}})},render:function(){this.renderAttributes();var t=this.$el,e=this.model,n=t.attr("class")||"";return!e.get("src")&&t.attr("class",(n+" "+this.classEmpty).trim()),t.attr("onmousedown","return false"),this.postRender(),this}})},function(t,e,n){"use strict";var i,r=n(0);var o=((i=r)&&i.__esModule?i:{default:i}).default.$;t.exports={startSelectPosition:function(t,e){this.isPointed=!1;var n=this.editorModel.get("Utils");n&&!this.sorter&&(this.sorter=new n.Sorter({container:this.getCanvasBody(),placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:e,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1})),t&&this.sorter.startSort(t)},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},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(t,e,n){var i=t||0,r=e||"before",o=n.length,s=0!==o&&"after"==r&&i==o;return 0!==o&&(!s&&!n[i][4]||n[i-1]&&!n[i-1][4]||s&&!n[i-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},function(t,e,n){"use strict";var i=r(n(1));r(n(0));function r(t){return t&&t.__esModule?t:{default:t}}var o=n(12);t.exports=i.default.extend({},o,{init:function(){for(var t=arguments.length,e=Array(t),n=0;n\n \n \n '},inputValueChanged:function(){if(!this.model.get("detached")){for(var t=arguments.length,e=Array(t),n=0;n'),this.input=this.$input.get(0)),this.props||(this.props=t.get("properties")),!this.$props)){this.props.each(function(e,n){e&&"composite"==e.get("type")&&(this.props.remove(e),console.warn("Nested composite types not yet allowed.")),e.parent=t},this);var i=new(n(16))(this.getPropsConfig());this.$props=i.render().$el,this.properties=i.properties,this.$el.find("#"+this.pfx+"input-holder").append(this.$props)}},getPropsConfig:function(t){var e=this,n=this.model,i={config:this.config,collection:this.props,target:this.target,propTarget:this.propTarget,onChange:function(t,e,i){n.set("value",n.getFullValue(),i)},customValue:function(t,n){return e.valueOnIndex(n,t)}};return n.get("detached")&&delete i.onChange,i},valueOnIndex:function(t,e){var n=void 0,i=this.getTargetValue({ignoreDefault:1});i?n=i.split(this.model.getSplitSeparator())[t]:n=e&&e.getTargetValue({ignoreCustomValue:1,ignoreDefault:1});return e&&(n=e.model.parseValue(n).value),n},clearCached:function(){s.prototype.clearCached.apply(this,arguments),this.$input=null,this.props=null,this.$props=null}})},function(t,e,n){"use strict";(function(e){var i=n(1),r=n(2),o=n(53);n(0).$;t.exports=o.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 t=this.ppfx;return'\n \n \n
\n
\n
\n
\n '},inputClass:function(){var t=this.ppfx;return this.opts.contClass||t+"field "+t+"field-integer"},initialize:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];o.prototype.initialize.apply(this,arguments),(0,i.bindAll)(this,"moveIncrement","upIncrement"),this.doc=document,this.listenTo(this.model,"change:unit",this.handleModelChange)},setValue:function(t,e){var n=e||{},i=this.validateInputValue(t,{deepCheck:1}),r={value:i.value};(i.unit||i.force)&&(r.unit=i.unit),this.model.set(r,n),n.silent&&this.handleModelChange()},handleChange:function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},handleUnitChange:function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set("unit",e),this.elementUpdated()},elementUpdated:function(){this.model.trigger("el:change")},handleModelChange:function(){var t=this.model;this.getInputEl().value=t.get("value");var e=this.getUnitEl();e&&(e.value=t.get("unit")||"")},getUnitEl:function(){if(!this.unitEl){var t=this.model,e=t.get("units")||[];if(e.length){var n=[];e.forEach(function(e){var i=e==t.get("unit")?"selected":"";n.push("")});var i=document.createElement("div");i.innerHTML='",this.unitEl=i.firstChild}}return this.unitEl},upArrowClick:function(){var t=this.model,e=t.get("step"),n=parseInt(t.get("value"),10);n=this.normalizeValue(n+e);var i=this.validateInputValue(n);t.set("value",i.value),this.elementUpdated()},downArrowClick:function(){var t=this.model,e=t.get("step"),n=parseInt(t.get("value"),10),i=this.normalizeValue(n-e),r=this.validateInputValue(i);t.set("value",r.value),this.elementUpdated()},downIncrement:function(t){t.preventDefault(),this.moved=0;var e=this.model.get("value");e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,r.on)(this.doc,"mousemove",this.moveIncrement),(0,r.on)(this.doc,"mouseup",this.upIncrement)},moveIncrement:function(t){this.moved=1;var e=this.model,n=e.get("step"),i=this.current,r=this.normalizeValue(i.val+(i.y-t.pageY)*n);return this.prValue=this.validateInputValue(r).value,e.set("value",this.prValue,{avoidStore:1}),!1},upIncrement:function(){var t=this.model,e=t.get("step");if((0,r.off)(this.doc,"mouseup",this.upIncrement),(0,r.off)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set("value",n,{avoidStore:1}).set("value",n+e),this.elementUpdated()}},normalizeValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model.get("step"),i=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var r=n.toString().split(".")[1];i=r?r.length:0}return i?parseFloat(t.toFixed(i)):t},validateInputValue:function(t,n){var r=0,o=n||{},s=this.model,a=(0,i.isUndefined)(t)?"":t,l=s.get("units")||[],c=s.get("unit")||l.length&&l[0]||"",u=s.get("max"),h=s.get("min");if(o.deepCheck){var d=s.get("fixedValues")||[];if(a){var f=new RegExp("^"+d.join("|"),"g");if(d.length&&f.test(a))a=a.match(f)[0],c="",r=1;else{var p=a+"";a+="",a=parseFloat(a.replace(",",".")),a=isNaN(a)?"":a;var g=p.replace(a,"");e.indexOf(l,g)>=0&&(c=g)}}}return(0,i.isUndefined)(u)||""===u||(a=a>u?u:a),(0,i.isUndefined)(h)||""===h||(a=a1&&void 0!==arguments[1]?arguments[1]:{};this.listenTo(this,"add",this.onAdd),this.config=e.config,this.em=e.em,this.model=function(t,n){var i,r=e.componentTypes;n.em=e.em,n.config=e.config,n.componentTypes=r;for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=n.get("CssComposer"),o=n.get("Parser").parseHtml(t);return o.css&&r&&!e.temporary&&r.addCollection(o.css,i({},e,{extend:1})),o.html},add:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.isString)(t)?t=this.parseString(t,n):(0,r.isArray)(t)&&t.forEach(function(n,i){(0,r.isString)(n)&&(t[i]=e.parseString(n))}),o.Collection.prototype.add.apply(this,[t,n])},onAdd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.em,o=t.getStyle(),s=i&&i.getConfig("avoidInlineStyle");if(!(0,r.isEmpty)(o)&&!s&&i&&i.get&&i.getConfig("forceClass")&&!n.temporary){var a=t.cid;i.get("CssComposer").setClassRule(a,o);t.setStyle({}),t.addClass(a)}}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=this.id;if(t.trigger("run:"+n+":before",e),!e||!e.abort){var i=e.sender||t,r=this.run(t,i,e);return t.trigger("run:"+n,r,e),r}t.trigger("abort:"+n,e)},callStop:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id,i=e.sender||t;t.trigger("stop:"+n+":before",e);var r=this.stop(t,i,e);return t.trigger("stop:"+n,r,e),r},run:function(t,e){},stop:function(t,e){}})},function(t,e,n){"use strict";var i,r=n(0);var o=((i=r)&&i.__esModule?i:{default:i}).default.$;t.exports={run:function(t,e){var n=this;arguments.length>2&&void 0!==arguments[2]&&arguments[2];e&&e.set&&e.set("active",0);var i=t.getConfig(),r=t.Modal,s=i.stylePrefix;if(this.cm=t.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}r.open({title:i.textViewCode,content:this.$editors}).getModel().once("change:open",function(){return t.stopCommand(n.id)}),this.htmlEditor.setContent(t.getHtml()),this.cssEditor.setContent(t.getCss())},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var i=document.createElement("textarea");!this.codeMirror&&(this.codeMirror=this.cm.getViewer("CodeMirror"));var r=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:i}),o=new this.cm.EditorView({model:r,config:this.cm.getConfig()}).render().$el;return r.init(i),{el:r,$el:o}}}},function(t,e,n){"use strict";var i=o(n(1)),r=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var s=n(11),a=r.default.$;t.exports=i.default.extend({},s,{init:function(t){i.default.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(t){t.stopPropagation();var e=a(t.target);e.data("model").get("removable")&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation(),a(t.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=a(t.target);e.data("model").get("removable")&&(e.data("model").destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html("Remove "+t.getName())}})},function(t,e,n){"use strict";var i=r(n(1));r(n(0));function r(t){return t&&t.__esModule?t:{default:t}}var o=n(20);t.exports=i.default.extend({},o,{beforeInsert:function(t){t.type="image",t.style={},t.attributes={},t.attributes.onmousedown="return false",this.config.firstCentered&&this.getCanvasWrapper()==this.sorter.target&&(t.style.margin="0 auto")},afterInsert:function(t){t.trigger("dblclick"),this.sender&&this.sender.set("active",!1)}})},function(t,e,n){"use strict";var i=s(n(1)),r=s(n(0)),o=n(2);function s(t){return t&&t.__esModule?t:{default:t}}var a=n(11),l=n(19),c=r.default.$;t.exports=i.default.extend({},l,a,{init:function(t){a.init.apply(this,arguments),i.default.bindAll(this,"initSorter","rollback","onEndMove"),this.opt=t,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var t=arguments.length,e=Array(t),n=0;n"),this.$cn2=s("
"),this.$cn.append(this.$cn2);var r=t.DeviceManager;if(r&&n.showDevices)i.addPanel({id:"devices-c"}).set("appendContent",r.render()).trigger("change:appendContent");var o=t.SelectorManager;o&&this.$cn2.append(o.render([])),this.$cn2.append(t.StyleManager.render());var a=t.StyleManager.getConfig(),l=a.stylePrefix;this.$header=s('
'+a.textNoElement+"
"),this.$cn.append(this.$header),i.getPanel("views-container")?this.panel=i.getPanel("views-container"):this.panel=i.addPanel({id:"views-container"}),this.panel.set("appendContent",this.$cn).trigger("change:appendContent"),this.target=t.editor,this.listenTo(this.target,"component:toggled",this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this.target,e=this.sender;e&&e.get&&!e.get("active")||(1===t.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()}}},function(t,e,n){"use strict";var i=n(0).$;t.exports={run:function(t,e){this.sender=e;var n=t.Config.stylePrefix,r=t.TraitManager;if(!this.$cn){var o=r.getTraitsViewer(),s=r.getConfig();this.$cn=i("
"),this.$cn2=i("
"),this.$cn.append(this.$cn2),this.$header=i("
").append('
'+s.textNoElement+"
"),this.$cn.append(this.$header),this.$cn2.append('
'+s.labelContainer+"
"),this.$cn2.append(o.render().el);var a=t.Panels;(a.getPanel("views-container")?a.getPanel("views-container"):a.addPanel({id:"views-container"})).set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=t.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()},toggleTm:function(){var t=this.sender;t&&t.get&&!t.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()}}},function(t,e,n){"use strict";t.exports={run:function(t,e){var n=t.BlockManager,i=t.Panels;if(!this.blocks){n.render();var r="views-container",o=document.createElement("div"),s=i.getPanel(r)||i.addPanel({id:r});o.appendChild(n.getContainer()),s.set("appendContent",o).trigger("change:appendContent"),this.blocks=o}this.blocks.style.display="block"},stop:function(){var t=this.blocks;t&&(t.style.display="none")}}},function(t,e,n){"use strict";t.exports={run:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.Modal,o=t.AssetManager,s=o.getConfig(),a=o.getContainer(),l=i.modalTitle||s.modalTitle||"",c=i.types,u=i.accept;if(o.setTarget(i.target),o.onClick(i.onClick),o.onDblClick(i.onDblClick),o.onSelect(i.onSelect),!this.rendered||c){var h=o.getAll().filter(function(t){return 1});c&&c.length&&(h=h.filter(function(t){return-1!==c.indexOf(t.get("type"))})),o.render(h),this.rendered=1}if(u){var d=a.querySelector("input#"+s.stylePrefix+"uploadFile");d&&d.setAttribute("accept",u)}return r.open({title:l,content:a}).getModel().once("change:open",function(){return t.stopCommand(n.id)}),this},stop:function(t){return t.Modal.close(),this}}},function(t,e,n){"use strict";var i,r=n(0);var o=((i=r)&&i.__esModule?i:{default:i}).default.$;t.exports={getOffsetMethod:function(t){return"get"+(t||"")+"OffsetViewerEl"},run:function(t,e,n){var i=n||{},r=i.state||"",s=t.getConfig();if(s.showOffsets&&(s.showOffsetsSelected||"Fixed"!=r)){var a=t.Canvas,l=i.el||"",c=i.elPos||a.getElementPos(l),u=window.getComputedStyle(l),h=this.ppfx,d=r+"State",f=a[this.getOffsetMethod(r)]();f.style.display="block";var p=this["marginT"+r],g=this["marginB"+r],v=this["marginL"+r],m=this["marginR"+r],y=this["padT"+r],b=this["padB"+r],x=this["padL"+r],w=this["padR"+r];if(!this[d]){var C=r.toLowerCase(),k=C+"margin-v",S=C+"padding-v",T=o('
').get(0),E=o('
').get(0),M=h+k+"-el"+" "+(h+k),A=h+S+"-el"+" "+(h+S);p=o('
').get(0),g=o('
').get(0),v=o('
').get(0),m=o('
').get(0),y=o('
').get(0),b=o('
').get(0),x=o('
').get(0),w=o('
').get(0),this["marginT"+r]=p,this["marginB"+r]=g,this["marginL"+r]=v,this["marginR"+r]=m,this["padT"+r]=y,this["padB"+r]=b,this["padL"+r]=x,this["padR"+r]=w,T.appendChild(p),T.appendChild(g),T.appendChild(v),T.appendChild(m),E.appendChild(y),E.appendChild(b),E.appendChild(x),E.appendChild(w),f.appendChild(T),f.appendChild(E),this[d]="1"}var O=u.marginLeft.replace("px",""),P=parseInt(u.marginTop.replace("px","")),L=parseInt(u.marginBottom.replace("px","")),_=p.style,N=g.style,D=v.style,I=m.style,F=y.style,j=b.style,R=x.style,z=w.style,V=parseInt(c.left);_.height=u.marginTop,_.width=u.width,_.top=c.top-u.marginTop.replace("px","")+"px",_.left=V+"px",N.height=u.marginBottom,N.width=u.width,N.top=c.top+c.height+"px",N.left=V+"px";var H=c.height+P+L+"px",$=c.top-P+"px";D.height=H,D.width=u.marginLeft,D.top=$,D.left=V-O+"px",I.height=H,I.width=u.marginRight,I.top=$,I.left=V+c.width+"px";var B=parseInt(u.paddingTop.replace("px",""));F.height=u.paddingTop,F.width=u.width,F.top=c.top+"px",F.left=V+"px";var W=parseInt(u.paddingBottom.replace("px",""));j.height=u.paddingBottom,j.width=u.width,j.top=c.top+c.height-W+"px",j.left=V+"px";var U=c.height-W-B+"px",q=c.top+B+"px";R.height=U,R.width=u.paddingLeft,R.top=q,R.left=c.left+"px";var K=parseInt(u.paddingRight.replace("px",""));z.height=U,z.width=u.paddingRight,z.top=q,z.left=c.left+c.width-K+"px"}},stop:function(t,e,n){var i=(n||{}).state||"",r=this.getOffsetMethod(i);t.Canvas[r]().style.display="none"}}},function(t,e,n){"use strict";t.exports={run:function(t){for(var e=t.getSelected(),n=e&&e.parent();n&&!n.get("selectable");)n=n.parent();n&&t.select(n)}}},function(t,e,n){"use strict";var i=n(1);t.exports={isEnabled:function(){var t=document;return t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement?1:0},enable:function(t){var e="";return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e="webkit",t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e="moz",t.mozRequestFullScreen()):t.msRequestFullscreen?t.msRequestFullscreen():console.warn("Fullscreen not supported"),e},disable:function(){var t=document;t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen()},fsChanged:function(t,e){document;var n=(t||"")+"fullscreenchange";this.isEnabled()||(this.stop(null,this.sender),document.removeEventListener(n,this.fsChanged))},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sender=e;var r=n.target,o=(0,i.isElement)(r)?r:document.querySelector(r),s=this.enable(o||t.getContainer());this.fsChanged=this.fsChanged.bind(this,s),document.addEventListener(s+"fullscreenchange",this.fsChanged),t.trigger("change:canvasOffset")},stop:function(t,e){e&&e.set&&e.set("active",!1),this.disable(),t&&t.trigger("change:canvasOffset")}}},function(t,e,n){"use strict";var i,r=n(1),o=(i=r)&&i.__esModule?i:{default:i};t.exports={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanelsEl()),this.panels},tglPointers:function(t,e){var n=t.Canvas.getBody().querySelectorAll("."+this.ppfx+"no-pointer");o.default.each(n,function(t){t.style.pointerEvents=e?"":"all"})},run:function(t,e){e&&e.set&&e.set("active",!1),t.stopCommand("sw-visibility"),t.getModel().stopDefault();var n=this.getPanels(t),i=t.Canvas.getElement(),r=t.getEl(),o=t.Config.stylePrefix;this.helper||(this.helper=document.createElement("span"),this.helper.className=o+"off-prv fa fa-eye-slash",r.appendChild(this.helper),this.helper.onclick=function(){t.stopCommand("preview")}),this.helper.style.display="inline-block",this.tglPointers(t),n.style.display="none";var s=i.style;s.width="100%",s.height="100%",s.top="0",s.left="0",s.padding="0",s.margin="0",t.trigger("change:canvasOffset")},stop:function(t,e){var n=this.getPanels(t);t.runCommand("sw-visibility"),t.getModel().runDefault(),n.style.display="block",t.Canvas.getElement().setAttribute("style",""),this.helper&&(this.helper.style.display="none"),t.trigger("change:canvasOffset"),this.tglPointers(t,1)}}},function(t,e,n){"use strict";t.exports={run:function(t,e,n){var i=n||{},r=i.el||"",o=t.Canvas,s=this.canvasResizer,a=i.options||{},l=o.getCanvasView();return a.ratioDefault=1,a.appendTo=o.getResizerEl(),a.prefix=t.getConfig().stylePrefix,a.posFetcher=l.getElementPos.bind(l),a.mousePosFetcher=o.getMouseRelativePos,s&&!i.forceNew||(this.canvasResizer=t.Utils.Resizer.init(a),s=this.canvasResizer),s.setOptions(a),s.blur(),s.focus(r),s},stop:function(){var t=this.canvasResizer;t&&t.blur()}}},function(t,e,n){"use strict";t.exports={run:function(t,e,n){var i=n&&n.el||"",r=t.Canvas,o=this.dragger,s=n.options||{},a=r.getCanvasView();return s.prefix=t.getConfig().stylePrefix,s.mousePosFetcher=r.getMouseRelativePos,s.posFetcher=a.getElementPos.bind(a),o||(o=t.Utils.Dragger.init(s),this.dragger=o),o.setOptions(s),o.focus(i),s.event&&o.start(s.event),o},stop:function(){this.canvasResizer&&this.canvasResizer.blur()}}},function(t,e,n){!function(e){var n,i={},r={16:!1,18:!1,17:!1,91:!1},o="all",s={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},a={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},l=function(t){return a[t]||t.toUpperCase().charCodeAt(0)},c=[];for(n=1;n<20;n++)a["f"+n]=111+n;function u(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function h(t,e){if(t.length!=e.length)return!1;for(var n=0;n1&&(o=m(t),t=[t[t.length-1]]),t=t[0],(t=l(t))in i||(i[t]=[]),i[t].push({shortcut:r[s],scope:e,method:n,key:r[s],mods:o})}for(n in s)p[n]=!1;function g(){return o||"all"}function v(t){var e;return""==(e=(t=t.replace(/\s/g,"")).split(","))[e.length-1]&&(e[e.length-2]+=","),e}function m(t){for(var e=t.slice(0,t.length-1),n=0;n0,r)(!r[o]&&u(n.mods,+o)>-1||r[o]&&-1==u(n.mods,+o))&&(l=!1);(0!=n.mods.length||r[16]||r[18]||r[17]||r[91])&&!l||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)}),y(document,"keyup",function(t){var e,n=t.keyCode,i=u(c,n);if(i>=0&&c.splice(i,1),93!=n&&224!=n||(n=91),n in r)for(e in r[n]=!1,s)s[e]==n&&(p[e]=!1)}),y(window,"focus",function(){for(n in r)r[n]=!1;for(n in s)p[n]=!1});var b=e.key;e.key=p,e.key.setScope=function(t){o=t||"all"},e.key.getScope=g,e.key.deleteScope=function(t){var e,n,r;for(e in i)for(n=i[e],r=0;r1&&(c=m(r),t=r[r.length-1]),t=l(t),void 0===e&&(e=g()),!i[t])return;for(o=0;o=0&&e<=k};function E(t){return function(e,n,i,r){n=y(n,r,4);var o=!T(e)&&m.keys(e),s=(o||e).length,a=t>0?0:s-1;return arguments.length<3&&(i=e[o?o[a]:a],a+=t),function(e,n,i,r,o,s){for(;o>=0&&o=0},m.invoke=function(t,e){var n=c.call(arguments,2),i=m.isFunction(e);return m.map(t,function(t){var r=i?e:t[e];return null==r?r:r.apply(t,n)})},m.pluck=function(t,e){return m.map(t,m.property(e))},m.where=function(t,e){return m.filter(t,m.matcher(e))},m.findWhere=function(t,e){return m.find(t,m.matcher(e))},m.max=function(t,e,n){var i,r,o=-1/0,s=-1/0;if(null==e&&null!=t)for(var a=0,l=(t=T(t)?t:m.values(t)).length;ao&&(o=i);else e=b(e,n),m.each(t,function(t,n,i){((r=e(t,n,i))>s||r===-1/0&&o===-1/0)&&(o=t,s=r)});return o},m.min=function(t,e,n){var i,r,o=1/0,s=1/0;if(null==e&&null!=t)for(var a=0,l=(t=T(t)?t:m.values(t)).length;ai||void 0===n)return 1;if(n0?0:r-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 i[o=n(i,r)]===r?o:-1;if(r!=r)return(o=e(c.call(i,s,a),m.isNaN))>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&oe?(s&&(clearTimeout(s),s=null),a=c,o=t.apply(i,r),s||(i=r=null)):s||!1===n.trailing||(s=setTimeout(l,u)),o}},m.debounce=function(t,e,n){var i,r,o,s,a,l=function(){var c=m.now()-s;c=0?i=setTimeout(l,e-c):(i=null,n||(a=t.apply(o,r),i||(o=r=null)))};return function(){o=this,r=arguments,s=m.now();var c=n&&!i;return i||(i=setTimeout(l,e)),c&&(a=t.apply(o,r),o=r=null),a}},m.wrap=function(t,e){return m.partial(e,t)},m.negate=function(t){return function(){return!t.apply(this,arguments)}},m.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}},m.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},m.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},m.once=m.partial(m.before,2);var _=!{toString:null}.propertyIsEnumerable("toString"),N=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function D(t,e){var n=N.length,i=t.constructor,r=m.isFunction(i)&&i.prototype||s,o="constructor";for(m.has(t,o)&&!m.contains(e,o)&&e.push(o);n--;)(o=N[n])in t&&t[o]!==r[o]&&!m.contains(e,o)&&e.push(o)}m.keys=function(t){if(!m.isObject(t))return[];if(f)return f(t);var e=[];for(var n in t)m.has(t,n)&&e.push(n);return _&&D(t,e),e},m.allKeys=function(t){if(!m.isObject(t))return[];var e=[];for(var n in t)e.push(n);return _&&D(t,e),e},m.values=function(t){for(var e=m.keys(t),n=e.length,i=Array(n),r=0;r":">",'"':""","'":"'","`":"`"},j=m.invert(F),R=function(t){var e=function(e){return t[e]},n="(?:"+m.keys(t).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(r,e):t}};m.escape=R(F),m.unescape=R(j),m.result=function(t,e,n){var i=null==t?void 0:t[e];return void 0===i&&(i=n),m.isFunction(i)?i.call(t):i};var z=0;m.uniqueId=function(t){var e=++z+"";return t?t+e:e},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var V=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},$=/\\|'|\r|\n|\u2028|\u2029/g,B=function(t){return"\\"+H[t]};m.template=function(t,e,n){!e&&n&&(e=n),e=m.defaults({},e,m.templateSettings);var i=RegExp([(e.escape||V).source,(e.interpolate||V).source,(e.evaluate||V).source].join("|")+"|$","g"),r=0,o="__p+='";t.replace(i,function(e,n,i,s,a){return o+=t.slice(r,a).replace($,B),r=a+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?o+="'+\n((__t=("+i+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.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";try{var s=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var a=function(t){return s.call(this,t,m)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a},m.chain=function(t){var e=m(t);return e._chain=!0,e};var W=function(t,e){return t._chain?m(e).chain():e};m.mixin=function(t){m.each(m.functions(t),function(e){var n=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),W(this,n.apply(m,t))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];m.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],W(this,n)}}),m.each(["concat","join","slice"],function(t){var e=o[t];m.prototype[t]=function(){return W(this,e.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},void 0===(i=function(){return m}.apply(e,[]))||(t.exports=i)}).call(this)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(104),o=(i=r)&&i.__esModule?i:{default:i};window.Promise=window.Promise||o.default,e.default="function"==typeof fetch?fetch.bind():function(t,e){return new o.default(function(n,i){var r=new XMLHttpRequest;for(var s in r.open(e.method||"get",t),r.withCredentials="include"==e.credentials,e.headers||{})r.setRequestHeader(s,e.headers[s]);r.onload=function(t){return n({status:r.status,statusText:r.statusText,text:function(){return o.default.resolve(r.responseText)}})},r.onerror=i,r.upload&&e.onProgress&&(r.upload.onprogress=e.onProgress),e.body?r.send(e.body):r.send()})}},function(t,e,n){"use strict";t.exports=function(t){var e=t;return{compTypes:"",parseStyle:function(t){for(var e={},n=t.split(";"),i=0,r=n.length;i1&&void 0!==arguments[1]?arguments[1]:{},n=e.model,r=void 0===n?{}:n,s=e.view,a=void 0===s?{}:s,l=this.getType(t);if(l)return new l.view(i({model:new l.model(r),config:o},a))},setTarget:function(t,n){return e.setTarget(t,n)},getEmitter:function(){return e.propTarget},render:function(){return e.render().el}}}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=t.Model,o=t.View;e.default={types:[],initialize:function(t,e){var n=this;this.model=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,r=void 0,o=void 0;if(t&&t.type){var s=n.getBaseType();i=(o=n.getType(t.type))?o.model:s.model,r=o?o.view:s.view}else{var a=n.recognizeType(t);i=(o=a.type).model,r=o.view,t=a.attributes}var l=new i(t,e);return l.typeView=r,l};var i=this.init&&this.init.bind(this);i&&i()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.callParentInit(r,this,t,e);var i=this.get("properties")||[],o=n(14);this.set("properties",new o(i)),this.listenTo(this,"change:value",this.updateValues),r.callInit(this,t,e)},clearValue:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.get("properties").each(function(t){return t.clearValue()}),r.prototype.clearValue.apply(this,arguments)},updateValues:function(){var t=this.getFullValue().split(this.getSplitSeparator());this.get("properties").each(function(e,n){var i=t.length;t[n]||t[n%i+(1!=i&&i%2?1:0)]})},getSplitSeparator:function(){return new RegExp(this.get("separator")+"(?![^\\(]*\\))")},getDefaultValue:function(t){var e=this.get("defaults");return e&&!t?e:(e="",this.get("properties").each(function(t,n){return e+=t.getDefaultValue()+" "}),e.trim())},getFullValue:function(){return this.get("detached")?"":this.get("properties").getFullValue()},getPropertyAt:function(t){return this.get("properties").at(t)}})},function(t,e,n){"use strict";var i=n(21),r=n(125);t.exports=i.extend({templateInput:function(){var t=this.pfx;this.ppfx;return'\n
\n \n
\n
\n '},init:function(){var t=this.model;this.pfx;t.set("stackIndex",null),this.events["click [data-add-layer]"]="addLayer",this.listenTo(t,"change:stackIndex",this.indexChanged),this.listenTo(t,"updateValue",this.inputValueChanged),this.delegateEvents()},clear:function(t){t&&t.stopPropagation(),this.model.get("layers").reset(),this.model.clearValue(),this.targetUpdated()},targetUpdated:function(){if(this.model.get("detached"))this.checkVisibility();else{for(var t=arguments.length,e=Array(t),n=0;n'},inputClass:function(){return this.ppfx+"field"},holderClass:function(){return this.ppfx+"input-holder"},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ppfx||"";this.opts=t,this.ppfx=e,this.em=t.target||{},this.listenTo(this.model,"change:value",this.handleModelChange)},elementUpdated:function(){this.model.trigger("el:change")},setValue:function(t){var e=this.model,n=t||e.get("defaults"),i=this.getInputEl();i&&(i.value=n)},handleModelChange:function(t,e,n){this.setValue(e,n)},handleChange:function(t){t.stopPropagation();var e=this.getInputEl().value;this.model.set({value:e},{fromInput:1}),this.elementUpdated()},getInputEl:function(){if(!this.inputEl){var t=this.model.get("defaults")||"";this.inputEl=r('')}return this.inputEl.get(0)},render:function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find("."+this.holderClass()).append(this.getInputEl()),this}})},function(t,e,n){"use strict";t.exports=n(5).extend({templateInput:function(){this.pfx;var t=this.ppfx;return'\n
\n
\n '},onRender:function(){var t=this.pfx,e=this.ppfx,n=e+"radio-item-label",i=this.model,r=i.get("property"),o=i.get("list")||i.get("options")||[];if(!this.input&&o&&o.length){var s="";o.forEach(function(i){var o=i.className?i.className+" "+t+"icon "+n:"",a=r+"-"+i.value,l=i.name||i.value,c=i.title?'title="'+i.title+'"':"";s+='\n
\n \n \n
\n "});var a=this.el.querySelector("."+e+"field");a.innerHTML='
'+s+"
",this.input=a.firstChild}},getInputValue:function(){var t=this.getCheckedEl();return t?t.value:""},getCheckedEl:function(){var t=this.getInputEl();return t?t.querySelector("input:checked"):""},setValue:function(t){var e=this.model,n=t||e.get("value")||e.getDefaultValue(),i=this.getInputEl(),r=i?i.querySelector('[value="'+n+'"]'):"";if(r)r.checked=!0;else{var o=this.getCheckedEl();o&&(o.checked=!1)}}})},function(t,e,n){"use strict";var i=o(n(0)),r=o(n(5));function o(t){return t&&t.__esModule?t:{default:t}}i.default.$;t.exports=r.default.extend({templateInput:function(){var t=this.pfx,e=this.ppfx;return'\n
\n \n
\n
\n
\n
\n '},initialize:function(){for(var t=arguments.length,e=Array(t),n=0;n"+e+""});var i=this.el.querySelector("#"+t+"input-holder");i.innerHTML="",this.input=i.firstChild}}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};e=i({},e,{silent:1}),this.inputInst.setValue(t,e)},onRender:function(){if(!this.input){var t=this.ppfx,e=new r({target:this.target,model:this.model,ppfx:t}).render();this.el.querySelector("."+t+"fields").appendChild(e.el),this.$input=e.inputEl,this.$color=e.colorEl,this.input=this.$input.get(0),this.inputInst=e}}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e
\n
\n
\n
\n
\n
\n '},inputClass:function(){var t=this.ppfx;return t+"field "+t+"field-color"},holderClass:function(){return this.ppfx+"input-holder"},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model.get("defaults"),i=(0,o.isUndefined)(t)?(0,o.isUndefined)(n)?"":n:t,r=this.getInputEl(),s=this.getColorEl(),a="none"!=i?i:"";r.value=i,s.get(0).style.backgroundColor=a,e.fromTarget&&(s.spectrum("set",a),this.noneColor="none"==i)},getColorEl:function(){if(!this.colorEl){var t=this,e=this.ppfx,n=this.model,r=c('
'),o=r.get(0).style,s=this.em&&this.em.config?this.em.config.el:"",a=this.em&&this.em.getConfig&&this.em.getConfig("colorPicker")||{},l=function(t){return(1==t.getAlpha()?t.toHexString():t.toRgbString()).replace(/ /g,"")},u=0,h=void 0;this.$el.find("[data-colorp-c]").append(r),r.spectrum(i({containerClassName:e+"one-bg "+e+"two-color",appendTo:s||"body",maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},a,{move:function(t){var e=l(t);o.backgroundColor=e,n.setValueFromInput(e,0)},change:function(e){u=1;var i=l(e);o.backgroundColor=i,n.setValueFromInput(i),t.noneColor=0},show:function(t){u=0,h=l(t)},hide:function(e){!u&&h&&(t.noneColor&&(h=""),o.backgroundColor=h,r.spectrum("set",h),n.setValueFromInput(h,0))}})),this.colorEl=r}return this.colorEl},render:function(){return l.prototype.render.call(this),this.getColorEl(),this}})},function(t,e,n){"use strict";var i,r=n(1),o=n(0),s=(i=o)&&i.__esModule?i:{default:i};var a=n(5),l=s.default.$;t.exports=a.extend({templateInput:function(){var t=this.pfx;this.ppfx;return'\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n '},init:function(){var t=this.em;this.modal=t.get("Modal"),this.am=t.get("AssetManager"),this.events["click #"+this.pfx+"close"]="removeFile",this.events["click #"+this.pfx+"images"]="openAssetManager",this.delegateEvents()},onRender:function(){if(!this.$input){var t=this.model.getDefaultValue();this.$input=l('')}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(){a.prototype.clearCached.apply(this,arguments),this.$preview=null,this.$previewBox=null},setValue:function(t,e){a.prototype.setValue.apply(this,arguments),this.setPreviewView(t&&t!=this.model.getDefaultValue()),this.setPreview(t)},setPreviewView:function(t){var e=this.$previewBox;e&&e[t?"addClass":"removeClass"](this.pfx+"show")},spreadUrl:function(t){this.model.set("value",t),this.setPreviewView(1)},setPreview:function(t){var e=this.$preview;t=t&&t.indexOf("url(")<0?"url("+t+")":t,e&&e.css("background-image",t)},cleanValue:function(){this.setPreviewView(0),this.model.set({value:""},{silent:!0})},removeFile:function(){this.model.set("value",this.model.getDefaultValue());for(var t=arguments.length,e=Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return this.set("options",t),this},addOption:function(t){if(t){var e=this.getOptions();this.setOptions([].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return this.set({value:void 0,unit:void 0},t),this},parseValue:function(t){var e=o.prototype.parseValue.apply(this,arguments),n=this.input.validateInputValue(e.value,{deepCheck:1}),i=n.value,r=n.unit;return e.value=i,e.unit=r,e},getFullValue:function(){var t=this.get("value"),e=this.get("unit");return t=""+(t=(0,r.isUndefined)(t)?"":t)+(e=!(0,r.isUndefined)(e)&&t?e:""),o.prototype.getFullValue.apply(this,[t])}})},function(t,e,n){!function(t){"use strict";function e(t){for(var e={},n=0;n0;r--)n.context=n.context.prev;return M(t,e,n)}function O(t){var e=t.current().toLowerCase();o=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var P={top:function(t,e,n){if("{"==t)return T(n,e,"block");if("}"==t&&n.context.prev)return E(n);if(x&&/@component/i.test(t))return T(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return T(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return T(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return T(n,e,"at");if("hash"==t)o="builtin";else if("word"==t)o="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return T(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return T(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var i=e.current().toLowerCase();return d.hasOwnProperty(i)?(o="property","maybeprop"):f.hasOwnProperty(i)?(o="string-2","maybeprop"):y?(o=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?P.top(t,e,n):(o="error","block")},maybeprop:function(t,e,n){return":"==t?T(n,e,"prop"):M(t,e,n)},prop:function(t,e,n){if(";"==t)return E(n);if("{"==t&&y)return T(n,e,"propBlock");if("}"==t||"{"==t)return A(t,e,n);if("("==t)return T(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())){if("word"==t)O(e);else if("interpolation"==t)return T(n,e,"interpolation")}else o+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?E(n):"word"==t?(o="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?A(t,e,n):")"==t?E(n):"("==t?T(n,e,"parens"):"interpolation"==t?T(n,e,"interpolation"):("word"==t&&O(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(o="variable-3",n.context.type):M(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(o="tag",n.context.type):P.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return T(n,e,"atBlock_parens");if("}"==t||";"==t)return A(t,e,n);if("{"==t)return E(n)&&T(n,e,y?"block":"top");if("interpolation"==t)return T(n,e,"interpolation");if("word"==t){var i=e.current().toLowerCase();o="only"==i||"not"==i||"and"==i||"or"==i?"keyword":c.hasOwnProperty(i)?"attribute":u.hasOwnProperty(i)?"property":h.hasOwnProperty(i)?"keyword":d.hasOwnProperty(i)?"property":f.hasOwnProperty(i)?"string-2":m.hasOwnProperty(i)?"atom":v.hasOwnProperty(i)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?A(t,e,n):"{"==t?E(n)&&T(n,e,y?"block":"top",!1):("word"==t&&(o="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?E(n):"{"==t||"}"==t?A(t,e,n,2):P.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?T(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):M(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,E(n)):"word"==t?(o="@font-face"==n.stateArg&&!p.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(o="variable","keyframes"):"{"==t?T(n,e,"top"):M(t,e,n)},at:function(t,e,n){return";"==t?E(n):"{"==t||"}"==t?A(t,e,n):("word"==t?o="tag":"hash"==t&&(o="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?E(n):"{"==t||";"==t?A(t,e,n):("word"==t?o="variable":"variable"!=t&&"("!=t&&")"!=t&&(o="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:i?"block":"top",stateArg:null,context:new S(i?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||function(t,e){var n=t.next();if(a[n]){var i=a[n](t,e);if(!1!==i)return i}return"@"==n?(t.eatWhile(/[\w\\\-]/),w("def",t.current())):"="==n||("~"==n||"|"==n)&&t.eat("=")?w(null,"compare"):'"'==n||"'"==n?(e.tokenize=C(n),e.tokenize(t,e)):"#"==n?(t.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==n?(t.match(/^\s*\w*/),w("keyword","important")):/\d/.test(n)||"."==n&&t.eat(/\d/)?(t.eatWhile(/[\w.%]/),w("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?w(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?w(null,n):("u"==n||"U"==n)&&t.match(/rl(-prefix)?\(/i)||("d"==n||"D"==n)&&t.match("omain(",!0,!0)||("r"==n||"R"==n)&&t.match("egexp(",!0,!0)?(t.backUp(1),e.tokenize=k,w("property","word")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),w("number","unit")):t.match(/^-[\w\\\-]+/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):t.match(/^\w+-/)?w("meta","meta"):void 0})(t,e);return n&&"object"==typeof n&&(r=n[1],n=n[0]),o=n,"comment"!=r&&(e.state=P[e.state](r,t,e)),o},indent:function(t,e){var n=t.context,i=e&&e.charAt(0),r=n.indent;return"prop"!=n.type||"}"!=i&&")"!=i||(n=n.prev),n.prev&&("}"!=i||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=i||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=i||"at"!=n.type&&"atBlock"!=n.type)||(r=Math.max(0,n.indent-s)):(n=n.prev,r=n.indent)),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],i=e(n),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(r),s=["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"],a=e(s),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],c=e(l),u=["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=e(u),d=["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"],f=e(d),p=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["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"],m=e(v),y=["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"],b=e(y),x=n.concat(r).concat(s).concat(l).concat(u).concat(d).concat(v).concat(y);function w(t,e){for(var n,i=!1;null!=(n=t.next());){if(i&&"/"==n){e.tokenize=null;break}i="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",x),t.defineMIME("text/css",{documentTypes:i,mediaTypes:o,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:f,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=w,w(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=w,w(t,e)):["operator","operator"]},":":function(t){return!!t.match(/\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:h,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:p,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=w,w(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:o,mediaFeatures:a,propertyKeywords:h,nonStandardPropertyKeywords:f,fontProperties:p,counterDescriptors:g,colorKeywords:m,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=w,w(t,e))}},name:"css",helperType:"gss"})}(n(6))},function(t,e,n){"use strict";var i=n(0),r=n(63);t.exports=i.Model.extend({defaults:{id:"",content:"",visible:!0,buttons:[],attributes:{}},initialize:function(t){this.btn=this.get("buttons")||[],this.buttons=new r(this.btn),this.set("buttons",this.buttons)}})},function(t,e,n){"use strict";var i=n(0),r=n(155);t.exports=i.Collection.extend({model:r,deactivateAllExceptOne:function(t,e){this.forEach(function(n,i){n!==t&&(n.set("active",!1),e&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(t,e))})},deactivateAll:function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&(t.set("active",!1),t.get("buttons").length&&t.get("buttons").deactivateAll(e))})},disableAllButtons:function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&(t.set("disable",!0),t.get("buttons").length&&t.get("buttons").disableAllButtons(e))})},disableAllButtonsExceptOne:function(t,e){this.forEach(function(n,i){n!==t&&(n.set("disable",!0),e&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(t,e))})}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e
\n
\n '},getInfo:function(){var t=this.pfx,e=this.model,n=e.get("name"),i=e.get("width"),r=e.get("height"),o=e.get("unitDim"),s=i&&r?i+"x"+r+o:"";return'\n
'+(n=n||e.getFilename())+'
\n
'+s+"
\n "},init:function(t){var e=this.pfx;this.className+=" "+e+"asset-image"},onClick:function(){var t=this.config.onClick,e=this.model;this.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),(0,i.isFunction)(t)?t(e):this.updateTarget(this.collection.target)},onDblClick:function(){var t=this.em,e=this.model,n=this.config.onDblClick;(0,i.isFunction)(n)?n(e):(this.updateTarget(this.collection.target),t&&t.get("Modal").close());var r=this.collection.onSelect;(0,i.isFunction)(r)&&r(e)},onRemove:function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)}})},function(t,e,n){"use strict";(function(e){var i,r=n(0),o=(i=r)&&i.__esModule?i:{default:i};t.exports=o.default.View.extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t,this.collection=t.collection;var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.em=e.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(t)},template:function(){var t=this.pfx;return'\n
\n '+this.getPreview()+'\n
\n
\n '+this.getInfo()+'\n
\n
\n ⨯\n
\n '},updateTarget:function(t){t&&t.set&&(t.set("attributes",e.clone(t.get("attributes"))),t.set("src",this.model.get("src")))},getPreview:function(){return""},getInfo:function(){return""},render:function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this}})}).call(this,n(1))},function(t,e,n){"use strict";var i=s(n(1)),r=s(n(0)),o=s(n(47));function s(t){return t&&t.__esModule?t:{default:t}}t.exports=r.default.View.extend({template:i.default.template('\n
\n
<%= title %>
\n <%= multiUpload ? \'multiple\' : \'\' %>/>\n
\n
\n '),events:{},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.target=this.options.globalCollection||{},this.uploadId=this.pfx+"uploadFile",this.disabled=void 0!==e.disableUpload?e.disableUpload:!e.upload&&!e.embedAsBase64,this.multiUpload=void 0===e.multiUpload||e.multiUpload,this.events["change #"+this.uploadId]="uploadFile";var n=e.uploadFile;n?this.uploadFile=n.bind(this):e.embedAsBase64&&(this.uploadFile=this.constructor.embedAsBase64),this.delegateEvents()},onUploadStart:function(){var t=this.config.em;t&&t.trigger("asset:upload:start")},onUploadEnd:function(t){var e=this.config.em;e&&e.trigger("asset:upload:end",t)},onUploadError:function(t){var e=this.config.em;console.error(t),this.onUploadEnd(t),e&&e.trigger("asset:upload:error",t)},onUploadResponse:function(t,e){var n=this.config.em,i=this.config,r=this.target,o=void 0;try{o="string"==typeof t?JSON.parse(t):t}catch(e){o=t}n&&n.trigger("asset:upload:response",o),i.autoAdd&&r&&r.add(o.data,{at:0}),this.onUploadEnd(t),e&&e(o)},uploadFile:function(t,e){var n=this,i=t.dataTransfer?t.dataTransfer.files:t.target.files,r=new FormData,s=this.config,a=s.params;for(var l in a)r.append(l,a[l]);if(this.multiUpload)for(var c=0;c'+i.dropzoneContent+"
"),h(),"draggable"in o&&[o,a].forEach(function(t){t.ondragover=d,t.ondragleave=f,t.ondrop=p})},render:function(){return this.$el.html(this.template({title:this.config.uploadText,uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:this.pfx})),this.initDrop(),this.$el.attr("class",this.pfx+"file-uploader"),this}},{embedAsBase64:function(t,e){var n=this,i=t.dataTransfer?t.dataTransfer.files:t.target.files,r={data:[]};if(FileReader){var o=[],s=/^(.+)\/(.+)$/,a=function(t){var e=new Promise(function(e,n){var i=new FileReader;i.addEventListener("load",function(r){var o=void 0,a=t.name,l=s.exec(t.type);if("image"===(o=l?l[1]:t.type)){var c={src:i.result,name:a,type:o,height:0,width:0},u=new Image;u.addEventListener("error",function(t){n(t)}),u.addEventListener("load",function(){c.height=u.height,c.width=u.width,e(c)}),u.src=c.src}else e(o?{src:i.result,name:a,type:o}:i.result)}),i.addEventListener("error",function(t){n(t)}),i.addEventListener("abort",function(t){n("Aborted")}),i.readAsDataURL(t)});o.push(e)},l=!0,c=!1,u=void 0;try{for(var h,d=i[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){a(h.value)}}catch(t){c=!0,u=t}finally{try{!l&&d.return&&d.return()}finally{if(c)throw u}}Promise.all(o).then(function(t){r.data=t,n.onUploadResponse(r,e)},function(t){n.onUploadError(t)})}else this.onUploadError(new Error("Unsupported platform, FileReader is not defined"))}})},function(t,e,n){"use strict";var i=n(1),r=a(i),o=a(n(0)),s=a(n(69));function a(t){return t&&t.__esModule?t:{default:t}}var l=n(10);t.exports=o.default.Model.extend(s.default).extend({defaults:{selectors:{},selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:0,important:0},initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t||{};var n=e.em,i=this.config.selectors||[];if(this.em=n,n){var r=n.get("SelectorManager"),o=[];i.forEach(function(t){o.push(r.add(t))}),i=o}this.set("selectors",new l(i))},getAtRule:function(){var t=this.get("atRuleType"),e=this.get("mediaText"),n=t?"@"+t:e?"@media":"";return n+(e&&n?" "+e:"")},selectorsToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.em,i=this.get("state"),r=this.get("wrapper"),o=this.get("selectorsAdd"),s=r&&n&&n.getConfig("wrappesIsBody")?"body":this.get("selectors").getFullString(),a=i?":"+i:"";return s&&e.push(""+s+a),o&&!t.skipAdd&&e.push(o),e.join(", ")},getDeclaration:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n=this.selectorsToString(),i=this.styleToString(t),r=this.get("singleAtRule");return(n||r)&&i&&(e=r?i:n+"{"+i+"}"),e},toCSS:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n=this.getAtRule(),i=this.getDeclaration(t);return i&&(e=i),n&&e&&(e=n+"{"+e+"}"),e},toJSON:function(){for(var t=arguments.length,e=Array(t),n=0;n3&&void 0!==arguments[3]?arguments[3]:{},o=e||"",s=n||"",a=i.selectorsAdd||"",l=i.atRuleType||"";t instanceof Array||t.models||(t=[t]);var c=r.default.map(t.models||t,function(t){return t.get("name")}),u=r.default.map(this.get("selectors").models,function(t){return t.get("name")});if(c.length!==u.length)return!1;for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.isString)(e)&&(e=l(e));var i=this.getStyle(),a=r({},e);this.set("style",a,n);var c=(0,s.shallowDiff)(i,a);return(0,o.keys)(c).forEach(function(e){var n=t.em;t.trigger("change:style:"+e),n&&(n.trigger("styleable:change",t,e),n.trigger("styleable:change:"+e,t,e))}),a},addStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof t?t={prop:e}:n=e||{},t=this.extendStyle(t),this.setStyle(t,n)},removeStyle:function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},styleToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.getStyle();for(var i in n){var r=t.important,s=(0,o.isArray)(r)?r.indexOf(i)>=0:r,a=n[i]+(s?" !important":"");a&&e.push(i+":"+a+";")}return e.join("")},getSelectors:function(){return this.get("selectors")||this.get("classes")}}},function(t,e,n){"use strict";t.exports=n(0).View.extend({tagName:"style",initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{};var e=this.model;this.listenTo(e,"change:style change:state change:mediaText",this.render),this.listenTo(e,"destroy remove",this.remove),this.listenTo(e.get("selectors"),"change",this.render)},render:function(){var t=this.model.get("important");return this.el.innerHTML=this.model.toCSS({important:t}),this}})},function(t,e,n){"use strict";var i=n(0);t.exports=i.View.extend({itemView:"",itemsView:"",itemType:"type",initialize:function(t,e){this.config=e||{}},addTo:function(t){this.add(t)},add:function(t,e){var n=e||null,i=this.itemView,r=t.get(this.itemType);this.itemsView&&this.itemsView[r]&&(i=this.itemsView[r]);var o=new i({model:t,config:this.config},this.config).render().el;n?n.appendChild(o):this.$el.append(o)},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.length&&this.collection.each(function(e){this.add(e,t)},this),this.$el.append(t),this}})},function(t,e,n){"use strict";var i,r=n(0),o=(i=r)&&i.__esModule?i:{default:i},s=n(1);t.exports=o.default.View.extend({initialize:function(t){this.opts=t||{},this.config=t.config||{};var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.resetChildren),this.listenTo(e,"remove",this.removeChildren)},removeChildren:function(t){var e=this.config.em,n=t.view;if(n){n.remove.apply(n);var i=n.childrenView;i&&i.stopListening(),e&&(t.get("style-signature")&&e.get("Commands").run("core:component-style-clear",{target:t}),e.trigger("component:remove",t))}},addTo:function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.config.em,i=this.collection.indexOf(t);this.addToCollection(t,null,i),n&&!e.temporary&&n.trigger("component:add",t)},addToCollection:function(t,e,i){this.compView||(this.compView=n(4));for(var r=e||null,o=this.compView,a=this.opts.componentTypes,l=t.get("type"),c=0;c2&&void 0!==arguments[2]?arguments[2]:{}).fromDisable&&this.disableEditing()},onActive:function(t){if(!this.rteEnabled&&this.model.get("editable")){t&&t.stopPropagation&&t.stopPropagation();var e=this.rte;if(e)try{this.activeRte=e.enable(this,this.activeRte)}catch(t){console.error(t)}this.rteEnabled=1,this.toggleEvents(1)}},disableEditing:function(){var t=this.model,e=t.get("editable"),n=this.rte,i={fromDisable:1};if(n&&e){try{n.disable(this,this.activeRte)}catch(t){console.error(t)}var r=this.getChildrenContainer().innerHTML,o=t.get("components");if(o.length&&o.reset(),t.set("content","",i),n.customRte)t.set("content",r,i);else{t.trigger("change:content",t,"",i),o.add(r),o.each(function(t){return function t(e){var n=!["text","default",""].some(function(t){return e.is(t)});e.set({editable:n&&e.get("editable"),highlightable:0,removable:0,draggable:0,copyable:0,selectable:n,hoverable:n,toolbar:""}),e.get("components").each(function(e){return t(e)})}(t)}),o.trigger("resetNavigator")}}this.rteEnabled=0,this.toggleEvents()},onInput:function(t){var e=this.em;e&&e.trigger("change:canvasOffset")},disablePropagation:function(t){t.stopPropagation()},toggleEvents:function(t){var e=t?"on":"off",n={on:i.on,off:i.off};this.em.setEditing(t);var r=[this.el.ownerDocument,document];n.off(r,"mousedown",this.disableEditing),n[e](r,"mousedown",this.disableEditing),this.$el.off("mousedown",this.disablePropagation),this.$el[e]("mousedown",this.disablePropagation)}})},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return(n=i({},r.default,e)).stylePrefix=e.pStylePrefix,t=n.em,this},getConfig:function(){return n},onLoad:function(){e=new o.default({level:0,config:n,opened:n.opened||{},model:t.get("DomComponents").getWrapper()}),t&&t.on("component:selected",this.componentChanged),this.componentChanged()},postRender:function(){var t=n.appendTo,e=n.root;(e&&this.setRoot(e),t)&&((0,s.isElement)(t)?t:document.querySelector(t)).appendChild(this.render())},setRoot:function(t){return e.setRoot(t),this},getRoot:function(){return e.model},getAll:function(){return e},componentChanged:function(e){if(!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).fromLayers){var i=t.get("opened"),r=t.getSelected(),o=n.scrollLayers,s=r&&r.collection?r.collection.parent:null;for(var a in i)i[a].set("open",0);for(;s;)s.set("open",1),i[s.cid]=s,s=s.collection?s.collection.parent:null;if(r&&o){var l=r.viewLayer&&r.viewLayer.el;l&&l.scrollIntoView(o)}}},render:function(){return e.render().el}}}},function(t,e,n){"use strict";var i,r=n(1),o=n(2),s=n(0),a=(i=s)&&i.__esModule?i:{default:i};var l=n(4),c=a.default.$,u=void 0;t.exports=a.default.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(t){var e=this.pfx,n=this.ppfx,i=this.config.hidable,r=this.countChildren(t),o=r?"":this.clsNoChild,s=this.clsTitle+" "+o,a=this.clsTitleC+" "+n+"one-bg",l=this.clsCaret+" fa fa-chevron-right",c=this.inputNameCls+" "+n+"no-app",u=30+10*(this.level+1)+"px",h=t.getName();return"\n "+(i?'':"")+'\n
\n
\n
\n \n '+t.getIcon()+'\n '+h+'\n
\n
\n
\n
'+(r||"")+'
\n
\n \n
\n
'},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=t,this.level=t.level,this.config=t.config,this.em=t.config.em,this.ppfx=this.em.get("Config").stylePrefix,this.sorter=t.sorter||"",this.pfx=this.config.stylePrefix;var e=this.pfx,n=this.ppfx,i=this.model,r=i.get("components");i.set("open",!1),this.listenTo(r,"remove add reset",this.checkChildren),this.listenTo(i,"change:status",this.updateStatus),this.listenTo(i,"change:open",this.updateOpening),this.listenTo(i,"change:style:display",this.updateVisibility),this.className=e+"layer no-select "+n+"two-color",this.inputNameCls=n+"layer-name",this.clsTitleC=e+"layer-title-c",this.clsTitle=e+"layer-title",this.clsCaret=e+"layer-caret",this.clsCount=e+"layer-count",this.clsMove=e+"layer-move",this.clsChildren=e+"layer-children",this.clsNoChild=e+"layer-no-chld",this.$el.data("model",i),this.$el.data("collection",r),i.viewLayer=this},getVisibilityEl:function(){return this.eyeEl||(this.eyeEl=this.$el.children("."+this.pfx+"layer-vis")),this.eyeEl},updateVisibility:function(){var t=this.pfx+"layer-hidden",e="none"==this.model.getStyle().display?"addClass":"removeClass";this.$el[e](t),this.getVisibilityEl()[e]("fa-eye-slash")},toggleVisibility:function(t){t&&t.stopPropagation();var e=this.model,n=e.getStyle();"none"==n.display?delete n.display:n.display="none",e.setStyle(n)},handleEdit:function(t){t&&t.stopPropagation();var e=this.em,n=this.getInputName();n.contentEditable=!0,n.focus(),e&&e.setEditing(1)},handleEditEnd:function(t){t&&t.stopPropagation();var e=this.em,n=this.getInputName(),i=n.textContent;n.contentEditable=!1,this.model.set({name:i}),e&&e.setEditing(0)},getInputName:function(){return this.inputName||(this.inputName=this.el.querySelector("."+this.inputNameCls)),this.inputName},updateOpening:function(){var t=this.opt.opened||{},e=this.model;e.get("open")?(this.$el.addClass("open"),this.getCaret().addClass("fa-chevron-down"),t[e.cid]=e):(this.$el.removeClass("open"),this.getCaret().removeClass("fa-chevron-down"),delete t[e.cid])},toggleOpening:function(t){t.stopPropagation(),this.model.get("components").length&&this.model.set("open",!this.model.get("open"))},handleSelect:function(t){t.stopPropagation();var e=this.em,n=this.config;if(e){var i=this.model;e.setSelected(i,{fromLayers:1});var r=n.scrollCanvas;r&&e.get("Canvas").scrollTo(i,r)}},handleHover:function(t){t.stopPropagation();var e=this.em,n=this.config,i=this.model;e&&n.showHover&&e.setHovered(i,{fromLayers:1})},startSort:function(t){t.stopPropagation();var e=this.sorter;t.button&&0!==t.button||e&&e.startSort(t.target)},freeze:function(){this.$el.addClass(this.pfx+"opac50"),this.model.set("open",0)},unfreeze:function(){this.$el.removeClass(this.pfx+"opac50")},updateStatus:function(t){l.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover}])},isVisible:function(){var t=this.model.get("style").display;if(!t||"none"!=t)return 1},checkChildren:function(){var t=this.model,e=this.countChildren(t),n=(this.pfx,this.clsNoChild),i=this.$el.children("."+this.clsTitleC).children("."+this.clsTitle);this.cnt||(this.cnt=this.$el.children("."+this.clsCount)),e?(i.removeClass(n),this.cnt.html(e)):(i.addClass(n),this.cnt.empty(),t.set("open",0))},countChildren:function(t){var e=0;return t.get("components").each(function(t){var n=this.opt.isCountable,i=this.config.hideTextnode;n&&!n(t,i)||e++},this),e},getCaret:function(){if(!this.caret||!this.caret.length){this.pfx;this.caret=this.$el.children("."+this.clsTitleC).find("."+this.clsCaret)}return this.caret},setRoot:function(t){t=(0,r.isString)(t)?this.em.getWrapper().find(t)[0]:t;var e=(0,o.getModel)(t,c);e&&(this.stopListening(),this.model=e,this.initialize(this.opt),this.render())},render:function(){var t=this.model,e=this.pfx,i=this.isVisible(),o=this.$el.empty(),s=this.level+1;(0,r.isUndefined)(u)&&(u=n(213));var a=new u({collection:t.get("components"),config:this.config,sorter:this.sorter,opened:this.opt.opened,parent:t,level:s}).render().$el;return this.config.showWrapper||1!==s?(o.html(this.template(t)),o.find("."+this.clsChildren).append(a)):o.append(a),t.get("draggable")&&this.config.sortable||o.children("."+this.clsMove).remove(),!i&&(this.className+=" "+e+"hide"),o.attr("class",this.className),this.updateOpening(),this.updateStatus(),this.updateVisibility(),this}})},function(t,e,n){"use strict";t.exports={run:function(t){t.DomComponents.clear(),t.CssComposer.clear()}}},function(t,e,n){"use strict";var i=n(1);t.exports={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.getModel().isEditing()&&!t.Canvas.isInputFocused()){var r=n.component||t.getSelectedAll();return r=(0,i.isArray)(r)?[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=0?r:t)}),e.length&&t.select(e)}}}},function(t,e,n){"use strict";var i=n(1);t.exports={run:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).target,r=t.DomComponents,o=n.get("type"),s=r.getWrapper().find('[data-gjs-type="'+o+'"]').length,a=[];if(!s){var l=t.CssComposer.getAll(),c=n.get("style-signature");c=(0,i.isArray)(c)?c:[c],l.forEach(function(t){var e=t.selectorsToString();c.forEach(function(n){n&&e.indexOf(n)>=0&&a.push(t)})}),l.remove(a)}return a}}},function(t,e,n){"use strict";t.exports={run:function(t){var e=t.getModel(),n=[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{},e=t.container;if(!e)throw new Error("'container' is required");(t=s({},o,t)).el=(0,c.isElement)(e)?e:document.querySelector(e);var n=new l.default(t).init();return t.plugins.forEach(function(e){var r=i.get(e),o=t.pluginsOpts[e]||{};if(!r){var s=window[e];r=s&&s.default?s.default:s}r?r(n,o):(0,c.isFunction)(e)?e(n,o):console.warn("Plugin "+e+" not found")}),n.getModel().loadOnStart(),t.autorender&&n.render(),r.push(n),n}})},function(t,e,n){"use strict";var i,r=n(13),o=(i=r)&&i.__esModule?i:{default:i};t.exports=function(t){var e=t||{},i=n(89),r=n(90),s=n(237);for(var a in i)a in e||(e[a]=i[a]);e.pStylePrefix=e.stylePrefix;var l=new r(e),c=new s({model:l,config:e});return{$:o.default,editor:l,DomComponents:l.get("DomComponents"),LayerManager:l.get("LayerManager"),CssComposer:l.get("CssComposer"),StorageManager:l.get("StorageManager"),AssetManager:l.get("AssetManager"),BlockManager:l.get("BlockManager"),TraitManager:l.get("TraitManager"),SelectorManager:l.get("SelectorManager"),CodeManager:l.get("CodeManager"),Commands:l.get("Commands"),Keymaps:l.get("Keymaps"),Modal:l.get("Modal"),Panels:l.get("Panels"),StyleManager:l.get("StyleManager"),Canvas:l.get("Canvas"),UndoManager:l.get("UndoManager"),DeviceManager:l.get("DeviceManager"),RichTextEditor:l.get("RichTextEditor"),Parser:l.get("Parser"),Utils:l.get("Utils"),Config:l.get("Config"),init:function(){return l.init(this),this},getConfig:function(t){return l.getConfig(t)},getHtml:function(t){return l.getHtml(t)},getCss:function(t){return l.getCss(t)},getJs:function(){return l.getJs()},getComponents:function(){return l.get("DomComponents").getComponents()},getWrapper:function(){return l.get("DomComponents").getWrapper()},setComponents:function(t){return l.setComponents(t),this},addComponents:function(t,e){return this.getComponents().add(t,e)},getStyle:function(){return l.get("CssComposer").getAll()},setStyle:function(t){return l.setStyle(t),this},getSelected:function(){return l.getSelected()},getSelectedAll:function(){return l.getSelectedAll()},getSelectedToStyle:function(){var t=l.getSelected();if(t)return this.StyleManager.getModelToStyle(t)},select:function(t){return l.setSelected(t),this},selectAdd:function(t){return l.addSelected(t),this},selectRemove:function(t){return l.removeSelected(t),this},selectToggle:function(t){return l.toggleSelected(t),this},setDevice:function(t){return l.set("device",t),this},getDevice:function(){return l.get("device")},runCommand:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l.get("Commands").run(t,e)},stopCommand:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l.get("Commands").stop(t,e)},store:function(t){return l.store(t)},load:function(t){return l.load(t)},getContainer:function(){return e.el},getDirtyCount:function(){return l.getDirtyCount()},refresh:function(){l.refreshCanvas()},setCustomRte:function(t){this.RichTextEditor.customRte=t},setCustomParserCss:function(t){return this.Parser.getConfig().parserCss=t,this},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l.log(t,e),this},on:function(t,e){return l.on(t,e),this},once:function(t,e){return l.once(t,e),this},off:function(t,e){return l.off(t,e),this},trigger:function(t){return l.trigger.apply(l,arguments),this},destroy:function(){return l.destroyAll()},getEl:function(){return c.el},getModel:function(){return l},render:function(){var t=this;return l.on("loaded",function(){t.UndoManager.clear(),l.get("modules").forEach(function(t){t.postRender&&t.postRender(c)})}),c.render(),c.el}}}},function(t,e,n){"use strict";t.exports={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, #wrapper {\n min-height: 100%;\n }\n body {\n margin: 0;\n height: 100%;\n background-color: #fff\n }\n #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,wrappesIsBody:1,avoidInlineStyle:0,avoidDefaults:0,clearStyles:0,el:"",undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},rte:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{devices:[{name:"Desktop",width:""},{name:"Tablet",width:"768px",widthMedia:"992px"},{name:"Mobile landscape",width:"568px",widthMedia:"768px"},{name:"Mobile portrait",width:"320px",widthMedia:"480px"}]},styleManager:{sectors:[{name:"General",open:!1,buildProps:["float","display","position","top","right","left","bottom"]},{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}},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.config=e,this.set("Config",e),this.set("modules",[]),this.set("toLoad",[]),this.set("storables",[]);var n=e.el,i=e.log,o=!0===i?(0,r.keys)(h):(0,r.isArray)(i)?i:[];n&&e.fromElement&&(this.config.components=n.innerHTML),this.attrsOrig=n?(0,r.toArray)(n.attributes).reduce(function(t,e){return t[e.nodeName]=e.nodeValue,t},{}):"",s.forEach(function(e){return t.loadModule(e)}),this.on("change:componentHovered",this.componentHovered,this),this.on("change:changesCount",this.updateChanges,this),o.forEach(function(e){return t.listenLog(e)}),[{from:"change:selectedComponent",to:"component:toggled"}].forEach(function(e){var n=e.from,i=e.to;t.listenTo(t,n,function(){for(var e=arguments.length,r=Array(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:null,n=this.get("StorageManager");this.get("toLoad").forEach(function(t){t.onLoad()});var i=function(){t.get("modules").forEach(function(e){return e.postLoad&&e.postLoad(t)}),e&&e()};n&&n.canAutoload()?this.load(i):i()},updateChanges:function(){var t=this.get("StorageManager"),e=this.get("changesCount");this.config.noticeOnUnload&&(window.onbeforeunload=e?function(t){return 1}:null),t.isAutosave()&&e>=t.getStepsBeforeSave()&&this.store()},loadModule:function(t){var e=this.config,n=new t,r=e[n.name.charAt(0).toLowerCase()+n.name.slice(1)]||e[n.name]||{};r.pStylePrefix=e.pStylePrefix||"";var o=this.get("StorageManager");if(n.storageKey&&n.store&&n.load&&o){r.stm=o;var s=this.get("storables");s.push(n),this.set("storables",s)}return r.em=this,n.init(i({},r)),!n.private&&this.set(n.name,n),n.onLoad&&this.get("toLoad").push(n),this.get("modules").push(n),this},init:function(t){this.set("Editor",t)},getEditor:function(){return this.get("Editor")},handleUpdates:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.temporary||(c&&clearInterval(c),c=setTimeout(function(){i.avoidStore||n.set("changesCount",n.get("changesCount")+1,i)},0))},componentHovered:function(t,e,n){var i=this.previous("componentHovered");i&&this.trigger("component:unhovered",i,n),e&&this.trigger("component:hovered",e,n)},getSelected:function(){return this.get("selected").last()},getSelectedAll:function(){return this.get("selected").models},setSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,r.isArray)(t),s=i?t:[t],a=this.get("selected");i&&this.removeSelected(a.filter(function(t){return!(0,r.contains)(s,t)})),s.forEach(function(t){var r=(0,o.getModel)(t,u);r&&!r.get("selectable")||(!i&&e.removeSelected(a.filter(function(t){return t!==r})),e.addSelected(r,n))})},addSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,o.getModel)(t,u);((0,r.isArray)(i)?i:[i]).forEach(function(t){if(!t||t.get("selectable")){var i=e.get("selected");n.forceChange&&i.remove(t,n),i.push(t,n)}})},removeSelected:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.get("selected").remove((0,o.getModel)(t,u),e)},toggleSelected:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,o.getModel)(t,u);((0,r.isArray)(i)?i:[i]).forEach(function(t){e.get("selected").contains(t)?e.removeSelected(t,n):e.addSelected(t,n)})},setHovered:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,o.getModel)(t,u);n&&!n.get("hoverable")||(e.forceChange&&this.set("componentHovered",""),this.set("componentHovered",n,e))},setComponents:function(t){return this.get("DomComponents").setComponents(t)},getComponents:function(){var t=this.get("DomComponents"),e=this.get("CodeManager");if(t&&e){var n=t.getComponents();return e.getCode(n,"json")}},setStyle:function(t){for(var e=this.get("CssComposer").getAll(),n=0,i=e.length;n"+i+"<\/script>":""},getCss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.config,n=e.wrappesIsBody,i=t.avoidProtected,o=(0,r.isUndefined)(t.keepUnusedStyles)?e.keepUnusedStyles:t.keepUnusedStyles,s=this.get("CssComposer"),a=this.get("DomComponents").getComponent();return(i?"":e.protectedCss)+this.get("CodeManager").getCode(a,"css",{cssc:s,wrappesIsBody:n,keepUnusedStyles:o})},getJs:function(){var t=this.get("DomComponents").getWrapper();return this.get("CodeManager").getCode(t,"js").trim()},store:function(t){var e=this,n=this.get("StorageManager"),i={};if(n)return this.get("storables").forEach(function(t){var e=t.store(1);for(var n in e)i[n]=e[n]}),n.store(i,function(n){t&&t(n),e.set("changesCount",0),e.trigger("storage:store",i)}),i},load:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.getCacheLoad(1,function(n){t.get("storables").forEach(function(t){return t.load(n)}),e&&e(n)})},getCacheLoad:function(t,e){var n=this,i=t?1:0;if(this.cacheLoad&&!i)return this.cacheLoad;var r=this.get("StorageManager"),o=[];if(!r)return{};this.get("storables").forEach(function(t){var e=t.storageKey;((e="function"==typeof e?e():e)instanceof Array?e:[e]).forEach(function(t){o.push(t)})}),r.load(o,function(t){n.cacheLoad=t,e&&e(t),setTimeout(function(){return n.trigger("storage:load",t)},0)})},getDeviceModel:function(){var t=this.get("device");return this.get("DeviceManager").get(t)},runDefault:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get("Commands").get(this.config.defaultCommand);e&&!this.defaultRunning&&(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=1)},stopDefault:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get("Commands").get(this.config.defaultCommand);e&&(e.stop(this,this,t),this.defaultRunning=0)},refreshCanvas:function(){this.set("canvasOffset",this.get("Canvas").getOffset())},clearSelection:function(t){(t||window).getSelection().removeAllRanges()},getCurrentMedia:function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,i=t.devicePreviewMode,r=e&&e.get("widthMedia");return e&&r&&!i?"("+n+": "+r+")":""},getWrapper:function(){return this.get("DomComponents").getWrapper()},getDirtyCount:function(){return this.get("changesCount")},destroyAll:function(){var t=this.attributes,e=t.DomComponents,n=t.CssComposer,i=t.UndoManager,r=t.Panels,o=t.Canvas,s=t.Keymaps;e.clear(),n.clear(),i.clear().removeAll(),r.getPanels().reset(),o.getCanvasView().remove(),s.removeAll(),this.view.remove(),this.stopListening(),u(this.config.el).empty().attr(this.attrsOrig)},setEditing:function(t){return this.set("editing",t),this},isEditing:function(){return!!this.get("editing")},log:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.ns,i=e.level,r=void 0===i?"debug":i;if(this.trigger("log",t,e),r&&this.trigger("log:"+r,t,e),n){var o="log-"+n;this.trigger(o,t,e),r&&this.trigger(o+":"+r,t,e)}},logInfo:function(t,e){this.log(t,i({},e,{level:"info"}))},logWarning:function(t,e){this.log(t,i({},e,{level:"warning"}))},logError:function(t,e){this.log(t,i({},e,{level:"error"}))},data:function(t,e,n){if(t["_gjs-data"]||(t["_gjs-data"]={}),(0,r.isUndefined)(n))return t["_gjs-data"][e];t["_gjs-data"][e]=n}})},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";t.exports=function(){return{name:"Utils",init:function(){return this},Sorter:n(93),Resizer:n(94),Dragger:n(95)}}},function(t,e,n){"use strict";(function(e){var i,r=Object.assign||function(t){for(var e=1;es+c-10||ra+l-10)return 1},getCurrentPos:function(){var t=this.eventMove;return{x:t.pageX||0,y:t.pageY||0}},getDim:function(t){var e,n,i,r;if(this.canvasRelative&&this.em){var o=this.em.get("Canvas").getElementPos(t),s=window.getComputedStyle(t),a=parseFloat(s.marginTop),l=parseFloat(s.marginBottom),c=parseFloat(s.marginRight),u=parseFloat(s.marginLeft);e=o.top-a,n=o.left-u,i=o.height+a+l,r=o.width+u+c}else{var h=this.offset(t);e=this.relative?t.offsetTop:h.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:h.left-(this.wmargin?-1:1)*this.elL,i=t.offsetHeight,r=t.offsetWidth}return[e,n,i,r]},getChildrenDim:function(t){var e=[];if(!t)return e;var n=this.getTargetModel(t);n&&n.view&&!this.ignoreViewChildren&&(t=n.view.getChildrenContainer());for(var i=t.children,r=0,o=i.length;rs||s>a+c-r||l+r>o||o>l+u-r)&&(i=1),!!i},findPosition:function(t,e,n){for(var i={index:0,method:"before"},r=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,f=t.length;do||a&&c>=a||r&&s0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setOptions(e),(0,r.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop"),this}return i(t,[{key:"getConfig",value:function(){return this.opts}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=(0,r.defaults)(t,s),this.setup()}},{key:"setup",value:function(){var t=this.opts,e=t.prefix||"",n=t.appendTo||document.body,i=this.container;for(i||((i=document.createElement("div")).className=e+"resizer-c",n.appendChild(i),this.container=i);i.firstChild;)i.removeChild(i.firstChild);var r={};for(var o in["tl","tc","tr","cl","cr","bl","bc","br"].forEach(function(e){return r[e]=t[e]?function(t,e){var n=e.prefix||"",i=document.createElement("i");return i.className=n+"resizer-h "+n+"resizer-h-"+t,i.setAttribute("data-"+n+"handler",t),i}(e,t):""}),r){var s=r[o];s&&i.appendChild(s)}this.handlers=r,this.mousePosFetcher=t.mousePosFetcher,this.updateTarget=t.updateTarget,this.posFetcher=t.posFetcher,this.onStart=t.onStart,this.onMove=t.onMove,this.onEnd=t.onEnd}},{key:"toggleFrames",value:function(t){if(this.opts.silentFrames){var e=document.querySelectorAll("iframe");(0,r.each)(e,function(e){return e.style.pointerEvents=t?"none":""})}}},{key:"isHandler",value:function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1}},{key:"getFocusedEl",value:function(){return this.el}},{key:"getDocumentEl",value:function(){return[this.el.ownerDocument,document]}},{key:"getElementPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.posFetcher||"";return n?n(t,e):function(t,e){var n=e||window,i=t.getBoundingClientRect();return{left:i.left+n.pageXOffset,top:i.top+n.pageYOffset,width:i.width,height:i.height}}(t)}},{key:"focus",value:function(t){if(!t||t!==this.el){this.el=t;var e=this.opts,n=this.getElementPos(t,{target:"container"}),i=this.container.style;e.avoidContainerUpdate||(i.left=n.left+"px",i.top=n.top+"px",i.width=n.width+"px",i.height=n.height+"px",i.display="block"),(0,o.on)(this.getDocumentEl(),"mousedown",this.handleMouseDown)}}},{key:"blur",value:function(){this.container.style.display="none",this.el&&((0,o.off)(this.getDocumentEl(),"mousedown",this.handleMouseDown),this.el=null)}},{key:"start",value:function(t){if(0===t.button){t.preventDefault(),t.stopPropagation();var e=this.el,n=this.opts||{},i="data-"+n.prefix+"handler",s=this.getElementPos(e,{target:"el"});this.handlerAttr=t.target.getAttribute(i),this.clickedHandler=t.target,this.startDim={t:s.top,l:s.left,w:s.width,h:s.height},this.rectDim={t:s.top,l:s.left,w:s.width,h:s.height},this.startPos={x:t.clientX,y:t.clientY};var a=this.getDocumentEl();(0,o.on)(a,"mousemove",this.move),(0,o.on)(a,"keydown",this.handleKeyDown),(0,o.on)(a,"mouseup",this.stop),(0,r.isFunction)(this.onStart)&&this.onStart(t,{docs:a,config:n,el:e,resizer:this}),this.toggleFrames(1),this.move(t)}}},{key:"move",value:function(t){var e=this.onMove,n=this.mousePosFetcher,i=n?n(t):{x:t.clientX,y:t.clientY};this.currentPos=i,this.delta={x:i.x-this.startPos.x,y:i.y-this.startPos.y},this.keys={shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey},this.rectDim=this.calc(this),this.updateRect(0),e&&e(t),0===t.which&&this.stop(t)}},{key:"stop",value:function(t){var e=this.opts,n=this.getDocumentEl();(0,o.off)(n,"mousemove",this.move),(0,o.off)(n,"keydown",this.handleKeyDown),(0,o.off)(n,"mouseup",this.stop),this.updateRect(1),this.toggleFrames(),(0,r.isFunction)(this.onEnd)&&this.onEnd(t,{docs:n,config:e})}},{key:"updateRect",value:function(t){var e=this.el,n=this.opts,i=this.rectDim,o=this.container.style,s=this.updateTarget,a=this.getSelectedHandler(),l=n.unitHeight,c=n.unitWidth,u=n.keyWidth,h=n.keyHeight;if((0,r.isFunction)(s))s(e,i,{store:t,selectedHandler:a,resizer:this,config:n});else{var d=e.style;d[u]=i.w+c,d[h]=i.h+l}var f=this.getElementPos(e,{target:"container"});n.avoidContainerUpdate||(o.left=f.left+"px",o.top=f.top+"px",o.width=f.width+"px",o.height=f.height+"px")}},{key:"getSelectedHandler",value:function(){var t=this.handlers;if(this.selectedHandler)for(var e in t)if(t[e]===this.selectedHandler)return e}},{key:"handleKeyDown",value:function(t){27===t.keyCode&&(this.rectDim=this.startDim,this.stop(t))}},{key:"handleMouseDown",value:function(t){var e=t.target;this.isHandler(e)?(this.selectedHandler=e,this.start(t)):e!==this.el&&(this.selectedHandler="",this.blur())}},{key:"calc",value:function(t){var e=void 0,n=this.opts||{},i=n.step,r=this.startDim,s=n.minDim,a=n.maxDim,l=t.delta.x,c=t.delta.y,u=r.w,h=r.h,d={t:0,l:0,w:u,h:h};if(t){var f=t.handlerAttr;~f.indexOf("r")&&(e=(0,o.normalizeFloat)(u+l*i,i),e=Math.max(s,e),a&&(e=Math.min(a,e)),d.w=e),~f.indexOf("b")&&(e=(0,o.normalizeFloat)(h+c*i,i),e=Math.max(s,e),a&&(e=Math.min(a,e)),d.h=e),~f.indexOf("l")&&(e=(0,o.normalizeFloat)(u-l*i,i),e=Math.max(s,e),a&&(e=Math.min(a,e)),d.w=e),~f.indexOf("t")&&(e=(0,o.normalizeFloat)(h-c*i,i),e=Math.max(s,e),a&&(e=Math.min(a,e)),d.h=e);var p=n.ratioDefault?!t.keys.shift:t.keys.shift;if(f.indexOf("c")<0&&p){var g=r.w/r.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=r.w-d.w),~f.indexOf("t")&&(d.t=r.h-d.h),d}}}]),t}();t.exports={init:function(t){return new a(t)}}},function(t,e,n){"use strict";var i,r=n(0);var o=((i=r)&&i.__esModule?i:{default:i}).default.$;t.exports={setKey:function(t,e){},getElementRect:function(t){var e=this.opts.posFetcher||"";return e?e(t,{avoidFrameOffset:1}):function(t,e){var n=e||window,i=t.getBoundingClientRect();return{left:i.left+n.pageXOffset,top:i.top+n.pageYOffset,width:i.width,height:i.height}}(t)},init:function(t){return this.setOptions(t),this.handleMouseDown=this.handleMouseDown.bind(this),this.drag=this.drag.bind(this),this.move=this.move.bind(this),this.stop=this.stop.bind(this),this.setKey("up, right, down, left",this.handleKey),this},setOptions:function(t){this.opts=t||{}},focus:function(t){if(!t||t!==this.el){this.getDocumentEl(t),this.blur(),this.el=t,this.handlers=this.opts.dragHandlers||[t];var e=this.getElementRect(t);this.elRect=e,this.startTop=e.top,this.startLeft=e.left,this.getDocumentEl().on("mousedown",this.handleMouseDown)}},blur:function(){this.getDocumentEl().off("mousedown",this.handleMouseDown),this.el=null},start:function(t){this.startPos=this.getMousePos(t);var e=this.getDocumentEl();e.on("mousemove",this.drag),e.on("mouseup",this.stop);var n=this.opts.onStart;"function"==typeof n&&n(t,{docs:e,el:this.el,start:this.startPos,elRect:this.elRect}),this.drag(t)},stop:function(t){var e=this.getDocumentEl();e.off("mousemove",this.drag),e.off("mouseup",this.stop),this.lockedAxis=null;var n=this.opts.onEnd;"function"==typeof n&&n(t,{docs:e,delta:this.delta,end:{x:this.startLeft+this.delta.x,y:this.startTop+this.delta.y}})},handleMouseDown:function(t){var e=t.target;this.isHandler(e)&&this.start(t)},isHandler:function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1},handleKey:function(t,e){switch(e.shortcut){case"up":this.move(0,-1);break;case"right":this.move(1,0);break;case"down":this.move(0,1);break;case"left":this.move(-1,0)}},getDocumentEl:function(t){t=t||this.el;if(!this.$doc){var e=[document];t&&e.push(t.ownerDocument),this.$doc=o(e)}return this.$doc},getMousePos:function(t){var e=this.opts.mousePosFetcher;return e?e(t):{x:t.clientX,y:t.clientY}},drag:function(t){var e=this.lockedAxis,n=this.getMousePos(t),i={x:n.x-this.startPos.x,y:n.y-this.startPos.y};if(t.shiftKey){if(!e){var r=i.x,o=i.y,s=Math.abs(r),a=Math.abs(o);o>=s||o<=-s?e="x":(r>a||r<-a)&&(e="y")}}else e=null;"x"===e&&(i.x=this.startPos.x),"y"===e&&(i.y=this.startPos.y),this.lockedAxis=e,this.delta=i,this.move(i.x,i.y);var l=this.opts.onDrag;"function"==typeof l&&l(t,{delta:i,current:{x:this.startLeft+i.x,y:this.startTop+i.y},lockedAxis:e}),0===t.which&&this.stop(t)},move:function(t,e){this.moveX(t),this.moveY(e)},moveX:function(t){var e=this.el,n=(this.opts,this.startLeft+t),i=this.opts.setX;"function"==typeof i?i(n,{el:e,start:this.startLeft,delta:t}):e.style.left=n+"px"},moveY:function(t){var e=this.el,n=(this.opts,this.startTop+t),i=this.opts.setY;"function"==typeof i?i(n,{el:e,start:this.startTop,delta:t}):e.style.top=n+"px"}}},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return e=r({},a,n),t=e.em,this.em=t,this},onLoad:function(){var t=e.defaults;for(var n in t){var i=t[n];this.add(n,i.keys,i.handler)}},add:function(t,e,r){var a=this.em,l=a.get("Commands"),c=a.getEditor(),u={id:t,keys:e,handler:r};return n[t]&&this.remove(t),n[t]=u,s(e,function(e,n){"object"==(void 0===(r=(0,o.isString)(r)?l.get(r):r)?"undefined":i(r))?r.run(c):r(c);var s=[t,n.shortcut,e];a.trigger.apply(a,["keymap:emit"].concat(s)),a.trigger.apply(a,["keymap:emit:"+t].concat(s))}),a.trigger("keymap:add",u),u},get:function(t){return n[t]},getAll:function(){return n},remove:function(t){var e=this.em,i=this.get(t);if(i)return delete n[t],s.unbind(i.keys),e&&e.trigger("keymap:remove",i),i},removeAll:function(){var t=this;return Object.keys(n).forEach(function(e){return t.remove(e)}),this}}}},function(t,e,n){"use strict";var i,r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};n=r({},a,o),t=n.em,this.em=t,(e=new s.default({track:!0,register:[]})).changeUndoType("change",{condition:!1}),e.changeUndoType("add",{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:e,before:void 0,after:t,options:r({},n)}}}),e.changeUndoType("remove",{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:e,before:t,after:void 0,options:r({},n)}}});var l={on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!i&&(i=t.previousAttributes()),!n.avoidStore){var r={object:t,before:i,after:t.toJSON()};return i=null,r}},undo:function(t,e,n,i){t.set(e)},redo:function(t,e,n,i){t.set(n)}};return["style","attributes","content","src"].forEach(function(t){return e.addUndoType("change:"+t,l)}),e.on("undo redo",function(){return t.trigger("component:toggled change:canvasOffset")}),["undo","redo"].forEach(function(n){return e.on(n,function(){return t.trigger(n)})}),this},getConfig:function(){return n},add:function(t){return e.register(t),this},remove:function(t){return e.unregister(t),this},removeAll:function(){return e.unregisterAll(),this},start:function(){return e.startTracking(),this},stop:function(){return e.stopTracking(),this},undo:function(){return!t.isEditing()&&e.undo(1),this},undoAll:function(){return e.undoAll(),this},redo:function(){return!t.isEditing()&&e.redo(1),this},redoAll:function(){return e.redoAll(),this},hasUndo:function(){return e.isAvailable("undo")},hasRedo:function(){return e.isAvailable("redo")},getStack:function(){return e.stack},clear:function(){return e.clear(),this},getInstance:function(){return e}}}},function(t,e,n){var i,r,o; /*! * Backbone.Undo.js v0.2 * diff --git a/package-lock.json b/package-lock.json index c204325fb4..e67b0b6fc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "grapesjs", - "version": "0.14.45", + "version": "0.14.46", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -19877,9 +19877,9 @@ } }, "whatwg-fetch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==", "dev": true }, "whatwg-mimetype": { diff --git a/package.json b/package.json index eb2807c05b..6318d7a0d2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "grapesjs", "description": "Free and Open Source Web Builder Framework", - "version": "0.14.45", + "version": "0.14.46", "author": "Artur Arseniev", "license": "BSD-3-Clause", "homepage": "http://grapesjs.com", @@ -42,7 +42,7 @@ "webpack": "^4.26.1", "webpack-cli": "^3.1.2", "webpack-dev-server": "^3.1.10", - "whatwg-fetch": "^2.0.4" + "whatwg-fetch": "^3.0.0" }, "keywords": [ "grapes",