!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/ecom1.picotech.app/public_html_ecom1/Modules/PageBuilder/Resources/assets/js/   drwxr-xr-x
Free 26.54 GB of 117.98 GB (22.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     grape.min.js (957.33 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*! grapesjs - 0.20.1 */
!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()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{var t={3410:(t,e,n)=>{var r,i,o;1&&(i=[n(9050),n(2316)],r=function(t,e){var n=Array.prototype.slice;function r(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function i(t,e){return n.call(t,e)}function o(e,n){return null!=e&&(t.isArray(n)||(n=i(arguments,1)),t.all(n,(function(t){return t in e})))}var a=function(){var e=!1,n=-1;function r(){n++,e=!0,t.defer((function(){e=!1}))}return function(){return e||r(),n}}();function s(){this.registeredObjects=[],this.cidIndexes=[]}function l(e,n,r,i){for(var o,a=0,s=n.length;a<s;a++)if(o=n[a]){if("on"===e){if(!i.objectRegistry.register(o))continue}else if(!i.objectRegistry.unregister(o))continue;t.isFunction(o[e])&&o[e]("all",r,i)}}function c(e,n){var r=n.type,i=n.undoTypes,o=!i[r]||i[r][e];t.isFunction(o)&&o(n.object,n.before,n.after,n.options)}function u(e,r,i,o,a){if(!(i.isCurrentlyUndoRedoing||"undo"===e&&-1===i.pointer||"redo"===e&&i.pointer===i.length-1)){i.isCurrentlyUndoRedoing=!0;var s,l,c="undo"===e;for(a?l=c&&i.pointer===i.length-1||!c&&-1===i.pointer?t.clone(i.models):n.apply(i.models,c?[0,i.pointer]:[i.pointer,i.length-1]):(s=i.at(c?i.pointer:i.pointer+1),l=o?i.where({magicFusionIndex:s.get("magicFusionIndex")}):[s]),i.pointer+=(c?-1:1)*l.length;s=c?l.pop():l.shift();)s[e]();i.isCurrentlyUndoRedoing=!1,r.trigger(e,r)}}function f(t,e){var n=t.condition,i=typeof n;return"function"===i?!!r(n,t,e):"boolean"!==i||n}function h(t,e,n,i){if(t.track&&!t.isCurrentlyUndoRedoing&&e in i&&f(i[e],n)){var s=r(i[e]["on"],i[e],n);if(o(s,"object","before","after")){if(s.type=e,s.magicFusionIndex=a(),s.undoTypes=i,t.pointer<t.length-1)for(var l=t.length-t.pointer-1;l--;)t.pop();t.pointer=t.length,t.add(s),t.length>t.maximumStackLength&&(t.shift(),t.pointer--)}}}s.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,(function(t){return this.registeredObjects[t]}),this).concat(this.registeredObjects)}};var p={add:{undo:function(t,e,n,r){t.remove(n,r)},redo:function(t,e,n,r){r.index&&(r.at=r.index),t.add(n,r)},on:function(e,n,r){return{object:n,before:void 0,after:e,options:t.clone(r)}}},remove:{undo:function(t,e,n,r){"index"in r&&(r.at=r.index),t.add(e,r)},redo:function(t,e,n,r){t.remove(e,r)},on:function(e,n,r){return{object:n,before:e,after:void 0,options:t.clone(r)}}},change:{undo:function(e,n,r,i){t.isEmpty(n)?t.each(t.keys(r),e.unset,e):(e.set(n),i&&i.unsetData&&i.unsetData.before&&i.unsetData.before.length&&t.each(i.unsetData.before,e.unset,e))},redo:function(e,n,r,i){t.isEmpty(r)?t.each(t.keys(n),e.unset,e):(e.set(r),i&&i.unsetData&&i.unsetData.after&&i.unsetData.after.length&&t.each(i.unsetData.after,e.unset,e))},on:function(e,n){var r=e.changedAttributes(),i=t.keys(r),o=t.pick(e.previousAttributes(),i),a=t.keys(o),s=(n||(n={})).unsetData={after:[],before:[]};return i.length!=a.length&&(i.length>a.length?t.each(i,(function(t){t in o||s.before.push(t)}),this):t.each(a,(function(t){t in r||s.after.push(t)}))),{object:e,before:o,after:r,options:t.clone(n)}}},reset:{undo:function(t,e,n){t.reset(e)},redo:function(t,e,n){t.reset(n)},on:function(e,n){return{object:e,before:n.previousModels,after:t.clone(e.models)}}}};function d(){}function g(e,n,r,i){if("object"==typeof n)return t.each(n,(function(t,n){2===e?g(e,t,r,i):g(e,n,t,r)}));switch(e){case 0:o(r,"undo","redo","on")&&t.all(t.pick(r,"undo","redo","on"),t.isFunction)&&(i[n]=r);break;case 1:i[n]&&t.isObject(r)&&(i[n]=t.extend({},i[n],r));break;case 2:delete i[n]}return this}d.prototype=p;var v=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){c("undo",this.attributes)},redo:function(t){c("redo",this.attributes)}}),m=e.Collection.extend({model:v,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),y=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new m,this.objectRegistry=new s,this.undoTypes=new d,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",(function(t,e){this.stack.setMaxLength(e)}),this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?r(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){h(this.stack,t,i(arguments,1),this.undoTypes)},register:function(){l("on",arguments,this._addToStack,this)},unregister:function(){l("off",arguments,this._addToStack,this)},unregisterAll:function(){r(this.unregister,this,this.objectRegistry.get())},undo:function(t){u("undo",this,this.stack,t)},undoAll:function(){u("undo",this,this.stack,!1,!0)},redo:function(t){u("redo",this,this.stack,t)},redoAll:function(){u("redo",this,this.stack,!1,!0)},isAvailable:function(t){var e=this.stack,n=e.length;switch(t){case"undo":return n>0&&e.pointer>-1;case"redo":return n>0&&e.pointer<n-1;default:return!1}},merge:function(e){for(var n,r=t.isArray(e)?e:i(arguments);n=r.pop();)n instanceof y&&n.stack instanceof m&&(n.stack=this.stack)},addUndoType:function(t,e){g(0,t,e,this.undoTypes)},changeUndoType:function(t,e){g(1,t,e,this.undoTypes)},removeUndoType:function(t){g(2,t,void 0,this.undoTypes)},clear:function(){this.stack.reset(),this.stack.pointer=-1}});return t.extend(y,{defaults:function(e){t.extend(y.prototype.defaults,e)},addUndoType:function(t,e){g(0,t,e,p)},changeUndoType:function(t,e){g(1,t,e,p)},removeUndoType:function(t){g(2,t,void 0,p)}}),e.UndoManager=y},void 0===(o='function'==typeof r?r.apply(e,i):r)||(t.exports=o))},2316:(t,e,n)=>{var r,i;!function(o){var a='object'==typeof self&&self.self===self&&self||'object'==typeof n.g&&n.g.global===n.g&&n.g;if(1)r=[n(9050),n(2579),e],i=function(t,e,n){a.Backbone=function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION='1.4.1',e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a,s=e.Events={},l=/\s+/,c=function(t,e,r,i,o){var a,s=0;if(r&&'object'==typeof r){void 0!==i&&'context'in o&&void 0===o.context&&(o.context=i);for(a=n.keys(r);s<a.length;s++)e=c(t,e,a[s],r[a[s]],o)}else if(r&&l.test(r))for(a=r.split(l);s<a.length;s++)e=t(e,a[s],i,o);else e=t(e,r,i,o);return e};s.on=function(t,e,n){(this._events=c(u,this._events||{},t,e,{context:n,ctx:this,listening:a}),a)&&((this._listeners||(this._listeners={}))[a.id]=a,a.interop=!1);return this},s.listenTo=function(t,e,r){if(!t)return this;var i=t._listenId||(t._listenId=n.uniqueId('l')),o=this._listeningTo||(this._listeningTo={}),s=a=o[i];s||(this._listenId||(this._listenId=n.uniqueId('l')),s=a=o[i]=new v(this,t));var l=f(t,e,r,this);if(a=void 0,l)throw l;return s.interop&&s.on(e,r),this};var u=function(t,e,n,r){if(n){var i=t[e]||(t[e]=[]),o=r.context,a=r.ctx,s=r.listening;s&&s.count++,i.push({callback:n,context:o,ctx:o||a,listening:s})}return t},f=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};s.off=function(t,e,n){return this._events?(this._events=c(h,this._events,t,e,{context:n,listeners:this._listeners}),this):this},s.stopListening=function(t,e,r){var i=this._listeningTo;if(!i)return this;for(var o=t?[t._listenId]:n.keys(i),a=0;a<o.length;a++){var s=i[o[a]];if(!s)break;s.obj.off(e,r,this),s.interop&&s.off(e,r)}return n.isEmpty(i)&&(this._listeningTo=void 0),this};var h=function(t,e,r,i){if(t){var o,a=i.context,s=i.listeners,l=0;if(e||a||r){for(o=e?[e]:n.keys(t);l<o.length;l++){var c=t[e=o[l]];if(!c)break;for(var u=[],f=0;f<c.length;f++){var h=c[f];if(r&&r!==h.callback&&r!==h.callback._callback||a&&a!==h.context)u.push(h);else{var p=h.listening;p&&p.off(e,r)}}u.length?t[e]=u:delete t[e]}return t}for(o=n.keys(s);l<o.length;l++)s[o[l]].cleanup()}};s.once=function(t,e,n){var r=c(p,{},t,e,this.off.bind(this));return'string'==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},s.listenToOnce=function(t,e,n){var r=c(p,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};var p=function(t,e,r,i){if(r){var o=t[e]=n.once((function(){i(e,o),r.apply(this,arguments)}));o._callback=r}return t};s.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return c(d,this._events,t,void 0,n),this};var d=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&g(i,r),o&&g(o,[e].concat(r))}return t},g=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,s);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}},v=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};v.prototype.on=s.on,v.prototype.off=function(t,e){var n;this.interop?(this._events=c(h,this._events,t,e,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},v.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},s.bind=s.on,s.unbind=s.off,n.extend(e,s);var m=e.Model=function(t,e){var r=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var i=n.result(this,'defaults');r=n.defaults(n.extend({},i,r),i),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(m.prototype,s,{changed:null,validationError:null,idAttribute:'id',cidPrefix:'c',preinitialize:function(){},initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(null==t)return this;var i;if('object'==typeof t?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var o=r.unset,a=r.silent,s=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,f=this._previousAttributes;for(var h in i)e=i[h],n.isEqual(c[h],e)||s.push(h),n.isEqual(f[h],e)?delete u[h]:u[h]=e,o?delete c[h]:c[h]=e;if(this.idAttribute in i){var p=this.id;this.id=this.get(this.idAttribute),this.trigger('changeId',this,p,r)}if(!a){s.length&&(this._pending=r);for(var d=0;d<s.length;d++)this.trigger('change:'+s[d],this,c[s[d]],r)}if(l)return this;if(!a)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger('change',this,r);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e,r=this._changing?this._previousAttributes:this.attributes,i={};for(var o in t){var a=t[o];n.isEqual(r[o],a)||(i[o]=a,e=!0)}return!!e&&i},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,r=t.success;return t.success=function(n){var i=t.parse?e.parse(n,t):n;if(!e.set(i,t))return!1;r&&r.call(t.context,e,n,t),e.trigger('sync',e,n,t)},G(this,t),this.sync('read',this,t)},save:function(t,e,r){var i;null==t||'object'==typeof t?(i=t,r=e):(i={})[t]=e;var o=(r=n.extend({validate:!0,parse:!0},r)).wait;if(i&&!o){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var a=this,s=r.success,l=this.attributes;r.success=function(t){a.attributes=l;var e=r.parse?a.parse(t,r):t;if(o&&(e=n.extend({},i,e)),e&&!a.set(e,r))return!1;s&&s.call(r.context,a,t,r),a.trigger('sync',a,t,r)},G(this,r),i&&o&&(this.attributes=n.extend({},l,i));var c=this.isNew()?'create':r.patch?'patch':'update';'patch'!==c||r.attrs||(r.attrs=i);var u=this.sync(c,this,r);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,i=t.wait,o=function(){e.stopListening(),e.trigger('destroy',e,e.collection,t)};t.success=function(n){i&&o(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger('sync',e,n,t)};var a=!1;return this.isNew()?n.defer(t.success):(G(this,t),a=this.sync('delete',this,t)),i||o(),a},url:function(){var t=n.result(this,'urlRoot')||n.result(this.collection,'url')||q();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,'$&/')+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger('invalid',this,r,n.extend(e,{validationError:r})),!1)}});var y=e.Collection=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},b={add:!0,remove:!0,merge:!0},w={add:!0,remove:!1},k=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,i=Array(t.length-n),o=e.length;for(r=0;r<i.length;r++)i[r]=t[r+n];for(r=0;r<o;r++)t[r+n]=e[r];for(r=0;r<i.length;r++)t[r+o+n]=i[r]};n.extend(y.prototype,s,{model:m,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,w))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var i=this._removeModels(t,e);return!e.silent&&i.length&&(e.changes={added:[],merged:[],removed:i},this.trigger('update',this,e)),r?i[0]:i},set:function(t,e){if(null!=t){(e=n.extend({},b,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var i=e.at;null!=i&&(i=+i),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);var o,a,s=[],l=[],c=[],u=[],f={},h=e.add,p=e.merge,d=e.remove,g=!1,v=this.comparator&&null==i&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(a=0;a<t.length;a++){o=t[a];var y=this.get(o);if(y){if(p&&o!==y){var w=this._isModel(o)?o.attributes:o;e.parse&&(w=y.parse(w,e)),y.set(w,e),c.push(y),v&&!g&&(g=y.hasChanged(m))}f[y.cid]||(f[y.cid]=!0,s.push(y)),t[a]=y}else h&&(o=t[a]=this._prepareModel(o,e))&&(l.push(o),this._addReference(o,e),f[o.cid]=!0,s.push(o))}if(d){for(a=0;a<this.length;a++)f[(o=this.models[a]).cid]||u.push(o);u.length&&this._removeModels(u,e)}var x=!1,O=!v&&h&&d;if(s.length&&O?(x=this.length!==s.length||n.some(this.models,(function(t,e){return t!==s[e]})),this.models.length=0,k(this.models,s,0),this.length=this.models.length):l.length&&(v&&(g=!0),k(this.models,l,null==i?this.length:i),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(a=0;a<l.length;a++)null!=i&&(e.index=i+a),(o=l[a]).trigger('add',o,this,e);(g||x)&&this.trigger('sort',this,e),(l.length||u.length||c.length)&&(e.changes={added:l,removed:u,merged:c},this.trigger('update',this,e))}return r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger('reset',this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t,t.idAttribute)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?'find':'filter'](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error('Cannot sort a set without a comparator');t||(t={});var r=e.length;return n.isFunction(e)&&(e=e.bind(this)),1===r||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger('sort',this,t),this},pluck:function(t){return this.map(t+'')},fetch:function(t){var e=(t=n.extend({parse:!0},t)).success,r=this;return t.success=function(n){var i=t.reset?'reset':'set';r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger('sync',r,n,t)},G(this,t),this.sync('read',this,t)},create:function(t,e){var r=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t,e){return t[e||this.model.prototype.idAttribute||'id']},values:function(){return new O(this,C)},keys:function(){return new O(this,S)},entries:function(){return new O(this,_)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){return this._isModel(t)?(t.collection||(t.collection=this),t):((e=e?n.clone(e):{}).collection=this,(r=this.model.prototype?new this.model(t,e):this.model(t,e)).validationError?(this.trigger('invalid',this,r.validationError,e),!1):r);var r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=this.get(t[r]);if(i){var o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];var a=this.modelId(i.attributes,i.idAttribute);null!=a&&delete this._byId[a],e.silent||(e.index=o,i.trigger('remove',i,this,e)),n.push(i),this._removeReference(i,e)}}return n},_isModel:function(t){return t instanceof m},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes,t.idAttribute);null!=n&&(this._byId[n]=t),t.on('all',this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes,t.idAttribute);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off('all',this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if(e){if(('add'===t||'remove'===t)&&n!==this)return;if('destroy'===t&&this.remove(e,r),'changeId'===t){var i=this.modelId(e.previousAttributes(),e.idAttribute),o=this.modelId(e.attributes,e.idAttribute);null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=e)}}this.trigger.apply(this,arguments)}});var x='function'==typeof Symbol&&Symbol.iterator;x&&(y.prototype[x]=y.prototype.values);var O=function(t,e){this._collection=t,this._kind=e,this._index=0},C=1,S=2,_=3;x&&(O.prototype[x]=function(){return this});O.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var t,e=this._collection.at(this._index);if(this._index++,this._kind===C)t=e;else{var n=this._collection.modelId(e.attributes,e.idAttribute);t=this._kind===S?n:[n,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var P=e.View=function(t){this.cid=n.uniqueId('view'),this.preinitialize.apply(this,arguments),n.extend(this,n.pick(t,E)),this._ensureElement(),this.initialize.apply(this,arguments)},T=/^(\S+)\s*(.*)$/,E=['model','collection','el','id','attributes','className','tagName','events'];n.extend(P.prototype,s,{tagName:'div',$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,'events')),!t)return this;for(var e in this.undelegateEvents(),t){var r=t[e];if(n.isFunction(r)||(r=this[r]),r){var i=e.match(T);this.delegate(i[1],i[2],r.bind(this))}}return this},delegate:function(t,e,n){return this.$el.on(t+'.delegateEvents'+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off('.delegateEvents'+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+'.delegateEvents'+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,'el'));else{var t=n.extend({},n.result(this,'attributes'));this.id&&(t.id=n.result(this,'id')),this.className&&(t['class']=n.result(this,'className')),this.setElement(this._createElement(n.result(this,'tagName'))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}});var j=function(t,e,n,r){switch(e){case 1:return function(){return t[n](this[r])};case 2:return function(e){return t[n](this[r],e)};case 3:return function(e,i){return t[n](this[r],R(e,this),i)};case 4:return function(e,i,o){return t[n](this[r],R(e,this),i,o)};default:return function(){var e=o.call(arguments);return e.unshift(this[r]),t[n].apply(t,e)}}},A=function(t,e,r,i){n.each(r,(function(n,r){e[r]&&(t.prototype[r]=j(e,n,r,i))}))},R=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?D(t):n.isString(t)?function(e){return e.get(t)}:t},D=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},M={forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},Z={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};n.each([[y,M,'models'],[m,Z,'attributes']],(function(t){var e=t[0],r=t[1],i=t[2];e.mixin=function(t){var r=n.reduce(n.functions(t),(function(t,e){return t[e]=0,t}),{});A(e,t,r,i)},A(e,n,r,i)})),e.sync=function(t,r,i){var o=L[t];n.defaults(i||(i={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:o,dataType:'json'};if(i.url||(a.url=n.result(r,'url')||q()),null!=i.data||!r||'create'!==t&&'update'!==t&&'patch'!==t||(a.contentType='application/json',a.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(a.contentType='application/x-www-form-urlencoded',a.data=a.data?{model:a.data}:{}),i.emulateHTTP&&('PUT'===o||'DELETE'===o||'PATCH'===o)){a.type='POST',i.emulateJSON&&(a.data._method=o);var s=i.beforeSend;i.beforeSend=function(t){if(t.setRequestHeader('X-HTTP-Method-Override',o),s)return s.apply(this,arguments)}}'GET'===a.type||i.emulateJSON||(a.processData=!1);var l=i.error;i.error=function(t,e,n){i.textStatus=e,i.errorThrown=n,l&&l.call(i.context,t,e,n)};var c=i.xhr=e.ajax(n.extend(a,i));return r.trigger('request',r,c,i),c};var L={create:'POST',update:'PUT',patch:'PATCH',delete:'DELETE',read:'GET'};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var N=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},I=/\((.*?)\)/g,F=/(\(\?)?:\w+/g,V=/\*\w+/g,B=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(N.prototype,s,{preinitialize:function(){},initialize:function(){},route:function(t,r,i){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(i=r,r=''),i||(i=this[r]);var o=this;return e.history.route(t,(function(n){var a=o._extractParameters(t,n);!1!==o.execute(i,a,r)&&(o.trigger.apply(o,['route:'+r].concat(a)),o.trigger('route',r,a),e.history.trigger('route',o,r,a))})),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,'routes');for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(B,'\\$&').replace(I,'(?:$1)?').replace(F,(function(t,e){return e?t:'([^/?]+)'})).replace(V,'([^?]*?)'),new RegExp('^'+t+'(?:\\?([\\s\\S]*))?$')},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,(function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null}))}});var H=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),'undefined'!=typeof window&&(this.location=window.location,this.history=window.history)},z=/^[#\/]|\s+$/g,U=/^\/+|\/+$/g,W=/#.*$/;H.started=!1,n.extend(H.prototype,s,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,'$&/')===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+'/'===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,'%2525'))},getSearch:function(){var t=this.location.href.replace(/#.*/,'').match(/\?.+/);return t?t[0]:''},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:''},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return'/'===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(z,'')},start:function(t){if(H.started)throw new Error('Backbone.history has already been started');if(H.started=!0,this.options=n.extend({root:'/'},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange='onhashchange'in window&&(void 0===document.documentMode||document.documentMode>7),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(U,'/'),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 r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash='#'+this.fragment}var o=window.addEventListener||function(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),H.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(!H.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 r=n+t;t=t.replace(W,'');var i=this.decodeFragment(t);if(this.fragment!==i){if(this.fragment=i,this._usePushState)this.history[e.replace?'replaceState':'pushState']({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var o=this.iframe.contentWindow;e.replace||(o.document.open(),o.document.close()),this._updateHash(o.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,'');t.replace(r+'#'+e)}else t.hash='#'+e}}),e.history=new H;var $=function(t,e){var r,i=this;return r=t&&n.has(t,'constructor')?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e),r.prototype=n.create(i.prototype,t),r.prototype.constructor=r,r.__super__=i.prototype,r};m.extend=y.extend=N.extend=P.extend=H.extend=$;var q=function(){throw new Error('A "url" property or function must be specified')},G=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger('error',t,r,e)}};return e}(a,n,t,e)}.apply(e,r),void 0===i||(t.exports=i);else;}()},9210:(t,e,n)=>{1&&function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,r){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!r.lexical||")"!=r.lexical.type)&&/^[;{}]$/.test(e)&&!/^;/.test(n)}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;t.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",newlineAfterToken:function(t,n,r,i){var o=!1;return"html"==this.configuration&&(o=!!i.context&&e.test(i.context.tagName)),!o&&("tag"==t&&/>$/.test(n)&&i.context||/^</.test(r))}}),t.defineExtension("commentRange",(function(e,n,r){var i=this,o=t.innerMode(i.getMode(),i.getTokenAt(n).state).mode;i.operation((function(){if(e)i.replaceRange(o.commentEnd,r),i.replaceRange(o.commentStart,n),n.line==r.line&&n.ch==r.ch&&i.setCursor(n.line,n.ch+o.commentStart.length);else{var t=i.getRange(n,r),a=t.indexOf(o.commentStart),s=t.lastIndexOf(o.commentEnd);a>-1&&s>-1&&s>a&&(t=t.substr(0,a)+t.substring(a+o.commentStart.length,s)+t.substr(s+o.commentEnd.length)),i.replaceRange(t,n,r)}}))})),t.defineExtension("autoIndentRange",(function(t,e){var n=this;this.operation((function(){for(var r=t.line;r<=e.line;r++)n.indentLine(r,"smart")}))})),t.defineExtension("autoFormatRange",(function(e,n){var r=this,i=r.getMode(),o=r.getRange(e,n).split("\n"),a=t.copyState(i,r.getTokenAt(e).state),s=r.getOption("tabSize"),l="",c=0,u=0===e.ch;function f(){l+="\n",u=!0,++c}for(var h=0;h<o.length;++h){for(var p=new t.StringStream(o[h],s);!p.eol();){var d=t.innerMode(i,a),g=i.token(p,a),v=p.current();p.start=p.pos,u&&!/\S/.test(v)||(l+=v,u=!1),!u&&d.mode.newlineAfterToken&&d.mode.newlineAfterToken(g,v,p.string.slice(p.pos)||o[h+1]||"",d.state)&&f()}!p.pos&&i.blankLine&&i.blankLine(a),!u&&h<o.length-1&&f()}r.operation((function(){r.replaceRange(l,e,n);for(var t=e.line+1,i=e.line+c;t<=i;++t)r.indentLine(t,"smart");r.setSelection(e,r.getCursor(!1))}))}))}(n(4631))},4631:function(t){1&&(t.exports=function(){'use strict';var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\/(\d+)/.exec(t),f=u&&+u[1],h=/Opera\//.test(t),p=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),g=/PhantomJS/.test(t),v=p&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),m=/Android/.test(t),y=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),b=v||/Mac/.test(e),w=/\bCrOS\b/.test(t),k=/win/i.test(e),x=h&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,l=!0);var O=b&&(c||h&&(null==x||x<12.11)),C=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var _,P=function(t,e){var n=t.className,r=S(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function E(t,e){return T(t).appendChild(e)}function j(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function A(t,e,n,r){var i=j(t,e,n,r);return i.setAttribute("role","presentation"),i}function R(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function D(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function M(t,e){var n=t.className;S(e).test(n)||(t.className+=(n?" ":"")+e)}function Z(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(e)&&(e+=" "+n[r]);return e}_=document.createRange?function(t,e,n,r){var i=document.createRange();return i.setEnd(r||t,n),i.setStart(t,e),i}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(t){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var L=function(t){t.select()};function N(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function I(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function F(t,e,n,r,i){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=r||0,a=i||0;;){var s=t.indexOf("\t",o);if(s<0||s>=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}v?L=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(L=function(t){try{t.select()}catch(t){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=N(this.onTimeout,this)};function B(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}V.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},V.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var H=50,z={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},W={origin:"*mouse"},$={origin:"+move"};function q(t,e,n){for(var r=0,i=0;;){var o=t.indexOf("\t",r);-1==o&&(o=t.length);var a=o-r;if(o==t.length||i+a>=e)return r+Math.min(a,e-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=e)return r}}var G=[""];function K(t){for(;G.length<=t;)G.push(Y(G)+" ");return G[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function J(t,e,n){for(var r=0,i=n(e);r<t.length&&n(t[r])<=i;)r++;t.splice(r,0,e)}function Q(){}function tt(t,e){var n;return Object.create?n=Object.create(t):(Q.prototype=t,n=new Q),e&&I(e,n),n}var et=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function nt(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||et.test(t))}function rt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&nt(t))||e.test(t):nt(t)}function it(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var ot=/[\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 at(t){return t.charCodeAt(0)>=768&&ot.test(t)}function st(t,e,n){for(;(n<0?e>0:e<t.length)&&at(t.charAt(e));)e+=n;return e}function lt(t,e,n){for(var r=e>n?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}function ct(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;o<t.length;++o){var a=t[o];(a.from<n&&a.to>e||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}var ut=null;function ft(t,e,n){var r;ut=null;for(var i=0;i<t.length;++i){var o=t[i];if(o.from<e&&o.to>e)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:ut=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:ut=i)}return null!=r?r:ut}var ht=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var c="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!r.test(t))return!1;for(var u=t.length,f=[],h=0;h<u;++h)f.push(n(t.charCodeAt(h)));for(var p=0,d=c;p<u;++p){var g=f[p];"m"==g?f[p]=d:d=g}for(var v=0,m=c;v<u;++v){var y=f[v];"1"==y&&"r"==m?f[v]="n":o.test(y)&&(m=y,"r"==y&&(f[v]="R"))}for(var b=1,w=f[0];b<u-1;++b){var k=f[b];"+"==k&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=k||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=k}for(var x=0;x<u;++x){var O=f[x];if(","==O)f[x]="N";else if("%"==O){var C=void 0;for(C=x+1;C<u&&"%"==f[C];++C);for(var S=x&&"!"==f[x-1]||C<u&&"1"==f[C]?"1":"N",_=x;_<C;++_)f[_]=S;x=C-1}}for(var P=0,T=c;P<u;++P){var E=f[P];"L"==T&&"1"==E?f[P]="L":o.test(E)&&(T=E)}for(var j=0;j<u;++j)if(i.test(f[j])){var A=void 0;for(A=j+1;A<u&&i.test(f[A]);++A);for(var R="L"==(j?f[j-1]:c),D=R==("L"==(A<u?f[A]:c))?R?"L":"R":c,M=j;M<A;++M)f[M]=D;j=A-1}for(var Z,L=[],N=0;N<u;)if(a.test(f[N])){var I=N;for(++N;N<u&&a.test(f[N]);++N);L.push(new l(0,I,N))}else{var F=N,V=L.length,B="rtl"==e?1:0;for(++N;N<u&&"L"!=f[N];++N);for(var H=F;H<N;)if(s.test(f[H])){F<H&&(L.splice(V,0,new l(1,F,H)),V+=B);var z=H;for(++H;H<N&&s.test(f[H]);++H);L.splice(V,0,new l(2,z,H)),V+=B,F=H}else++H;F<N&&L.splice(V,0,new l(1,F,N))}return"ltr"==e&&(1==L[0].level&&(Z=t.match(/^\s+/))&&(L[0].from=Z[0].length,L.unshift(new l(0,0,Z[0].length))),1==Y(L).level&&(Z=t.match(/\s+$/))&&(Y(L).to-=Z[0].length,L.push(new l(0,u-Z[0].length,u)))),"rtl"==e?L.reverse():L}}();function pt(t,e){var n=t.order;return null==n&&(n=t.order=ht(t.text,e)),n}var dt=[],gt=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={});r[e]=(r[e]||dt).concat(n)}};function vt(t,e){return t._handlers&&t._handlers[e]||dt}function mt(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,i=r&&r[e];if(i){var o=B(i,n);o>-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function yt(t,e){var n=vt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function bt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),yt(t,n||e.type,t,e),St(e)||e.codemirrorIgnore}function wt(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==B(n,e[r])&&n.push(e[r])}function kt(t,e){return vt(t,e).length>0}function xt(t){t.prototype.on=function(t,e){gt(this,t,e)},t.prototype.off=function(t,e){mt(this,t,e)}}function Ot(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Ct(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function _t(t){Ot(t),Ct(t)}function Pt(t){return t.target||t.srcElement}function Tt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),b&&t.ctrlKey&&1==e&&(e=3),e}var Et,jt,At=function(){if(a&&s<9)return!1;var t=j('div');return"draggable"in t||"dragDrop"in t}();function Rt(t){if(null==Et){var e=j("span","​");E(t,j("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Et=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Et?j("span","​"):j("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Dt(t){if(null!=jt)return jt;var e=E(t,document.createTextNode("AخA")),n=_(e,0,1).getBoundingClientRect(),r=_(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(jt=r.right-n.right<3)}var Mt,Zt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Lt=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)},Nt="oncopy"in(Mt=j("div"))||(Mt.setAttribute("oncopy","return;"),"function"==typeof Mt.oncopy),It=null;function Ft(t){if(null!=It)return It;var e=E(t,j("span","x")),n=e.getBoundingClientRect(),r=_(e,0,1).getBoundingClientRect();return It=Math.abs(n.left-r.left)>1}var Vt={},Bt={};function Ht(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Vt[t]=e}function zt(t,e){Bt[t]=e}function Ut(t){if("string"==typeof t&&Bt.hasOwnProperty(t))t=Bt[t];else if(t&&"string"==typeof t.name&&Bt.hasOwnProperty(t.name)){var e=Bt[t.name];"string"==typeof e&&(e={name:e}),(t=tt(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Ut("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Ut("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Wt(t,e){e=Ut(e);var n=Vt[e.name];if(!n)return Wt(t,"text/plain");var r=n(t,e);if($t.hasOwnProperty(e.name)){var i=$t[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var $t={};function qt(t,e){I(e,$t.hasOwnProperty(t)?$t[t]:$t[t]={})}function Gt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Kt(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 Yt(t,e,n){return!t.startState||t.startState(e,n)}var Xt=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};function Jt(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 r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e<o){n=i;break}e-=o}return n.lines[e]}function Qt(t,e,n){var r=[],i=e.line;return t.iter(e.line,n.line+1,(function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch)),i==e.line&&(o=o.slice(e.ch)),r.push(o),++i})),r}function te(t,e,n){var r=[];return t.iter(e,n,(function(t){r.push(t.text)})),r}function ee(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function ne(t){if(null==t.parent)return null;for(var e=t.parent,n=B(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function re(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(e<o){t=i;continue t}e-=o,n+=i.chunkSize()}return n}while(!t.lines);for(var a=0;a<t.lines.length;++a){var s=t.lines[a].height;if(e<s)break;e-=s}return n+a}function ie(t,e){return e>=t.first&&e<t.first+t.size}function oe(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function ae(t,e,n){if(void 0===n&&(n=null),!(this instanceof ae))return new ae(t,e,n);this.line=t,this.ch=e,this.sticky=n}function se(t,e){return t.line-e.line||t.ch-e.ch}function le(t,e){return t.sticky==e.sticky&&0==se(t,e)}function ce(t){return ae(t.line,t.ch)}function ue(t,e){return se(t,e)<0?e:t}function fe(t,e){return se(t,e)<0?t:e}function he(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function pe(t,e){if(e.line<t.first)return ae(t.first,0);var n=t.first+t.size-1;return e.line>n?ae(n,Jt(t,n).text.length):de(e,Jt(t,e.line).text.length)}function de(t,e){var n=t.ch;return null==n||n>e?ae(t.line,e):n<0?ae(t.line,0):t}function ge(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=pe(t,e[r]);return n}Xt.prototype.eol=function(){return this.pos>=this.string.length},Xt.prototype.sol=function(){return this.pos==this.lineStart},Xt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xt.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},Xt.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},Xt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Xt.prototype.skipToEnd=function(){this.pos=this.string.length},Xt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Xt.prototype.backUp=function(t){this.pos-=t},Xt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Xt.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Xt.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},Xt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Xt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Xt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ve=function(t,e){this.state=t,this.lookAhead=e},me=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ye(t,e,n,r){var i=[t.state.modeGen],o={};Pe(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],l=1,c=0;n.state=!0,Pe(t,e.text,s.mode,n,(function(t,e){for(var n=l;c<t;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+e}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function be(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=we(t,ne(e)),i=e.text.length>t.options.maxHighlightLength&&Gt(t.doc.mode,r.state),o=ye(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),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 we(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new me(r,!0,e);var o=Te(t,e,n),a=o>r.first&&Jt(r,o-1).stateAfter,s=a?me.fromSaved(r,a,o):new me(r,Yt(r.mode),o);return r.iter(o,e,(function(n){ke(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function ke(t,e,n,r){var i=t.doc.mode,o=new Xt(e,t.options.tabSize,n);for(o.start=o.pos=r||0,""==e&&xe(i,n.state);!o.eol();)Oe(i,o,n.state),o.start=o.pos}function xe(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Kt(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Oe(t,e,n,r){for(var i=0;i<10;i++){r&&(r[0]=Kt(t,n).mode);var o=t.token(e,n);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}me.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},me.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}},me.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},me.fromSaved=function(t,e,n){return e instanceof ve?new me(t,Gt(t.mode,e.state),n,e.lookAhead):new me(t,Gt(t.mode,e),n)},me.prototype.save=function(t){var e=!1!==t?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ve(e,this.maxLookAhead):e};var Ce=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Se(t,e,n,r){var i,o,a=t.doc,s=a.mode,l=Jt(a,(e=pe(a,e)).line),c=we(t,e.line,n),u=new Xt(l.text,t.options.tabSize,c);for(r&&(o=[]);(r||u.pos<e.ch)&&!u.eol();)u.start=u.pos,i=Oe(s,u,c.state),r&&o.push(new Ce(u,i,Gt(a.mode,c.state)));return r?o:new Ce(u,i,c.state)}function _e(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[r])||(e[r]+=" "+n[2])}return t}function Pe(t,e,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,c=0,u=null,f=new Xt(e,t.options.tabSize,r),h=t.options.addModeClass&&[null];for(""==e&&_e(xe(n,r.state),o);!f.eol();){if(f.pos>t.options.maxHighlightLength?(s=!1,a&&ke(t,e,r,f.pos),f.pos=e.length,l=null):l=_e(Oe(n,f,r.state,h),o),h){var p=h[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<f.start;)i(c=Math.min(f.start,c+5e3),u);u=l}f.start=f.pos}for(;c<f.pos;){var d=Math.min(f.pos,c+5e3);i(d,u),c=d}}function Te(t,e,n){for(var r,i,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var l=Jt(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ve?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,t.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}function Ee(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,r=e-1;r>n;r--){var i=Jt(t,r).stateAfter;if(i&&(!(i instanceof ve)||r+i.lookAhead<e)){n=r+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}var je=!1,Ae=!1;function Re(){je=!0}function De(){Ae=!0}function Me(t,e,n){this.marker=t,this.from=e,this.to=n}function Ze(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function Le(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Ne(t,e,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&t.markedSpans&&r.has(t.markedSpans)?t.markedSpans.push(e):(t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],r&&r.add(t.markedSpans)),e.marker.attachLine(t)}function Ie(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e)||o.from==e&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(r||(r=[])).push(new Me(a,o.from,s?null:o.to))}}return r}function Fe(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(r||(r=[])).push(new Me(a,s?null:o.from-e,null==o.to?null:o.to-e))}}return r}function Ve(t,e){if(e.full)return null;var n=ie(t,e.from.line)&&Jt(t,e.from.line).markedSpans,r=ie(t,e.to.line)&&Jt(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,o=e.to.ch,a=0==se(e.from,e.to),s=Ie(n,i,a),l=Fe(r,o,a),c=1==e.text.length,u=Y(e.text).length+(c?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var p=Ze(l,h.marker);p?c&&(h.to=null==p.to?null:p.to+u):h.to=i}}if(l)for(var d=0;d<l.length;++d){var g=l[d];null!=g.to&&(g.to+=u),null==g.from?Ze(s,g.marker)||(g.from=u,c&&(s||(s=[])).push(g)):(g.from+=u,c&&(s||(s=[])).push(g))}s&&(s=Be(s)),l&&l!=s&&(l=Be(l));var v=[s];if(!c){var m,y=e.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(m||(m=[])).push(new Me(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(l)}return v}function Be(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function He(t,e,n){var r=null;if(t.iter(e.line,n.line+1,(function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&-1!=B(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:e,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(se(c.to,s.from)<0||se(c.from,s.to)>0)){var u=[l,1],f=se(c.from,s.from),h=se(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function ze(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Ue(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function We(t){return t.inclusiveLeft?-1:0}function $e(t){return t.inclusiveRight?1:0}function qe(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),o=se(r.from,i.from)||We(t)-We(e);if(o)return-o;var a=se(r.to,i.to)||$e(t)-$e(e);return a||e.id-t.id}function Ge(t,e){var n,r=Ae&&t.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(e?i.from:i.to)&&(!n||qe(n,i.marker)<0)&&(n=i.marker);return n}function Ke(t){return Ge(t,!0)}function Ye(t){return Ge(t,!1)}function Xe(t,e){var n,r=Ae&&t.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<e)&&(null==o.to||o.to>e)&&(!n||qe(n,o.marker)<0)&&(n=o.marker)}return n}function Je(t,e,n,r,i){var o=Jt(t,e),a=Ae&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=se(c.from,n)||We(l.marker)-We(i),f=se(c.to,r)||$e(l.marker)-$e(i);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?se(c.to,n)>=0:se(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?se(c.from,r)<=0:se(c.from,r)<0)))return!0}}}function Qe(t){for(var e;e=Ke(t);)t=e.find(-1,!0).line;return t}function tn(t){for(var e;e=Ye(t);)t=e.find(1,!0).line;return t}function en(t){for(var e,n;e=Ye(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function nn(t,e){var n=Jt(t,e),r=Qe(n);return n==r?e:ne(r)}function rn(t,e){if(e>t.lastLine())return e;var n,r=Jt(t,e);if(!on(t,r))return e;for(;n=Ye(r);)r=n.find(1,!0).line;return ne(r)+1}function on(t,e){var n=Ae&&e.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&an(t,e,r))return!0}}function an(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return an(t,r.line,Ze(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i=void 0,o=0;o<e.markedSpans.length;++o)if((i=e.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&an(t,e,i))return!0}function sn(t){for(var e=0,n=(t=Qe(t)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;e+=s.height}return e}function ln(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=Ke(r);){var i=e.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=t;e=Ye(r);){var o=e.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function cn(t){var e=t.display,n=t.doc;e.maxLine=Jt(n,n.first),e.maxLineLength=ln(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=ln(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var un=function(t,e,n){this.text=t,Ue(this,e),this.height=n?n(this):1};function fn(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),ze(t),Ue(t,n);var i=r?r(t):1;i!=t.height&&ee(t,i)}function hn(t){t.parent=null,ze(t)}un.prototype.lineNo=function(){return ne(this)},xt(un);var pn={},dn={};function gn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?dn:pn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function vn(t,e){var n=A("span",null,null,l?"padding-right: .1px":null),r={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;r.pos=0,r.addToken=yn,Dt(t.display.measure)&&(a=pt(o,t.doc.direction))&&(r.addToken=wn(r.addToken,a)),r.map=[],xn(o,r,be(t,o,e!=t.display.externalMeasured&&ne(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Z(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Z(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Rt(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return yt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=Z(r.pre.className,r.textClass||"")),r}function mn(t){var e=j("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function yn(t,e,n,r,i,o,l){if(e){var c,u=t.splitSpaces?bn(e,t.trailingSpace):e,f=t.cm.state.specialChars,h=!1;if(f.test(e)){c=document.createDocumentFragment();for(var p=0;1;){f.lastIndex=p;var d=f.exec(e),g=d?d.index-p:e.length-p;if(g){var v=document.createTextNode(u.slice(p,p+g));a&&s<9?c.appendChild(j("span",[v])):c.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!d)break;p+=g+1;var m=void 0;if("\t"==d[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(m=c.appendChild(j("span",K(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=b}else"\r"==d[0]||"\n"==d[0]?((m=c.appendChild(j("span","\r"==d[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",d[0]),t.col+=1):((m=t.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),a&&s<9?c.appendChild(j("span",[m])):c.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),a&&s<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||r||i||h||o||l){var w=n||"";r&&(w+=r),i&&(w+=i);var k=j("span",[c],w,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&k.setAttribute(x,l[x]);return t.content.appendChild(k)}t.content.appendChild(c)}}function bn(t,e){if(t.length>1&&!/  /.test(t))return t;for(var n=e,r="",i=0;i<t.length;i++){var o=t.charAt(i);" "!=o||!n||i!=t.length-1&&32!=t.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function wn(t,e){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=void 0,h=0;h<e.length&&!((f=e[h]).to>c&&f.from<=c);h++);if(f.to>=u)return t(n,r,i,o,a,s,l);t(n,r.slice(0,f.to-c),i,o,null,s,l),o=null,r=r.slice(f.to-c),c=f.to}}}function kn(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function xn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,c,u,f,h,p=i.length,d=0,g=1,v="",m=0;;){if(m==d){l=c=u=s="",h=null,f=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var k=r[w],x=k.marker;if("bookmark"==x.type&&k.from==d&&x.widgetNode)y.push(x);else if(k.from<=d&&(null==k.to||k.to>d||x.collapsed&&k.to==d&&k.from==d)){if(null!=k.to&&k.to!=d&&m>k.to&&(m=k.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&k.from==d&&(u+=" "+x.startStyle),x.endStyle&&k.to==m&&(b||(b=[])).push(x.endStyle,k.to),x.title&&((h||(h={})).title=x.title),x.attributes)for(var O in x.attributes)(h||(h={}))[O]=x.attributes[O];x.collapsed&&(!f||qe(f.marker,x)<0)&&(f=k)}else k.from>d&&m>k.from&&(m=k.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==m&&(c+=" "+b[C]);if(!f||f.from==d)for(var S=0;S<y.length;++S)kn(e,0,y[S]);if(f&&(f.from||0)==d){if(kn(e,(null==f.to?p+1:f.to)-d,f.marker,null==f.from),null==f.to)return;f.to==d&&(f=!1)}}if(d>=p)break;for(var _=Math.min(p,m);1;){if(v){var P=d+v.length;if(!f){var T=P>_?v.slice(0,_-d):v;e.addToken(e,T,a?a+l:l,u,d+T.length==m?c:"",s,h)}if(P>=_){v=v.slice(_-d),d=_;break}d=P,u=""}v=i.slice(o,o=n[g++]),a=gn(n[g++],e.cm.options)}}else for(var E=1;E<n.length;E+=2)e.addToken(e,i.slice(o,o=n[E]),gn(n[E+1],e.cm.options))}function On(t,e,n){this.line=e,this.rest=en(e),this.size=this.rest?ne(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=on(t,e)}function Cn(t,e,n){for(var r,i=[],o=e;o<n;o=r){var a=new On(t.doc,Jt(t.doc,o),o);r=o+a.size,i.push(a)}return i}var Sn=null;function _n(t){Sn?Sn.ops.push(t):t.ownsGroup=Sn={ops:[t],delayedCallbacks:[]}}function Pn(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<e.length)}function Tn(t,e){var n=t.ownsGroup;if(n)try{Pn(n)}finally{Sn=null,e(n)}}var En=null;function jn(t,e){var n=vt(t,e);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Sn?r=Sn.delayedCallbacks:En?r=En:(r=En=[],setTimeout(An,0));for(var o=function(t){r.push((function(){return n[t].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function An(){var t=En;En=null;for(var e=0;e<t.length;++e)t[e]()}function Rn(t,e,n,r){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?Ln(t,e):"gutter"==o?In(t,e,n,r):"class"==o?Nn(t,e):"widget"==o&&Fn(t,e,r)}e.changes=null}function Dn(t){return t.node==t.text&&(t.node=j("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),a&&s<8&&(t.node.style.zIndex=2)),t.node}function Mn(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var r=Dn(e);e.background=r.insertBefore(j("div",null,n),r.firstChild),t.display.input.setUneditable(e.background)}}function Zn(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):vn(t,e)}function Ln(t,e){var n=e.text.className,r=Zn(t,e);e.text==e.node&&(e.node=r.pre),e.text.parentNode.replaceChild(r.pre,e.text),e.text=r.pre,r.bgClass!=e.bgClass||r.textClass!=e.textClass?(e.bgClass=r.bgClass,e.textClass=r.textClass,Nn(t,e)):n&&(e.text.className=n)}function Nn(t,e){Mn(t,e),e.line.wrapClass?Dn(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function In(t,e,n,r){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var i=Dn(e);e.gutterBackground=j("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),i.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(t.options.lineNumbers||o){var a=Dn(e),s=e.gutter=j("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),t.display.input.setUneditable(s),a.insertBefore(s,e.text),e.line.gutterClass&&(s.className+=" "+e.line.gutterClass),!t.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(e.lineNumber=s.appendChild(j("div",oe(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<t.display.gutterSpecs.length;++l){var c=t.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(j("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function Fn(t,e,n){e.alignable&&(e.alignable=null);for(var r=S("CodeMirror-linewidget"),i=e.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&e.node.removeChild(i);Bn(t,e,n)}function Vn(t,e,n,r){var i=Zn(t,e);return e.text=e.node=i.pre,i.bgClass&&(e.bgClass=i.bgClass),i.textClass&&(e.textClass=i.textClass),Nn(t,e),In(t,e,n,r),Bn(t,e,r),e.node}function Bn(t,e,n){if(Hn(t,e.line,e,n,!0),e.rest)for(var r=0;r<e.rest.length;r++)Hn(t,e.rest[r],e,n,!1)}function Hn(t,e,n,r,i){if(e.widgets)for(var o=Dn(n),a=0,s=e.widgets;a<s.length;++a){var l=s[a],c=j("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),zn(l,c,n,r),t.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),jn(l,"redraw")}}function zn(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px",t.coverGutter||(i-=r.gutterTotalWidth,e.style.paddingLeft=r.gutterTotalWidth+"px"),e.style.width=i+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px"))}function Un(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!R(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),E(e.display.measure,j("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Wn(t,e){for(var n=Pt(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function $n(t){return t.lineSpace.offsetTop}function qn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Gn(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=E(t.measure,j("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r),r}function Kn(t){return H-t.display.nativeBarWidth}function Yn(t){return t.display.scroller.clientWidth-Kn(t)-t.display.barWidth}function Xn(t){return t.display.scroller.clientHeight-Kn(t)-t.display.barHeight}function Jn(t,e,n){var r=t.options.lineWrapping,i=r&&Yn(t);if(!e.measure.heights||r&&e.measure.width!=i){var o=e.measure.heights=[];if(r){e.measure.width=i;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Qn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var i=0;i<t.rest.length;i++)if(ne(t.rest[i])>n)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}}function tr(t,e){var n=ne(e=Qe(e)),r=t.display.externalMeasured=new On(t.doc,e,n);r.lineN=n;var i=r.built=vn(t,r);return r.text=i.pre,E(t.display.lineMeasure,i.pre),r}function er(t,e,n,r){return ir(t,rr(t,e),n,r)}function nr(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Nr(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function rr(t,e){var n=ne(e),r=nr(t,n);r&&!r.text?r=null:r&&r.changes&&(Rn(t,r,n,Rr(t)),t.curOp.forceUpdate=!0),r||(r=tr(t,e));var i=Qn(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function ir(t,e,n,r,i){e.before&&(n=-1);var o,a=n+(r||"");return e.cache.hasOwnProperty(a)?o=e.cache[a]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(Jn(t,e.view,e.rect),e.hasHeights=!0),(o=cr(t,e,n,r)).bogus||(e.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var or,ar={left:0,right:0,top:0,bottom:0};function sr(t,e,n){for(var r,i,o,a,s,l,c=0;c<t.length;c+=3)if(s=t[c],l=t[c+1],e<s?(i=0,o=1,a="left"):e<l?o=(i=e-s)+1:(c==t.length-3||e==l&&t[c+3]>e)&&(i=(o=l-s)-1,e>=l&&(a="right")),null!=i){if(r=t[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[(c-=3)+2],a="left";if("right"==n&&i==l-s)for(;c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft;)r=t[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function lr(t,e){var n=ar;if("left"==e)for(var r=0;r<t.length&&(n=t[r]).left==n.right;r++);else for(var i=t.length-1;i>=0&&(n=t[i]).left==n.right;i--);return n}function cr(t,e,n,r){var i,o=sr(e.map,n,r),l=o.node,c=o.start,u=o.end,f=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&at(e.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&at(e.line.text.charAt(o.coverStart+u));)++u;if((i=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():lr(_(l,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,f="right"}a&&s<11&&(i=ur(t.display.measure,i))}else{var p;c>0&&(f=r="right"),i=t.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var d=l.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+Ar(t.display),top:d.top,bottom:d.bottom}:ar}for(var g=i.top-e.rect.top,v=i.bottom-e.rect.top,m=(g+v)/2,y=e.view.measure.heights,b=0;b<y.length-1&&!(m<y[b]);b++);var w=b?y[b-1]:0,k=y[b],x={left:("right"==f?i.right:i.left)-e.rect.left,right:("left"==f?i.left:i.right)-e.rect.left,top:w,bottom:k};return i.left||i.right||(x.bogus=!0),t.options.singleCursorHeightPerLine||(x.rtop=g,x.rbottom=v),x}function ur(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ft(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}function fr(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function hr(t){t.display.externalMeasure=null,T(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)fr(t.display.view[e])}function pr(t){hr(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function dr(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function gr(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vr(t){var e=Qe(t).widgets,n=0;if(e)for(var r=0;r<e.length;++r)e[r].above&&(n+=Un(e[r]));return n}function mr(t,e,n,r,i){if(!i){var o=vr(e);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=sn(e);if("local"==r?a+=$n(t.display):a-=t.display.viewOffset,"page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:gr());var l=s.left+("window"==r?0:dr());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function yr(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n)r-=dr(),i-=gr();else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function br(t,e,n,r,i){return r||(r=Jt(t.doc,e.line)),mr(t,r,er(t,r,e.ch,i),n)}function wr(t,e,n,r,i,o){function a(e,a){var s=ir(t,i,e,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,mr(t,r,s,n)}r=r||Jt(t.doc,e.line),i||(i=rr(t,r));var s=pt(r,t.doc.direction),l=e.ch,c=e.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var f=ft(s,l,c),h=ut,p=u(l,f,"before"==c);return null!=h&&(p.other=u(l,h,"before"!=c)),p}function kr(t,e){var n=0;e=pe(t.doc,e),t.options.lineWrapping||(n=Ar(t.display)*e.ch);var r=Jt(t.doc,e.line),i=sn(r)+$n(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(t,e,n,r,i){var o=ae(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function Or(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=re(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Jt(r,o).text.length,null,1,1);e<0&&(e=0);for(var a=Jt(r,i);;){var s=Pr(t,a,i,e,n),l=Xe(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=Jt(r,i=c.line)}}function Cr(t,e,n,r){r-=vr(e);var i=e.text.length,o=lt((function(e){return ir(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=lt((function(e){return ir(t,n,e).top>r}),o,i)}}function Sr(t,e,n,r){return n||(n=rr(t,e)),Cr(t,e,n,mr(t,e,ir(t,n,r),"line").top)}function _r(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function Pr(t,e,n,r,i){i-=sn(e);var o=rr(t,e),a=vr(e),s=0,l=e.text.length,c=!0,u=pt(e,t.doc.direction);if(u){var f=(t.options.lineWrapping?Er:Tr)(t,e,n,o,u,r,i);s=(c=1!=f.level)?f.from:f.to-1,l=c?f.to:f.from-1}var h,p,d=null,g=null,v=lt((function(e){var n=ir(t,o,e);return n.top+=a,n.bottom+=a,!!_r(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(d=e,g=n),!0)}),s,l),m=!1;if(g){var y=r-g.left<g.right-r,b=y==c;v=d+(b?0:1),p=b?"after":"before",h=y?g.left:g.right}else{c||v!=l&&v!=s||v++,p=0==v?"after":v==e.text.length?"before":ir(t,o,v-(c?1:0)).bottom+a<=i==c?"after":"before";var w=wr(t,ae(n,v,p),"line",e,o);h=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return xr(n,v=st(e.text,v,1),p,m,r-h)}function Tr(t,e,n,r,i,o,a){var s=lt((function(s){var l=i[s],c=1!=l.level;return _r(wr(t,ae(n,c?l.to:l.from,c?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=wr(t,ae(n,c?l.from:l.to,c?"after":"before"),"line",e,r);_r(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function Er(t,e,n,r,i,o,a){var s=Cr(t,e,r,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,f=null,h=0;h<i.length;h++){var p=i[h];if(!(p.from>=c||p.to<=l)){var d=ir(t,r,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,g=d<o?o-d+1e9:d-o;(!u||f>g)&&(u=p,f=g)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function jr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==or){or=j("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)or.appendChild(document.createTextNode("x")),or.appendChild(j("br"));or.appendChild(document.createTextNode("x"))}E(t.measure,or);var n=or.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function Ar(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=j("span","xxxxxxxxxx"),n=j("pre",[e],"CodeMirror-line-like");E(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function Rr(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Dr(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function Dr(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Mr(t){var e=jr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/Ar(t.display)-3);return function(i){if(on(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*e:o+e}}function Zr(t){var e=t.doc,n=Mr(t);e.iter((function(t){var e=n(t);e!=t.height&&ee(t,e)}))}function Lr(t,e,n,r){var i=t.display;if(!n&&"true"==Pt(e).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left,a=e.clientY-s.top}catch(t){return null}var l,c=Or(t,o,a);if(r&&c.xRel>0&&(l=Jt(t.doc,c.line).text).length==c.ch){var u=F(l,l.length,t.options.tabSize)-l.length;c=ae(c.line,Math.max(0,Math.round((o-Gn(t.display).left)/Ar(t.display))-u))}return c}function Nr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;r<n.length;r++)if((e-=n[r].size)<0)return r}function Ir(t,e,n,r){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),r||(r=0);var i=t.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Ae&&nn(t.doc,e)<i.viewTo&&Vr(t);else if(n<=i.viewFrom)Ae&&rn(t.doc,n+r)>i.viewFrom?Vr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)Vr(t);else if(e<=i.viewFrom){var o=Br(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Vr(t)}else if(n>=i.viewTo){var a=Br(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Vr(t)}else{var s=Br(t,e,e,-1),l=Br(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Cn(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Vr(t)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:e<c.lineN+c.size&&(i.externalMeasured=null))}function Fr(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;if(i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null),!(e<r.viewFrom||e>=r.viewTo)){var o=r.view[Nr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function Vr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Br(t,e,n,r){var i,o=Nr(t,e),a=t.display.view;if(!Ae||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=e){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}for(;nn(t.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Hr(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=Cn(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=Cn(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(Nr(t,e))),r.viewFrom=e,r.viewTo<n?r.view=r.view.concat(Cn(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Nr(t,n)))),r.viewTo=n}function zr(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function Ur(t){t.display.input.showSelection(t.display.input.prepareSelection())}function Wr(t,e){void 0===e&&(e=!0);var n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=t.options.$customCursor;a&&(e=!0);for(var s=0;s<n.sel.ranges.length;s++)if(e||s!=n.sel.primIndex){var l=n.sel.ranges[s];if(!(l.from().line>=t.display.viewTo||l.to().line<t.display.viewFrom)){var c=l.empty();if(a){var u=a(t,l);u&&$r(t,u,i)}else(c||t.options.showCursorWhenSelecting)&&$r(t,l.head,i);c||Gr(t,l,o)}}return r}function $r(t,e,n){var r=wr(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(j("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var o=br(t,e,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:t.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(j("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function qr(t,e){return t.top-e.top||t.left-e.left}function Gr(t,e,n){var r=t.display,i=t.doc,o=document.createDocumentFragment(),a=Gn(t.display),s=a.left,l=Math.max(r.sizerWidth,Yn(t)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),o.appendChild(j("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n                             top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n                             height: "+(r-e)+"px"))}function f(e,n,r){var o,a,f=Jt(i,e),h=f.text.length;function p(n,r){return br(t,ae(e,n),"div",f,r)}function d(e,n,r){var i=Sr(t,f,null,e),o="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var g=pt(f,i.direction);return ct(g,n||0,null==r?h:r,(function(t,e,i,f){var v="ltr"==i,m=p(t,v?"left":"right"),y=p(e-1,v?"right":"left"),b=null==n&&0==t,w=null==r&&e==h,k=0==f,x=!g||f==g.length-1;if(y.top-m.top<=3){var O=(c?w:b)&&x,C=(c?b:w)&&k?s:(v?m:y).left,S=O?l:(v?y:m).right;u(C,m.top,S-C,m.bottom)}else{var _,P,T,E;v?(_=c&&b&&k?s:m.left,P=c?l:d(t,i,"before"),T=c?s:d(e,i,"after"),E=c&&w&&x?l:y.right):(_=c?d(t,i,"before"):s,P=!c&&b&&k?l:m.right,T=!c&&w&&x?s:y.left,E=c?d(e,i,"after"):l),u(_,m.top,P-_,m.bottom),m.bottom<y.top&&u(s,m.bottom,null,y.top),u(T,y.top,E-T,y.bottom)}(!o||qr(m,o)<0)&&(o=m),qr(y,o)<0&&(o=y),(!a||qr(m,a)<0)&&(a=m),qr(y,a)<0&&(a=y)})),{start:o,end:a}}var h=e.from(),p=e.to();if(h.line==p.line)f(h.line,h.ch,p.ch);else{var d=Jt(i,h.line),g=Jt(i,p.line),v=Qe(d)==Qe(g),m=f(h.line,h.ch,v?d.text.length+1:null).end,y=f(p.line,v?0:null,p.ch).start;v&&(m.top<y.top-2?(u(m.right,m.top,null,m.bottom),u(s,y.top,y.left,y.bottom)):u(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&u(s,m.bottom,null,y.top)}n.appendChild(o)}function Kr(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){t.hasFocus()||Qr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Yr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Jr(t))}function Xr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Qr(t))}),100)}function Jr(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(yt(t,"focus",t,e),t.state.focused=!0,M(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()),Kr(t))}function Qr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(yt(t,"blur",t,e),t.state.focused=!1,P(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function ti(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=Math.max(0,e.scroller.getBoundingClientRect().top),i=e.lineDiv.getBoundingClientRect().top,o=0,l=0;l<e.view.length;l++){var c=e.view[l],u=t.options.lineWrapping,f=void 0,h=0;if(!c.hidden){if(i+=c.line.height,a&&s<8){var p=c.node.offsetTop+c.node.offsetHeight;f=p-n,n=p}else{var d=c.node.getBoundingClientRect();f=d.bottom-d.top,!u&&c.text.firstChild&&(h=c.text.firstChild.getBoundingClientRect().right-d.left-1)}var g=c.line.height-f;if((g>.005||g<-.005)&&(i<r&&(o-=g),ee(c.line,f),ei(c.line),c.rest))for(var v=0;v<c.rest.length;v++)ei(c.rest[v]);if(h>t.display.sizerWidth){var m=Math.ceil(h/Ar(t.display));m>t.display.maxLineLength&&(t.display.maxLineLength=m,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(e.scroller.scrollTop+=o)}function ei(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ni(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-$n(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=re(e,r),a=re(e,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=re(e,sn(Jt(e,s))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=a&&(o=re(e,sn(Jt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ri(t,e){if(!bt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;if(e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!g){var o=j("div","​",null,"position: absolute;\n                         top: "+(e.top-n.viewOffset-$n(t.display))+"px;\n                         height: "+(e.bottom-e.top+Kn(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(i),t.display.lineSpace.removeChild(o)}}}function ii(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?ae(e.line,e.ch+1,"before"):e,e=e.ch?ae(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var o=0;o<5;o++){var a=!1,s=wr(t,e),l=n&&n!=e?wr(t,n):s,c=ai(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=t.doc.scrollTop,f=t.doc.scrollLeft;if(null!=c.scrollTop&&(pi(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(gi(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}function oi(t,e){var n=ai(t,e);null!=n.scrollTop&&pi(t,n.scrollTop),null!=n.scrollLeft&&gi(t,n.scrollLeft)}function ai(t,e){var n=t.display,r=jr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Xn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+qn(n),l=e.top<r,c=e.bottom>s-r;if(e.top<i)a.scrollTop=l?0:e.top;else if(e.bottom>i+o){var u=Math.min(e.top,(c?s:e.bottom)-o);u!=i&&(a.scrollTop=u)}var f=t.options.fixedGutter?0:n.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-f,p=Yn(t)-n.gutters.offsetWidth,d=e.right-e.left>p;return d&&(e.right=e.left+p),e.left<10?a.scrollLeft=0:e.left<h?a.scrollLeft=Math.max(0,e.left+f-(d?0:10)):e.right>p+h-3&&(a.scrollLeft=e.right+(d?0:10)-p),a}function si(t,e){null!=e&&(fi(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function li(t){fi(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function ci(t,e,n){null==e&&null==n||fi(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function ui(t,e){fi(t),t.curOp.scrollToPos=e}function fi(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,hi(t,kr(t,e.from),kr(t,e.to),e.margin))}function hi(t,e,n,r){var i=ai(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});ci(t,i.scrollLeft,i.scrollTop)}function pi(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Ui(t,{top:e}),di(t,e,!0),n&&Ui(t),Li(t,100))}function di(t,e,n){e=Math.max(0,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 gi(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,Gi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function vi(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+qn(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:r,scrollHeight:r+Kn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var mi=function(t,e,n){this.cm=n;var r=this.vert=j("div",[j("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=j("div",[j("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),gt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),gt(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r: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==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},mi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var t=b&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new V,this.disableVert=new V},mi.prototype.enableZeroWidthBar=function(t,e,n){function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.visibility="hidden":e.set(1e3,r)}t.style.visibility="",e.set(1e3,r)},mi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var yi=function(){};function bi(t,e){e||(e=vi(t));var n=t.display.barWidth,r=t.display.barHeight;wi(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&ti(t),wi(t,vi(t)),n=t.display.barWidth,r=t.display.barHeight}function wi(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}yi.prototype.update=function(){return{bottom:0,right:0}},yi.prototype.setScrollLeft=function(){},yi.prototype.setScrollTop=function(){},yi.prototype.clear=function(){};var ki={native:mi,null:yi};function xi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&P(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new ki[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),gt(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?gi(t,e):pi(t,e)}),t),t.display.scrollbars.addClass&&M(t.display.wrapper,t.display.scrollbars.addClass)}var Oi=0;function Ci(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Oi,markArrays:null},_n(t.curOp)}function Si(t){var e=t.curOp;e&&Tn(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;_i(t)}))}function _i(t){for(var e=t.ops,n=0;n<e.length;n++)Pi(e[n]);for(var r=0;r<e.length;r++)Ti(e[r]);for(var i=0;i<e.length;i++)Ei(e[i]);for(var o=0;o<e.length;o++)ji(e[o]);for(var a=0;a<e.length;a++)Ai(e[a])}function Pi(t){var e=t.cm,n=e.display;Fi(e),t.updateMaxLine&&cn(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Ii(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Ti(t){t.updatedDisplay=t.mustUpdate&&Hi(t.cm,t.update)}function Ei(t){var e=t.cm,n=e.display;t.updatedDisplay&&ti(e),t.barMeasure=vi(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=er(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+Kn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Yn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function ji(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&gi(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==D();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&bi(e,t.barMeasure),t.updatedDisplay&&qi(e,t.barMeasure),t.selectionChanged&&Kr(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Yr(t.cm)}function Ai(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&zi(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&di(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&gi(e,t.scrollLeft,!0,!0),t.scrollToPos&&ri(e,ii(e,pe(r,t.scrollToPos.from),pe(r,t.scrollToPos.to),t.scrollToPos.margin));var i=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||yt(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&yt(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&yt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Ri(t,e){if(t.curOp)return e();Ci(t);try{return e()}finally{Si(t)}}function Di(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Ci(t);try{return e.apply(t,arguments)}finally{Si(t)}}}function Mi(t){return function(){if(this.curOp)return t.apply(this,arguments);Ci(this);try{return t.apply(this,arguments)}finally{Si(this)}}}function Zi(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Ci(e);try{return t.apply(this,arguments)}finally{Si(e)}}}function Li(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,N(Ni,t))}function Ni(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=we(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Gt(e.mode,r.state):null,l=ye(t,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&h<a.length;++h)f=a[h]!=o.styles[h];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=t.options.maxHighlightLength&&ke(t,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Li(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Ri(t,(function(){for(var e=0;e<i.length;e++)Fr(t,i[e],"text")}))}}var Ii=function(t,e,n){var r=t.display;this.viewport=e,this.visible=ni(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Yn(t),this.force=n,this.dims=Rr(t),this.events=[]};function Fi(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Kn(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Kn(t)+"px",e.scrollbarsClipped=!0)}function Vi(t){if(t.hasFocus())return null;var e=D();if(!e||!R(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&R(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Bi(t){if(t&&t.activeElt&&t.activeElt!=D()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&R(document.body,t.anchorNode)&&R(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)}}function Hi(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden)return Vr(t),!1;if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zr(t))return!1;Ki(t)&&(Vr(t),e.dims=Rr(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Ae&&(o=nn(t.doc,o),a=rn(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Hr(t,o,a),n.viewOffset=sn(Jt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=zr(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Vi(t);return l>4&&(n.lineDiv.style.display="none"),Wi(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Bi(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Li(t,400)),n.updateLineNumbers=null,!0}function zi(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Yn(t))r&&(e.visible=ni(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+qn(t.display)-Xn(t),n.top)}),e.visible=ni(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Hi(t,e))break;ti(t);var i=vi(t);Ur(t),bi(t,i),qi(t,i),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 Ui(t,e){var n=new Ii(t,e);if(Hi(t,n)){ti(t),zi(t,n);var r=vi(t);Ur(t),bi(t,r),qi(t,r),n.finish()}}function Wi(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return l&&b&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=r.view,u=r.viewFrom,f=0;f<c.length;f++){var h=c[f];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;a!=h.node;)a=s(a);var p=i&&null!=e&&e<=u&&h.lineNumber;h.changes&&(B(h.changes,"gutter")>-1&&(p=!1),Rn(t,h,u,n)),p&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(oe(t.options,u)))),a=h.node.nextSibling}else{var d=Vn(t,h,u,n);o.insertBefore(d,a)}u+=h.size}for(;a;)a=s(a)}function $i(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",jn(t,"gutterChanged",t)}function qi(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+Kn(t)+"px"}function Gi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=Dr(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=r+i+"px")}}function Ki(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=oe(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(j("div",[j("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",$i(t.display),!0}return!1}function Yi(t,e){for(var n=[],r=!1,i=0;i<t.length;i++){var o=t[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!e)continue;r=!0}n.push({className:o,style:a})}return e&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Xi(t){var e=t.gutters,n=t.gutterSpecs;T(e),t.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=e.appendChild(j("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(t.lineGutter=s,s.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",$i(t)}function Ji(t){Xi(t.display),Ir(t),Gi(t)}function Qi(t,e,r,i){var o=this;this.input=r,o.scrollbarFiller=j("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=j("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=A("div",null,"CodeMirror-code"),o.selectionDiv=j("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=j("div",null,"CodeMirror-cursors"),o.measure=j("div",null,"CodeMirror-measure"),o.lineMeasure=j("div",null,"CodeMirror-measure"),o.lineSpace=A("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=A("div",[o.lineSpace],"CodeMirror-lines");o.mover=j("div",[c],null,"position: relative"),o.sizer=j("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=j("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),o.gutters=j("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=j("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=j("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),o.wrapper.setAttribute('translate','no'),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&y||(o.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(o.wrapper):t(o.wrapper)),o.viewFrom=o.viewTo=e.first,o.reportedViewFrom=o.reportedViewTo=e.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Yi(i.gutters,i.lineNumbers),Xi(o),r.init(o)}Ii.prototype.signal=function(t,e){kt(t,e)&&this.events.push(arguments)},Ii.prototype.finish=function(){for(var t=0;t<this.events.length;t++)yt.apply(null,this.events[t])};var to=0,eo=null;function no(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function ro(t){var e=no(t);return e.x*=eo,e.y*=eo,e}function io(t,e){u&&f>=102&&(null==t.display.chromeScrollHack?t.display.sizer.style.pointerEvents="none":clearTimeout(t.display.chromeScrollHack),t.display.chromeScrollHack=setTimeout((function(){t.display.chromeScrollHack=null,t.display.sizer.style.pointerEvents=""}),100));var r=no(e),i=r.x,o=r.y,a=eo;0===e.deltaMode&&(i=e.deltaX,o=e.deltaY,a=1);var s=t.display,c=s.scroller,p=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight;if(i&&p||o&&d){if(o&&b&&l)t:for(var g=e.target,v=s.view;g!=c;g=g.parentNode)for(var m=0;m<v.length;m++)if(v[m].node==g){t.display.currentWheelTarget=g;break t}if(i&&!n&&!h&&null!=a)return o&&d&&pi(t,Math.max(0,c.scrollTop+o*a)),gi(t,Math.max(0,c.scrollLeft+i*a)),(!o||o&&d)&&Ot(e),void(s.wheelStartX=null);if(o&&null!=a){var y=o*a,w=t.doc.scrollTop,k=w+s.wrapper.clientHeight;y<0?w=Math.max(0,w+y-50):k=Math.min(t.doc.height,k+y+50),Ui(t,{top:w,bottom:k})}to<20&&0!==e.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=c.scrollLeft,s.wheelStartY=c.scrollTop,s.wheelDX=i,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var t=c.scrollLeft-s.wheelStartX,e=c.scrollTop-s.wheelStartY,n=e&&s.wheelDY&&e/s.wheelDY||t&&s.wheelDX&&t/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(eo=(eo*to+n)/(to+1),++to)}}),200)):(s.wheelDX+=i,s.wheelDY+=o))}}a?eo=-.53:n?eo=15:u?eo=-.7:p&&(eo=-1/3);var oo=function(t,e){this.ranges=t,this.primIndex=e};oo.prototype.primary=function(){return this.ranges[this.primIndex]},oo.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],r=t.ranges[e];if(!le(n.anchor,r.anchor)||!le(n.head,r.head))return!1}return!0},oo.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new ao(ce(this.ranges[e].anchor),ce(this.ranges[e].head));return new oo(t,this.primIndex)},oo.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},oo.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(se(e,r.from())>=0&&se(t,r.to())<=0)return n}return-1};var ao=function(t,e){this.anchor=t,this.head=e};function so(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return se(t.from(),e.from())})),n=B(e,i);for(var o=1;o<e.length;o++){var a=e[o],s=e[o-1],l=se(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=fe(s.from(),a.from()),u=ue(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new ao(f?u:c,f?c:u))}}return new oo(e,n)}function lo(t,e){return new oo([new ao(t,e||t)],0)}function co(t){return t.text?ae(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function uo(t,e){if(se(t,e.from)<0)return t;if(se(t,e.to)<=0)return co(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=co(e).ch-e.to.ch),ae(n,r)}function fo(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new ao(uo(i.anchor,e),uo(i.head,e)))}return so(t.cm,n,t.sel.primIndex)}function ho(t,e,n){return t.line==e.line?ae(n.line,t.ch-e.ch+n.ch):ae(n.line+(t.line-e.line),t.ch)}function po(t,e,n){for(var r=[],i=ae(t.first,0),o=i,a=0;a<e.length;a++){var s=e[a],l=ho(s.from,i,o),c=ho(co(s),i,o);if(i=s.to,o=c,"around"==n){var u=t.sel.ranges[a],f=se(u.head,u.anchor)<0;r[a]=new ao(f?c:l,f?l:c)}else r[a]=new ao(l,l)}return new oo(r,t.sel.primIndex)}function go(t){t.doc.mode=Wt(t.options,t.doc.modeOption),vo(t)}function vo(t){t.doc.iter((function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)})),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,Li(t,100),t.state.modeGen++,t.curOp&&Ir(t)}function mo(t,e){return 0==e.from.ch&&0==e.to.ch&&""==Y(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function yo(t,e,n,r){function i(t){return n?n[t]:null}function o(t,n,i){fn(t,n,i,r),jn(t,"change",t,e)}function a(t,e){for(var n=[],o=t;o<e;++o)n.push(new un(c[o],i(o),r));return n}var s=e.from,l=e.to,c=e.text,u=Jt(t,s.line),f=Jt(t,l.line),h=Y(c),p=i(c.length-1),d=l.line-s.line;if(e.full)t.insert(0,a(0,c.length)),t.remove(c.length,t.size-c.length);else if(mo(t,e)){var g=a(0,c.length-1);o(f,f.text,p),d&&t.remove(s.line,d),g.length&&t.insert(s.line,g)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,s.ch)+h+u.text.slice(l.ch),p);else{var v=a(1,c.length-1);v.push(new un(h+u.text.slice(l.ch),p,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),t.insert(s.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(l.ch),i(0)),t.remove(s.line+1,d);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(f,h+f.text.slice(l.ch),p);var m=a(1,c.length-1);d>1&&t.remove(s.line+1,d-1),t.insert(s.line+1,m)}jn(t,"change",t,e)}function bo(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a<t.linked.length;++a){var s=t.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(e(s.doc,l),r(s.doc,t,l))}}}r(t,null,!0)}function wo(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,Zr(t),go(t),ko(t),t.options.direction=e.direction,t.options.lineWrapping||cn(t),t.options.mode=e.modeOption,Ir(t)}function ko(t){("rtl"==t.doc.direction?M:P)(t.display.lineDiv,"CodeMirror-rtl")}function xo(t){Ri(t,(function(){ko(t),Ir(t)}))}function Oo(t){this.done=[],this.undone=[],this.undoDepth=t?t.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t?t.maxGeneration:1}function Co(t,e){var n={from:ce(e.from),to:co(e),text:Qt(t,e.from,e.to)};return Ao(t,n,e.from.line,e.to.line+1),bo(t,(function(t){return Ao(t,n,e.from.line,e.to.line+1)}),!0),n}function So(t){for(;t.length&&Y(t).ranges;)t.pop()}function _o(t,e){return e?(So(t.done),Y(t.done)):t.done.length&&!Y(t.done).ranges?Y(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}function Po(t,e,n,r){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=_o(i,i.lastOp==r)))a=Y(o.changes),0==se(e.from,e.to)&&0==se(e.from,a.to)?a.to=co(e):o.changes.push(Co(t,e));else{var l=Y(i.done);for(l&&l.ranges||jo(t.sel,i.done),o={changes:[Co(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||yt(t,"historyAdded")}function To(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Eo(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(t,o,Y(i.done),e))?i.done[i.done.length-1]=e:jo(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function jo(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ao(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Ro(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function Do(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=[],i=0;i<e.text.length;++i)r.push(Ro(n[i]));return r}function Mo(t,e){var n=Do(t,e),r=Ve(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue t;o.push(l)}else a&&(n[i]=a)}return n}function Zo(t,e,n){for(var r=[],i=0;i<t.length;++i){var o=t[i];if(o.ranges)r.push(n?oo.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),e)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&B(e,Number(u[1]))>-1&&(Y(s)[f]=c[f],delete c[f])}}}return r}function Lo(t,e,n,r){if(r){var i=t.anchor;if(n){var o=se(e,i)<0;o!=se(n,i)<0?(i=e,e=n):o!=se(e,n)<0&&(e=n)}return new ao(i,e)}return new ao(n||e,e)}function No(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),zo(t,new oo([Lo(t.sel.primary(),e,n,i)],0),r)}function Io(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)r[o]=Lo(t.sel.ranges[o],e[o],null,i);zo(t,so(t.cm,r,t.sel.primIndex),n)}function Fo(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n,zo(t,so(t.cm,i,t.sel.primIndex),r)}function Vo(t,e,n,r){zo(t,lo(e,n),r)}function Bo(t,e,n){var r={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new ao(pe(t,e[n].anchor),pe(t,e[n].head))},origin:n&&n.origin};return yt(t,"beforeSelectionChange",t,r),t.cm&&yt(t.cm,"beforeSelectionChange",t.cm,r),r.ranges!=e.ranges?so(t.cm,r.ranges,r.ranges.length-1):e}function Ho(t,e,n){var r=t.history.done,i=Y(r);i&&i.ranges?(r[r.length-1]=e,Uo(t,e,n)):zo(t,e,n)}function zo(t,e,n){Uo(t,e,n),Eo(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function Uo(t,e,n){(kt(t,"beforeSelectionChange")||t.cm&&kt(t.cm,"beforeSelectionChange"))&&(e=Bo(t,e,n));var r=n&&n.bias||(se(e.primary().head,t.sel.primary().head)<0?-1:1);Wo(t,qo(t,e,r,!0)),n&&!1===n.scroll||!t.cm||"nocursor"==t.cm.getOption("readOnly")||li(t.cm)}function Wo(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,wt(t.cm)),jn(t,"cursorActivity",t))}function $o(t){Wo(t,qo(t,t.sel,null,!1))}function qo(t,e,n,r){for(var i,o=0;o<e.ranges.length;o++){var a=e.ranges[o],s=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],l=Ko(t,a.anchor,s&&s.anchor,n,r),c=a.head==a.anchor?l:Ko(t,a.head,s&&s.head,n,r);(i||l!=a.anchor||c!=a.head)&&(i||(i=e.ranges.slice(0,o)),i[o]=new ao(l,c))}return i?so(t.cm,i,e.primIndex):e}function Go(t,e,n,r,i){var o=Jt(t,e.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(u?s.to>=e.ch:s.to>e.ch))){if(i&&(yt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var f=l.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(f=Yo(t,f,-r,f&&f.line==e.line?o:null)),f&&f.line==e.line&&(h=se(f,n))&&(r<0?h<0:h>0))return Go(t,f,e,r,i)}var p=l.find(r<0?-1:1);return(r<0?c:u)&&(p=Yo(t,p,r,p.line==e.line?o:null)),p?Go(t,p,e,r,i):null}}return e}function Ko(t,e,n,r,i){var o=r||1,a=Go(t,e,n,o,i)||!i&&Go(t,e,n,o,!0)||Go(t,e,n,-o,i)||!i&&Go(t,e,n,-o,!0);return a||(t.cantEdit=!0,ae(t.first,0))}function Yo(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?pe(t,ae(e.line-1)):null:n>0&&e.ch==(r||Jt(t,e.line)).text.length?e.line<t.first+t.size-1?ae(e.line+1,0):null:new ae(e.line,e.ch+n)}function Xo(t){t.setSelection(ae(t.firstLine(),0),ae(t.lastLine()),U)}function Jo(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(e,n,i,o){e&&(r.from=pe(t,e)),n&&(r.to=pe(t,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),yt(t,"beforeChange",t,r),t.cm&&yt(t.cm,"beforeChange",t.cm,r),r.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Qo(t,e,n){if(t.cm){if(!t.cm.curOp)return Di(t.cm,Qo)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(kt(t,"beforeChange")||t.cm&&kt(t.cm,"beforeChange"))||(e=Jo(t,e,!0))){var r=je&&!n&&He(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)ta(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else ta(t,e)}}function ta(t,e){if(1!=e.text.length||""!=e.text[0]||0!=se(e.from,e.to)){var n=fo(t,e);Po(t,e,n,t.cm?t.cm.curOp.id:NaN),ra(t,e,n,Ve(t,e));var r=[];bo(t,(function(t,n){n||-1!=B(r,t.history)||(la(t.history,e),r.push(t.history)),ra(t,e,null,Ve(t,e))}))}}function ea(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(t.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(jo(i,l),n&&!i.equals(t.sel))return void zo(t,i,{clearRedo:!1});a=i}var u=[];jo(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=kt(t,"beforeChange")||t.cm&&kt(t.cm,"beforeChange"),h=function(n){var r=i.changes[n];if(r.origin=e,f&&!Jo(t,r,!1))return s.length=0,{};u.push(Co(t,r));var o=n?fo(t,r):Y(s);ra(t,r,o,Mo(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:co(r)});var a=[];bo(t,(function(t,e){e||-1!=B(a,t.history)||(la(t.history,r),a.push(t.history)),ra(t,r,null,Mo(t,r))}))},p=i.changes.length-1;p>=0;--p){var d=h(p);if(d)return d.v}}}}function na(t,e){if(0!=e&&(t.first+=e,t.sel=new oo(X(t.sel.ranges,(function(t){return new ao(ae(t.anchor.line+e,t.anchor.ch),ae(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Ir(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)Fr(t.cm,r,"gutter")}}function ra(t,e,n,r){if(t.cm&&!t.cm.curOp)return Di(t.cm,ra)(t,e,n,r);if(e.to.line<t.first)na(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);na(t,i),e={from:ae(t.first,0),to:ae(e.to.line+i,e.to.ch),text:[Y(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:ae(o,Jt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Qt(t,e.from,e.to),n||(n=fo(t,e)),t.cm?ia(t.cm,e,r):yo(t,e,r),Uo(t,n,U),t.cantEdit&&Ko(t,ae(t.firstLine(),0))&&(t.cantEdit=!1)}}function ia(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=ne(Qe(Jt(r,o.line))),r.iter(l,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&wt(t),yo(r,e,n,Mr(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=ln(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),Ee(r,o.line),Li(t,400);var c=e.text.length-(a.line-o.line)-1;e.full?Ir(t):o.line!=a.line||1!=e.text.length||mo(t.doc,e)?Ir(t,o.line,a.line+1,c):Fr(t,o.line,"text");var u=kt(t,"changes"),f=kt(t,"change");if(f||u){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};f&&jn(t,"change",t,h),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}function oa(t,e,n,r,i){var o;r||(r=n),se(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Qo(t,{from:n,to:r,text:e,origin:i})}function aa(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function sa(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i],a=!0;if(o.ranges){o.copied||((o=t[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)aa(o.ranges[s].anchor,e,n,r),aa(o.ranges[s].head,e,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=ae(c.from.line+r,c.from.ch),c.to=ae(c.to.line+r,c.to.ch);else if(e<=c.to.line){a=!1;break}}a||(t.splice(0,i+1),i=0)}}}function la(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;sa(t.done,n,r,i),sa(t.undone,n,r,i)}function ca(t,e,n,r){var i=e,o=e;return"number"==typeof e?o=Jt(t,he(t,e)):i=ne(e),null==i?null:(r(o,i)&&t.cm&&Fr(t.cm,i,n),o)}function ua(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function fa(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var i=t[r];e+=i.chunkSize(),n+=i.height,i.parent=this}this.size=e,this.height=n,this.parent=null}ao.prototype.from=function(){return fe(this.anchor,this.head)},ao.prototype.to=function(){return ue(this.anchor,this.head)},ao.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ua.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;n<r;++n){var i=this.lines[n];this.height-=i.height,hn(i),jn(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;r<e.length;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;t<r;++t)if(n(this.lines[t]))return!0}},fa.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(t<i){var o=Math.min(e,i-t),a=r.height;if(r.removeInner(t,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(t<=o){if(i.insertInner(t,e,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new ua(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new fa(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=B(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var r=new fa(t.children);r.parent=t,t.children=[r,e],t=r}e.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(t<o){var a=Math.min(e,o-t);if(i.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var ha=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=t,this.node=e};function pa(t,e,n){sn(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&si(t,n)}function da(t,e,n,r){var i=new ha(t,n,r),o=t.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ca(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!on(t,e)){var r=sn(e)<t.scrollTop;ee(e,e.height+Un(i)),r&&si(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&jn(o,"lineWidgetAdded",o,i,"number"==typeof e?e:ne(e)),i}ha.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,r=ne(n);if(null!=r&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(n.widgets=null);var o=Un(this);ee(n,Math.max(0,n.height-o)),t&&(Ri(t,(function(){pa(t,n,-o),Fr(t,r,"widget")})),jn(t,"lineWidgetCleared",t,this,r))}},ha.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Un(this)-e;i&&(on(this.doc,r)||ee(r,r.height+i),n&&Ri(n,(function(){n.curOp.forceUpdate=!0,pa(n,r,i),jn(n,"lineWidgetChanged",n,t,ne(r))})))},xt(ha);var ga=0,va=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++ga};function ma(t,e,n,r,i){if(r&&r.shared)return ba(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return Di(t.cm,ma)(t,e,n,r,i);var o=new va(t,i),a=se(e,n);if(r&&I(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Je(t,e.line,e,n,o)||e.line!=n.line&&Je(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");De()}o.addToHistory&&Po(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(r){c&&o.collapsed&&!c.options.lineWrapping&&Qe(r)==c.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&ee(r,0),Ne(r,new Me(o,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){on(t,e)&&ee(e,0)})),o.clearOnEnter&&gt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Re(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++ga,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Ir(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++)Fr(c,u,"text");o.atomic&&$o(c.doc),jn(c,"markerAdded",c,o)}return o}va.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Ci(t),kt(this,"clear")){var n=this.find();n&&jn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Ze(a.markedSpans,this);t&&!this.collapsed?Fr(t,ne(a),"text"):t&&(null!=s.to&&(i=ne(a)),null!=s.from&&(r=ne(a))),a.markedSpans=Le(a.markedSpans,s),null==s.from&&this.collapsed&&!on(this.doc,a)&&t&&ee(a,jr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Qe(this.lines[l]),u=ln(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Ir(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&$o(t.doc)),t&&jn(t,"markerCleared",t,this,r,i),e&&Si(t),this.parent&&this.parent.clear()}},va.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ze(o.markedSpans,this);if(null!=a.from&&(n=ae(e?o:ne(o),a.from),-1==t))return n;if(null!=a.to&&(r=ae(e?o:ne(o),a.to),1==t))return r}return n&&{from:n,to:r}},va.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&Ri(r,(function(){var i=e.line,o=ne(e.line),a=nr(r,o);if(a&&(fr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!on(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=Un(n)-s;l&&ee(i,i.height+l)}jn(r,"markerChanged",r,t)}))},va.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=B(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},va.prototype.detachLine=function(t){if(this.lines.splice(B(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},xt(va);var ya=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function ba(t,e,n,r,i){(r=I(r)).shared=!1;var o=[ma(t,e,n,r,i)],a=o[0],s=r.widgetNode;return bo(t,(function(t){s&&(r.widgetNode=s.cloneNode(!0)),o.push(ma(t,pe(t,e),pe(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=Y(o)})),new ya(o,a)}function wa(t){return t.findMarks(ae(t.first,0),t.clipPos(ae(t.lastLine())),(function(t){return t.parent}))}function ka(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),o=t.clipPos(i.from),a=t.clipPos(i.to);if(se(o,a)){var s=ma(t,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function xa(t){for(var e=function(e){var n=t[e],r=[n.primary.doc];bo(n.primary.doc,(function(t){return r.push(t)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==B(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<t.length;n++)e(n)}ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();jn(this,"clear")}},ya.prototype.find=function(t,e){return this.primary.find(t,e)},xt(ya);var Oa=0,Ca=function(t,e,n,r,i){if(!(this instanceof Ca))return new Ca(t,e,n,r,i);null==n&&(n=0),fa.call(this,[new ua([new un("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ae(n,0);this.sel=lo(o),this.history=new Oo(null),this.id=++Oa,this.modeOption=e,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),yo(this,{from:o,to:o,text:t}),zo(this,lo(o),U)};Ca.prototype=tt(fa.prototype,{constructor:Ca,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=te(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:Zi((function(t){var e=ae(this.first,0),n=this.first+this.size-1;Qo(this,{from:e,to:ae(n,Jt(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&ci(this.cm,0,0),zo(this,lo(e),U)})),replaceRange:function(t,e,n,r){oa(this,t,e=pe(this,e),n=n?pe(this,n):e,r)},getRange:function(t,e,n){var r=Qt(this,pe(this,t),pe(this,e));return!1===n?r:''===n?r.join(''):r.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(ie(this,t))return Jt(this,t)},getLineNumber:function(t){return ne(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=Jt(this,t)),Qe(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return pe(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Zi((function(t,e,n){Vo(this,pe(this,"number"==typeof t?ae(t,e||0):t),null,n)})),setSelection:Zi((function(t,e,n){Vo(this,pe(this,t),pe(this,e||t),n)})),extendSelection:Zi((function(t,e,n){No(this,pe(this,t),e&&pe(this,e),n)})),extendSelections:Zi((function(t,e){Io(this,ge(this,t),e)})),extendSelectionsBy:Zi((function(t,e){Io(this,ge(this,X(this.sel.ranges,t)),e)})),setSelections:Zi((function(t,e,n){if(t.length){for(var r=[],i=0;i<t.length;i++)r[i]=new ao(pe(this,t[i].anchor),pe(this,t[i].head||t[i].anchor));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),zo(this,so(this.cm,r,e),n)}})),addSelection:Zi((function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new ao(pe(this,t),pe(this,e||t))),zo(this,so(this.cm,r,r.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var i=Qt(this,n[r].from(),n[r].to());e=e?e.concat(i):i}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Qt(this,n[r].from(),n[r].to());!1!==t&&(i=i.join(t||this.lineSeparator())),e[r]=i}return e},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:Zi((function(t,e,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(t[o]),origin:n}}for(var s=e&&"end"!=e&&po(this,r,e),l=r.length-1;l>=0;l--)Qo(this,r[l]);s?Ho(this,s):this.cm&&li(this.cm)})),undo:Zi((function(){ea(this,"undo")})),redo:Zi((function(){ea(this,"redo")})),undoSelection:Zi((function(){ea(this,"undo",!0)})),redoSelection:Zi((function(){ea(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,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var i=0;i<t.undone.length;i++)t.undone[i].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Oo(this.history),bo(this,(function(e){return e.history=t.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:Zo(this.history.done),undone:Zo(this.history.undone)}},setHistory:function(t){var e=this.history=new Oo(this.history);e.done=Zo(t.done.slice(0),null,!0),e.undone=Zo(t.undone.slice(0),null,!0)},setGutterMarker:Zi((function(t,e,n){return ca(this,t,"gutter",(function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&it(r)&&(t.gutterMarkers=null),!0}))})),clearGutter:Zi((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&ca(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,it(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!ie(this,t))return null;if(e=t,!(t=Jt(this,t)))return null}else if(null==(e=ne(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:Zi((function(t,e,n){return ca(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(S(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0}))})),removeLineClass:Zi((function(t,e,n){return ca(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var o=i.match(S(n));if(!o)return!1;var a=o.index+o[0].length;t[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:Zi((function(t,e,n){return da(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return ma(this,pe(this,t),pe(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return ma(this,t=pe(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=Jt(this,(t=pe(this,t)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=pe(this,t),e=pe(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==t.line&&t.ch>=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)})),t},posFromIndex:function(t){var e,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>t)return e=t,!0;t-=o,++n})),pe(this,ae(n,e))},indexFromPos:function(t){var e=(t=pe(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,(function(t){e+=t.text.length+n})),e},copy:function(t){var e=new Ca(te(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var r=new Ca(te(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],ka(r,wa(this)),r},unlinkDoc:function(t){if(t instanceof Is&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e)if(this.linked[e].doc==t){this.linked.splice(e,1),t.unlinkDoc(this),xa(wa(this));break}if(t.history==this.history){var n=[t.id];bo(t,(function(t){return n.push(t.id)}),!0),t.history=new Oo(null),t.history.done=Zo(this.history.done,n),t.history.undone=Zo(this.history.undone,n)}},iterLinkedDocs:function(t){bo(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):Zt(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Zi((function(t){"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&xo(this.cm))}))}),Ca.prototype.eachLine=Ca.prototype.iter;var Sa=0;function _a(t){var e=this;if(Ea(e),!bt(e,t)&&!Wn(e.display,t)){Ot(t),a&&(Sa=+new Date);var n=Lr(e,t,!0),r=t.dataTransfer.files;if(n&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,l=function(){++s==i&&Di(e,(function(){var t={from:n=pe(e.doc,n),to:n,text:e.doc.splitLines(o.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};Qo(e.doc,t),Ho(e.doc,lo(pe(e.doc,n),pe(e.doc,co(t))))}))()},c=function(t,n){if(e.options.allowDropFileTypes&&-1==B(e.options.allowDropFileTypes,t.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var t=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(o[n]=t),l()},r.readAsText(t)}},u=0;u<r.length;u++)c(r[u],u);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var f=t.dataTransfer.getData("Text");if(f){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),Uo(e.doc,lo(n,n)),h)for(var p=0;p<h.length;++p)oa(e.doc,"",h[p].anchor,h[p].head,"drag");e.replaceSelection(f,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Pa(t,e){if(a&&(!t.state.draggingText||+new Date-Sa<100))_t(e);else if(!bt(t,e)&&!Wn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!p)){var n=j("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)}}function Ta(t,e){var n=Lr(t,e);if(n){var r=document.createDocumentFragment();$r(t,n,r),t.display.dragCursor||(t.display.dragCursor=j("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),E(t.display.dragCursor,r)}}function Ea(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function ja(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var i=e[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Aa=!1;function Ra(){Aa||(Da(),Aa=!0)}function Da(){var t;gt(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,ja(Ma)}),100))})),gt(window,"blur",(function(){return ja(Qr)}))}function Ma(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Za={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},La=0;La<10;La++)Za[La+48]=Za[La+96]=String(La);for(var Na=65;Na<=90;Na++)Za[Na]=String.fromCharCode(Na);for(var Ia=1;Ia<=12;Ia++)Za[Ia+111]=Za[Ia+63235]="F"+Ia;var Fa={};function Va(t){var e,n,r,i,o=t.split(/-(?!$)/);t=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),i&&(t="Cmd-"+t),r&&(t="Shift-"+t),t}function Ba(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=X(n.split(" "),Va),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=e[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var c in e)t[c]=e[c];return t}function Ha(t,e,n,r){var i=(e=$a(e)).call?e.call(t,r):e[t];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Ha(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var a=Ha(t,e.fallthrough[o],n,r);if(a)return a}}}function za(t){var e="string"==typeof t?t:Za[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Ua(t,e,n){var r=t;return e.altKey&&"Alt"!=r&&(t="Alt-"+t),(O?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(t="Ctrl-"+t),(O?e.ctrlKey:e.metaKey)&&"Mod"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function Wa(t,e){if(h&&34==t.keyCode&&t["char"])return!1;var n=Za[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),Ua(n,t,e))}function $a(t){return"string"==typeof t?Fa[t]:t}function qa(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&se(o.from,Y(r).to)<=0;){var a=r.pop();if(se(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Ri(t,(function(){for(var e=r.length-1;e>=0;e--)oa(t.doc,"",r[e].from,r[e].to,"+delete");li(t)}))}function Ga(t,e,n){var r=st(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Ka(t,e,n){var r=Ga(t,e.ch,n);return null==r?null:new ae(e.line,r,n<0?"after":"before")}function Ya(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=pt(n,e.doc.direction);if(o){var a,s=i<0?Y(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=rr(e,n);a=i<0?n.text.length-1:0;var u=ir(e,c,a).top;a=lt((function(t){return ir(e,c,t).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ga(n,a,1))}else a=i<0?s.to:s.from;return new ae(r,a,l)}}return new ae(r,i<0?n.text.length:0,i<0?"before":"after")}function Xa(t,e,n,r){var i=pt(e,t.doc.direction);if(!i)return Ka(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ft(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Ka(e,n,r);var s,l=function(t,n){return Ga(e,t instanceof ae?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(s=s||rr(t,e),Sr(t,e,s,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==a.level){var f=1==a.level==r<0,h=l(n,f?1:-1);if(null!=h&&(f?h<=a.to&&h<=u.end:h>=a.from&&h>=u.begin)){var p=f?"before":"after";return new ae(n.line,h,p)}}var d=function(t,e,r){for(var o=function(t,e){return e?new ae(n.line,l(t,1),"before"):new ae(n.line,t,"after")};t>=0&&t<i.length;t+=e){var a=i[t],s=e>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},g=d(o+r,r,u);if(g)return g;var v=r>0?u.end:l(u.begin,-1);return null==v||r>0&&v==e.text.length||!(g=d(r>0?0:i.length-1,r,c(v)))?null:g}Fa.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"},Fa.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"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.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"]},Fa["default"]=b?Fa.macDefault:Fa.pcDefault;var Ja={selectAll:Xo,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),U)},killLine:function(t){return qa(t,(function(e){if(e.empty()){var n=Jt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:ae(e.head.line+1,0)}:{from:e.head,to:ae(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return qa(t,(function(e){return{from:ae(e.from().line,0),to:pe(t.doc,ae(e.to().line+1,0))}}))},delLineLeft:function(t){return qa(t,(function(t){return{from:ae(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return qa(t,(function(e){var n=t.charCoords(e.head,"div").top+5;return{from:t.coordsChar({left:0,top:n},"div"),to:e.from()}}))},delWrappedLineRight:function(t){return qa(t,(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}}))},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(ae(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(ae(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return Qa(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return es(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return ts(t,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),$)},goLineLeft:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),$)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?es(t,e.head):r}),$)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(t.getLine(o.line),o.ch,r);e.push(K(r-a%r))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Ri(t,(function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++)if(e[r].empty()){var i=e[r].head,o=Jt(t.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ae(i.line,i.ch-1)),i.ch>0)i=new ae(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ae(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Jt(t.doc,i.line-1).text;a&&(i=new ae(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),ae(i.line-1,a.length-1),i,"+transpose"))}n.push(new ao(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Ri(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 r=0;r<e.length;r++)t.indentLine(e[r].from().line,null,!0);li(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function Qa(t,e){var n=Jt(t.doc,e),r=Qe(n);return r!=n&&(e=ne(r)),Ya(!0,t,r,e,1)}function ts(t,e){var n=Jt(t.doc,e),r=tn(n);return r!=n&&(e=ne(r)),Ya(!0,t,n,e,-1)}function es(t,e){var n=Qa(t,e.line),r=Jt(t.doc,n.line),i=pt(r,t.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return ae(n.line,a?0:o,n.sticky)}return n}function ns(t,e,n){if("string"==typeof e&&!(e=Ja[e]))return!1;t.display.input.ensurePolled();var r=t.display.shift,i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),i=e(t)!=z}finally{t.display.shift=r,t.state.suppressEdits=!1}return i}function rs(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=Ha(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&Ha(e,t.options.extraKeys,n,t)||Ha(e,t.options.keyMap,n,t)}var is=new V;function os(t,e,n,r){var i=t.state.keySeq;if(i){if(za(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:is.set(50,(function(){t.state.keySeq==i&&(t.state.keySeq=null,t.display.input.reset())})),as(t,i+" "+e,n,r))return!0}return as(t,e,n,r)}function as(t,e,n,r){var i=rs(t,e,r);return"multi"==i&&(t.state.keySeq=e),"handled"==i&&jn(t,"keyHandled",t,e,n),"handled"!=i&&"multi"!=i||(Ot(n),Kr(t)),!!i}function ss(t,e){var n=Wa(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?os(t,"Shift-"+n,e,(function(e){return ns(t,e,!0)}))||os(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return ns(t,e)})):os(t,n,e,(function(e){return ns(t,e)})))}function ls(t,e,n){return os(t,"'"+n+"'",e,(function(e){return ns(t,e,!0)}))}var cs=null;function us(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||(e.curOp.focus=D(),bt(e,t)))){a&&s<11&&27==t.keyCode&&(t.returnValue=!1);var r=t.keyCode;e.display.shift=16==r||t.shiftKey;var i=ss(e,t);h&&(cs=i?r:null,i||88!=r||Nt||!(b?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!b&&!i&&46==r&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||fs(e)}}function fs(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(P(e,"CodeMirror-crosshair"),mt(document,"keyup",n),mt(document,"mouseover",n))}M(e,"CodeMirror-crosshair"),gt(document,"keyup",n),gt(document,"mouseover",n)}function hs(t){16==t.keyCode&&(this.doc.sel.shift=!1),bt(this,t)}function ps(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||Wn(e.display,t)||bt(e,t)||t.ctrlKey&&!t.altKey||b&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(h&&n==cs)return cs=null,void Ot(t);if(!h||t.which&&!(t.which<10)||!ss(e,t)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(ls(e,t,i)||e.display.input.onKeyPress(t))}}}var ds,gs,vs=400,ms=function(t,e,n){this.time=t,this.pos=e,this.button=n};function ys(t,e){var n=+new Date;return gs&&gs.compare(n,t,e)?(ds=gs=null,"triple"):ds&&ds.compare(n,t,e)?(gs=new ms(n,t,e),ds=null,"double"):(ds=new ms(n,t,e),gs=null,"single")}function bs(t){var e=this,n=e.display;if(!(bt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,Wn(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ts(e,t)){var r=Lr(e,t),i=Tt(t),o=r?ys(r,i):"single";window.focus(),1==i&&e.state.selectingText&&e.state.selectingText(t),r&&ws(e,i,r,o,t)||(1==i?r?xs(e,r,o,t):Pt(t)==n.scroller&&Ot(t):2==i?(r&&No(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(C?e.display.input.onContextMenu(t):Xr(e)))}}function ws(t,e,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),os(t,Ua(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,(function(e){if("string"==typeof e&&(e=Ja[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=z}finally{t.state.suppressEdits=!1}return r}))}function ks(t,e,n){var r=t.getOption("configureMouse"),i=r?r(t,e,n):{};if(null==i.unit){var o=w?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==i.extend||t.doc.extend)&&(i.extend=t.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey)),i}function xs(t,e,n,r){a?setTimeout(N(Yr,t),0):t.curOp.focus=D();var i,o=ks(t,n,r),s=t.doc.sel;t.options.dragDrop&&At&&!t.isReadOnly()&&"single"==n&&(i=s.contains(e))>-1&&(se((i=s.ranges[i]).from(),e)<0||e.xRel>0)&&(se(i.to(),e)>0||e.xRel<0)?Os(t,r,e,o):Ss(t,r,e,o)}function Os(t,e,n,r){var i=t.display,o=!1,c=Di(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Xr(t)),mt(i.wrapper.ownerDocument,"mouseup",c),mt(i.wrapper.ownerDocument,"mousemove",u),mt(i.scroller,"dragstart",f),mt(i.scroller,"drop",c),o||(Ot(e),r.addNew||No(t.doc,n,null,null,r.extend),l&&!p||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},f=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=c,c.copy=!r.moveOnDrag,gt(i.wrapper.ownerDocument,"mouseup",c),gt(i.wrapper.ownerDocument,"mousemove",u),gt(i.scroller,"dragstart",f),gt(i.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Cs(t,e,n){if("char"==n)return new ao(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ao(ae(e.line,0),pe(t.doc,ae(e.line+1,0)));var r=n(t,e);return new ao(r.from,r.to)}function Ss(t,e,n,r){a&&Xr(t);var i=t.display,o=t.doc;Ot(e);var s,l,c=o.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?u[l]:new ao(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new ao(n,n)),n=Lr(t,e,!0,!0),l=-1;else{var f=Cs(t,n,r.unit);s=r.extend?Lo(s,f.anchor,f.head,r.extend):f}r.addNew?-1==l?(l=u.length,zo(o,so(t,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(zo(o,so(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Fo(o,l,s,W):(l=0,zo(o,new oo([s],0),W),c=o.sel);var h=n;function p(e){if(0!=se(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],a=t.options.tabSize,u=F(Jt(o,n.line).text,n.ch,a),f=F(Jt(o,e.line).text,e.ch,a),p=Math.min(u,f),d=Math.max(u,f),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=Jt(o,g).text,y=q(m,p,a);p==d?i.push(new ao(ae(g,y),ae(g,y))):m.length>y&&i.push(new ao(ae(g,y),ae(g,q(m,d,a))))}i.length||i.push(new ao(n,n)),zo(o,so(t,c.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=s,k=Cs(t,e,r.unit),x=w.anchor;se(k.anchor,x)>0?(b=k.head,x=fe(w.from(),k.anchor)):(b=k.anchor,x=ue(w.to(),k.head));var O=c.ranges.slice(0);O[l]=_s(t,new ao(pe(o,x),b)),zo(o,so(t,O,l),W)}}var d=i.wrapper.getBoundingClientRect(),g=0;function v(e){var n=++g,a=Lr(t,e,!0,"rectangle"==r.unit);if(a)if(0!=se(a,h)){t.curOp.focus=D(),p(a);var s=ni(i,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Di(t,(function(){g==n&&v(e)})),150)}else{var l=e.clientY<d.top?-20:e.clientY>d.bottom?20:0;l&&setTimeout(Di(t,(function(){g==n&&(i.scroller.scrollTop+=l,v(e))})),50)}}function m(e){t.state.selectingText=!1,g=1/0,e&&(Ot(e),i.input.focus()),mt(i.wrapper.ownerDocument,"mousemove",y),mt(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Di(t,(function(t){0!==t.buttons&&Tt(t)?v(t):m(t)})),b=Di(t,m);t.state.selectingText=b,gt(i.wrapper.ownerDocument,"mousemove",y),gt(i.wrapper.ownerDocument,"mouseup",b)}function _s(t,e){var n=e.anchor,r=e.head,i=Jt(t.doc,n.line);if(0==se(n,r)&&n.sticky==r.sticky)return e;var o=pt(i);if(!o)return e;var a=ft(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ft(o,r.ch,r.sticky),f=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:f>0}var h=o[c+(l?-1:0)],p=l==(1==h.level),d=p?h.from:h.to,g=p?"after":"before";return n.ch==d&&n.sticky==g?e:new ao(new ae(n.line,d,g),r)}function Ps(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&Ot(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!kt(t,n))return St(e);o-=s.top-a.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return yt(t,n,t,re(t.doc,o),t.display.gutterSpecs[l].className,e),St(e)}}function Ts(t,e){return Ps(t,e,"gutterClick",!0)}function Es(t,e){Wn(t.display,e)||js(t,e)||bt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function js(t,e){return!!kt(t,"gutterContextMenu")&&Ps(t,e,"gutterContextMenu",!1)}function As(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(t)}ms.prototype.compare=function(t,e,n){return this.time+vs>t&&0==se(e,this.pos)&&n==this.button};var Rs={toString:function(){return"CodeMirror.Init"}},Ds={},Ms={};function Zs(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=Rs&&i(t,e,n)}:i)}t.defineOption=n,t.Init=Rs,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,go(t)}),!0),n("indentUnit",2,go,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){vo(t),pr(t),Ir(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(ae(r,o))}r++}));for(var i=n.length-1;i>=0;i--)oa(t.doc,e,n[i],ae(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Rs&&t.refresh()})),n("specialCharPlaceholder",mn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"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("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!k),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){As(t),Ji(t)}),!0),n("keyMap","default",(function(t,e,n){var r=$a(e),i=n!=Rs&&$a(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ns,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Yi(e,t.options.lineNumbers),Ji(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Dr(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return bi(t)}),!0),n("scrollbarStyle","native",(function(t){xi(t),bi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Yi(t.options.gutters,e),Ji(t)}),!0),n("firstLineNumber",1,Ji,!0),n("lineNumberFormatter",(function(t){return t}),Ji,!0),n("showCursorWhenSelecting",!1,Ur,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Qr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=''===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Ls),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Ur,!0),n("singleCursorHeightPerLine",!0,Ur,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,vo,!0),n("addModeClass",!1,vo,!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,vo,!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)}function Ls(t,e,n){if(!e!=!(n&&n!=Rs)){var r=t.display.dragFunctions,i=e?gt:mt;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function Ns(t){t.options.lineWrapping?(M(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(P(t.display.wrapper,"CodeMirror-wrap"),cn(t)),Zr(t),Ir(t),pr(t),setTimeout((function(){return bi(t)}),100)}function Is(t,e){var n=this;if(!(this instanceof Is))return new Is(t,e);this.options=e=e?I(e):{},I(Ds,e,!1);var r=e.value;"string"==typeof r?r=new Ca(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Is.inputStyles[e.inputStyle](this),o=this.display=new Qi(t,r,i,e);for(var c in o.wrapper.CodeMirror=this,As(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(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 V,keySeq:null,specialChars:null},e.autofocus&&!y&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),Ra(),Ci(this),this.curOp.forceUpdate=!0,wo(this,r),e.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Jr(n)}),20):Qr(this),Ms)Ms.hasOwnProperty(c)&&Ms[c](this,e[c],Rs);Ki(this),e.finishInit&&e.finishInit(this);for(var u=0;u<Vs.length;++u)Vs[u](this);Si(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Fs(t){var e=t.display;gt(e.scroller,"mousedown",Di(t,bs)),gt(e.scroller,"dblclick",a&&s<11?Di(t,(function(e){if(!bt(t,e)){var n=Lr(t,e);if(n&&!Ts(t,e)&&!Wn(t.display,e)){Ot(e);var r=t.findWordAt(n);No(t.doc,r.anchor,r.head)}}})):function(e){return bt(t,e)||Ot(e)}),gt(e.scroller,"contextmenu",(function(e){return Es(t,e)})),gt(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||Es(t,n)}));var n,r={end:0};function i(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(r=e.activeTouch).end=+new Date)}function o(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}function l(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>20*20}gt(e.scroller,"touchstart",(function(i){if(!bt(t,i)&&!o(i)&&!Ts(t,i)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),gt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),gt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Wn(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=t.coordsChar(e.activeTouch,"page");o=!r.prev||l(r,r.prev)?new ao(a,a):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(a):new ao(ae(a.line,0),pe(t.doc,ae(a.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),Ot(n)}i()})),gt(e.scroller,"touchcancel",i),gt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(pi(t,e.scroller.scrollTop),gi(t,e.scroller.scrollLeft,!0),yt(t,"scroll",t))})),gt(e.scroller,"mousewheel",(function(e){return io(t,e)})),gt(e.scroller,"DOMMouseScroll",(function(e){return io(t,e)})),gt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){bt(t,e)||_t(e)},over:function(e){bt(t,e)||(Ta(t,e),_t(e))},start:function(e){return Pa(t,e)},drop:Di(t,_a),leave:function(e){bt(t,e)||Ea(t)}};var c=e.input.getField();gt(c,"keyup",(function(e){return hs.call(t,e)})),gt(c,"keydown",Di(t,us)),gt(c,"keypress",Di(t,ps)),gt(c,"focus",(function(e){return Jr(t,e)})),gt(c,"blur",(function(e){return Qr(t,e)}))}Is.defaults=Ds,Is.optionHandlers=Ms;var Vs=[];function Bs(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=we(t,e).state:n="prev");var a=t.options.tabSize,s=Jt(o,e),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==z||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?F(Jt(o,e-1).text,null,a):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 f="",h=0;if(t.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)h+=a,f+="\t";if(h<c&&(f+=K(c-h)),f!=u)return oa(o,f,ae(e,0),ae(e,u.length),"+input"),s.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var g=o.sel.ranges[d];if(g.head.line==e&&g.head.ch<u.length){var v=ae(e,u.length);Fo(o,d,new ao(v,v));break}}}Is.defineInitHook=function(t){return Vs.push(t)};var Hs=null;function zs(t){Hs=t}function Us(t,e,n,r,i){var o=t.doc;t.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||t.state.pasteIncoming>a,l=Zt(e),c=null;if(s&&r.ranges.length>1)if(Hs&&Hs.text.join("\n")==e){if(r.ranges.length%Hs.text.length==0){c=[];for(var u=0;u<Hs.text.length;u++)c.push(o.splitLines(Hs.text[u]))}}else l.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(c=X(l,(function(t){return[t]})));for(var f=t.curOp.updateInput,h=r.ranges.length-1;h>=0;h--){var p=r.ranges[h],d=p.from(),g=p.to();p.empty()&&(n&&n>0?d=ae(d.line,d.ch-n):t.state.overwrite&&!s?g=ae(g.line,Math.min(Jt(o,g.line).text.length,g.ch+Y(l).length)):s&&Hs&&Hs.lineWise&&Hs.text.join("\n")==l.join("\n")&&(d=g=ae(d.line,0)));var v={from:d,to:g,text:c?c[h%c.length]:l,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};Qo(t.doc,v),jn(t,"inputRead",t,v)}e&&!s&&$s(t,e),li(t),t.curOp.updateInput<2&&(t.curOp.updateInput=f),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ws(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||!e.hasFocus()||Ri(e,(function(){return Us(e,n,0,null,"paste")})),!0}function $s(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(e.indexOf(o.electricChars.charAt(s))>-1){a=Bs(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Jt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Bs(t,i.head.line,"smart"));a&&jn(t,"electricInput",t,i.head.line)}}}function qs(t){for(var e=[],n=[],r=0;r<t.doc.sel.ranges.length;r++){var i=t.doc.sel.ranges[r].head.line,o={anchor:ae(i,0),head:ae(i+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function Gs(t,e,n,r){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",r?"":"off"),t.setAttribute("spellcheck",!!e)}function Ks(){var t=j("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),e=j("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),v&&(t.style.border="1px solid black"),Gs(t),e}function Ys(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 r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&Di(this,e[t])(this,n,i),yt(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"]($a(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:Mi((function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");J(this.state.overlays,{mode:r,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,Ir(this)})),removeOverlay:Mi((function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t)return e.splice(n,1),this.state.modeGen++,void Ir(this)}})),indentLine:Mi((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),ie(this.doc,t)&&Bs(this,t,e,n)})),indentSelection:Mi((function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var i=e[r];if(i.empty())i.head.line>n&&(Bs(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&li(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Bs(this,l,t);var c=this.doc.sel.ranges;0==o.ch&&e.length==c.length&&c[r].from().ch>0&&Fo(this.doc,r,new ao(o,c[r].to()),U)}}})),getTokenAt:function(t,e){return Se(this,t,e)},getLineTokens:function(t,e){return Se(this,ae(t),e,!0)},getTokenTypeAt:function(t){t=pe(this.doc,t);var e,n=be(this,Jt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){e=n[2*a+2];break}r=a+1}}var s=e?e.indexOf("overlay "):-1;return s<0?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var r=[];if(!n.hasOwnProperty(e))return r;var i=n[e],o=this.getModeAt(t);if("string"==typeof o[e])i[o[e]]&&r.push(i[o[e]]);else if(o[e])for(var a=0;a<o[e].length;a++){var s=i[o[e][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==B(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(t,e){var n=this.doc;return we(this,(t=he(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return wr(this,null==t?n.head:"object"==typeof t?pe(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return br(this,pe(this.doc,t),e||"page")},coordsChar:function(t,e){return Or(this,(t=yr(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=yr(this,{top:t,left:0},e||"page").top,re(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var r,i=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>o&&(t=o,i=!0),r=Jt(this.doc,t)}else r=t;return mr(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-sn(r):0)},defaultTextHeight:function(){return jr(this.display)},defaultCharWidth:function(){return Ar(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display,a=(t=wr(this,pe(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);('above'==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>c&&(s=c-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==i?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&oi(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Mi(us),triggerOnKeyPress:Mi(ps),triggerOnKeyUp:hs,triggerOnMouseDown:Mi(bs),execCommand:function(t){if(Ja.hasOwnProperty(t))return Ja[t].call(null,this)},triggerElectric:Mi((function(t){$s(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=pe(this.doc,t),a=0;a<e&&!(o=Xs(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:Mi((function(t,e){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Xs(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()}),$)})),deleteH:Mi((function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):qa(this,(function(n){var i=Xs(r,n.head,t,e,!1);return t<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(t,e,n,r){var i=1,o=r;e<0&&(i=-1,e=-e);for(var a=pe(this.doc,t),s=0;s<e;++s){var l=wr(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Js(this,l,i,n)).hitSide)break}return a},moveV:Mi((function(t,e){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return t<0?a.from():a.to();var s=wr(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Js(n,s,t,e);return"page"==e&&a==r.sel.primary()&&si(n,br(n,l,"div").top-s.top),l}),$),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(t){var e=Jt(this.doc,t.line).text,n=t.ch,r=t.ch;if(e){var i=this.getHelper(t,"wordChars");"before"!=t.sticky&&r!=e.length||!n?++r:--n;for(var o=e.charAt(n),a=rt(o,i)?function(t){return rt(t,i)}:/\s/.test(o)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!rt(t)};n>0&&a(e.charAt(n-1));)--n;for(;r<e.length&&a(e.charAt(r));)++r}return new ao(ae(t.line,n),ae(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?M(this.display.cursorDiv,"CodeMirror-overwrite"):P(this.display.cursorDiv,"CodeMirror-overwrite"),yt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Mi((function(t,e){ci(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Kn(this)-this.display.barHeight,width:t.scrollWidth-Kn(this)-this.display.barWidth,clientHeight:Xn(this),clientWidth:Yn(this)}},scrollIntoView:Mi((function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:ae(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?ui(this,t):hi(this,t.from,t.to,t.margin)})),setSize:Mi((function(t,e){var n=this,r=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=r(t)),null!=e&&(this.display.wrapper.style.height=r(e)),this.options.lineWrapping&&hr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){Fr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,yt(this,"refresh",this)})),operation:function(t){return Ri(this,t)},startOperation:function(){return Ci(this)},endOperation:function(){return Si(this)},refresh:Mi((function(){var t=this.display.cachedTextHeight;Ir(this),this.curOp.forceUpdate=!0,pr(this),ci(this,this.doc.scrollLeft,this.doc.scrollTop),$i(this.display),(null==t||Math.abs(t-jr(this.display))>.5||this.options.lineWrapping)&&Zr(this),yt(this,"refresh",this)})),swapDoc:Mi((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),wo(this,t),pr(this),this.display.input.reset(),ci(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,jn(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}},xt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}function Xs(t,e,n,r,i){var o=e,a=n,s=Jt(t,e.line),l=i&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n<t.first||n>=t.first+t.size)&&(e=new ae(n,e.ch,e.sticky),s=Jt(t,n))}function u(o){var a;if("codepoint"==r){var u=s.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var f=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new ae(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(f?2:1))),-n)}}else a=i?Xa(t.cm,s,e,n):Ka(s,e,n);if(null==a){if(o||!c())return!1;e=Ya(i,t.cm,s,e.line,l)}else e=a;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var f=null,h="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||u(!d);d=!1){var g=s.text.charAt(e.ch)||"\n",v=rt(g,p)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||d||v||(v="s"),f&&f!=v){n<0&&(n=1,u(),e.sticky="after");break}if(v&&(f=v),n>0&&!u(!d))break}var m=Ko(t,e,o,a,!0);return le(o,m)&&(m.hitSide=!0),m}function Js(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*jr(t.display),3);i=(n>0?e.bottom:e.top)+n*c}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=Or(t,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Qs=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function tl(t,e){var n=nr(t,e.line);if(!n||n.hidden)return null;var r=Jt(t.doc,e.line),i=Qn(n,r,e.line),o=pt(r,t.doc.direction),a="left";o&&(a=ft(o,e.ch)%2?"right":"left");var s=sr(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function nl(t,e){return e&&(t.bad=!0),t}function rl(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function f(t){t&&(u(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void f(n);var o,p=e.getAttribute("cm-marker");if(p){var d=t.findMarks(ae(r,0),ae(i+1,0),c(+p));return void(d.length&&(o=d[0].find(0))&&f(Qt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&u();for(var v=0;v<e.childNodes.length;v++)h(e.childNodes[v]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),g&&(a=!0)}else 3==e.nodeType&&f(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;h(e),e!=n;)e=e.nextSibling,l=!1;return o}function il(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return nl(t.clipPos(ae(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var i=0;i<t.display.view.length;i++){var o=t.display.view[i];if(o.node==r)return ol(o,e,n)}}function ol(t,e,n){var r=t.text.firstChild,i=!1;if(!e||!R(r,e))return nl(ae(ne(t.line),0),!0);if(e==r&&(i=!0,e=r.childNodes[n],n=0,!e)){var o=t.rest?Y(t.rest):t.line;return nl(ae(ne(o),o.text.length),i)}var a=3==e.nodeType?e:null,s=e;for(a||1!=e.childNodes.length||3!=e.firstChild.nodeType||(a=e.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=t.measure,c=l.maps;function u(e,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==e||s==n){var u=ne(i<0?t.line:t.rest[i]),f=o[a]+r;return(r<0||s!=e)&&(f=o[a+(r?1:0)]),ae(u,f)}}}var f=u(a,s,n);if(f)return nl(f,i);for(var h=s.nextSibling,p=a?a.nodeValue.length-n:0;h;h=h.nextSibling){if(f=u(h,h.firstChild,0))return nl(ae(f.line,f.ch-p),i);p+=h.textContent.length}for(var d=s.previousSibling,g=n;d;d=d.previousSibling){if(f=u(d,d.firstChild,-1))return nl(ae(f.line,f.ch+g),i);g+=d.textContent.length}}Qs.prototype.init=function(t){var e=this,n=this,r=n.cm,i=n.div=t.lineDiv;function o(t){for(var e=t.target;e;e=e.parentNode){if(e==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function a(t){if(o(t)&&!bt(r,t)){if(r.somethingSelected())zs({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=qs(r);zs({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation((function(){r.setSelections(e.ranges,0,U),r.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var a=Hs.text.join("\n");if(t.clipboardData.setData("Text",a),t.clipboardData.getData("Text")==a)return void t.preventDefault()}var s=Ks(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Hs.text.join("\n");var c=D();L(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==i&&n.showPrimarySelection()}),50)}}i.contentEditable=!0,Gs(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),gt(i,"paste",(function(t){!o(t)||bt(r,t)||Ws(t,r)||s<=11&&setTimeout(Di(r,(function(){return e.updateFromDOM()})),20)})),gt(i,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),gt(i,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),gt(i,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),gt(i,"touchstart",(function(){return n.forceCompositionEnd()})),gt(i,"input",(function(){e.composing||e.readFromDOMSoon()})),gt(i,"copy",a),gt(i,"cut",a)},Qs.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute('aria-label',t):this.div.removeAttribute('aria-label')},Qs.prototype.prepareSelection=function(){var t=Wr(this.cm,!1);return t.focus=D()==this.div,t},Qs.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},Qs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qs.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,r=e.doc.sel.primary(),i=r.from(),o=r.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||o.line<e.display.viewFrom)t.removeAllRanges();else{var a=il(e,t.anchorNode,t.anchorOffset),s=il(e,t.focusNode,t.focusOffset);if(!a||a.bad||!s||s.bad||0!=se(fe(a,s),i)||0!=se(ue(a,s),o)){var l=e.display.view,c=i.line>=e.display.viewFrom&&tl(e,i)||{node:l[0].measure.map[2],offset:0},u=o.line<e.display.viewTo&&tl(e,o);if(!u){var f=l[l.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&u){var p,d=t.rangeCount&&t.getRangeAt(0);try{p=_(c.node,c.offset,u.offset,u.node)}catch(t){}p&&(!n&&e.state.focused?(t.collapse(c.node,c.offset),p.collapsed||(t.removeAllRanges(),t.addRange(p))):(t.removeAllRanges(),t.addRange(p)),d&&null==t.anchorNode?t.addRange(d):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},Qs.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation((function(){return t.cm.curOp.selectionChanged=!0}))}),20)},Qs.prototype.showMultipleSelections=function(t){E(this.cm.display.cursorDiv,t.cursors),E(this.cm.display.selectionDiv,t.selection)},Qs.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},Qs.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return R(this.div,e)},Qs.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&D()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qs.prototype.blur=function(){this.div.blur()},Qs.prototype.getField=function(){return this.div},Qs.prototype.supportsTouch=function(){return!0},Qs.prototype.receivedFocus=function(){var t=this,e=this;function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.selectionInEditor()?setTimeout((function(){return t.pollSelection()}),20):Ri(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,n)},Qs.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},Qs.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(m&&u&&this.cm.display.gutterSpecs.length&&el(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=il(e,t.anchorNode,t.anchorOffset),r=il(e,t.focusNode,t.focusOffset);n&&r&&Ri(e,(function(){zo(e.doc,lo(n,r),U),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)}))}}},Qs.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=ae(a.line-1,Jt(r.doc,a.line-1).length)),s.ch==Jt(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=ae(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(t=Nr(r,a.line))?(e=ne(i.view[0].line),n=i.view[0].node):(e=ne(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,c,u=Nr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=ne(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(rl(r,n,c,e,l)),h=Qt(r.doc,ae(e,0),ae(l,Jt(r.doc,l).text.length));f.length>1&&h.length>1;)if(Y(f)==Y(h))f.pop(),h.pop(),l--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),e++}for(var p=0,d=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);p<m&&g.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=Y(f),b=Y(h),w=Math.min(y.length-(1==f.length?p:0),b.length-(1==h.length?p:0));d<w&&y.charCodeAt(y.length-d-1)==b.charCodeAt(b.length-d-1);)++d;if(1==f.length&&1==h.length&&e==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-d-1)==b.charCodeAt(b.length-d-1);)p--,d++;f[f.length-1]=y.slice(0,y.length-d).replace(/^\u200b+/,""),f[0]=f[0].slice(p).replace(/\u200b+$/,"");var k=ae(e,p),x=ae(l,h.length?Y(h).length-d:0);return f.length>1||f[0]||se(k,x)?(oa(r.doc,f,k,x,"+input"),!0):void 0},Qs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qs.prototype.reset=function(){this.forceCompositionEnd()},Qs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Qs.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))},Qs.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Ri(this.cm,(function(){return Ir(t.cm)}))},Qs.prototype.setUneditable=function(t){t.contentEditable="false"},Qs.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Di(this.cm,Us)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Qs.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Qs.prototype.onContextMenu=function(){},Qs.prototype.resetPosition=function(){},Qs.prototype.needsContentAttribute=!0;var al=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};function sl(t,e){if((e=e?I(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=D();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(gt(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(mt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Is((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function ll(t){t.off=mt,t.on=gt,t.wheelEventPixels=ro,t.Doc=Ca,t.splitLines=Zt,t.countColumn=F,t.findColumn=q,t.isWordChar=nt,t.Pass=z,t.signal=yt,t.Line=un,t.changeEnd=co,t.scrollbarModel=ki,t.Pos=ae,t.cmpPos=se,t.modes=Vt,t.mimeModes=Bt,t.resolveMode=Ut,t.getMode=Wt,t.modeExtensions=$t,t.extendMode=qt,t.copyState=Gt,t.startState=Yt,t.innerMode=Kt,t.commands=Ja,t.keyMap=Fa,t.keyName=Wa,t.isModifierKey=za,t.lookupKey=Ha,t.normalizeKeyMap=Ba,t.StringStream=Xt,t.SharedTextMarker=ya,t.TextMarker=va,t.LineWidget=ha,t.e_preventDefault=Ot,t.e_stopPropagation=Ct,t.e_stop=_t,t.addClass=M,t.contains=R,t.rmClass=P,t.keyNames=Za}al.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!bt(r,t)){if(r.somethingSelected())zs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=qs(r);zs({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,U):(n.prevInput="",i.value=e.text.join("\n"),L(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),v&&(i.style.width="0px"),gt(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),gt(i,"paste",(function(t){bt(r,t)||Ws(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),gt(i,"cut",o),gt(i,"copy",o),gt(t.scroller,"paste",(function(e){if(!Wn(t,e)&&!bt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),gt(t.lineSpace,"selectstart",(function(e){Wn(t,e)||Ot(e)})),gt(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),gt(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},al.prototype.createField=function(t){this.wrapper=Ks(),this.textarea=this.wrapper.firstChild},al.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute('aria-label',t):this.textarea.removeAttribute('aria-label')},al.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=Wr(t);if(t.options.moveInputWithCursor){var i=wr(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},al.prototype.showSelection=function(t){var e=this.cm.display;E(e.cursorDiv,t.cursors),E(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},al.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&&L(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},al.prototype.getField=function(){return this.textarea},al.prototype.supportsTouch=function(){return!1},al.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||D()!=this.textarea))try{this.textarea.focus()}catch(t){}},al.prototype.blur=function(){this.textarea.blur()},al.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},al.prototype.receivedFocus=function(){this.slowPoll()},al.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},al.prototype.fastPoll=function(){var t=!1,e=this;function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},al.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||Lt(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,i.length);l<c&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Ri(e,(function(){Us(e,i.slice(l),r.length-l,null,t.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},al.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},al.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},al.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Lr(n,t),c=r.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Di(n,zo)(n.doc,lo(o),U);var u,f=i.style.cssText,p=e.wrapper.style.cssText,d=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n      z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),C){_t(t);var g=function(){mt(window,"mouseup",g),setTimeout(m,20)};gt(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="​"+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=p,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&v();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==e.prevInput?Di(n,Xo)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},al.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},al.prototype.setUneditable=function(){},al.prototype.needsContentAttribute=!1,Zs(Is),Ys(Is);var cl="iter insert remove copy getEditor constructor".split(" ");for(var ul in Ca.prototype)Ca.prototype.hasOwnProperty(ul)&&B(cl,ul)<0&&(Is.prototype[ul]=function(t){return function(){return t.apply(this.doc,arguments)}}(Ca.prototype[ul]));return xt(Ca),Is.inputStyles={textarea:al,contenteditable:Qs},Is.defineMode=function(t){Is.defaults.mode||"null"==t||(Is.defaults.mode=t),Ht.apply(this,arguments)},Is.defineMIME=zt,Is.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Is.defineMIME("text/plain","null"),Is.defineExtension=function(t,e){Is.prototype[t]=e},Is.defineDocExtension=function(t,e){Ca.prototype[t]=e},Is.fromTextArea=sl,ll(Is),Is.version="5.65.6",Is}())},6629:(t,e,n)=>{1&&function(t){"use strict";function e(t){for(var e={},n=0;n<t.length;++n)e[t[n].toLowerCase()]=!0;return e}t.defineMode("css",(function(e,n){var r=n.inline;n.propertyKeywords||(n=t.resolveMode("text/css"));var i,o,a=e.indentUnit,s=n.tokenHooks,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},f=n.mediaValueKeywords||{},h=n.propertyKeywords||{},p=n.nonStandardPropertyKeywords||{},d=n.fontProperties||{},g=n.counterDescriptors||{},v=n.colorKeywords||{},m=n.valueKeywords||{},y=n.allowNested,b=n.lineComment,w=!0===n.supportsAtComponent,k=!1!==e.highlightNonStandardPropertyKeywords;function x(t,e){return i=e,t}function O(t,e){var n=t.next();if(s[n]){var r=s[n](t,e);if(!1!==r)return r}return"@"==n?(t.eatWhile(/[\w\\\-]/),x("def",t.current())):"="==n||("~"==n||"|"==n)&&t.eat("=")?x(null,"compare"):"\""==n||"'"==n?(e.tokenize=C(n),e.tokenize(t,e)):"#"==n?(t.eatWhile(/[\w\\\-]/),x("atom","hash")):"!"==n?(t.match(/^\s*\w*/),x("keyword","important")):/\d/.test(n)||"."==n&&t.eat(/\d/)?(t.eatWhile(/[\w.%]/),x("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?x(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):t.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(t.current())&&(e.tokenize=S),x("variable callee","variable")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),x("number","unit")):t.match(/^-[\w\\\-]*/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):t.match(/^\w+-/)?x("meta","meta"):void 0}function C(t){return function(e,n){for(var r,i=!1;null!=(r=e.next());){if(r==t&&!i){")"==t&&e.backUp(1);break}i=!i&&"\\"==r}return(r==t||!i&&")"!=t)&&(n.tokenize=null),x("string","string")}}function S(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=C(")"),x(null,"(")}function _(t,e,n){this.type=t,this.indent=e,this.prev=n}function P(t,e,n,r){return t.context=new _(n,e.indentation()+(!1===r?0:a),t.context),n}function T(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function E(t,e,n){return R[n.context.type](t,e,n)}function j(t,e,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return E(t,e,n)}function A(t){var e=t.current().toLowerCase();o=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var R={top:function(t,e,n){if("{"==t)return P(n,e,"block");if("}"==t&&n.context.prev)return T(n);if(w&&/@component/i.test(t))return P(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return P(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return P(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 P(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 P(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return P(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return h.hasOwnProperty(r)?(o="property","maybeprop"):p.hasOwnProperty(r)?(o=k?"string-2":"property","maybeprop"):y?(o=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?R.top(t,e,n):(o="error","block")},maybeprop:function(t,e,n){return":"==t?P(n,e,"prop"):E(t,e,n)},prop:function(t,e,n){if(";"==t)return T(n);if("{"==t&&y)return P(n,e,"propBlock");if("}"==t||"{"==t)return j(t,e,n);if("("==t)return P(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)A(e);else if("interpolation"==t)return P(n,e,"interpolation")}else o+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?T(n):"word"==t?(o="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?j(t,e,n):")"==t?T(n):"("==t?P(n,e,"parens"):"interpolation"==t?P(n,e,"interpolation"):("word"==t&&A(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(o="variable-3",n.context.type):E(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(o="tag",n.context.type):R.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return P(n,e,"atBlock_parens");if("}"==t||";"==t)return j(t,e,n);if("{"==t)return T(n)&&P(n,e,y?"block":"top");if("interpolation"==t)return P(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?"keyword":h.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?k?"string-2":"property":m.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?j(t,e,n):"{"==t?T(n)&&P(n,e,y?"block":"top",!1):("word"==t&&(o="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?T(n):"{"==t||"}"==t?j(t,e,n,2):R.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?P(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):E(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,T(n)):"word"==t?(o="@font-face"==n.stateArg&&!d.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?P(n,e,"top"):E(t,e,n)},at:function(t,e,n){return";"==t?T(n):"{"==t||"}"==t?j(t,e,n):("word"==t?o="tag":"hash"==t&&(o="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?T(n):"{"==t||";"==t?j(t,e,n):("word"==t?o="variable":"variable"!=t&&"("!=t&&")"!=t&&(o="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new _(r?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||O)(t,e);return n&&"object"==typeof n&&(i=n[1],n=n[0]),o=n,"comment"!=i&&(e.state=R[e.state](i,t,e)),o},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-a)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=e(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=e(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","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","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","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","contain","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-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","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-variation-settings","font-weight","gap","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","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","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","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","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","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","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-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","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","writing-mode","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","paint-order","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"],f=e(u),h=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=e(h),d=e(["font-display","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","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","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","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","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","slategrey","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","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","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","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","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","drop-shadow","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","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","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","hue-rotate","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","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","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","pinch-zoom","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","repeating-conic-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","saturate","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","sepia","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","stroke-box","sub","subpixel-antialiased","svg_masks","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","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","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),w=n.concat(i).concat(a).concat(l).concat(u).concat(h).concat(v).concat(y);function k(t,e){for(var n,r=!1;null!=(n=t.next());){if(r&&"/"==n){e.tokenize=null;break}r="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",w),t.defineMIME("text/css",{documentTypes:r,mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:d,counterDescriptors:g,colorKeywords:m,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=k,k(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:m,valueKeywords:b,fontProperties:d,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=k,k(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:s,mediaValueKeywords:c,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:m,valueKeywords:b,fontProperties:d,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=k,k(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:r,mediaTypes:o,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:d,counterDescriptors:g,colorKeywords:m,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=k,k(t,e))}},name:"css",helperType:"gss"})}(n(4631))},6531:(t,e,n)=>{1&&function(t){"use strict";var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function n(t,e,n){var r=t.current(),i=r.search(e);return i>-1?t.backUp(r.length-i):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}var r={};function i(t){var e=r[t];return e||(r[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function o(t,e){var n=t.match(i(e));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function a(t,e){return new RegExp((e?"^":"")+"</\\s*"+t+"\\s*>","i")}function s(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),i=t[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function l(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(!r[0]||r[1].test(o(e,r[0])))return r[2]}}t.defineMode("htmlmixed",(function(r,i){var o=t.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag,allowMissingTagName:i.allowMissingTagName}),c={},u=i&&i.tags,f=i&&i.scriptTypes;if(s(e,c),u&&s(u,c),f)for(var h=f.length-1;h>=0;h--)c.script.unshift(["type",f[h].matches,f[h].mode]);function p(e,i){var s,u=o.token(e,i.htmlState),f=/\btag\b/.test(u);if(f&&!/[<>\s\/]/.test(e.current())&&(s=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))i.inTag=s+" ";else if(i.inTag&&f&&/>$/.test(e.current())){var h=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var d=">"==e.current()&&l(c[h[1]],h[2]),g=t.getMode(r,d),v=a(h[1],!0),m=a(h[1],!1);i.token=function(t,e){return t.match(v,!1)?(e.token=p,e.localState=e.localMode=null,null):n(t,m,e.localMode.token(t,e.localState))},i.localMode=g,i.localState=t.startState(g,o.indent(i.htmlState,"",""))}else i.inTag&&(i.inTag+=e.current(),e.eol()&&(i.inTag+=" "));return u}return{startState:function(){return{token:p,inTag:null,localMode:null,localState:null,htmlState:t.startState(o)}},copyState:function(e){var n;return e.localState&&(n=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:n,htmlState:t.copyState(o,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,r){return!e.localMode||/^\s*<\//.test(n)?o.indent(e.htmlState,n,r):e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||o}}}}),"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(4631),n(9589),n(6876),n(6629))},6876:(t,e,n)=>{1&&function(t){"use strict";t.defineMode("javascript",(function(e,n){var r,i,o=e.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=!1!==n.trackScope,u=n.typescript,f=n.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("keyword d"),o=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:t("new"),delete:r,void:r,throw:r,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:t("this"),class:t("class"),super:t("atom"),yield:r,export:t("export"),import:t("import"),extends:r,await:r}}(),p=/[+\-*&%=<>!?|~^@]/,d=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function v(t,e,n){return r=t,i=n,e}function m(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=y(n),e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if("."==n&&t.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&t.eat(">"))return v("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if("/"==n)return t.eat("*")?(e.tokenize=b,b(t,e)):t.eat("/")?(t.skipToEnd(),v("comment","comment")):ie(t,e,1)?(g(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(t.eat("="),v("operator","operator",t.current()));if("`"==n)return e.tokenize=w,w(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),v("meta","meta");if("#"==n&&t.eatWhile(f))return v("variable","property");if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),v("comment","comment");if(p.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat(".")?v("."):v("operator","operator",t.current());if(f.test(n)){t.eatWhile(f);var r=t.current();if("."!=e.lastType){if(h.propertyIsEnumerable(r)){var i=h[r];return v(i.type,i.style,r)}if("async"==r&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",r)}return v("variable","variable",r)}}function y(t){return function(e,n){var r,i=!1;if(s&&"@"==e.peek()&&e.match(d))return n.tokenize=m,v("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=t||i);)i=!i&&"\\"==r;return i||(n.tokenize=m),v("string","string")}}function b(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=m;break}r="*"==n}return v("comment","comment")}function w(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=m;break}r=!r&&"\\"==n}return v("quasi","string-2",t.current())}var k="([{}])";function x(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),l=k.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(f.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(t.string.charAt(a-1)==s&&"\\"!=t.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(e.fatArrowAt=a)}}var O={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function C(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function S(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==e)return!0}function _(t,e,n,r,i){var o=t.cc;for(P.state=t,P.stream=i,P.marked=null,P.cc=o,P.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);1;)if((o.length?o.pop():l?W:z)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return P.marked?P.marked:"variable"==n&&S(t,r)?"variable-2":e}}var P={state:null,column:null,marked:null,cc:null};function T(){for(var t=arguments.length-1;t>=0;t--)P.cc.push(arguments[t])}function E(){return T.apply(null,arguments),!0}function j(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function A(t){var e=P.state;if(P.marked="def",c){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var r=R(t,e.context);if(null!=r)return void(e.context=r)}else if(!j(t,e.localVars))return void(e.localVars=new Z(t,e.localVars));n.globalVars&&!j(t,e.globalVars)&&(e.globalVars=new Z(t,e.globalVars))}}function R(t,e){if(e){if(e.block){var n=R(t,e.prev);return n?n==e.prev?e:new M(n,e.vars,!0):null}return j(t,e.vars)?e:new M(e.prev,new Z(t,e.vars),!1)}return null}function D(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function M(t,e,n){this.prev=t,this.vars=e,this.block=n}function Z(t,e){this.name=t,this.next=e}var L=new Z("this",new Z("arguments",null));function N(){P.state.context=new M(P.state.context,P.state.localVars,!1),P.state.localVars=L}function I(){P.state.context=new M(P.state.context,P.state.localVars,!0),P.state.localVars=null}function F(){P.state.localVars=P.state.context.vars,P.state.context=P.state.context.prev}function V(t,e){var n=function(){var n=P.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new C(r,P.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function B(){var t=P.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function H(t){function e(n){return n==t?E():";"==t||"}"==n||")"==n||"]"==n?T():E(e)}return e}function z(t,e){return"var"==t?E(V("vardef",e),Tt,H(";"),B):"keyword a"==t?E(V("form"),q,z,B):"keyword b"==t?E(V("form"),z,B):"keyword d"==t?P.stream.match(/^\s*$/,!1)?E():E(V("stat"),K,H(";"),B):"debugger"==t?E(H(";")):"{"==t?E(V("}"),I,ht,B,F):";"==t?E():"if"==t?("else"==P.state.lexical.info&&P.state.cc[P.state.cc.length-1]==B&&P.state.cc.pop()(),E(V("form"),q,z,B,Mt)):"function"==t?E(It):"for"==t?E(V("form"),I,Zt,z,F,B):"class"==t||u&&"interface"==e?(P.marked="keyword",E(V("form","class"==t?t:e),zt,B)):"variable"==t?u&&"declare"==e?(P.marked="keyword",E(z)):u&&("module"==e||"enum"==e||"type"==e)&&P.stream.match(/^\s*\w/,!1)?(P.marked="keyword","enum"==e?E(ee):"type"==e?E(Vt,H("operator"),mt,H(";")):E(V("form"),Et,H("{"),V("}"),ht,B,B)):u&&"namespace"==e?(P.marked="keyword",E(V("form"),W,z,B)):u&&"abstract"==e?(P.marked="keyword",E(z)):E(V("stat"),ot):"switch"==t?E(V("form"),q,H("{"),V("}","switch"),I,ht,B,B,F):"case"==t?E(W,H(":")):"default"==t?E(H(":")):"catch"==t?E(V("form"),N,U,z,B,F):"export"==t?E(V("stat"),qt,B):"import"==t?E(V("stat"),Kt,B):"async"==t?E(z):"@"==e?E(W,z):T(V("stat"),W,H(";"),B)}function U(t){if("("==t)return E(Bt,H(")"))}function W(t,e){return G(t,e,!1)}function $(t,e){return G(t,e,!0)}function q(t){return"("!=t?T():E(V(")"),K,H(")"),B)}function G(t,e,n){if(P.state.fatArrowAt==P.stream.start){var r=n?et:tt;if("("==t)return E(N,V(")"),ut(Bt,")"),B,H("=>"),r,F);if("variable"==t)return T(N,Et,H("=>"),r,F)}var i=n?X:Y;return O.hasOwnProperty(t)?E(i):"function"==t?E(It,i):"class"==t||u&&"interface"==e?(P.marked="keyword",E(V("form"),Ht,B)):"keyword c"==t||"async"==t?E(n?$:W):"("==t?E(V(")"),K,H(")"),B,i):"operator"==t||"spread"==t?E(n?$:W):"["==t?E(V("]"),te,B,i):"{"==t?ft(st,"}",null,i):"quasi"==t?T(J,i):"new"==t?E(nt(n)):E()}function K(t){return t.match(/[;\}\)\],]/)?T():T(W)}function Y(t,e){return","==t?E(K):X(t,e,!1)}function X(t,e,n){var r=0==n?Y:X,i=0==n?W:$;return"=>"==t?E(N,n?et:tt,F):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?E(r):u&&"<"==e&&P.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?E(V(">"),ut(mt,">"),B,r):"?"==e?E(W,H(":"),i):E(i):"quasi"==t?T(J,r):";"!=t?"("==t?ft($,")","call",r):"."==t?E(at,r):"["==t?E(V("]"),K,H("]"),B,r):u&&"as"==e?(P.marked="keyword",E(mt,r)):"regexp"==t?(P.state.lastType=P.marked="operator",P.stream.backUp(P.stream.pos-P.stream.start-1),E(i)):void 0:void 0}function J(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?E(J):E(K,Q)}function Q(t){if("}"==t)return P.marked="string-2",P.state.tokenize=w,E(J)}function tt(t){return x(P.stream,P.state),T("{"==t?z:W)}function et(t){return x(P.stream,P.state),T("{"==t?z:$)}function nt(t){return function(e){return"."==e?E(t?it:rt):"variable"==e&&u?E(St,t?X:Y):T(t?$:W)}}function rt(t,e){if("target"==e)return P.marked="keyword",E(Y)}function it(t,e){if("target"==e)return P.marked="keyword",E(X)}function ot(t){return":"==t?E(B,z):T(Y,H(";"),B)}function at(t){if("variable"==t)return P.marked="property",E()}function st(t,e){return"async"==t?(P.marked="property",E(st)):"variable"==t||"keyword"==P.style?(P.marked="property","get"==e||"set"==e?E(lt):(u&&P.state.fatArrowAt==P.stream.start&&(n=P.stream.match(/^\s*:\s*/,!1))&&(P.state.fatArrowAt=P.stream.pos+n[0].length),E(ct))):"number"==t||"string"==t?(P.marked=s?"property":P.style+" property",E(ct)):"jsonld-keyword"==t?E(ct):u&&D(e)?(P.marked="keyword",E(st)):"["==t?E(W,pt,H("]"),ct):"spread"==t?E($,ct):"*"==e?(P.marked="keyword",E(st)):":"==t?T(ct):void 0;var n}function lt(t){return"variable"!=t?T(ct):(P.marked="property",E(It))}function ct(t){return":"==t?E($):"("==t?T(It):void 0}function ut(t,e,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=P.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),E((function(n,r){return n==e||r==e?T():T(t)}),r)}return i==e||o==e?E():n&&n.indexOf(";")>-1?T(t):E(H(e))}return function(n,i){return n==e||i==e?E():T(t,r)}}function ft(t,e,n){for(var r=3;r<arguments.length;r++)P.cc.push(arguments[r]);return E(V(e,n),ut(t,e),B)}function ht(t){return"}"==t?E():T(z,ht)}function pt(t,e){if(u){if(":"==t)return E(mt);if("?"==e)return E(pt)}}function dt(t,e){if(u&&(":"==t||"in"==e))return E(mt)}function gt(t){if(u&&":"==t)return P.stream.match(/^\s*\w+\s+is\b/,!1)?E(W,vt,mt):E(mt)}function vt(t,e){if("is"==e)return P.marked="keyword",E()}function mt(t,e){return"keyof"==e||"typeof"==e||"infer"==e||"readonly"==e?(P.marked="keyword",E("typeof"==e?$:mt)):"variable"==t||"void"==e?(P.marked="type",E(Ct)):"|"==e||"&"==e?E(mt):"string"==t||"number"==t||"atom"==t?E(Ct):"["==t?E(V("]"),ut(mt,"]",","),B,Ct):"{"==t?E(V("}"),bt,B,Ct):"("==t?E(ut(Ot,")"),yt,Ct):"<"==t?E(ut(mt,">"),mt):"quasi"==t?T(kt,Ct):void 0}function yt(t){if("=>"==t)return E(mt)}function bt(t){return t.match(/[\}\)\]]/)?E():","==t||";"==t?E(bt):T(wt,bt)}function wt(t,e){return"variable"==t||"keyword"==P.style?(P.marked="property",E(wt)):"?"==e||"number"==t||"string"==t?E(wt):":"==t?E(mt):"["==t?E(H("variable"),dt,H("]"),wt):"("==t?T(Ft,wt):t.match(/[;\}\)\],]/)?void 0:E()}function kt(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?E(kt):E(mt,xt)}function xt(t){if("}"==t)return P.marked="string-2",P.state.tokenize=w,E(kt)}function Ot(t,e){return"variable"==t&&P.stream.match(/^\s*[?:]/,!1)||"?"==e?E(Ot):":"==t?E(mt):"spread"==t?E(Ot):T(mt)}function Ct(t,e){return"<"==e?E(V(">"),ut(mt,">"),B,Ct):"|"==e||"."==t||"&"==e?E(mt):"["==t?E(mt,H("]"),Ct):"extends"==e||"implements"==e?(P.marked="keyword",E(mt)):"?"==e?E(mt,H(":"),mt):void 0}function St(t,e){if("<"==e)return E(V(">"),ut(mt,">"),B,Ct)}function _t(){return T(mt,Pt)}function Pt(t,e){if("="==e)return E(mt)}function Tt(t,e){return"enum"==e?(P.marked="keyword",E(ee)):T(Et,pt,Rt,Dt)}function Et(t,e){return u&&D(e)?(P.marked="keyword",E(Et)):"variable"==t?(A(e),E()):"spread"==t?E(Et):"["==t?ft(At,"]"):"{"==t?ft(jt,"}"):void 0}function jt(t,e){return"variable"!=t||P.stream.match(/^\s*:/,!1)?("variable"==t&&(P.marked="property"),"spread"==t?E(Et):"}"==t?T():"["==t?E(W,H(']'),H(':'),jt):E(H(":"),Et,Rt)):(A(e),E(Rt))}function At(){return T(Et,Rt)}function Rt(t,e){if("="==e)return E($)}function Dt(t){if(","==t)return E(Tt)}function Mt(t,e){if("keyword b"==t&&"else"==e)return E(V("form","else"),z,B)}function Zt(t,e){return"await"==e?E(Zt):"("==t?E(V(")"),Lt,B):void 0}function Lt(t){return"var"==t?E(Tt,Nt):"variable"==t?E(Nt):T(Nt)}function Nt(t,e){return")"==t?E():";"==t?E(Nt):"in"==e||"of"==e?(P.marked="keyword",E(W,Nt)):T(W,Nt)}function It(t,e){return"*"==e?(P.marked="keyword",E(It)):"variable"==t?(A(e),E(It)):"("==t?E(N,V(")"),ut(Bt,")"),B,gt,z,F):u&&"<"==e?E(V(">"),ut(_t,">"),B,It):void 0}function Ft(t,e){return"*"==e?(P.marked="keyword",E(Ft)):"variable"==t?(A(e),E(Ft)):"("==t?E(N,V(")"),ut(Bt,")"),B,gt,F):u&&"<"==e?E(V(">"),ut(_t,">"),B,Ft):void 0}function Vt(t,e){return"keyword"==t||"variable"==t?(P.marked="type",E(Vt)):"<"==e?E(V(">"),ut(_t,">"),B):void 0}function Bt(t,e){return"@"==e&&E(W,Bt),"spread"==t?E(Bt):u&&D(e)?(P.marked="keyword",E(Bt)):u&&"this"==t?E(pt,Rt):T(Et,pt,Rt)}function Ht(t,e){return"variable"==t?zt(t,e):Ut(t,e)}function zt(t,e){if("variable"==t)return A(e),E(Ut)}function Ut(t,e){return"<"==e?E(V(">"),ut(_t,">"),B,Ut):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(P.marked="keyword"),E(u?mt:W,Ut)):"{"==t?E(V("}"),Wt,B):void 0}function Wt(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&D(e))&&P.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(P.marked="keyword",E(Wt)):"variable"==t||"keyword"==P.style?(P.marked="property",E($t,Wt)):"number"==t||"string"==t?E($t,Wt):"["==t?E(W,pt,H("]"),$t,Wt):"*"==e?(P.marked="keyword",E(Wt)):u&&"("==t?T(Ft,Wt):";"==t||","==t?E(Wt):"}"==t?E():"@"==e?E(W,Wt):void 0}function $t(t,e){if("!"==e)return E($t);if("?"==e)return E($t);if(":"==t)return E(mt,Rt);if("="==e)return E($);var n=P.state.lexical.prev;return T(n&&"interface"==n.info?Ft:It)}function qt(t,e){return"*"==e?(P.marked="keyword",E(Qt,H(";"))):"default"==e?(P.marked="keyword",E(W,H(";"))):"{"==t?E(ut(Gt,"}"),Qt,H(";")):T(z)}function Gt(t,e){return"as"==e?(P.marked="keyword",E(H("variable"))):"variable"==t?T($,Gt):void 0}function Kt(t){return"string"==t?E():"("==t?T(W):"."==t?T(Y):T(Yt,Xt,Qt)}function Yt(t,e){return"{"==t?ft(Yt,"}"):("variable"==t&&A(e),"*"==e&&(P.marked="keyword"),E(Jt))}function Xt(t){if(","==t)return E(Yt,Xt)}function Jt(t,e){if("as"==e)return P.marked="keyword",E(Yt)}function Qt(t,e){if("from"==e)return P.marked="keyword",E(W)}function te(t){return"]"==t?E():T(ut($,"]"))}function ee(){return T(V("form"),Et,H("{"),V("}"),ut(ne,"}"),B,B)}function ne(){return T(Et,Rt)}function re(t,e){return"operator"==t.lastType||","==t.lastType||p.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function ie(t,e,n){return e.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return N.lex=I.lex=!0,F.lex=!0,B.lex=!0,{startState:function(t){var e={tokenize:m,lastType:"sof",cc:[],lexical:new C((t||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new M(null,null,!1),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),x(t,e)),e.tokenize!=b&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==r?n:(e.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",_(e,n,r,i,t))},indent:function(e,r){if(e.tokenize==b||e.tokenize==w)return t.Pass;if(e.tokenize!=m)return 0;var i,s=r&&r.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(r))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==B)l=l.prev;else if(u!=Mt&&u!=F)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=e.cc[e.cc.length-1])&&(i==Y||i==X)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var f=l.type,h=s==f;return"vardef"==f?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==f&&"{"==s?l.indented:"form"==f?l.indented+o:"stat"==f?l.indented+(re(e,r)?a||o:0):"switch"!=l.info||h||0==n.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:ie,skipExpression:function(e){_(e,"atom","atom","true",new t.StringStream("",2,null))}}})),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/manifest+json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(4631))},9589:(t,e,n)=>{1&&function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function f(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(d("atom","]]>")):null:t.match("--")?n(d("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=d("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function h(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=f,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){e.tokenize=f,e.state=w,e.tagName=e.tagStart=null;var r=e.tokenize(t,e);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=p(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=h;break}return"string"};return e.isInAttribute=!0,e}function d(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=f;break}n.next()}return t}}function g(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=f;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function v(t){return t&&t.toLowerCase()}function m(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function y(t){t.context&&(t.context=t.context.prev)}function b(t,e){for(var n;1;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(v(n))||!l.contextGrabbers[v(n)].hasOwnProperty(v(e)))return;y(t)}}function w(t,e,n){return"openTag"==t?(n.tagStart=e.column(),k):"closeTag"==t?x:w}function k(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,e,n)):(a="error",k)}function x(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(v(n.context.tagName))&&y(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",O):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",O(t,e,n)):(a="error",C)}function O(t,e,n){return"endTag"!=t?(a="error",O):(y(n),w)}function C(t,e,n){return a="error",O(t,e,n)}function S(t,e,n){if("word"==t)return a="attribute",_;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(v(r))?b(n,r):(b(n,r),n.context=new m(n,r,i==n.indented)),w}return a="error",S}function _(t,e,n){return"equals"==t?P:(l.allowMissing||(a="error"),S(t,e,n))}function P(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,e,n))}function T(t,e,n){return"string"==t?T:S(t,e,n)}return f.isInText=!0,{startState:function(t){var e={tokenize:f,state:w,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(e,n,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=h&&e.tokenize!=f)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(v(i.tagName)))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[v(i.tagName)];if(!a||!a.hasOwnProperty(v(o[2])))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==P&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(4631))},9714:(t,e,n)=>{"use strict";n.d(e,{Z:()=>f});var r=n(4942),i=n(2982),o=n(5671),a=n(3144),s=n(9050),l=n(1163);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f=function(){function t(){(0,o.Z)(this,t)}return(0,a.Z)(t,[{key:"getConfig",value:function(t){return this.__getConfig(t)}},{key:"getProjectData",value:function(t){var e={},n=this.storageKey;return n&&(e[n]=t||this.getAll()),e}},{key:"loadProjectData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.all,r=e.onResult,i=e.reset,o=this.storageKey,a={action:'load'},s=n||this.getAll(),c=t[o];if('string'==typeof c)try{c=JSON.parse(c)}catch(t){this.__logWarn('Data parsing failed',{input:c})}return i&&c&&s.reset(null,a),r?c&&r(c,a):c&&(0,l.isDef)(c.length)&&s.reset(c,a),c}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all;return e&&e.reset(null,t),this}},{key:"__getConfig",value:function(t){var e=this.config||{};return t?e[t]:e}},{key:"getAll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.all?t.array?(0,i.Z)(this.all.models):this.all:[]}},{key:"getAllMap",value:function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})}},{key:"__initConfig",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=(0,l.deepMerge)(t,e),this.em=this.config.em,this.cls=[]}},{key:"__initListen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all,n=this.em,r=this.events;e&&n&&e.on('add',(function(t,e,i){return n.trigger(r.add,t,i)})).on('remove',(function(t,e,i){return n.trigger(r.remove,t,i)})).on('change',(function(t,e){return n.trigger(r.update,t,t.changedAttributes(),e)})).on('all',this.__catchAllEvent,this),this.cls=[e].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var r=t.entity,i=t.event;r.on('all',(function(t,r,o,a){var s=u({event:t},a||o);[n,e].map((function(t){return t.trigger(i,r,s)}))}))}))}},{key:"__remove",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=(0,s.isString)(t)?this.get(t):t,o=function(){return i&&e.all.remove(i,n),i};return!n.silent&&r&&r.trigger(this.events.removeBefore,i,o,n),!n.abort&&o()}},{key:"__catchAllEvent",value:function(t,e,n,r){var i=this.em,o=this.events,a=r||n;i&&o.all&&i.trigger(o.all,{event:t,model:e,options:a}),this.__onAllEvent()}},{key:"__appendTo",value:function(){var t=this.getConfig().appendTo;if(t){var e=(0,s.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}}},{key:"__onAllEvent",value:function(){}},{key:"__logWarn",value:function(t,e){this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)}},{key:"_createId",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,n=this.getAll(),r=n.length+e,i=this.getAllMap();do{t=(0,l.createId)(r)}while(i[t]);return t}},{key:"__listenAdd",value:function(t,e){var n=this;t.on('add',(function(t,r,i){return n.em.trigger(e,t,i)}))}},{key:"__listenRemove",value:function(t,e){var n=this;t.on('remove',(function(t,r,i){return n.em.trigger(e,t,i)}))}},{key:"__listenUpdate",value:function(t,e){var n=this;t.on('change',(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))}},{key:"__destroy",value:function(){var t;this.cls.forEach((function(t){t.stopListening(),t.reset()})),this.em=0,this.config=0,null===(t=this.view)||void 0===t||t.remove(),this.view=0}}]),t}()},1030:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>et,evAdd:()=>U,evAll:()=>V,evClose:()=>K,evCustom:()=>q,evOpen:()=>G,evPfx:()=>B,evRemove:()=>W,evRemoveBefore:()=>$,evSelect:()=>H,evUpdate:()=>z,evUpload:()=>Y,evUploadEnd:()=>J,evUploadError:()=>Q,evUploadRes:()=>tt,evUploadStart:()=>X});var r=n(4942),i=n(9050),o=n(9304);const a={assets:[],noAssets:'',stylePrefix:'am-',upload:0,uploadName:'files',headers:{},params:{},credentials:'include',multiUpload:!0,autoAdd:!0,customFetch:null,uploadFile:null,embedAsBase64:!0,handleAdd:null,beforeUpload:null,showUrlInput:!0,custom:!1,dropzone:!1,openAssetsOnDrop:1,dropzoneContent:''};var s=n(3144),l=n(5671),c=n(9340),u=n(2963),f=n(1120),h=n(2316);function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var d=function(t){(0,c.Z)(n,t);var e=p(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"defaults",value:function(){return{type:'',src:''}}},{key:"getType",value:function(){return this.get('type')}},{key:"getSrc",value:function(){return this.get('src')}},{key:"getFilename",value:function(){return this.get('src').split('/').pop().split('?').shift()}},{key:"getExtension",value:function(){return this.getFilename().split('.').pop()}}]),n}(h.Model);function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}d.prototype.idAttribute='src',d.getDefaults=function(){return(0,i.result)(this.prototype,'defaults')};var y=function(t){(0,c.Z)(n,t);var e=m(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"defaults",value:function(){return v(v({},d.getDefaults()),{},{type:'image',unitDim:'px',height:0,width:0})}}]),n}(d),b=n(168);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var k,x,O=function(t){(0,c.Z)(n,t);var e=w(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"initialize",value: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)}},{key:"__getBhv",value:function(){var t=this.em,e=t&&t.get('AssetManager');return e&&e.__getBehaviour()||{}}},{key:"template",value:function(){var t=this.pfx;return"\n      <div class=\"".concat(t,"preview-cont\">\n        ").concat(this.getPreview(),"\n      </div>\n      <div class=\"").concat(t,"meta\">\n        ").concat(this.getInfo(),"\n      </div>\n      <div class=\"").concat(t,"close\" data-toggle=\"asset-remove\">\n        &Cross;\n      </div>\n    ")}},{key:"updateTarget",value:function(t){t&&t.set&&(t.set('attributes',(0,i.clone)(t.get('attributes'))),t.set('src',this.model.get('src')))}},{key:"getPreview",value:function(){return''}},{key:"getInfo",value:function(){return''}},{key:"render",value:function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this}}]),n}(h.View),C=n(7539);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var _=function(t){(0,c.Z)(n,t);var e=S(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"getPreview",value:function(){var t=this.pfx,e=this.ppfx,n=this.model.get('src');return(0,C.Z)(k||(k=(0,b.Z)(["\n      <div class=\"","preview\" style=\"background-image: url('","');\"></div>\n      <div class=\"","preview-bg ","checker-bg\"></div>\n    "])),t,n,t,e)}},{key:"getInfo",value:function(){var t=this.pfx,e=this.model,n=e.get('name'),r=e.get('width'),i=e.get('height'),o=e.get('unitDim'),a=r&&i?"".concat(r,"x").concat(i).concat(o):'';return n=n||e.getFilename(),(0,C.Z)(x||(x=(0,b.Z)(["\n      <div class=\"","name\">","</div>\n      <div class=\"","dimensions\">","</div>\n    "])),t,n,t,a)}},{key:"init",value:function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")}},{key:"onClick",value:function(){var t=this.model,e=this.pfx,n=this.__getBhv().select,r=this.config.onClick,o=this.collection;o.trigger('deselectAll'),this.$el.addClass(e+'highlight'),(0,i.isFunction)(n)?n(t,!1):(0,i.isFunction)(r)?r(t):this.updateTarget(o.target)}},{key:"onDblClick",value:function(){var t=this.em,e=this.model,n=this.__getBhv().select,r=this.config.onDblClick,o=this.collection,a=o.target,s=o.onSelect;(0,i.isFunction)(n)?n(e,!0):(0,i.isFunction)(r)?r(e):(this.updateTarget(a),t&&t.get('Modal').close()),(0,i.isFunction)(s)&&s(e)}},{key:"onRemove",value:function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)}}]),n}(O);_.prototype.events={'click [data-toggle=asset-remove]':'onRemove',click:'onClick',dblclick:'onDblClick'};var P=n(793);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var E=function(t){(0,c.Z)(n,t);var e=T(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n)}(h.Collection.extend(P.Z));function j(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}E.prototype.types=[{id:'image',model:y,view:_,isType:function(t){return'string'==typeof t?{type:'image',src:t}:t}}];var A=function(t){(0,c.Z)(n,t);var e=j(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"template",value:function(t){var e=t.pfx,n=t.ppfx,r=t.em,i='';return this.config.showUrlInput&&(i="\n          <form class=\"".concat(e,"add-asset\">\n            <div class=\"").concat(n,"field ").concat(e,"add-field\">\n              <input placeholder=\"").concat(r&&r.t('assetManager.inputPlh'),"\"/>\n            </div>\n            <button class=\"").concat(n,"btn-prim\">").concat(r&&r.t('assetManager.addButton'),"</button>\n            <div style=\"clear:both\"></div>\n          </form>\n      ")),"\n    <div class=\"".concat(e,"assets-cont\">\n      <div class=\"").concat(e,"assets-header\">\n        ").concat(i,"\n      </div>\n      <div class=\"").concat(e,"assets\" data-el=\"assets\"></div>\n      <div style=\"clear:both\"></div>\n    </div>\n    ")}},{key:"initialize",value:function(t){this.options=t,this.config=t.config,this.pfx=this.config.stylePrefix||'',this.ppfx=this.config.pStylePrefix||'',this.em=this.config.em;var e=this.collection;this.listenTo(e,'reset',this.renderAssets),this.listenTo(e,'add',this.addToAsset),this.listenTo(e,'remove',this.removedAsset),this.listenTo(e,'deselectAll',this.deselectAll)}},{key:"handleSubmit",value:function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),r=this.config.handleAdd;n&&(e.value='',this.getAssetsEl().scrollTop=0,r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0}))}},{key:"getAssetsEl",value:function(){return this.el.querySelector(".".concat(this.pfx,"assets"))}},{key:"getAddInput",value:function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl}},{key:"removedAsset",value:function(t){this.collection.length||this.toggleNoAssets()}},{key:"addToAsset",value:function(t){1==this.collection.length&&this.toggleNoAssets(1),this.addAsset(t)}},{key:"addAsset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e,r=this.collection,i=this.config,o=new t.typeView({model:t,collection:r,config:i}).render().el;if(n)n.appendChild(o);else{var a=this.getAssetsEl();a&&a.insertBefore(o,a.firstChild)}return o}},{key:"toggleNoAssets",value:function(t){var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}}},{key:"deselectAll",value:function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))}},{key:"renderAssets",value:function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(this.collection.length),this.collection.each((function(n){return t.addAsset(n,e)})),n.append(e)}},{key:"render",value:function(){var t=this.options.fu.render().el;return this.$el.empty(),this.$el.append(t).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this}}]),n}(h.View);A.prototype.events={submit:'handleSubmit'};var R,D=n(9661);function M(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var N=function(t){(0,c.Z)(n,t);var e=L(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"template",value:function(t){var e=t.pfx,n=t.title,r=t.uploadId,i=t.disabled,o=t.multiUpload;return(0,C.Z)(R||(R=(0,b.Z)(["\n      <form>\n        <div id=\"","title\">","</div>\n        <input\n          type=\"file\"\n          id=\"","\"\n          name=\"file\"\n          accept=\"*/*\"\n          ","\n          ","\n        />\n        <div style=\"clear:both;\"></div>\n      </form>\n    "])),e,n,r,i?'disabled':'',o?'multiple':'')}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.config||{};this.module=t.module,this.config=e,this.em=this.config.em,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 #".concat(this.uploadId)]:'uploadFile'};var n=e.uploadFile;n?this.uploadFile=n.bind(this):!e.upload&&e.embedAsBase64&&(this.uploadFile=this.constructor.embedAsBase64),this.delegateEvents()}},{key:"onUploadStart",value:function(){var t=this.module;t&&t.__propEv('asset:upload:start')}},{key:"onUploadEnd",value:function(t){var e=this.$el,n=this.module;n&&n.__propEv('asset:upload:end',t);var r=e.find('input');r&&r.val('')}},{key:"onUploadError",value:function(t){var e=this.module;console.error(t),this.onUploadEnd(t),e&&e.__propEv('asset:upload:error',t)}},{key:"onUploadResponse",value:function(t,e){var n,r=this.module,i=this.config,o=this.target;try{n='string'==typeof t?JSON.parse(t):t}catch(e){n=t}r&&r.__propEv('asset:upload:response',n),i.autoAdd&&o&&o.add(n.data,{at:0}),this.onUploadEnd(t),e&&e(n)}},{key:"uploadFile",value:function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,i=this.config,o=i.beforeUpload;if(!1!==(o&&o(r))){var a=new FormData,s=i.params,l=i.customFetch;for(var c in s)a.append(c,s[c]);if(this.multiUpload)for(var u=0;u<r.length;u++)a.append("".concat(i.uploadName,"[]"),r[u]);else r.length&&a.append(i.uploadName,r[0]);this.target;var f=i.upload,h=i.headers,p='X-Requested-With';if(void 0===h[p]&&(h[p]='XMLHttpRequest'),f){this.onUploadStart();var d={method:'post',credentials:i.credentials||'include',headers:h,body:a};return(l?l(f,d):(0,D.Z)(f,d).then((function(t){return 1==(t.status/200|0)?t.text():t.text().then((function(t){return Promise.reject(t)}))}))).then((function(t){return n.onUploadResponse(t,e)})).catch((function(t){return n.onUploadError(t)}))}}}},{key:"initDrop",value:function(){var t=this;if(!this.uploadForm&&(this.uploadForm=this.$el.find('form').get(0),'draggable'in this.uploadForm)){this.uploadFile;this.uploadForm.ondragover=function(){return this.className=t.pfx+'hover',!1},this.uploadForm.ondragleave=function(){return this.className='',!1},this.uploadForm.ondrop=function(e){this.className='',e.preventDefault(),t.uploadFile(e)}}}},{key:"initDropzone",value:function(t){var e=this,n=0,r=this.config,i=t.model,o=t.el,a=i.get('Editor'),s=(i.get('Config').el,i.get('Canvas').getBody()),l=this.ppfx,c="".concat(l,"dropzone-active"),u="".concat(l,"dropzone"),f=function(){o.className=o.className.replace(c,'').trim(),n=0},h=function(){return n||(o.className+=" ".concat(c),n=1),!1},p=function(){return f(),!1},d=function(t){if(f(),t.preventDefault(),t.stopPropagation(),e.uploadFile(t),r.openAssetsOnDrop&&a){var n=a.getSelected();a.runCommand('open-assets',{target:n,onSelect:function(){a.Modal.close(),a.AssetManager.setTarget(null)}})}return!1};t.$el.append("<div class=\"".concat(u,"\">").concat(r.dropzoneContent,"</div>")),f(),'draggable'in o&&[o,s].forEach((function(t){t.ondragover=h,t.ondragleave=p,t.ondrop=d}))}},{key:"render",value:function(){var t=this.$el,e=this.pfx,n=this.em;return t.html(this.template({title:n&&n.t('assetManager.uploadTitle'),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:e})),this.initDrop(),t.attr('class',e+'file-uploader'),this}}]),n}(h.View);function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}N.embedAsBase64=function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,i={data:[]};if(FileReader){var o,a=[],s=/^(.+)\/(.+)$/,l=M(r);try{var c=function(){var t=o.value,e=new Promise((function(e,n){var r=new FileReader;r.addEventListener('load',(function(i){var o,a=t.name,l=s.exec(t.type);if('image'===(o=l?l[1]:t.type)){var c={src:r.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:r.result,name:a,type:o}:r.result)})),r.addEventListener('error',(function(t){n(t)})),r.addEventListener('abort',(function(t){n('Aborted')})),r.readAsDataURL(t)}));a.push(e)};for(l.s();!(o=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}Promise.all(a).then((function(t){i.data=t,n.onUploadResponse(i,e)}),(function(t){n.onUploadError(t)}))}else this.onUploadError(new Error('Unsupported platform, FileReader is not defined'))};var V='asset',B="".concat(V,":"),H="".concat(B,"select"),z="".concat(B,"update"),U="".concat(B,"add"),W="".concat(B,"remove"),$="".concat(W,":before"),q="".concat(B,"custom"),G="".concat(B,"open"),K="".concat(B,"close"),Y="".concat(B,"upload"),X="".concat(Y,":start"),J="".concat(Y,":end"),Q="".concat(Y,":error"),tt="".concat(Y,":response");const et=function(){var t,e,n,r,s={},l='open-assets';return F(F({},o.Z),{},{name:'AssetManager',storageKey:'assets',Asset:E,Assets:E,events:{all:V,select:H,update:z,add:U,remove:W,removeBefore:$,custom:q,open:G,close:K,uploadStart:X,uploadEnd:J,uploadError:Q,uploadResponse:tt},init:function(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(s=F(F({},a),r)).pStylePrefix,o=s,l=o.em;return this.config=s,this.em=l,i&&(s.stylePrefix=i+s.stylePrefix),t=new E([]),e=new E([]),this.all=t,this.__initListen(),t.on('add',(function(t){return n.getAllVisible().add(t)})),t.on('remove',(function(t){return n.getAllVisible().remove(t)})),this},__propEv:function(t){for(var e,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(e=this.em).trigger.apply(e,[t].concat(i)),(n=this.getAll()).trigger.apply(n,[t].concat(i))},__onAllEvent:(0,i.debounce)((function(){this.__trgCustom()})),__trgCustom:function(){(this.__getBehaviour().container||this.getConfig().custom.open)&&this.em.trigger(this.events.custom,this.__customData())},__customData:function(){var t=this,e=this.__getBehaviour();return{am:this,open:this.isOpen(),assets:this.getAll().models,types:e.types||[],container:e.container,close:function(){return t.close()},remove:function(){return t.remove.apply(t,arguments)},select:function(n,r){var o=t.add(n);(0,i.isFunction)(e.select)&&e.select(o,r)},options:e.options||{}}},open:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em.get('Commands');e.run(l,F({types:['image'],select:function(){}},t))},close:function(){this.em.get('Commands').stop(l)},isOpen:function(){var t=this.em.get('Commands');return!(!t||!t.isActive(l))},add:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0===n.at&&(n.at=0),t.add(e,n)},get:function(e){return t.where({src:e})[0]||null},getAll:function(){return t},getAllVisible:function(){return e},remove:function(t,e){return this.__remove(t,e)},store:function(){return this.getProjectData()},load:function(t){return this.loadProjectData(t)},getContainer:function(){return this.__getBehaviour().container||n&&n.el},getAssetsEl:function(){return n.el.querySelector('[data-el=assets]')},render:function(t){if(!this.getConfig().custom){var r=t||this.getAll().models;if(!n){var i=this.__viewParams();i.fu=this.FileUploader();var o=n&&n.el;(n=new A(F({el:o},i))).render()}return e.reset(r),this.getContainer()}},__viewParams:function(){return{collection:e,globalCollection:t,config:s,module:this}},addType:function(t,e){this.getAll().addType(t,e)},getType:function(t){return this.getAll().getType(t)},getTypes:function(){return this.getAll().getTypes()},AssetsView:function(){return n},FileUploader:function(){return r||(r=new N(this.__viewParams())),r},onLoad:function(){var t=this;this.getAll().reset(s.assets);var e=this.em,n=this.events;e.on("run:".concat(l),(function(){return t.__propEv(n.open)})),e.on("stop:".concat(l),(function(){return t.__propEv(n.close)}))},postRender:function(t){s.dropzone&&r&&r.initDropzone(t)},setTarget:function(t){e.target=t},onSelect:function(t){e.onSelect=t},onClick:function(t){s.onClick=t},onDblClick:function(t){s.onDblClick=t},__behaviour:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._bhv=F(F({},this._bhv||{}),t)},__getBehaviour:function(){return this._bhv||{}},destroy:function(){t.stopListening(),e.stopListening(),t.reset(),e.reset(),r&&r.remove(),n&&n.remove(),[t,e,n,r].forEach((function(t){return null})),this._bhv={},this.all={},s={}}})}},6407:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>q,evAdd:()=>F,evAll:()=>N,evCustom:()=>$,evDrag:()=>z,evDragStart:()=>U,evDragStop:()=>W,evPfx:()=>I,evRemove:()=>B,evRemoveBefore:()=>H,evUpdate:()=>V});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(4942),u=n(9050),f=n(9714);const h={appendTo:'',appendOnClick:!1,blocks:[],custom:!1};var p=n(2316);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var g=function(t){(0,a.Z)(n,t);var e=d(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"defaults",value:function(){return{label:'',content:'',media:'',category:'',activate:!1,select:null,resetId:!1,disable:!1,onClick:null,attributes:{}}}},{key:"getId",value:function(){return this.id}},{key:"getLabel",value:function(){return this.get('label')}},{key:"getMedia",value:function(){return this.get('media')}},{key:"getContent",value:function(){return this.get('content')}},{key:"getCategoryLabel",value:function(){var t=this.get('category');return(0,u.isFunction)(t.get)?t.get('label'):t.label?t.label:t}}]),n}(p.Model);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var m=function(t){(0,a.Z)(n,t);var e=v(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n)}(p.Collection);function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}m.prototype.model=g;var b=function(t){(0,a.Z)(n,t);var e=y(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"defaults",value:function(){return{id:'',label:'',open:!0,attributes:{}}}}]),n}(p.Model);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var k=function(t){(0,a.Z)(n,t);var e=w(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n)}(p.Collection);k.prototype.model=b;var x=n(1163);function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var C,S=function(t){(0,a.Z)(n,t);var e=O(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"events",value:function(){return{click:'handleClick',mousedown:'startDrag',dragstart:'handleDragStart',drag:'handleDrag',dragend:'handleDragEnd'}}},{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model;this.em=e.em,this.config=e,this.endDrag=this.endDrag.bind(this),this.ppfx=e.pStylePrefix||'',this.listenTo(n,'destroy remove',this.remove),this.listenTo(n,'change',this.render)}},{key:"__getModule",value:function(){return this.em.get('BlockManager')}},{key:"handleClick",value:function(t){var e=this.config,n=this.model,r=this.em,i=n.get('onClick')||e.appendOnClick;if(r.trigger('block:click',n,t),i){if((0,u.isFunction)(i))return i(n,r.getEditor(),{event:t});var o,a,s=e.getSorter(),l=n.get('content'),c=r.getSelected();if(s.setDropContent(l),c)if(s.validTarget(c.getEl(),l).valid)o=c;else{var f=c.parent();s.validTarget(f.getEl(),l).valid&&(o=f,a=f.components().indexOf(c)+1)}if(!o){var h=r.getWrapper();s.validTarget(h.getEl(),l).valid&&(o=h)}var p=o&&o.append(l,{at:a})[0];p&&r.setSelected(p,{scroll:1})}}},{key:"startDrag",value:function(t){var e=this.config,n=this.em,r=this.model.get('disable');if(0===t.button&&e.getSorter&&!this.el.draggable&&!r){n.refreshCanvas();var i=e.getSorter();i.setDragHelper(this.el,t),i.setDropContent(this.model.get('content')),i.startSort(this.el),(0,x.on)(document,'mouseup',this.endDrag)}}},{key:"handleDragStart",value:function(t){this.__getModule().__startDrag(this.model,t)}},{key:"handleDrag",value:function(t){this.__getModule().__drag(t)}},{key:"handleDragEnd",value:function(){this.__getModule().__endDrag()}},{key:"endDrag",value:function(t){(0,x.off)(document,'mouseup',this.endDrag);var e=this.config.getSorter();e.moved=0,e.endMove()}},{key:"render",value:function(){var t=this.em,e=this.el,n=this.$el,r=this.ppfx,i=this.model,o=i.get('disable'),a=i.get('attributes')||{},s=a.class||'',l="".concat(r,"block"),c=t&&t.t("blockManager.labels.".concat(i.id))||i.get('label'),u=i.get('render'),f=i.get('media'),h=o?"".concat(l,"--disable"):"".concat(r,"four-color-h");n.attr(a),e.className="".concat(s," ").concat(l," ").concat(r,"one-bg ").concat(h).trim(),e.innerHTML="\n      ".concat(f?"<div class=\"".concat(l,"__media\">").concat(f,"</div>"):'',"\n      <div class=\"").concat(l,"-label\">").concat(c,"</div>\n    "),e.title=a.title||e.textContent.trim(),e.setAttribute('draggable',!(!(0,x.hasDnd)(t)||o));var p=u&&u({el:e,model:i,className:l,prefix:r});return p&&(e.innerHTML=p),this}}]),n}(p.View),_=n(168),P=n(7539);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var E=function(t){(0,a.Z)(n,t);var e=T(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"template",value:function(t){var e=t.pfx,n=t.label;return(0,P.Z)(C||(C=(0,_.Z)(["\n      <div class=\"","title\">\n        <i class=\"","caret-icon\"></i>\n        ","\n      </div>\n      <div class=\"","blocks-c\"></div>\n    "])),e,e,n,e)}},{key:"attributes",value:function(){return this.model.get('attributes')}},{key:"initialize",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t;var e=t.pStylePrefix||'';this.em=t.em,this.pfx=e,this.caretR='fa fa-caret-right',this.caretD='fa fa-caret-down',this.iconClass="".concat(e,"caret-icon"),this.activeClass="".concat(e,"open"),this.className="".concat(e,"block-category"),this.events={},this.events["click .".concat(e,"title")]='toggle',this.listenTo(this.model,'change:open',this.updateVisibility),this.delegateEvents(),this.model.view=this}},{key:"updateVisibility",value:function(){this.model.get('open')?this.open():this.close()}},{key:"open",value:function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=''}},{key:"close",value:function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display='none'}},{key:"toggle",value:function(){var t=this.model;t.set('open',!t.get('open'))}},{key:"getIconEl",value:function(){return this.iconEl||(this.iconEl=this.el.querySelector('.'+this.iconClass)),this.iconEl}},{key:"getBlocksEl",value:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector('.'+this.pfx+'blocks-c')),this.blocksEl}},{key:"append",value:function(t){this.getBlocksEl().appendChild(t)}},{key:"render",value:function(){var t=this.em,e=this.el,n=this.$el,r=this.model,i=this.pfx,o=t.t("blockManager.categories.".concat(r.id))||r.get('label');return e.innerHTML=this.template({pfx:i,label:o}),n.addClass(this.className),n.css({order:r.get('order')}),this.updateVisibility(),this}}]),n}(p.View);function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){(0,c.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var D=function(t){(0,a.Z)(n,t);var e=R(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"initialize",value:function(t,e){(0,u.bindAll)(this,'getSorter','onDrag','onDrop','onMove'),this.config=e||{},this.categories=t.categories||'',this.renderedCategories=[];var n=this.config.pStylePrefix||'';this.ppfx=n,this.noCatClass="".concat(n,"blocks-no-cat"),this.blockContClass="".concat(n,"blocks-c"),this.catsClass="".concat(n,"block-categories");var r=this.collection;this.listenTo(r,'add',this.addTo),this.listenTo(r,'reset',this.render),this.em=this.config.em,this.tac='test-tac',this.grabbingCls=this.ppfx+'grabbing',this.em&&(this.config.getSorter=this.getSorter,this.canvas=this.em.get('Canvas'))}},{key:"updateConfig",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=A(A({},this.config),t)}},{key:"getSorter",value:function(){if(this.em){if(!this.sorter){var t=this.em.get('Utils'),e=this.canvas;this.sorter=new t.Sorter({container:e.getBody(),placer:e.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:e.getFrameEl().contentDocument,direction:'a',wmargin:1,nested:1,em:this.em,canvasRelative:1})}return this.sorter}}},{key:"onDrag",value:function(t){this.em.stopDefault(),this.em.trigger('block:drag:start',t)}},{key:"onMove",value:function(t){this.em.trigger('block:drag:move',t)}},{key:"onDrop",value:function(t){var e=this.em;if(e.runDefault(),t&&t.get){var n='activeOnRender';t.get(n)&&(t.trigger('active'),t.unset(n)),e.trigger('block:drag:stop',t)}}},{key:"addTo",value:function(t){this.add(t)}},{key:"add",value:function(t,e){var n=this.config,r=e||null,i=new S({model:t,attributes:t.get('attributes')},n).render().el,o=t.get('category');if(o&&this.categories&&!n.ignoreCategories){(0,u.isString)(o)?o={id:o,label:o}:(0,u.isObject)(o)&&!o.id&&(o.id=o.label);var a=this.categories.add(o),s=a.get('id'),l=this.renderedCategories[s],c=this.getCategoriesEl();return t.set('category',a,{silent:!0}),!l&&c&&(l=new E({model:a},this.config).render(),this.renderedCategories[s]=l,c.appendChild(l.el)),void(l&&l.append(i))}r?r.appendChild(i):this.append(i)}},{key:"getCategoriesEl",value:function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl}},{key:"getBlocksEl",value:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl}},{key:"append",value:function(t){var e=this.getBlocksEl();e&&e.appendChild(t)}},{key:"render",value:function(){var t=this,e=this.ppfx,n=document.createDocumentFragment();this.catsEl=null,this.blocksEl=null,this.renderedCategories=[],this.el.innerHTML="\n      <div class=\"".concat(this.catsClass,"\"></div>\n      <div class=\"").concat(this.noCatClass,"\">\n        <div class=\"").concat(this.blockContClass,"\"></div>\n      </div>\n    "),this.collection.each((function(e){return t.add(e,n)})),this.append(n);var r="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(r),this.rendered=!0,this}}]),n}(p.View);function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Z(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?M(Object(n),!0).forEach((function(e){(0,c.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var N='block',I="".concat(N,":"),F="".concat(I,"add"),V="".concat(I,"update"),B="".concat(I,"remove"),H="".concat(B,":before"),z="".concat(I,"drag"),U="".concat(z,":start"),W="".concat(z,":stop"),$="".concat(I,"custom"),q=function(t){(0,a.Z)(n,t);var e=L(n);function n(){var t;(0,r.Z)(this,n);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return t=e.call.apply(e,[this].concat(a)),(0,c.Z)((0,o.Z)(t),"name",'BlockManager'),(0,c.Z)((0,o.Z)(t),"Block",g),(0,c.Z)((0,o.Z)(t),"Blocks",m),(0,c.Z)((0,o.Z)(t),"Category",b),(0,c.Z)((0,o.Z)(t),"Categories",k),(0,c.Z)((0,o.Z)(t),"events",{all:N,update:V,add:F,remove:B,removeBefore:H,drag:z,dragStart:U,dragEnd:W,custom:$}),t}return(0,i.Z)(n,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.c=Z(Z({},h),e);var n=this.c.em;return this.em=n,this.blocks=new m(this.c.blocks),this.blocksVisible=new m(this.blocks.models),this.categories=new k,this.all=this.blocks,this.__initListen(),this.blocks.on('add',(function(e){return t.blocksVisible.add(e)})),this.blocks.on('remove',(function(e){return t.blocksVisible.remove(e)})),this.blocks.on('reset',(function(e){return t.blocksVisible.reset(e.models)})),this}},{key:"__trgCustom",value:function(){this.em.trigger(this.events.custom,this.__customData())}},{key:"__customData",value:function(){var t=this,e=this.__getBehaviour();return{bm:this,blocks:this.getAll().models,container:e.container,dragStart:function(e,n){return t.startDrag(e,n)},drag:function(e){return t.__drag(e)},dragStop:function(e){return t.endDrag(e)}}}},{key:"__startDrag",value:function(t,e){var n=this.em,r=this.events,i=this.blocks,o=t.getContent?t.getContent():t;this._dragBlock=t,n.set({dragResult:null,dragContent:o}),[n,i].map((function(n){return n.trigger(r.dragStart,t,e)}))}},{key:"__drag",value:function(t){var e=this.em,n=this.events,r=this.blocks,i=this._dragBlock;[e,r].map((function(e){return e.trigger(n.drag,i,t)}))}},{key:"__endDrag",value:function(){var t=this.em,e=this.events,n=this.blocks,r=this._dragBlock,i=t.get('dragResult');if(this._dragBlock=null,i){var o='activeOnRender',a=i.get&&i.get(o),s=r.get('activate')||a,l=r.get('select'),c=(0,u.isArray)(i)?i[0]:i;(l||s&&!1!==l)&&t.setSelected(c),s&&(c.trigger('active'),a&&c.unset(o)),r.get('resetId')&&c.onAll((function(t){return t.resetId()}))}t.set({dragResult:null,dragContent:null}),[t,n].map((function(t){return t.trigger(e.dragEnd,i,r)}))}},{key:"__getFrameViews",value:function(){return this.em.get('Canvas').getFrames().map((function(t){return t.view}))}},{key:"__behaviour",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._bhv=Z(Z({},this._bhv||{}),t)}},{key:"__getBehaviour",value:function(){return this._bhv||{}}},{key:"startDrag",value:function(t,e){this.__startDrag(t,e),this.__getFrameViews().forEach((function(t){return t.droppable.startCustom()}))}},{key:"endDrag",value:function(t){this.__getFrameViews().forEach((function(e){return e.droppable.endCustom(t)})),this.__endDrag()}},{key:"getConfig",value:function(){return this.c}},{key:"postRender",value:function(){var t=this.categories,e=this.blocksVisible;this.blocksView=new D({collection:e,categories:t},this.c);var n=this.getConfig().appendTo;if(n){var r=(0,u.isElement)(n)?n:document.querySelector(n);if(!r)return this.__logWarn('"appendTo" element not found');r.appendChild(this.render(this.blocksVisible.models))}this.__trgCustom()}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e||{};return r.id=t,this.blocks.add(r,n)}},{key:"get",value:function(t){return this.blocks.get(t)}},{key:"getAll",value:function(){return this.blocks}},{key:"getAllVisible",value:function(){return this.blocksVisible}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__remove(t,e)}},{key:"getCategories",value:function(){return this.categories}},{key:"getContainer",value:function(){return this.blocksView.el}},{key:"render",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.categories.categories,r=t||this.getAll().models;if(e.external){var i=new m(r);return new D({collection:i,categories:n},Z(Z({},this.c),e)).render().el}return this.blocksView&&(this.blocksView.updateConfig(e),this.blocksView.collection.reset(r),this.blocksView.rendered||(this.blocksView.render(),this.blocksView.rendered=1)),this.getContainer()}},{key:"destroy",value:function(){var t,e=[this.blocks,this.blocksVisible,this.categories];e.map((function(t){return t.stopListening()})),e.map((function(t){return t.reset()})),null===(t=this.blocksView)||void 0===t||t.remove(),this.c={},this.blocks={},this.blocksVisible={},this.blocksView={},this.categories=[],this.all={}}}]),n}(f.Z)},7619:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>j});var r=n(9050);const i={stylePrefix:'cm-',inlineCss:!1};var o=n(4925),a=n(5671),s=n(3144),l=n(9340),c=n(2963),u=n(1120),f=n(2316),h=["em"];function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var d=function(t){(0,l.Z)(n,t);var e=p(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"build",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.em,r=(0,o.Z)(e,h),i=r;if(e.cleanId&&n){var a=n.get('CssComposer').getAll(),s=a.toJSON().map((function(t){var e=t.selectors,n=e&&1===e.length&&e.models[0];return n&&n.isId()&&n.get('name')})).filter((function(t){return t}));i.attributes||(i.attributes=function(t,e){var n=e.id;return n&&'i'===n[0]&&!t.get('script')&&!t.get('attributes').id&&s.indexOf(n)<0&&delete e.id,e})}return t.toHTML(i)}}]),n}(f.Model),g=n(8795);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var m=function(t){(0,l.Z)(n,t);var e=v(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"build",value:function(t){var e=t.toJSON();return this.beforeEach(e),(0,r.each)(e,(function(t,n){var r=e[n];if(r instanceof f.Model)e[n]=this.build(r);else if(r instanceof f.Collection){var i=r;e[n]=[],i.length&&i.each((function(t,r){e[n][r]=this.build(t)}),this)}}),this),e}},{key:"beforeEach",value:function(t){delete t.status}}]),n}(f.Model);function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var b,w=function(t){(0,l.Z)(n,t);var e=y(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"mapModel",value:function(t){var e='',n=t.get('script-export')||t.get('script'),i=t.get('type'),o=t.get('components'),a=t.getId();if(n){var s=t.get('attributes');s=(0,r.extend)({},s,{id:a}),t.set('attributes',s,{silent:1});var l=t.getScriptString(n),c=t.get('script-props');if(t.get('scriptUpdated')&&!c)this.mapJs[i+'-'+a]={ids:[a],code:l};else{var u,f=this.mapJs[i];if(c&&(u=t.__getScriptProps()),f)f.ids.push(a),u&&(f.props[a]=u);else{var h={ids:[a],code:l};u&&(h.props={[a]:u}),this.mapJs[i]=h}}}return o.each((function(t){e+=this.mapModel(t)}),this),e}},{key:"build",value:function(t){this.mapJs={},this.mapModel(t);var e='';for(var n in this.mapJs){var r=this.mapJs[n];if(r.code)if(r.props){if(0===r.code.toString().match(/\{([\s\S]*)\}/m)[1].replace(/^\s*\/\/.*$/gm,'').trim().length)continue;e+="\n          var props = ".concat(JSON.stringify(r.props),";\n          var ids = Object.keys(props).map(function(id) { return '#'+id }).join(',');\n          var els = document.querySelectorAll(ids);\n          for (var i = 0, len = els.length; i < len; i++) {\n            var el = els[i];\n            (").concat(r.code,".bind(el))(props[el.id]);\n          }")}else{var i='#'+r.ids.join(', #');e+="\n          var items = document.querySelectorAll('".concat(i,"');\n          for (var i = 0, len = items.length; i < len; i++) {\n            (function(){\n").concat(r.code,"\n}.bind(items[i]))();\n          }")}}return e}}]),n}(f.Model),k=n(4942);function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}(0,n(1163).hasWin)()&&(b=n(4631),n(6531),n(6629),n(9210));var C=function(t){(0,l.Z)(n,t);var e=O(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"defaults",value:function(){return{input:'',label:'',codeName:'',theme:'hopscotch',readOnly:!0,lineNumbers:!0}}},{key:"init",value:function(t){return(0,r.bindAll)(this,'onChange'),this.editor=b.fromTextArea(t,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){(0,k.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({dragDrop:!1,lineWrapping:!0,mode:this.get('codeName')},this.attributes)),this.element=t,this.editor.on('change',this.onChange),this}},{key:"onChange",value:function(){this.trigger('update',this)}},{key:"getEditor",value:function(){return this.editor}},{key:"getElement",value:function(){return this.element}},{key:"setElement",value:function(t){return this.element=t,this}},{key:"refresh",value:function(){return this.getEditor().refresh(),this}},{key:"focus",value:function(){return this.getEditor().focus(),this}},{key:"getContent",value:function(){var t=this.getEditor();return t&&t.getValue()}},{key:"setContent",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.editor;r&&(r.setValue(t),r.autoFormatRange&&(b.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),b.commands.goDocStart(r)),!n.noRefresh&&setTimeout((function(){return e.refresh()})))}}]),n}(f.Model);C.prototype.CodeMirror=b;var S,_=n(168),P=n(7539);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var E=function(t){(0,l.Z)(n,t);var e=T(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"template",value:function(t){var e=t.pfx,n=t.codeName,r=t.label;return(0,P.Z)(S||(S=(0,_.Z)(["\n      <div class=\"","editor\" id=\"","","\">\n        <div id=\"","title\">","</div>\n        <div id=\"","code\"></div>\n      </div>\n    "])),e,e,n,e,r,e)}},{key:"initialize",value:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix}},{key:"render",value:function(){var t=this.model,e=this.pfx,n=this.$el,r=t.toJSON();return r.pfx=e,n.html(this.template(r)),n.attr('class',"".concat(e,"editor-c")),n.find("#".concat(e,"code")).append(t.get('input')),this}}]),n}(f.View);const j=function(){var t={},e={},n={},o={},a={},s='CodeMirror';return{getConfig:function(){return t},config:t,EditorView:E,name:'CodeManager',init:function(e){for(var r in t=e||{},i)r in t||(t[r]=i[r]);var o=t.pStylePrefix;return o&&(t.stylePrefix=o+t.stylePrefix),n.html=new d,n.css=new g.Z,n.json=new m,n.js=new w,a.CodeMirror=new C,this.loadDefaultGenerators().loadDefaultViewers(),this},addGenerator:function(t,n){return e[t]=n,this},getGenerator:function(t){return e[t]||null},getGenerators:function(){return e},addViewer:function(t,e){return o[t]=e,this},getViewer:function(t){return o[t]||null},getViewers:function(){return o},createViewer:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,r.isUndefined)(t.type)?s:t.type,n=this.getViewer(e)&&this.getViewer(e).clone(),i=document.createElement('div'),o=document.createElement('textarea');return i.appendChild(o),n.set(t),n.init(o),n.setElement(i),n},updateViewer:function(t,e){t.setContent(e)},getCode:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.em=t.em;var i=this.getGenerator(n);return i?i.build(e,r):''},loadDefaultGenerators:function(){for(var t in n)this.addGenerator(t,n[t]);return this},loadDefaultViewers:function(){for(var t in a)this.addViewer(t,a[t]);return this},destroy:function(){[t,e,n,o,a].forEach((function(t){return{}}))}}}},8795:(t,e,n)=>{"use strict";n.d(e,{U:()=>p,Z:()=>d});var r=n(5671),i=n(3144),o=n(9340),a=n(2963),s=n(1120),l=n(9050),c=n(2316),u=n(1163);function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var h=Number.MAX_VALUE,p=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?e[0]:''},d=function(t){(0,o.Z)(n,t);var e=f(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"initialize",value:function(){(0,l.bindAll)(this,'sortRules'),this.compCls=[],this.ids=[]}},{key:"buildFromModel",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r='',i=this.em,o=i&&i.getConfig().avoidInlineStyle,a=t.styleToString(),s=t.get('classes');this.ids.push("#".concat(t.getId())),s.each((function(t){return e.compCls.push(t.getFullName())})),!o&&a&&(r="#".concat(t.getId(),"{").concat(a,"}"));var l=t.components();return l.each((function(t){return r+=e.buildFromModel(t,n)})),r}},{key:"build",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.json,i=n.em||'',o=n.cssc||i&&i.get('CssComposer');this.em=i,this.compCls=[],this.ids=[],this.model=t;var a=[],s=t?this.buildFromModel(t,n):'',c=(0,l.isUndefined)(n.clearStyles)&&i?i.getConfig().clearStyles:n.clearStyles;if(o){var f=n.rules||o.getAll(),h={},p=[];n.onlyMatched&&t&&(0,u.hasWin)()&&(f=this.matchedRules(t,f)),f.forEach((function(t){var i=t.getAtRule();if(i){var o=h[i];o?o.push(t):h[i]=[t]}else{var l=e.buildFromRule(t,p,n);r?a.push(l):s+=l}})),this.sortMediaObject(h).forEach((function(t){var i='',o=t.key;t.value.forEach((function(t){var l=e.buildFromRule(t,p,n);t.get('singleAtRule')?s+="".concat(o,"{").concat(l,"}"):i+=l,r&&a.push(l)})),i&&(s+="".concat(o,"{").concat(i,"}"))})),i&&c&&f.remove&&f.remove(p)}return r?a.filter((function(t){return t})):s}},{key:"buildFromRule",value:function(t,e){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o='',a=this.model,s=t.selectorsToString({skipAdd:1}),l=t.get('selectorsAdd'),c=t.get('singleAtRule');if(t.get('selectors').each((function(t){var e=t.getFullName();(r.compCls.indexOf(e)>=0||r.ids.indexOf(e)>=0||i.keepUnusedStyles)&&(n=1)})),s&&n||l||c||!a){var u=t.getDeclaration({body:1});u&&(i.json?o=t:o+=u)}else e.push(t);return o}},{key:"matchedRules",value:function(t,e){var n=this,r=t.getEl(),i=[];return e.forEach((function(t){try{t.selectorsToString().split(',').some((function(t){return r.matches(n.__cleanSelector(t))}))&&i.push(t)}catch(t){}})),t.components().forEach((function(t){i=i.concat(n.matchedRules(t,e))})),i=i.filter((function(t,e){return i.indexOf(t)===e}))}},{key:"getQueryLength",value:function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):h}},{key:"sortMediaObject",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return(0,l.each)(e,(function(t,e){return n.push({key:e,value:t})})),n.sort((function(e,n){var r=[e.key,n.key].every((function(t){return-1!==t.indexOf('min-width')})),i=r?e.key:n.key,o=r?n.key:e.key;return t.getQueryLength(i)-t.getQueryLength(o)}))}},{key:"sortRules",value:function(t,e){var n=function(t){return t.get('mediaText')},r=[n(t),n(e)].every((function(t){return-1!==t.indexOf('min-width')})),i=n(r?t:e),o=n(r?e:t);return this.getQueryLength(i)-this.getQueryLength(o)}},{key:"__cleanSelector",value:function(t){return t.split(' ').map((function(t){return t.split(':')[0]})).join(' ')}}]),n}(c.Model)},289:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>h});var r=n(2982),i=n(4942),o=n(9050),a=n(238);const s={stylePrefix:'com-',defaults:[],strict:1};var l=n(9138);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f=[['preview','Preview','preview'],['resize','Resize','resize'],['fullscreen','Fullscreen','fullscreen'],['copy','CopyComponent'],['paste','PasteComponent'],['canvas-move','CanvasMove'],['canvas-clear','CanvasClear'],['open-code','ExportTemplate','export-template'],['open-layers','OpenLayers','open-layers'],['open-styles','OpenStyleManager','open-sm'],['open-traits','OpenTraitManager','open-tm'],['open-blocks','OpenBlocks','open-blocks'],['open-assets','OpenAssets','open-assets'],['component-select','SelectComponent','select-comp'],['component-outline','SwitchVisibility','sw-visibility'],['component-offset','ShowOffset','show-offset'],['component-move','MoveComponent','move-comp'],['component-next','ComponentNext'],['component-prev','ComponentPrev'],['component-enter','ComponentEnter'],['component-exit','ComponentExit','select-parent'],['component-delete','ComponentDelete'],['component-style-clear','ComponentStyleClear'],['component-drag','ComponentDrag']];const h=function(){var t,e={},i={},c={},h={};return{CommandAbstract:a["default"],name:'Commands',init:function(){var i=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=u(u({},s),a),t=e.em;var h=e.pStylePrefix;return h&&(e.stylePrefix=h+e.stylePrefix),Object.keys(e.defaults).forEach((function(t){var n=e.defaults[t];n.id&&i.add(n.id,n)})),c['tlb-delete']={run:function(t){return t.runCommand('core:component-delete')}},c['tlb-clone']={run:function(t){t.runCommand('core:copy'),t.runCommand('core:paste',{action:'clone-component'})}},c['tlb-move']={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getModel(),a=n&&n.event,s=n.target,c=s||t.getSelected(),u=s?[s]:(0,r.Z)(t.getSelectedAll()),f=a&&'dragstart'==a.type,h={preserveSelected:1},p=['absolute','translate'];if(!c||!c.get('draggable'))return i.logWarning('The element is not draggable');var d=c.get('dmode')||i.get('dmode'),g=function(){return i.stopDefault(h)},v=(0,o.includes)(p,d);u.forEach((function(t){return t.trigger('disable')})),f?setTimeout(g,0):g();var m=function(t){i.trigger("".concat(l.OA,":start"),t)},y=function(t){i.trigger(l.OA,t)},b=function(e,n,r){u.forEach((function(t){return t.set('status','selected')})),t.select(u),c.emitUpdate(),i.trigger("".concat(l.OA,":end"),r),setTimeout((function(){return i.runDefault(h)})),(v||r.cancelled)&&i.set('_cmpDrag',1)};if(v)t.runCommand('core:component-drag',{guidesInfo:1,mode:d,target:c,onStart:m,onDrag:y,onEnd:b,event:a});else{f&&a.dataTransfer.setDragImage(c.view.el,0,0);var w=t.Commands.get('move-comp');w.onStart=m,w.onDrag=y,w.onEndMoveFromModel=b,w.initSorterFromModels(u)}u.forEach((function(t){return t.set('status','freezed-selected')}))}},c['core:undo']=function(t){return t.UndoManager.undo()},c['core:redo']=function(t){return t.UndoManager.redo()},f.forEach((function(e){var r=e[2],i=n(2828)("./".concat(e[1])).default,o="core:".concat(e[0]);c[o]=i,r&&(c[r]=i,['run','stop'].forEach((function(e){t.on("".concat(e,":").concat(r),(function(){for(var n,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(n=t).trigger.apply(n,["".concat(e,":").concat(o)].concat(i))}))})))})),e.em&&(e.model=e.em.get('Canvas')),this.loadDefaultCommands(),this},add:function(t,e){return(0,o.isFunction)(e)&&(e={run:e}),e.stop||(e.noStop=1),delete e.initialize,e.id=t,i[t]=a["default"].extend(e),this},get:function(n){var r=i[n];return(0,o.isFunction)(r)?(r=new r(e),i[n]=r):r||t.logWarning("'".concat(n,"' command not found")),r},extend:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get(t);if(n){var r=u(u({},n.constructor.prototype),e);this.add(t,r);var i=f.filter((function(e){return"core:".concat(e[0])===t&&e[2]}))[0];i&&this.add(i[2],r)}return this},has:function(t){return!!i[t]},getAll:function(){return i},run:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.runCommand(this.get(t),e)},stop:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.stopCommand(this.get(t),e)},isActive:function(t){return this.getActive().hasOwnProperty(t)},getActive:function(){return h},loadDefaultCommands:function(){for(var t in c)this.add(t,c[t]);return this},runCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,a=t.get('Editor');this.isActive(o)&&!i.force&&e.strict||(r=a&&n.callRun(a,i),o&&n.stop&&!n.noStop&&!i.abort&&(h[o]=r))}return r},stopCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,a=t.get('Editor');(this.isActive(o)||i.force||!e.strict)&&(o&&delete h[o],r=n.callStop(a,i))}return r},create:function(t){return t.stop||(t.noStop=1),new(a["default"].extend(t))(e)},destroy:function(){[t,e,i,c,h].forEach((function(t){return{}}))}}}},7202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){t.DomComponents.clear(),t.CssComposer.clear()}}},327:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var r=n(9050),i=n(1163),o=n(5610);const a={run:function(t){(0,r.bindAll)(this,'onKeyUp','enableDragger','disableDragger'),this.editor=t,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(t){this.toggleMove(),this.disableDragger()},onKeyUp:function(t){' '===(0,i.getKeyChar)(t)&&this.editor.stopCommand(this.id)},enableDragger:function(t){this.toggleDragger(1,t)},disableDragger:function(t){this.toggleDragger(0,t)},toggleDragger:function(t,e){var n=this.canvasModel,r=this.em,i=this.dragger,a=t?'add':'remove';this.getCanvas().classList[a]("".concat(this.ppfx,"is__grabbing")),i||(i=new o.Z({getPosition:function(){return{x:n.get('x'),y:n.get('y')}},setPosition:function(t){var e=t.x,r=t.y;n.set({x:e,y:r})},onStart:function(t,e){r.trigger('canvas:move:start',e)},onDrag:function(t,e){r.trigger('canvas:move',e)},onEnd:function(t,e){r.trigger('canvas:move:end',e)}}),this.dragger=i),t?i.start(e):i.stop()},toggleMove:function(t){var e=this.ppfx,n=t?'add':'remove',r=t?'on':'off',o={on:i.on,off:i.off},a=this.getCanvas(),s=["".concat(e,"is__grab")];!t&&s.push("".concat(e,"is__grabbing")),s.forEach((function(t){return a.classList[n](t)})),o[r](document,'keyup',this.onKeyUp),o[r](a,'mousedown',this.enableDragger),o[r](document,'mouseup',this.disableDragger)}}},238:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(5671),i=n(3144),o=n(9340),a=n(2963),s=n(1120),l=n(2316);function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var u=function(t){(0,o.Z)(n,t);var e=c(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"initialize",value:function(t){this.config=t||{},this.editorModel=this.em=this.config.em||{},this.pfx=this.config.stylePrefix,this.ppfx=this.config.pStylePrefix,this.hoverClass=this.pfx+'hover',this.badgeClass=this.pfx+'badge',this.plhClass=this.pfx+'placeholder',this.freezClass=this.ppfx+'freezed',this.canvas=this.em.get&&this.em.get('Canvas'),this.init(this.config)}},{key:"onFrameScroll",value:function(t){}},{key:"getCanvas",value:function(){return this.canvas.getElement()}},{key:"getCanvasBody",value:function(){return this.canvas.getBody()}},{key:"getCanvasTools",value:function(){return this.canvas.getToolsEl()}},{key:"offset",value:function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}}},{key:"init",value:function(t){}},{key:"callRun",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id;if(t.trigger("run:".concat(n,":before"),e),!e||!e.abort){var r=e.sender||t,i=this.run(t,r,e);return t.trigger("run:".concat(n),i,e),t.trigger('run',n,i,e),i}t.trigger("abort:".concat(n),e)}},{key:"callStop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id,r=e.sender||t;t.trigger("stop:".concat(n,":before"),e);var i=this.stop(t,r,e);return t.trigger("stop:".concat(n),i,e),t.trigger('stop',n,i,e),i}},{key:"stopCommand",value:function(){this.em.get('Commands').stop(this.id)}},{key:"run",value:function(t,e){}},{key:"stop",value:function(t,e){}}]),n}(l.Model)},5820:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2982),i=n(9050);const o={run:function(t,e){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[],s=o.component||t.getSelectedAll();return(s=(0,i.isArray)(s)?(0,r.Z)(s):[s]).filter(Boolean).forEach((function(t){if(!t.get('removable'))return a.push(t),n.em.logWarning('The element is not removable',{component:t});t.remove()})),t.select(a),s}}},6694:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>c});var r=n(4942),i=n(9050),o=n(5610);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var l='dmode';const c={run:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.bindAll)(this,'setPosition','onStart','onDrag','onEnd','getPosition','getGuidesStatic','renderGuide','getGuidesTarget');var a=r.target,c=r.event,u=r.mode,f=r.dragger,h=void 0===f?{}:f,p=a.getEl(),d=s({doc:p.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return n.guidesStatic},guidesTarget:function(){return n.guidesTarget}},h);this.setupGuides(),this.opts=r,this.editor=t,this.em=t.getModel(),this.target=a,this.isTran='translate'==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(d):(g=new o.Z(d),this.dragger=g),c&&g.start(c),this.toggleDrag(1),this.em.trigger("".concat(l,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach((function(t){var e=t.guide;e&&e.parentNode.removeChild(e)})),this.guides=[]},getGuidesContainer:function(){var t=this,e=this.guidesEl;if(!e){var n=this.editor,r=this.em,o=this.opts,a=n.getConfig().stylePrefix,s=document.createElement('div'),l=document.createElement('div'),c="<div class=\"".concat(a,"guide-info__line ").concat(a,"danger-bg\">\n        <div class=\"").concat(a,"guide-info__content ").concat(a,"danger-color\"></div>\n      </div>");(e=document.createElement('div')).className="".concat(a,"guides"),s.className="".concat(a,"guide-info ").concat(a,"guide-info__x"),l.className="".concat(a,"guide-info ").concat(a,"guide-info__y"),s.innerHTML=c,l.innerHTML=c,e.appendChild(s),e.appendChild(l),n.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=s,this.elGuideInfoY=l,this.elGuideInfoContentX=s.querySelector(".".concat(a,"guide-info__content")),this.elGuideInfoContentY=l.querySelector(".".concat(a,"guide-info__content")),r.on('canvas:update frame:scroll',(0,i.debounce)((function(){t.updateGuides(),o.debug&&t.guides.forEach((function(e){return t.renderGuide(e)}))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),r=n.parentNode,o=void 0===r?{}:r;return(0,i.each)(o.children,(function(r){return e=e.concat(n!==r?t.getElementGuides(r):[])})),e.concat(this.getElementGuides(o))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,r=this;(t||this.guides).forEach((function(t){var o=t.origin,a=e===o?n:r.getElementPos(o);e=o,n=a,(0,i.each)(r.getGuidePosUpdate(t,a),(function(e,n){return t[n]=e})),t.originRect=a}))},getGuidePosUpdate:function(t,e){var n={},r=e.top,i=e.height,o=e.left,a=e.width;switch(t.type){case't':n.y=r;break;case'b':n.y=r+i;break;case'l':n.x=o;break;case'r':n.x=o+a;break;case'x':n.x=o+a/2;break;case'y':n.y=r+i/2}return n},renderGuide:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.guide||document.createElement('div'),n='px',r=t.active?2:1,i=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?'green':'red',";"),e.children.length||((i=document.createElement('div')).style='position: absolute; color: red; padding: 5px; top: 0; left: 0;',e.appendChild(i)),t.y?(e.style.width='100%',e.style.height="".concat(r).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(r).concat(n),e.style.height='100%',e.style.left="".concat(t.x).concat(n),e.style.top="0".concat(n)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,r=this.getElementPos(t),i=r.top,o=r.height,a=r.left,l=r.width,c=[{type:'t',y:i},{type:'b',y:i+o},{type:'l',x:a},{type:'r',x:a+l},{type:'x',x:a+l/2},{type:'y',y:i+o/2}].map((function(i){return s(s({},i),{},{origin:t,originRect:r,guide:n.debug&&e.renderGuide(i)})}));return c.forEach((function(t){return e.guides.push(t)})),c},getTranslate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'x',n=0;return(t||'').split(' ').forEach((function(t){var r=t.trim(),i="translate".concat(e.toUpperCase(),"(");0===r.indexOf(i)&&(n=parseFloat(r.replace(i,'')))})),n},setTranslate:function(t,e,n){var r="translate".concat(e.toUpperCase(),"("),i="".concat(r).concat(n,")"),o=(t||'').split(' ').map((function(t){return 0===t.trim().indexOf(r)&&(t=i),t})).join(' ');return o.indexOf(r)<0&&(o+=" ".concat(i)),o},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),r=n.left,i=n.top,o=n.transform,a=0,s=0;return e?(a=this.getTranslate(o),s=this.getTranslate(o,'y')):(a=parseFloat(r||0),s=parseFloat(i||0)),{x:a,y:s}},setPosition:function(t){var e=t.x,n=t.y,r=t.end,o=t.position,a=t.width,s=t.height,l=this.target,c=this.isTran,u=this.em,f='px',h=r?'':1,p="".concat(e).concat(f),d="".concat(n).concat(f),g={};if(c){var v=l.getStyle()['transform']||'';v=this.setTranslate(v,'x',p),g={transform:v=this.setTranslate(v,'y',d),en:h},l.addStyle(g,{avoidStore:!r})}else{var m={position:o,width:a,height:s},y={left:p,top:d,en:h};(0,i.keys)(m).forEach((function(t){var e=m[t];e&&(y[t]=e)})),g=y,l.addStyle(g,{avoidStore:!r})}u.getSelected()&&(0,i.keys)(g).forEach((function(t){return u.trigger("update:component:style:".concat(t))}))},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this.target,n=this.editor,r=this.isTran,i=this.opts,o=i.center,a=i.onStart,s=n.Canvas,l=e.getStyle(),c='absolute',u=[c,'relative'];if(a&&a(this._getDragData()),!r&&l.position!==c){var f,h=s.offset(e.getEl()),p=h.left,d=h.top,g=h.width,v=h.height,m=e.parent();do{var y=m.getStyle();f=u.indexOf(y.position)>=0?m:null,m=m.parent()}while(m&&!f);if(o){var b=s.getMouseRelativeCanvas(t);p=b.x,d=b.y}else if(f){var w=s.offset(f.getEl());p-=w.left,d-=w.top}this.setPosition({x:p,y:d,width:"".concat(g,"px"),height:"".concat(v,"px"),position:c})}},onDrag:function(){var t=this,e=this.guidesTarget,n=this.opts,r=n.onDrag;this.updateGuides(e),n.debug&&e.forEach((function(e){return t.renderGuide(e)})),n.guidesInfo&&this.renderGuideInfo(e.filter((function(t){return t.active}))),r&&r(this._getDragData())},onEnd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.editor,i=this.opts,o=this.id,a=i.onEnd;a&&a(t,n,s(s({event:t},n),this._getDragData())),r.stopCommand(o),this.hideGuidesInfo(),this.em.trigger("".concat(l,":end"),this.getEventOpts())},hideGuidesInfo:function(){var t=this;['X','Y'].forEach((function(e){var n=t["elGuideInfo".concat(e)];n&&(n.style.display='none')}))},renderGuideInfo:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.guidesStatic;this.hideGuidesInfo(),e.forEach((function(e){var r=e.origin,o=e.x,a=t.getElementPos(r),c=(0,i.isUndefined)(o)?'y':'x',u='y'===c,f=a[u?'left':'top'],h=a.rect[u?'left':'top'],p=u?f+a.width:f+a.height,d=u?h+a.rect.width:h+a.rect.height,g=t["elGuideInfo".concat(c.toUpperCase())],v=t["elGuideInfoContent".concat(c.toUpperCase())],m=g.style,y=n.filter((function(t){return t.type===e.type})).map((function(t){var e=t.originRect,n=e.left,r=e.width,i=e.top,o=e.height,a=u?n+r:i+o;return{gap:a<f?f-a:(u?n:i)-p,guide:t}})).filter((function(t){return t.gap>0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(y){var b=y.originRect,w=b.left,k=b.width,x=b.top,O=b.height,C=b.rect,S=u?w<a.left:x<a.top,_=u?w:x,P=u?C.left:C.top,T=u?w+k:x+O,E=u?C.left+C.width:C.top+C.height,j=u?e.y:e.x,A=S?T:p,R="".concat(j,"px"),D=S?f-T:_-p,M=S?h-E:P-d;m.display='',m[u?'top':'left']=R,m[u?'left':'top']="".concat(A,"px"),m[u?'width':'height']="".concat(D,"px"),v.innerHTML="".concat(Math.round(M),"px"),t.em.trigger("".concat(l,":active"),s(s({},t.getEventOpts()),{},{guide:e,guidesStatic:n,matched:y,posFirst:j,posSecond:A,size:D,sizeRaw:M,elGuideInfo:g,elGuideInfoCnt:v}))}}))},toggleDrag:function(t){var e=this.ppfx,n=this.editor,r=t?'add':'remove',i=["".concat(e,"is__grabbing")],o=n.Canvas,a=o.getBody();i.forEach((function(t){return a.classList[r](t)})),o[t?'startAutoscroll':'stopAutoscroll']()}}},1947:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.components(),r=n&&n.filter((function(t){return t.get('selectable')}))[0];r&&e.push(r)})),e.length&&t.select(e)}}}},3888:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.Canvas.hasFocus()||n.force){var r=[];t.getSelectedAll().forEach((function(t){for(var e=t.parent();e&&!e.get('selectable');)e=e.parent();e&&r.push(e)})),r.length&&t.select(r)}}}},5883:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,i=n.components().length,o=0,a=0;do{o++,r=(a=t.index()+o)<=i?n.getChildAt(a):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},7508:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,i=0,o=0;do{i++,r=(o=t.index()-i)>=0?n.getChildAt(o):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},8769:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050);const i={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.target,o=[];if(!i.get('styles'))return o;var a=i.get('type'),s=t.Pages.getAllWrappers(),l=(0,r.flatten)(s.map((function(t){return t.findType(a)}))).length;if(!l){var c=t.CssComposer.getAll();o=c.filter((function(t){return t.get('group')==="cmp:".concat(a)})),c.remove(o)}return o}}},2213:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(2982);const i={run:function(t){var e=t.getModel(),n=(0,r.Z)(t.getSelectedAll());n.length&&e.set('clipboard',n)}}},5049:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var r=n(9050),i=n(2316),o=n.n(i),a=n(2620),s=o().$;const l=(0,r.extend)({},a["default"],{init:function(t){(0,r.bindAll)(this,'startDelete','stopDelete','onDelete'),this.hoverClass=this.pfx+'hover-delete',this.badgeClass=this.pfx+'badge-red'},enable:function(){this.$el.find('*').mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation(),s(t.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.data('model').destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html('Remove '+t.getName())}})},3775:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2316),i=n.n(r)().$;const o={run:function(t,e){var n=this;e&&e.set&&e.set('active',0);var r=t.getConfig(),o=t.Modal,a=r.stylePrefix;if(this.cm=t.CodeManager||null,!this.$editors){var s=this.buildEditor('htmlmixed','hopscotch','HTML'),l=this.buildEditor('css','hopscotch','CSS');this.htmlEditor=s.el,this.cssEditor=l.el;var c=i("<div class=\"".concat(a,"export-dl\"></div>"));c.append(s.$el).append(l.$el),this.$editors=c}o.open({title:r.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 r=document.createElement('textarea');!this.codeMirror&&(this.codeMirror=this.cm.getViewer('CodeMirror'));var i=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:r}),o=new this.cm.EditorView({model:i,config:this.cm.getConfig()}).render().$el;return i.init(r),{el:i,$el:o}}}},58:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050);const i={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;this.isEnabled()&&(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 i=n.target,o=(0,r.isElement)(i)?i:document.querySelector(i),a=this.enable(o||t.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+'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')}}},8658:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(9050),i=n(2316),o=n.n(i),a=n(1163),s=n(2620),l=n(8463),c=o().$;const u=(0,r.extend)({},l["default"],s["default"],{init:function(t){s["default"].init.apply(this,arguments),(0,r.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=new Array(t),n=0;n<t;n++)e[n]=arguments[n];s["default"].enable.apply(this,e),this.getBadgeEl().addClass(this.badgeClass),this.getHighlighterEl().addClass(this.hoverClass);var r=this.$wrapper;r.css('cursor','move'),r.on('mousedown',this.initSorter),r.addClass(this.noSelClass)},toggleClipboard:function(){},initSorter:function(t){var e=c(t.target).data('model').get('draggable');e&&(this.cacheEl=null,this.startSelectPosition(t.target,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.onEndMove=this.onEndMove.bind(this),this.stopSelectComponent(),this.$wrapper.off('mousedown',this.initSorter),(0,a.on)(this.getContentWindow(),'keydown',this.rollback))},initSorterFromModel:function(t){var e=t.get('draggable');if(e){this.cacheEl=null;var n=t.view.el;this.startSelectPosition(n,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,a.on)(this.getContentWindow(),'keydown',this.rollback)}},initSorterFromModels:function(t){this.cacheEl=null;var e=t[t.length-1],n=(this.em.get('currentFrame')||{}).model,r=e.getEl(n),i=r.ownerDocument;this.startSelectPosition(r,i,{onStart:this.onStart}),this.sorter.draggable=e.get('draggable'),this.sorter.toMove=t,this.sorter.onMoveClb=this.onDrag,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,a.on)(this.getContentWindow(),'keydown',this.rollback)},onEndMoveFromModel:function(){(0,a.off)(this.getContentWindow(),'keydown',this.rollback)},onEndMove:function(){this.enable(),(0,a.off)(this.getContentWindow(),'keydown',this.rollback)},onSelect:function(t,e){},rollback:function(t,e){(27==(t.which||t.keyCode)||e)&&(this.sorter.moved=!1,this.sorter.endMove())},getBadgeEl:function(){return this.$badge||(this.$badge=c(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=c(this.canvas.getHighlighter())),this.$hl},stop:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];s["default"].stop.apply(this,e),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass);var r=this.$wrapper;r.css('cursor','').unbind().removeClass(this.noSelClass)}})},9617:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(9050),i=n(9283);const o={open:function(t){var e=this,n=this.editor,i=this.title,o=this.config,a=this.am,s=o.custom;if((0,r.isFunction)(s.open))return s.open(a.__customData());n.Modal.open({title:i,content:t}).onceClose((function(){return n.stopCommand(e.id)}))},close:function(){var t=this.config.custom;if((0,r.isFunction)(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.AssetManager,o=r.getConfig(),a=n.types,s=void 0===a?[]:a,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t('assetManager.modalTitle')||'',this.editor=t,this.config=o,this.am=r,r.setTarget(n.target),r.onClick(n.onClick),r.onDblClick(n.onDblClick),r.onSelect(n.onSelect),r.__behaviour({select:c,types:s,options:n}),o.custom)this.rendered=this.rendered||(0,i.ut)('div'),this.rendered.className="".concat(o.stylePrefix,"custom-wrp"),r.__behaviour({container:this.rendered}),r.__trgCustom();else{if(!this.rendered||s){var u=r.getAll().filter((function(t){return t}));s&&s.length&&(u=u.filter((function(t){return-1!==s.indexOf(t.get('type'))}))),r.render(u),this.rendered=r.getContainer()}if(l){var f=this.rendered.querySelector("input#".concat(o.stylePrefix,"uploadFile"));f&&f.setAttribute('accept',l)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},5821:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(9050),i=n(9283);const o={open:function(){var t=this.container,e=this.editor,n=this.bm,i=this.config,o=i.custom,a=i.appendTo;if((0,r.isFunction)(o.open))return o.open(n.__customData());if(this.firstRender&&!a){var s='views-container',l=e.Panels;(l.getPanel(s)||l.addPanel({id:s})).set('appendContent',t).trigger('change:appendContent'),o||t.appendChild(n.render())}t&&(t.style.display='block')},close:function(){var t=this.container,e=this.config.custom;if((0,r.isFunction)(e.close))return e.close(this.bm.__customData());t&&(t.style.display='none')},run:function(t){var e=t.Blocks;this.config=e.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,i.ut)('div'),this.editor=t,this.bm=e;var n=this.container;e.__behaviour({container:n}),this.config.custom&&e.__trgCustom(),this.open()},stop:function(){this.close()}}},3452:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.LayerManager,n=t.Panels,r=e.getConfig();if(!r.appendTo){if(!this.layers){var i='views-container',o=document.createElement('div'),a=n.getPanel(i)||n.addPanel({id:i});r.custom?e.__trgCustom({container:o}):o.appendChild(e.render()),a.set('appendContent',o).trigger('change:appendContent'),this.layers=o}this.layers.style.display='block'}},stop:function(){var t=this.layers;t&&(t.style.display='none')}}},2840:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2316),i=n.n(r)().$;const o={run:function(t,e){if(this.sender=e,!this.$cn){var n=t.getConfig(),r=t.Panels,o='change:appendContent';this.$cn=i('<div></div>'),this.$cn2=i('<div></div>'),this.$cn.append(this.$cn2);var a=t.DeviceManager;if(a&&n.showDevices){var s=r.addPanel({id:'devices-c'}),l=a.render();s.set('appendContent',l).trigger(o)}var c=t.SelectorManager;this.slm=c;var u=c.getConfig();u.custom?c.__trgCustom({container:this.$cn2.get(0)}):u.appendTo||this.$cn2.append(c.render([]));var f=t.StyleManager;this.sm=f;var h=f.getConfig(),p=h.stylePrefix;this.$header=i("<div class=\"".concat(p,"header\">").concat(t.t('styleManager.empty'),"</div>")),this.$cn.append(this.$header),h.custom?f.__trgCustom({container:this.$cn2.get(0)}):h.appendTo||this.$cn2.append(f.render());var d='views-container';this.panel=r.getPanel(d),this.panel||(this.panel=r.addPanel({id:d})),this.panel.set('appendContent',this.$cn).trigger(o),this.em=t.getModel(),this.listenTo(this.em,f.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t,e,n,r,i=this.sender,o=this.sm;i&&i.get&&!i.get('active')||!o||(o.getSelected()?(null===(t=this.$cn2)||void 0===t||t.show(),null===(e=this.$header)||void 0===e||e.hide()):(null===(n=this.$cn2)||void 0===n||n.hide(),null===(r=this.$header)||void 0===r||r.show()))},stop:function(){var t,e;null===(t=this.$cn2)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},8644:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2316),i=n.n(r)().$;const o={run:function(t,e){this.sender=e;var n=t.getModel(),r=t.Config.stylePrefix,o=t.TraitManager,a=o.getConfig();if(!a.appendTo){if(!this.$cn){this.$cn=i('<div></div>'),this.$cn2=i('<div></div>'),this.$cn.append(this.$cn2),this.$header=i('<div>').append("<div class=\"".concat(a.stylePrefix,"header\">").concat(n.t('traitManager.empty'),"</div>")),this.$cn.append(this.$header),this.$cn2.append("<div class=\"".concat(r,"traits-label\">").concat(n.t('traitManager.label'),"</div>")),this.$cn2.append(o.render());var s=t.Panels;(s.getPanel('views-container')?s.getPanel('views-container'):s.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()}}},560:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050);const i={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getModel(),o=i.get('clipboard'),a=t.getSelected();o&&a&&(t.getSelectedAll().forEach((function(e){var i=e.collection;if(i){var a,s={at:e.index()+1,action:n.action||'paste-component'};if((0,r.contains)(o,e)&&e.get('copyable'))a=i.add(e.clone(),s);else{var l=o.filter((function(t){return t.get('copyable')})).filter((function(n){return t.Components.canMove(e.parent(),n).result}));a=i.add(l.map((function(t){return t.clone()})),s)}(a=(0,r.isArray)(a)?a:[a]).forEach((function(e){return t.trigger('component:paste',e)}))}})),a.emitUpdate())}}},4944:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var r=n(2982),i=n(9050),o='sw-visibility';const a={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanels()),this.panels},preventDrag:function(t){t.abort=1},tglEffects:function(t){var e=this.em,n=t?'on':'off';if(e){var r=e.get('Canvas'),o=r.getBody(),a=r.getToolbarEl();a&&(a.style.display=t?'none':'');var s=o.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,i.each)(s,(function(e){return e.style.pointerEvents=t?'all':''})),e[n]('run:tlb-move:before',this.preventDrag)}},run:function(t,e){var n=this;this.sender=e,this.selected=(0,r.Z)(t.getSelectedAll()),t.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=t.Commands.isActive(o)),this.shouldRunSwVisibility&&t.stopCommand(o),t.getModel().stopDefault();var i=this.getPanels(t),a=t.Canvas.getElement(),s=t.getEl(),l=t.Config.stylePrefix;if(!this.helper){var c=document.createElement('span');c.className="".concat(l,"off-prv fa fa-eye-slash"),s.appendChild(c),c.onclick=function(){return n.stopCommand()},this.helper=c}this.helper.style.display='inline-block',i.forEach((function(t){return t.set('visible',!1)}));var u=a.style;u.width='100%',u.height='100%',u.top='0',u.left='0',u.padding='0',u.margin='0',t.refresh(),this.tglEffects(1)},stop:function(t){var e=this.sender,n=void 0===e?{}:e,r=this.selected;n.set&&n.set('active',0);var i=this.getPanels(t);this.shouldRunSwVisibility&&(t.runCommand(o),this.shouldRunSwVisibility=!1),t.getModel().runDefault(),i.forEach((function(t){return t.set('visible',!0)})),t.Canvas.getElement().setAttribute('style',''),r&&t.select(r),delete this.selected,this.helper&&(this.helper.style.display='none'),t.refresh(),this.tglEffects()}}},7538:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(4942);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}const o={run:function(t,e,n){var o=n||{},a=t.Canvas,s=a.getCanvasView(),l=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({appendTo:a.getResizerEl(),prefix:t.getConfig().stylePrefix,posFetcher:s.getElementPos.bind(s),mousePosFetcher:a.getMouseRelativePos},o.options||{}),c=this.canvasResizer;return c&&!o.forceNew||(this.canvasResizer=t.Utils.Resizer.init(l),c=this.canvasResizer),c.setOptions(l),c.blur(),c.focus(o.el),c},stop:function(){var t;null===(t=this.canvasResizer)||void 0===t||t.blur()}}},2620:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>E});var r=n(1002),i=n(4942),o=n(2316),a=n.n(o),s=n(9050),l=n(1163),c=n(9283),u=n(3144),f=n(5671),h=n(9340),p=n(2963),d=n(1120),g=n(6602);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var b=function(t){(0,h.Z)(n,t);var e=y(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,u.Z)(n,[{key:"events",value:function(){return this.model.get('events')||{mousedown:'handleClick'}}},{key:"attributes",value:function(){return this.model.get('attributes')}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.config,n=void 0===e?{}:e;this.em=n.em,this.editor=n.editor}},{key:"handleClick",value:function(t){t.preventDefault(),t.stopPropagation();var e=this.editor,n=this.em,r=e.Canvas.getFrameEl().getBoundingClientRect(),i=r.left,o=r.top,a=m(m({},t),{},{clientX:t.clientX-i,clientY:t.clientY-o});n.trigger('toolbar:run:before'),this.execCommand(a)}},{key:"execCommand",value:function(t){var e={event:t},n=this.model.get('command'),r=this.editor;'function'==typeof n&&n(r,null,e),'string'==typeof n&&r.runCommand(n,e)}},{key:"render",value:function(){var t=this.editor,e=this.$el,n=this.model,r=n.get('id'),i=n.get('label'),o=t.getConfig().stylePrefix;return e.addClass("".concat(o,"toolbar-item")),r&&e.addClass("".concat(o,"toolbar-item__").concat(r)),i&&e.append(i),this}}]),n}(a().View);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var k=function(t){(0,h.Z)(n,t);var e=w(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return(0,f.Z)(this,n),(t=e.call(this,r,i)).config={editor:r.editor||'',em:r.em},t.listenTo(t.collection,'reset',t.render),t}return(0,u.Z)(n)}(g.Z);function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}k.prototype.itemView=b;var O=function(t){(0,h.Z)(n,t);var e=x(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,u.Z)(n,[{key:"defaults",value:function(){return{command:'',attributes:{}}}}]),n}(a().Model);const C=a().Collection.extend({model:O});function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var P,T=a().$;const E={init:function(t){(0,s.bindAll)(this,'onHover','onOut','onClick','onFrameScroll','onFrameUpdated','onContainerChange')},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null,this.startSelectComponent(),P=1},startSelectComponent:function(){this.toggleSelectComponent(1),this.em.getSelected()&&this.onSelect()},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(t){var e=this,n=this.em,r=n.getConfig().listenToEl,i=n.getContainer().parentNode,o=t?'on':'off',a={on:l.on,off:l.off};!r.length&&i&&r.push(i);a[o](window,'resize',this.onFrameUpdated),a[o](r,'scroll',this.onContainerChange),n[o]('component:toggled component:update undo redo',this.onSelect,this),n[o]('change:componentHovered',this.onHovered,this),n[o]('component:resize styleable:change component:input',this.updateGlobalPos,this),n[o]('component:update:toolbar',this._upToolbar,this),n[o]('change:canvasOffset',this.updateAttached,this),n[o]('frame:updated',this.onFrameUpdated,this),n[o]('canvas:updateTools',this.onFrameUpdated,this),n.get('Canvas').getFrames().forEach((function(t){var n=t.view,r=null==n?void 0:n.getWindow();r&&function(t,n){a[o](n,'mouseover',e.onHover),a[o](n,'mouseleave',e.onOut),a[o](n,'click touchend',e.onClick),a[o](t,'scroll',e.onFrameScroll,!0)}(r,n.getBody())}))},onHover:function(t){t.stopPropagation();var e=this.em,n=t.target,r=(0,l.getViewEl)(n),i=r&&r._getFrame(),o=T(n),a=o.data('model');if(!a)for(var s=o.parent();!a&&s.length&&!(0,c.Mx)(s[0]);)a=s.data('model'),s=s.parent();this.currentDoc=n.ownerDocument,e.setHovered(a,{useValid:!0}),i&&e.set('currentFrame',i)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(t,e){var n=this,r={};e?e.views.forEach((function(t){var i=t.el,o=n.getElementPos(i);r={el:i,pos:o,component:e,view:(0,l.getViewEl)(i)},n.updateToolsLocal(r),i.ownerDocument===n.currentDoc&&(n.elHovered=r)})):(this.currentDoc=null,this.elHovered=0,this.updateToolsLocal(),this.canvas.getFrames().forEach((function(t){var e=t.view,r=e&&e.getToolsEl();r&&n.toggleToolsEl(0,0,{el:r})})))},onSelect:(0,s.debounce)((function(){var t=this.em,e=t.getSelected(),n=t.get('currentFrame')||{},r=e&&e.getView(n.model),i=r&&r.el,o={};i&&(0,c.pn)(i)&&(o={el:i,pos:this.getElementPos(i),component:e,view:(0,l.getViewEl)(i)});this.elSelected=o,this.updateToolsGlobal(),this.updateLocalPos(o),this.initResize(e)})),updateGlobalPos:function(){var t=this.getElSelected();t.el&&(t.pos=this.getElementPos(t.el),this.updateToolsGlobal())},updateLocalPos:function(t){var e=this.getElHovered();e.el&&(e.pos=this.getElementPos(e.el),this.updateToolsLocal(t))},getElHovered:function(){return this.elHovered||{}},getElSelected:function(){return this.elSelected||{}},onOut:function(){this.em.setHovered(0)},toggleToolsEl:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.el||this.canvas.getToolsEl(e);return r&&(r.style.display=t?'':'none'),r||{}},showElementOffset:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};P&&this.editor.runCommand('show-offset',{el:t,elPos:e,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(t){this.editor.stopCommand('show-offset',{view:t})},showFixedElementOffset:function(t,e){this.editor.runCommand('show-offset',{el:t,elPos:e,state:'Fixed'})},hideFixedElementOffset:function(t,e){this.editor&&this.editor.stopCommand('show-offset',{state:'Fixed'})},hideHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=0},onClick:function(t){t.stopPropagation(),t.preventDefault();var e=this.em;if(e.get('_cmpDrag'))return e.set('_cmpDrag');var n=T(t.target),r=n.data('model');if(!r)for(var i=n.parent();!r&&i.length&&!(0,c.Mx)(i[0]);)r=i.data('model'),i=i.parent();if(r){if(e.isEditing()&&!r.get('textable')&&r.isChildOf('text'))return;this.select(r,t)}},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(this.editor.select(t,{event:e,useValid:!0}),this.initResize(t))},updateBadge:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.canvas,i=T(t).data('model');if(i&&i.get('badgable')){var o=this.getBadge(n);if(!n.posOnly){var a=this.canvas.getConfig(),s=i.getIcon(),l=a.pStylePrefix||'',c="".concat(l,"badge"),u=a.customBadgeLabel,f="".concat(s?"<div class=\"".concat(c,"__icon\">").concat(s,"</div>"):'',"\n        <div class=\"").concat(c,"__name\">").concat(i.getName(),"</div>");o.innerHTML=u?u(i):f}var h='px',p=o.style;p.display='block';var d=r.getTargetToElementFixed(t,o,{pos:e}),g=d.top,v=n.leftOff<0?-n.leftOff:0;p.top=g+h,p.left=v+h}},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=''},initResize:function(t){var e,n=this.em,i=this.canvas,o=n?n.get('Editor'):'',a=(n?n.get('Config'):'').stylePrefix||'',c="".concat(a,"resizing"),u=!(0,s.isElement)(t)&&(0,l.isTaggableNode)(t)?t:n.getSelected(),f=u&&u.get('resizable'),h={},p=function(t,e,n){var r=n.docs;r&&r.forEach((function(e){var n=e.body,r=n.className||'';n.className=('add'==t?"".concat(r," ").concat(c):r.replace(c,'')).trim()}))};if(o&&f){var d=(0,s.isElement)(t)?t:u.getEl();h={onStart:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.el,a=r.config,s=r.resizer,c=a.keyHeight,f=a.keyWidth,h=a.currentUnit,d=a.keepAutoHeight,g=a.keepAutoWidth;p('add',0,r),e=n.get('StyleManager').getModelToStyle(u),i.toggleFramesEvents();var v=getComputedStyle(o),m=e.getStyle(),y=m[f];a.autoWidth=g&&'auto'===y,isNaN(parseFloat(y))&&(y=v[f]);var b=m[c];a.autoHeight=d&&'auto'===b,isNaN(parseFloat(b))&&(b=v[c]),s.startDim.w=parseFloat(y),s.startDim.h=parseFloat(b),P=0,h&&(a.unitHeight=(0,l.getUnitFromValue)(b),a.unitWidth=(0,l.getUnitFromValue)(y))},onMove:function(){o.trigger('component:resize')},onEnd:function(t,e){p('remove',0,e),o.trigger('component:resize'),i.toggleFramesEvents(1),P=1},updateTarget:function(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var a=o.store,s=o.selectedHandler,l=o.config,c=l.keyHeight,u=l.keyWidth,f=l.autoHeight,h=l.autoWidth,p=l.unitWidth,d=l.unitHeight,g=['tc','bc'].indexOf(s)>=0,v=['cl','cr'].indexOf(s)>=0,m={},y=a?'':1;if(!g){var b=i.getBody().offsetWidth,w=r.w<b?r.w:b;m[u]=h?'auto':"".concat(w).concat(p)}v||(m[c]=f?'auto':"".concat(r.h).concat(d)),e.addStyle(_(_({},m),{},{en:y}),{avoidStore:!a});var k='update:component:style',x="".concat(k,":").concat(c," ").concat(k,":").concat(u);n&&n.trigger(x,null,null,{noEmit:1})}}},'object'==(0,r.Z)(f)&&(h=_(_(_({},h),f),{},{parent:h})),this.resizer=o.runCommand('resize',{el:d,options:h,force:1})}else o.stopCommand('resize'),this.resizer=null},updateToolbar:function(t){var e=this.config.em,n=t==e?e.getSelected():t,r=this.canvas.getToolbarEl(),i=r.style,o=n.get('toolbar'),a=e.get('Config').showToolbar;if(n&&a&&o&&o.length){if(i.display='',!this.toolbar){r.innerHTML='',this.toolbar=new C(o);var s=new k({collection:this.toolbar,editor:this.editor,em:e});r.appendChild(s.render().el)}this.toolbar.reset(o),i.top='-100px',i.left=0}else i.display='none'},updateToolbarPos:function(t){var e='px',n=this.canvas.getToolbarEl().style;n.top="".concat(t.top).concat(e),n.left="".concat(t.left).concat(e),n.opacity=''},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},getBadge:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.canvas.getBadgeEl(t.view)},onFrameScroll:function(){this.updateTools()},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(t){return t&&'selected'===t.get('status')},updateToolsLocal:function(t){var e=t||this.getElHovered(),n=e.el,r=e.pos,i=e.view,o=e.component;if(n){var a=o.get('hoverable'),s=this.lastHovered!==n,l=s?{}:{posOnly:1};s&&a&&(this.lastHovered=n,this.showHighlighter(i),this.showElementOffset(n,r,{view:i})),this.isCompSelected(o)&&(this.hideHighlighter(i),this.hideElementOffset(i));var c='px',u=this.toggleToolsEl(1,i),f=u.style,h=this.canvas.canvasRectOffset(n,r),p=h.top,d=h.left;this.updateBadge(n,r,_(_({},l),{},{view:i,topOff:p,leftOff:d})),f.top=p+c,f.left=d+c,f.width=r.width+c,f.height=r.height+c,this._trgToolUp('local',{component:o,el:u,top:p,left:d,width:r.width,height:r.height})}else this.lastHovered=0},_upToolbar:(0,s.debounce)((function(){this.updateToolsGlobal({force:1})})),_trgToolUp:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em.trigger('canvas:tools:update',_({type:t},e))},updateToolsGlobal:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getElSelected(),n=e.el,r=e.pos,i=e.component;if(!n)return this.toggleToolsEl(),void(this.lastSelected=0);var o=this.canvas,a=this.lastSelected!==n;(a||t.force)&&(this.lastSelected=n,this.updateToolbar(i));var s='px',l=this.toggleToolsEl(1),c=l.style,u=o.getTargetToElementFixed(n,o.getToolbarEl(),{pos:r}),f=u.canvasOffsetTop,h=u.canvasOffsetLeft;c.top=f+s,c.left=h+s,c.width=r.width+s,c.height=r.height+s,this.updateToolbarPos({top:u.top,left:u.left}),this._trgToolUp('global',{component:i,el:l,top:f,left:h,width:r.width,height:r.height})},updateAttached:(0,s.debounce)((function(){this.updateGlobalPos()})),onContainerChange:(0,s.debounce)((function(){this.em.refreshCanvas()}),150),getElementPos:function(t){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.canvas.getWindow()},run:function(t){(0,l.hasWin)()&&(this.editor=t&&t.get('Editor'),this.enable())},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((0,l.hasWin)()){var r=this.em,i=this.editor;this.onHovered(),this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.toggleToolsEl(),i&&i.stopCommand('resize')}}}},8463:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2316),i=n.n(r)().$;const o={startSelectPosition:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.isPointed=!1;var i=this.editorModel.get('Utils'),o=t.ownerDocument.body;i&&!this.sorter&&(this.sorter=new i.Sorter({container:o,placer:this.canvas.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,direction:'a',document:e,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1,scale:function(){return n.em.getZoomDecimal()}})),r.onStart&&(this.sorter.onStart=r.onStart),t&&this.sorter.startSort(t,{container:o})},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?i(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?i(this.cDim[this.posIndex][5]).parent():i(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 r=t||0,i=e||'before',o=n.length,a=0!==o&&'after'==i&&r==o;return 0!==o&&(!a&&!n[r][4]||n[r-1]&&!n[r-1][4]||a&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css('cursor',''),this.$wrapper.unbind()}}},7994:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(4942),i=n(2316),o=n.n(i),a=n(9050),s=n(1163);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var c=o().$;const u={getOffsetMethod:function(t){return'get'+(t||'')+'OffsetViewerEl'},run:function(t,e,n){var i=n||{},o=i.state||'',u=t.getConfig(),f=this.em.getZoomDecimal(),h=i.el||'';if(!u.showOffsets||(0,s.isTextNode)(h)||!u.showOffsetsSelected&&'Fixed'==o)t.stopCommand(this.id,n);else{var p=t.Canvas,d=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},i.elPos||p.getElementPos(h));(0,a.isUndefined)(i.top)||(d.top=i.top),(0,a.isUndefined)(i.left)||(d.left=i.left);var g=window.getComputedStyle(h),v=this.ppfx,m=o+'State',y=p[this.getOffsetMethod(o)](n.view);y.style.opacity='';var b=this['marginT'+o],w=this['marginB'+o],k=this['marginL'+o],x=this['marginR'+o],O=this['padT'+o],C=this['padB'+o],S=this['padL'+o],_=this['padR'+o];if(y.childNodes.length&&(this[m]='1',b=y.querySelector('[data-offset-m-t]'),w=y.querySelector('[data-offset-m-b]'),k=y.querySelector('[data-offset-m-l]'),x=y.querySelector('[data-offset-m-r]'),O=y.querySelector('[data-offset-p-t]'),C=y.querySelector('[data-offset-p-b]'),S=y.querySelector('[data-offset-p-l]'),_=y.querySelector('[data-offset-p-r]')),!this[m]){var P=o.toLowerCase(),T=P+'margin-v',E=P+'padding-v',j=c("<div class=\"".concat(v,"marginName\">")).get(0),A=c("<div class=\"".concat(v,"paddingName\">")).get(0),R=v+E+'-el',D="".concat(v+T+'-el'," ").concat(v+T),M="".concat(R," ").concat(v+E);b=c("<div class=\"".concat(D,"-top\"></div>")).get(0),w=c("<div class=\"".concat(D,"-bottom\"></div>")).get(0),k=c("<div class=\"".concat(D,"-left\"></div>")).get(0),x=c("<div class=\"".concat(D,"-right\"></div>")).get(0),O=c("<div class=\"".concat(M,"-top\"></div>")).get(0),C=c("<div class=\"".concat(M,"-bottom\"></div>")).get(0),S=c("<div class=\"".concat(M,"-left\"></div>")).get(0),_=c("<div class=\"".concat(M,"-right\"></div>")).get(0),this['marginT'+o]=b,this['marginB'+o]=w,this['marginL'+o]=k,this['marginR'+o]=x,this['padT'+o]=O,this['padB'+o]=C,this['padL'+o]=S,this['padR'+o]=_,j.appendChild(b),j.appendChild(w),j.appendChild(k),j.appendChild(x),A.appendChild(O),A.appendChild(C),A.appendChild(S),A.appendChild(_),y.appendChild(j),y.appendChild(A),this[m]='1'}var Z='px',L=parseFloat(g.marginLeft.replace(Z,''))*f,N=parseFloat(g.marginRight.replace(Z,''))*f,I=parseFloat(g.marginTop.replace(Z,''))*f,F=parseFloat(g.marginBottom.replace(Z,''))*f,V=b.style,B=w.style,H=k.style,z=x.style,U=O.style,W=C.style,$=S.style,q=_.style,G=parseFloat(d.left),K=parseFloat(g.width)*f+Z;V.height=I+Z,V.width=K,V.top=d.top-I+Z,V.left=G+Z,B.height=F+Z,B.width=K,B.top=d.top+d.height+Z,B.left=G+Z;var Y=d.height+I+F+Z,X=d.top-I+Z;H.height=Y,H.width=L+Z,H.top=X,H.left=G-L+Z,z.height=Y,z.width=N+Z,z.top=X,z.left=G+d.width+Z;var J=parseFloat(g.paddingTop)*f;U.height=J+Z;var Q=parseFloat(g.paddingBottom)*f;W.height=Q+Z;var tt=d.height-Q-J+Z,et=d.top+J+Z;$.height=tt,$.width=parseFloat(g.paddingLeft)*f+Z,$.top=et;var nt=parseFloat(g.paddingRight)*f;q.height=tt,q.width=nt+Z,q.top=et}},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n||{},i=r.state||'',o=this.getOffsetMethod(i),a=t.Canvas,s=a[o](n.view);s.style.opacity=0}}},8352:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050);const i={init:function(){(0,r.bindAll)(this,'_onFramesChange')},run:function(t){this.toggleVis(t)},stop:function(t){this.toggleVis(t,0)},toggleVis:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t.Commands.isActive('preview')){var r=t.Canvas,i=n?'on':'off';r.getFrames().forEach((function(t){return e._upFrame(t,n)})),r.getModel()[i]('change:frames',this._onFramesChange)}},_onFramesChange:function(t,e){var n=this;e.forEach((function(t){return t.once('loaded',(function(){return n._upFrame(t,!0)}))}))},_upFrame:function(t,e){var n=e?'add':'remove';t.view.getBody().classList[n]("".concat(this.ppfx,"dashed"))}}},9304:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(4942),i=n(2982),o=n(9050),a=n(1163);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const c={getConfig:function(t){return this.__getConfig(t)},getProjectData:function(t){var e={},n=this.storageKey;return n&&(e[n]=t||this.getAll()),e},loadProjectData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.all,r=e.onResult,i=e.reset,o=this.storageKey,s={action:'load'},l=n||this.getAll(),c=t[o];if('string'==typeof c)try{c=JSON.parse(c)}catch(t){this.__logWarn('Data parsing failed',{input:c})}return i&&c&&l.reset(null,s),r?c&&r(c,s):c&&(0,a.isDef)(c.length)&&l.reset(c,s),c},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all;return e&&e.reset(null,t),this},__getConfig:function(t){var e=this.config||{};return t?e[t]:e},getAll:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.all?t.array?(0,i.Z)(this.all.models):this.all:[]},getAllMap:function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})},__initConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=(0,a.deepMerge)(t,e),this.em=this.config.em,this.cls=[]},__initListen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all,n=this.em,r=this.events;e&&n&&e.on('add',(function(t,e,i){return n.trigger(r.add,t,i)})).on('remove',(function(t,e,i){return n.trigger(r.remove,t,i)})).on('change',(function(t,e){return n.trigger(r.update,t,t.changedAttributes(),e)})).on('all',this.__catchAllEvent,this),this.cls=[e].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var r=t.entity,i=t.event;r.on('all',(function(t,r,o,a){var s=l({event:t},a||o);[n,e].map((function(t){return t.trigger(i,r,s)}))}))}))},__remove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=(0,o.isString)(t)?this.get(t):t,a=function(){return i&&e.all.remove(i,n),i};return!n.silent&&r&&r.trigger(this.events.removeBefore,i,a,n),!n.abort&&a()},__catchAllEvent:function(t,e,n,r){var i=this.em,o=this.events,a=r||n;i&&o.all&&i.trigger(o.all,{event:t,model:e,options:a}),this.__onAllEvent()},__appendTo:function(){var t=this.getConfig().appendTo;if(t){var e=(0,o.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},__onAllEvent:function(){},__logWarn:function(t,e){this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)},_createId:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,n=this.getAll(),r=n.length+e,i=this.getAllMap();do{t=(0,a.createId)(r)}while(i[t]);return t},__listenAdd:function(t,e){var n=this;t.on('add',(function(t,r,i){return n.em.trigger(e,t,i)}))},__listenRemove:function(t,e){var n=this;t.on('remove',(function(t,r,i){return n.em.trigger(e,t,i)}))},__listenUpdate:function(t,e){var n=this;t.on('change',(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))},__destroy:function(){var t;this.cls.forEach((function(t){t.stopListening(),t.reset()})),this.em=0,this.config=0,null===(t=this.view)||void 0===t||t.remove(),this.view=0}}},672:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>A});var r=n(2982),i=n(5671),o=n(3144),a=n(7326),s=n(9340),l=n(2963),c=n(1120),u=n(4942),f=n(9050),h=n(1163),p=n(9714),d=n(966),g=n(5963);const v={stylePrefix:'css-',rules:[]};var m=n(2316),y=n(9524),b=n(8795);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){(0,u.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.Z)(t);if(e){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.Z)(this,n)}}var O=((0,h.hasWin)()?window:{}).CSS,C=function(t){(0,s.Z)(n,t);var e=x(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"defaults",value:function(){return{selectors:[],selectorsAdd:'',style:{},mediaText:'',state:'',stylable:!0,atRuleType:'',singleAtRule:!1,important:!1,group:'',shallow:!1,_undo:!0}}},{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t||{},this.opt=e,this.em=e.em,this.ensureSelectors(),this.on('change',this.__onChange)}},{key:"__onChange",value:function(t,e){var n=this.em,r=this.changedAttributes();!(0,h.isEmptyObj)(r)&&n&&n.changesUp(e)}},{key:"clone",value:function(){var t=k({},this.opt),e=k({},this.attributes);return e.selectors=this.get('selectors').map((function(t){return t.clone()})),new this.constructor(e,t)}},{key:"ensureSelectors",value:function(t,e,n){var i=this.em,o=i&&i.get('SelectorManager'),a=[this,'change:selectors',this.ensureSelectors],s=this.getSelectors();if(this.stopListening.apply(this,a),s.models&&(s=(0,r.Z)(s.models)),s=(0,f.isString)(s)?[s]:s,Array.isArray(s)){var l=s.filter((function(t){return t})).map((function(t){return o?o.add(t):t}));s=new d.Z(l)}this.set('selectors',s,n),this.listenTo.apply(this,a)}},{key:"getAtRule",value:function(){var t=this.get('atRuleType'),e=this.get('mediaText'),n=t?"@".concat(t):e?'@media':'';return n+(e&&n?" ".concat(e):'')}},{key:"selectorsToString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.get('state'),r=this.get('selectorsAdd'),i={escape:function(t){return O&&O.escape?O.escape(t):t}},o=this.get('selectors').getFullString(0,i),a=n&&!t.skipState?":".concat(n):'';return o&&e.push("".concat(o).concat(a)),r&&!t.skipAdd&&e.push(r),e.join(', ')}},{key:"getDeclaration",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e='',n=this.attributes.important,r=this.selectorsToString(t),i=this.styleToString(k({important:n},t)),o=this.get('singleAtRule');return(r||o)&&(i||t.allowEmpty)&&(e=o?i:"".concat(r,"{").concat(i,"}")),e}},{key:"getDevice",value:function(){var t=this.em,e=this.attributes,n=e.atRuleType,r=e.mediaText,i=(null==t?void 0:t.get('DeviceManager').getDevices())||[],o=i.filter((function(t){return''===t.getWidthMedia()}))[0];return'media'===n&&r?i.filter((function(t){return t.getWidthMedia()===(0,b.U)(r)}))[0]||null:o||null}},{key:"getState",value:function(){var t=this.em,e=this.get('state');return(t.get('SelectorManager').getStates()||[]).filter((function(t){return t.getName()===e}))[0]||null}},{key:"getComponent",value:function(){var t,e=this.getSelectors(),n=1==e.length&&e.at(0),r=n&&n.isId()&&n.get('name');return r&&(null===(t=this.em)||void 0===t?void 0:t.get('DomComponents').getById(r))||null}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e='',n=this.getAtRule(),r=this.getDeclaration(t);return(r||t.allowEmpty)&&(e=r),n&&e&&(e="".concat(n,"{").concat(e,"}")),e}},{key:"toJSON",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=m.Model.prototype.toJSON.apply(this,e);if(this.em.getConfig().avoidDefaults){var i=this.defaults();(0,f.forEach)(i,(function(t,e){r[e]===t&&delete r[e]})),delete r.style.__p,(0,f.isEmpty)(r.selectors)&&delete r.selectors,(0,f.isEmpty)(r.style)&&delete r.style}return r}},{key:"compare",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e||'',o=n||'',a=r.selectorsAdd||'',s=r.atRuleType||'',l=(0,f.isArray)(t)||t.models?t.models||t:[t];o&&!s&&(s='media');var c=l.map((function(t){return t.getFullName()})),u=this.get('selectors').map((function(t){return t.getFullName()})),h=c.slice().sort(),p=u.slice().sort();return!(c.length!==u.length||!h.every((function(t,e){return t===p[e]})))&&(this.get('state')===i&&this.get('mediaText')===o&&this.get('selectorsAdd')===a&&this.get('atRuleType')===s)}}]),n}(y.Z);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.Z)(t);if(e){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.Z)(this,n)}}var _=function(t){(0,s.Z)(n,t);var e=S(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"initialize",value:function(t,e){var n=this;e&&e.em&&(this.editor=e.em),setTimeout((function(){n.on('remove',n.onRemove),n.on('add',n.onAdd)}))}},{key:"toJSON",value:function(t){return m.Collection.prototype.toJSON.call(this,t).filter((function(t){return t.style&&!t.shallow}))}},{key:"onAdd",value:function(t,e,n){t.ensureSelectors(t,e,n)}},{key:"onRemove",value:function(t){var e=this.editor;e.stopListening(t),e.get('UndoManager').remove(t)}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return'string'==typeof t&&(t=this.editor.get('Parser').parseCss(t)),e.em=this.editor,m.Collection.prototype.add.apply(this,[t,e])}}]),n}(m.Collection);_.prototype.model=C;var P=n(4868);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){(0,u.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function j(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.Z)(t);if(e){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.Z)(this,n)}}var A=function(t){(0,s.Z)(n,t);var e=j(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,u.Z)((0,a.Z)(t),"Selectors",d.Z),(0,u.Z)((0,a.Z)(t),"name",'CssComposer'),(0,u.Z)((0,a.Z)(t),"storageKey",'styles'),t}return(0,o.Z)(n,[{key:"getConfig",value:function(){return this.c}},{key:"init",value:function(t){for(var e in this.c=t||{},v)e in this.c||(this.c[e]=v[e]);var n=this.c.pStylePrefix;n&&(this.c.stylePrefix=n+this.c.stylePrefix);var r=this.c.em&&this.c.em.config.style||'';return this.c.rules=r||this.c.rules,this.em=this.c.em,this.rules=new _([],this.c),this}},{key:"onLoad",value:function(){this.rules.add(this.c.rules,{silent:1})}},{key:"postLoad",value:function(){var t,e=null===(t=this.em)||void 0===t?void 0:t.get('UndoManager');e&&e.add(this.getAll())}},{key:"store",value:function(){return this.getProjectData()}},{key:"load",value:function(t){return this.loadProjectData(t)}},{key:"add",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=e||'',a=n||'',s=E({},r),l=this.get(t,o,a,s);return l&&l.config&&!l.config.singleAtRule||(s.state=o,s.mediaText=a,s.selectors=[],a&&(s.atRuleType='media'),(l=new C(s,this.c)).get('selectors').add(t,i),this.rules.add(l,i)),l}},{key:"get",value:function(t,e,n,r){var i=t;if((0,f.isString)(t)){var o=this.em.get('SelectorManager'),a=t.split(',')[0].trim(),s=this.em.get('Parser').parserCss.checkNode({selectors:a})[0];i=o.get(s.selectors)}return this.rules.find((function(t){return t.compare(i,e,n,r)}))||null}},{key:"getAll",value:function(){return this.rules}},{key:"addCollection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[];(0,f.isString)(t)&&(t=this.em.get('Parser').parseCss(t));for(var i=t instanceof Array?t:[t],o=0,a=i.length;o<a;o++){var s,l=i[o]||{};if(l.selectors){var c=null===(s=this.em)||void 0===s?void 0:s.get('SelectorManager');c||console.warn('Selector Manager not found');for(var u=l.selectors,p=u instanceof Array?u:[u],d=[],g=0,v=p.length;g<v;g++){var m=c.add(p[g]);d.push(m)}var y=this.get(d,l.state,l.mediaText,l),b=this.add(d,l.state,l.mediaText,l,e),w=!y||!e.avoidUpdateStyle,k=l.style||{};if((0,h.isObject)(n)&&b.set(n,e),w){var x=e.extend?E(E({},b.get('style')),k):k;b.set('style',x,e)}r.push(b)}}return r}},{key:"addRules",value:function(t){return this.addCollection(t)}},{key:"setRule",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.atRuleType,i=n.atRuleParams,o=this.em.get('Parser').parserCss.checkNode({selectors:t,style:e})[0],a=o.state,s=o.selectorsAdd,l=this.em.get('SelectorManager'),c=l.add(o.selectors),u=this.add(c,a,i,{selectorsAdd:s,atRule:r});return u.setStyle(e,n),u}},{key:"getRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em.get('SelectorManager'),r=this.em.get('Parser').parserCss.checkNode({selectors:t})[0],i=n.get(r.selectors),o=r.state,a=r.selectorsAdd,s=e.atRuleType,l=e.atRuleParams;return i&&this.get(i,o,l,{selectorsAdd:a,atRule:s})}},{key:"getRules",value:function(t){var e=this.getAll();if(!t)return(0,r.Z)(e.models);var n={sort:!0},i=(0,f.isString)(t)?t.split(',').map((function(t){return t.trim()})):t;return e.filter((function(t){return i.indexOf(t.getSelectors().getFullString(null,n))>=0}))}},{key:"setIdRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.addOpts,i=void 0===r?{}:r,o=n.mediaText,a=n.state||'',s=(0,f.isUndefined)(o)?this.em.getCurrentMedia():o,l=this.em.get('SelectorManager'),c=l.add({name:t,type:g.Z.TYPE_ID},i),u=this.add(c,a,s,{},i);return u.setStyle(e,E(E({},n),i)),u}},{key:"getIdRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.mediaText,r=e.state||'',i=(0,f.isUndefined)(n)?this.em.getCurrentMedia():n,o=this.em.get('SelectorManager').get(t,g.Z.TYPE_ID);return o&&this.get(o,r,i)}},{key:"setClassRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.state||'',i=n.mediaText||this.em.getCurrentMedia(),o=this.em.get('SelectorManager'),a=o.add({name:t,type:g.Z.TYPE_CLASS}),s=this.add(a,r,i);return s.setStyle(e,n),s}},{key:"getClassRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state||'',r=e.mediaText||this.em.getCurrentMedia(),i=this.em.get('SelectorManager').get(t,g.Z.TYPE_CLASS);return i&&this.get(i,n,r)}},{key:"remove",value:function(t,e){var n=(0,f.isString)(t)?this.getRules(t):t,r=this.getAll().remove(n,e);return(0,f.isArray)(r)?r:[r]}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().reset(null,t),this}},{key:"getComponentRules",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state,r=e.mediaText,i=e.current;i&&(n=this.em.get('state')||'',r=this.em.getCurrentMedia());var o=t.getId(),a=this.getAll().filter((function(t){if(((0,f.isUndefined)(n)||t.get('state')===n)&&((0,f.isUndefined)(r)||t.get('mediaText')===r))return t.getSelectorsString()==="#".concat(o)}));return a}},{key:"render",value:function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new P.Z({collection:this.rules,config:this.c}),this.rulesView.render().el}},{key:"destroy",value:function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove(),[this.em,this.rules,this.rulesView].forEach((function(t){return null})),this.c={}}}]),n}(p.Z)},4868:(t,e,n)=>{"use strict";n.d(e,{Z:()=>y});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(9050),u=n(2316),f=n(9283);function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var p=function(t){(0,a.Z)(n,t);var e=h(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"tagName",value:function(){return'style'}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{};var e=this.model;this.listenTo(e,'change',this.render),this.listenTo(e,'destroy remove',this.remove),this.listenTo(e.get('selectors'),'change',this.render)}},{key:"render",value:function(){var t=this.model,e=this.el,n=t.get('important');return e.innerHTML=t.toCSS({important:n}),this}}]),n}(u.View);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var g=function(t){(0,a.Z)(n,t);var e=d(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"_createElement",value:function(){return document.createTextNode('')}},{key:"render",value:function(){var t=this.model,e=t.get('important');return this.el.textContent=t.getDeclaration({important:e}),this}}]),n}(p);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var m=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):'')},y=function(t){(0,a.Z)(n,t);var e=v(n);function n(t){var i;return(0,r.Z)(this,n),i=e.call(this,t),(0,c.bindAll)((0,o.Z)(i),'sortRules'),i}return(0,i.Z)(n,[{key:"initialize",value:function(t){var e=t.config||{};this.atRules={},this.config=e,this.em=e.em,this.pfx=e.stylePrefix||'',this.className=this.pfx+'rules';var n=this.collection;this.listenTo(n,'add',this.addTo),this.listenTo(n,'reset',this.render)}},{key:"addTo",value:function(t){this.addToCollection(t)}},{key:"addToCollection",value:function(t,e){if(this.renderStarted){var n,r,i=e||null,o={model:t,config:this.config};if('keyframes'===t.get('atRuleType')){var a=t.getAtRule(),s=this.atRules[a];if(!s){var l=document.createElement('style');s=document.createTextNode(''),l.appendChild(document.createTextNode("".concat(a,"{"))),l.appendChild(s),l.appendChild(document.createTextNode('}')),this.atRules[a]=s,n=l}r=new g(o),s.appendData(r.render().el.textContent)}else n=(r=new p(o)).render().el;var c=this.className,u=t.get('mediaText'),f=m(c),h=f;if(u&&(h=m(c,this.getMediaWidth(u))),n){var d,v=i||this.el;try{d=v.querySelector("#".concat(h))}catch(t){}d||(d=v.querySelector("#".concat(f))),d.appendChild(n)}return n}}},{key:"getMediaWidth",value:function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),'').replace(')','')}},{key:"sortRules",value:function(t,e){var n=-1!==(this.em.getConfig().mediaCondition||'').indexOf('min-width');return n?(n?t:e)-(n?e:t):0}},{key:"render",value:function(){var t=this;this.renderStarted=1,this.atRules={};var e=this.em,n=this.$el,r=this.className,i=this.collection,o=document.createDocumentFragment();n.empty();var a=e.get('DeviceManager').getAll().pluck('priority').sort(this.sortRules);return a.every((function(t){return t}))&&a.unshift(0),a.forEach((function(t){return o.appendChild((0,f.ut)('div',{id:m(r,t)}))})),i.each((function(e){return t.addToCollection(e,o)})),n.append(o),n.attr('class',r),this}}]),n}(u.View)},2004:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>L,evAdd:()=>A,evAddBefore:()=>R,evAll:()=>_,evPfx:()=>P,evRemove:()=>D,evRemoveBefore:()=>M,evSelect:()=>T,evSelectBefore:()=>E,evUpdate:()=>j});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(4942),u=n(9050),f=n(9714);const h={default:null,devices:[{id:'desktop',name:'Desktop',width:''},{id:'tablet',name:'Tablet',width:'770px',widthMedia:'992px'},{id:'mobileLandscape',name:'Mobile landscape',width:'568px',widthMedia:'768px'},{id:'mobilePortrait',name:'Mobile portrait',width:'320px',widthMedia:'480px'}]};var p=n(2316);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var g=function(t){(0,a.Z)(n,t);var e=d(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"defaults",value:function(){return{name:'',width:null,height:'',widthMedia:null,priority:null}}},{key:"initialize",value:function(){var t=this;null===this.get('widthMedia')&&this.set('widthMedia',this.get('width')),null===this.get('width')&&this.set('width',this.get('widthMedia')),!this.get('priority')&&this.set('priority',parseFloat(this.get('widthMedia'))||0);['width','height','widthMedia'].forEach((function(e){return t.checkUnit(e)}))}},{key:"checkUnit",value:function(t){var e=this.get(t)||'';(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))}},{key:"getName",value:function(){return this.get('name')||this.get('id')}},{key:"getWidthMedia",value:function(){return this.get('widthMedia')||''}}]),n}(p.Model);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var m=function(t){(0,a.Z)(n,t);var e=v(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n)}(p.Collection);m.prototype.model=g;var y,b=n(168),w=n(7539);function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var x=function(t){(0,a.Z)(n,t);var e=k(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"template",value:function(t){var e=t.ppfx,n=t.label;return(0,w.Z)(y||(y=(0,b.Z)(["\n      <div class=\"","device-label\">","</div>\n      <div class=\"","field ","select\">\n        <span id=\"","input-holder\">\n          <select class=\"","devices\"></select>\n        </span>\n        <div class=\"","sel-arrow\">\n          <div class=\"","d-s-arrow\"></div>\n        </div>\n      </div>\n      <button style=\"display:none\" class=\"","add-trasp\">+</button>\n    "])),e,n,e,e,e,e,e,e,e)}},{key:"events",value:function(){return{change:'updateDevice'}}},{key:"initialize",value:function(t){this.config=t.config||{},this.em=this.config.em,this.ppfx=this.config.pStylePrefix||'',this.events['click .'+this.ppfx+'add-trasp']=this.startAdd,this.listenTo(this.em,'change:device',this.updateSelect),this.delegateEvents()}},{key:"startAdd",value:function(){}},{key:"updateDevice",value:function(){var t=this.em;if(t){var e=this.devicesEl,n=e?e.val():'';t.set('device',n)}}},{key:"updateSelect",value:function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel(),r=n?n.get('id'):'';e.val(r)}}},{key:"getOptions",value:function(){var t=this.collection,e=this.em,n='';return t.each((function(t){var r=t.attributes,i=r.name,o=r.id,a=e&&e.t&&e.t("deviceManager.devices.".concat(o))||i;n+="<option value=\"".concat(o||i,"\">").concat(a,"</option>")})),n}},{key:"render",value:function(){var t=this.em,e=this.ppfx,n=this.$el,r=this.el,i=t&&t.t&&t.t('deviceManager.device');return n.html(this.template({ppfx:e,label:i})),this.devicesEl=n.find(".".concat(e,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(t.get('device')),r.className="".concat(e,"devices-c"),this}}]),n}(p.View);function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){(0,c.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var _='device',P="".concat(_,":"),T="".concat(P,"select"),E="".concat(T,":before"),j="".concat(P,"update"),A="".concat(P,"add"),R="".concat(A,":before"),D="".concat(P,"remove"),M="".concat(D,":before"),Z='change:device',L=function(t){(0,a.Z)(n,t);var e=S(n);function n(){var t;(0,r.Z)(this,n);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return t=e.call.apply(e,[this].concat(a)),(0,c.Z)((0,o.Z)(t),"name",'DeviceManager'),(0,c.Z)((0,o.Z)(t),"Device",g),(0,c.Z)((0,o.Z)(t),"Devices",m),(0,c.Z)((0,o.Z)(t),"events",{all:_,select:T,update:j,add:A,remove:D,removeBefore:M}),t}return(0,i.Z)(n,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.c=C(C({},h),e);var n=this.c.em;return this.devices=new m,this.c.devices.forEach((function(e){return t.add(e)})),this.em=n,this.all=this.devices,this.select(this.c.default||this.devices.at(0)),this.__initListen(),n.on(Z,this._onSelect,this),this}},{key:"_onSelect",value:function(t,e,n){var r=this.em,i=this.events,o=t.previous('device'),a=this.get(e),s=i.select;r.trigger(s,a,this.get(o)),this.__catchAllEvent(s,a,n)}},{key:"add",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n;if((0,u.isString)(t)){var i=n;e=C(C({},r=arguments[2]||{}),{},{id:t,name:r.name||t,width:i})}else e=t;return e.id||(e.id=e.name||this._createId()),this.devices.add(e,r)}},{key:"get",value:function(t){return this.getAll().filter((function(e){return e.get('name')===t}))[0]||this.devices.get(t)||null}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__remove(t,e)}},{key:"getDevices",value:function(){return this.devices.models}},{key:"select",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,u.isString)(t)?this.get(t):t;return n&&this.em.set('device',n.get('id'),e),this}},{key:"getSelected",value:function(){return this.get(this.em.get('device'))}},{key:"getAll",value:function(){return this.devices}},{key:"render",value:function(){var t;return null===(t=this.view)||void 0===t||t.remove(),this.view=new x({collection:this.devices,config:this.c}),this.view.render().el}},{key:"destroy",value:function(){var t;this.devices.stopListening(),this.devices.reset(),null===(t=this.view)||void 0===t||t.remove(),[this.devices,this.view].forEach((function(t){return null})),this.c={}}}]),n}(f.Z)},9138:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>N,OA:()=>A,GN:()=>Z,xH:()=>L});var r=n(1002),i=n(2982),o=n(885),a=n(4942),s=n(5671),l=n(3144),c=n(1752),u=n(9340),f=n(2963),h=n(1120),p=n(9050),d=n(1163),g=n(9524),v=n(2316),m=n(8431),y=n(5963),b=n(966);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){(0,a.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var O=function(t){(0,u.Z)(n,t);var e=x(n);function n(){return(0,s.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"initialize",value:function(){var t=this.attributes,e=t.target,n=t.name,r=t.changeProp;if(!this.get('id')&&this.set('id',n),e){this.target=e,this.unset('target');var i=r?"change:".concat(n):"change:attributes:".concat(n);this.listenTo(e,i,this.targetUpdated)}}},{key:"getId",value:function(){return this.get('id')}},{key:"getType",value:function(){return this.get('type')}},{key:"getName",value:function(){return this.get('name')}},{key:"getLabel",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.locale,r=void 0===n||n,i=this.getId(),o=this.get('label')||this.getName();return r&&(null===(t=this.em)||void 0===t?void 0:t.t("traitManager.traits.labels.".concat(i)))||o}},{key:"getValue",value:function(){return this.getTargetValue()}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};e.partial&&(n.avoidStore=!0),this.setTargetValue(t,n),!1===e.partial&&(this.setTargetValue(''),this.setTargetValue(t))}},{key:"props",value:function(){return this.attributes}},{key:"targetUpdated",value:function(){var t,e=this.getTargetValue();this.set({value:e},{fromTarget:1}),null===(t=this.em)||void 0===t||t.trigger('trait:update',{trait:this,component:this.target})}},{key:"getTargetValue",value:function(){var t,e=this.get('name'),n=this.target;return t=this.get('changeProp')?n.get(e):n.getAttributes()[e],(0,p.isUndefined)(t)?'':t}},{key:"setTargetValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=this.get('name');if(!(0,p.isUndefined)(t)){var i=t;if('false'===t?i=!1:'true'===t&&(i=!0),this.get('changeProp'))n.set(r,i,e);else{var o=k({},n.get('attributes'));o[r]=i,n.set('attributes',o,e)}}}},{key:"setValueFromInput",value: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={value:t};this.set(r,k(k({},n),{},{avoidStore:1})),e&&(this.set('value','',n),this.set(r,n))}},{key:"getInitValue",value:function(){var t,e=this.target,n=this.get('name');if(e){var r=e.get('attributes');t=this.get('changeProp')?e.get(n):r[n]}return t||this.get('value')||this.get('default')}}]),n}(v.Model);O.prototype.defaults={type:'text',label:'',name:'',min:'',max:'',unit:'',step:1,value:'',target:'',default:'',placeholder:'',changeProp:0,options:[]};function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var S=function(t){(0,u.Z)(n,t);var e=C(n);function n(){return(0,s.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em,this.listenTo(this,'add',this.handleAdd),this.listenTo(this,'reset',this.handleReset)}},{key:"handleReset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels,r=void 0===n?[]:n;r.forEach((function(t){return t.trigger('remove')}))}},{key:"handleAdd",value:function(t){t.em=this.em;var e=this.target;e&&(t.target=e)}},{key:"setTarget",value:function(t){this.target=t}},{key:"add",value:function(t,e){var n=this.em;if((0,p.isString)(t)||(0,p.isArray)(t)){var r=n&&n.get&&n.get('TraitManager'),i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(e){var n=[];'string'==typeof e&&(e=[e]);for(var r=0;r<e.length;r++){var i={},o=e[r];i.name=o,'target'===o&&(i.type='select',i.default=!1,i.options=t.optionsTarget),n.push(i)}return n}}}(r&&r.getConfig());(0,p.isString)(t)&&(t=[t]);for(var o=0,a=t.length;o<a;o++){var s=t[o],l=(0,p.isString)(s)?i.build(s)[0]:s;l.target=this.target,t[o]=l}}return v.Collection.prototype.add.apply(this,[t,e])}}]),n}(v.Collection);function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){(0,a.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}S.prototype.model=O;var E=function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,'\\$&')},j=function(t){return t&&t.getConfig().avoidInlineStyle},A='component:drag',R='__symbols',D='__symbol',M='__symbol_ovrd',Z='component:update',L="".concat(Z,"-inside"),N=function(t){(0,u.Z)(n,t);var e=T(n);function n(){return(0,s.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"defaults",get:function(){return{tagName:'div',type:'',name:'',removable:!0,draggable:!0,droppable:!0,badgable:!0,stylable:!0,'stylable-require':'','style-signature':'',unstylable:'',highlightable:!0,copyable:!0,resizable:!1,editable:!1,layerable:!0,selectable:!0,hoverable:!0,locked:!1,void:!1,state:'',status:'',content:'',icon:'',style:'',styles:'',classes:'',script:'','script-props':'','script-export':'',attributes:'',traits:['id','title'],propagate:'',dmode:'',toolbar:null,[D]:0,[R]:0,[M]:0,_undo:!0,_undoexc:['status','open']}}},{key:"init",value:function(){}},{key:"updated",value:function(t,e,n){}},{key:"removed",value:function(){}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,p.bindAll)(this,'__upSymbProps','__upSymbCls','__upSymbComps');var i=r.em,o=this.parent(),a=o&&o.attributes,s=this.get('propagate');if(s&&this.set('propagate',(0,p.isArray)(s)?s:[s]),a&&a.propagate&&!s){var l={},c=a.propagate;c.forEach((function(t){return l[t]=o.get(t)})),l.propagate=c,this.set(P(P({},l),e))}if(r&&r.config&&r.config.voidElements.indexOf(this.get('tagName'))>=0&&this.set('void',!0),r.em=i,this.opt=r,this.em=i,this.frame=r.frame,this.config=r.config||{},this.set('attributes',P(P({},(0,p.result)(this,'defaults').attributes||{}),this.get('attributes')||{})),this.ccid=n.createId(this,r),this.initClasses(),this.initTraits(),this.initComponents(),this.initToolbar(),this.initScriptProps(),this.listenTo(this,'change:script',this.scriptUpdated),this.listenTo(this,'change:tagName',this.tagUpdated),this.listenTo(this,'change:attributes',this.attrUpdated),this.listenTo(this,'change:attributes:id',this._idUpdated),this.on('change:toolbar',this.__emitUpdateTlb),this.on('change',this.__onChange),this.on(L,this.__propToParent),this.set('status',''),this.views=[],['classes','traits','components'].forEach((function(e){var n="add remove ".concat('components'!==e?'change':'');t.listenTo(t.get(e),n.trim(),(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.emitUpdate.apply(t,[e].concat(r))}))})),!r.temporary){var u=i&&i.get('CssComposer'),f=this.attributes,h=f.styles,d=f.type;h&&u&&u.addCollection(h,{},{group:"cmp:".concat(d)}),this.__postAdd(),this.init(),this.__isSymbolOrInst()&&this.__initSymb(),i&&i.trigger('component:create',this)}}},{key:"__postAdd",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=e&&e.get('UndoManager'),r=this.components();n&&!this.__hasUm&&(n.add(r),n.add(this.getSelectors()),this.__hasUm=1),t.recursive&&r.map((function(e){return e.__postAdd(t)}))}},{key:"__postRemove",value:function(){var t=this.em,e=t&&t.get('UndoManager');e&&(e.remove(this.components()),e.remove(this.getSelectors()),delete this.__hasUm)}},{key:"__onChange",value:function(t,e){var n=this,r=this.changedAttributes();(0,p.keys)(r).forEach((function(t){return n.emitUpdate(t)})),['status','open','toolbar','traits'].forEach((function(t){return delete r[t]})),(0,d.isEmptyObj)(r)||(this.__changesUp(e),this.__propSelfToParent({component:this,changed:r,options:e}))}},{key:"__changesUp",value:function(t){var e=this.em;[this.frame,e].forEach((function(e){return e&&e.changesUp(t)}))}},{key:"__propSelfToParent",value:function(t){this.trigger(Z,t),this.__propToParent(t)}},{key:"__propToParent",value:function(t){var e=this.parent();e&&e.trigger(L,t)}},{key:"__emitUpdateTlb",value:function(){this.emitUpdate('toolbar')}},{key:"is",value:function(t){return!(this.get('type')!=t)}},{key:"props",value:function(){return this.attributes}},{key:"index",value:function(){var t=this.collection;return t?t.indexOf(this):0}},{key:"setDragMode",value:function(t){return this.set('dmode',t)}},{key:"find",value:function(t){var e=[],n=this.view.$el.find(t);return n.each((function(t){var r=n.eq(t).data('model');r&&e.push(r)})),e}},{key:"findType",value:function(t){var e=[];return function n(r){return r.forEach((function(r){r.is(t)&&e.push(r),n(r.components())}))}(this.components()),e}},{key:"closest",value:function(t){var e=this.view.$el.closest(t);return e.length&&e.data('model')}},{key:"closestType",value:function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e}},{key:"contains",value:function(t){var e=!1;if(!t)return e;var n=function n(r){!e&&r.forEach((function(r){r===t&&(e=!0),!e&&n(r.components())}))};return n(this.components()),e}},{key:"tagUpdated",value:function(){this.trigger('rerender')}},{key:"replaceWith",value:function(t){var e=this.collection,n=e.indexOf(this);return e.remove(this),e.add(t,{at:n})}},{key:"attrUpdated",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.get('attributes'),o=i.class;o&&this.setClass(o),delete i.class;var a=i.style;a&&this.setStyle(a),delete i.style;var s=P({},this.previous('attributes')),l=(0,d.shallowDiff)(s,this.get('attributes'));(0,p.keys)(l).forEach((function(t){return n.trigger("change:attributes:".concat(t),n,l[t],r)}))}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.set('attributes',P({},t),e),this}},{key:"addAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.setAttributes(P(P({},this.getAttributes({noClass:1})),t),e)}},{key:"removeAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(t)?t:[t],r=this.getAttributes();return n.map((function(t){return delete r[t]})),this.setAttributes(r,e)}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=(0,p.isString)(t)?t:'',o=i?e:t;if(r&&r.getConfig().avoidInlineStyle&&!o.inline){var a=r.get('state'),s=r.get('CssComposer'),l=s.getIdRule(this.getId(),P({state:a},o));if(this.rule=l,l)return l.getStyle(i)}return(0,c.Z)((0,h.Z)(n.prototype),"getStyle",this).call(this,i)}},{key:"setStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,o=this.opt;if(i&&i.getConfig().avoidInlineStyle&&!o.temporary&&!r.inline){var a=this.get('style')||{};e=P(P({},e=(0,p.isString)(e)?this.parseStyle(e):e),a);var s=i.get('state'),l=i.get('CssComposer'),u=this.getStyle(r);this.rule=l.setIdRule(this.getId(),e,P(P({},r),{},{state:s}));var f=(0,d.shallowDiff)(u,e);this.set('style','',{silent:1}),(0,p.keys)(f).forEach((function(e){return t.trigger("change:style:".concat(e))}))}else e=(0,c.Z)((0,h.Z)(n.prototype),"setStyle",this).apply(this,arguments);return e}},{key:"getAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=[],i=P({},this.get('attributes')),o=n&&n.get('SelectorManager'),a=this.getId();if(e.noClass||(this.get('classes').forEach((function(t){return r.push((0,p.isString)(t)?t:t.get('name'))})),r.length&&(i.class=r.join(' '))),!e.noStyle){var s=this.get('style');(0,d.isObject)(s)&&!(0,d.isEmptyObj)(s)&&(i.style=this.styleToString({inline:1}))}(0,p.has)(i,'id')||(j(n)?t=o&&o.get(a,o.Selector.TYPE_ID):(0,p.isEmpty)(this.getStyle())||(t=1),(this.__getSymbol()||this.__getSymbols())&&(t=1),t&&(i.id=a));return i}},{key:"addClass",value:function(t){var e=this.em.get('SelectorManager').addClass(t);return this.get('classes').add(e)}},{key:"setClass",value:function(t){return this.get('classes').reset(),this.addClass(t)}},{key:"removeClass",value:function(t){var e=[];t=(0,p.isArray)(t)?t:[t];var n=this.get('classes'),r=y.Z.TYPE_CLASS;return t.forEach((function(t){t.split(' ').forEach((function(t){var i=n.where({name:t,type:r})[0];i&&e.push(n.remove(i))}))})),e}},{key:"getClasses",value:function(){var t=this.getAttributes().class;return t?t.split(' '):[]}},{key:"__logSymbol",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.__getSymbol(),i=this.__getSymbols();(r||i)&&this.em.log(t,{model:this,toUp:e,context:'symbols',opts:n})}},{key:"__initSymb",value:function(){this.__symbReady||(this.on('change',this.__upSymbProps),this.__symbReady=1)}},{key:"__isSymbol",value:function(){return(0,p.isArray)(this.get(R))}},{key:"__isSymbolOrInst",value:function(){return!(!this.__isSymbol()&&!this.get(D))}},{key:"__isSymbolTop",value:function(){var t=this.parent();return this.__isSymbolOrInst()&&(!t||t&&!t.__isSymbol()&&!t.__getSymbol())}},{key:"__isSymbolNested",value:function(){if(!this.__isSymbolOrInst()||this.__isSymbolTop())return!1;var t=(this.__isSymbol()?this:this.__getSymbol()).__getSymbTop(),e=this.__getSymbTop();return(e.__isSymbol()?e:e.__getSymbol())!==t}},{key:"__getAllById",value:function(){var t=this.em;return t?t.get('DomComponents').allById():{}}},{key:"__getSymbol",value:function(){var t=this.get(D);if(t&&(0,p.isString)(t)){var e=this.__getAllById()[t];e?(t=e,this.set(D,e)):t=0}return t}},{key:"__getSymbols",value:function(){var t=this,e=this.get(R);return e&&(0,p.isArray)(e)&&(e.forEach((function(n,r){n&&(0,p.isString)(n)&&(e[r]=t.__getAllById()[n])})),e=e.filter((function(t){return t&&!(0,p.isString)(t)}))),e}},{key:"__isSymbOvrd",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=this.get(M),n=t.split(':'),r=(0,o.Z)(n,1),i=r[0],a=t!==i?[t,i]:[t];return!0===e||(0,p.isArray)(e)&&a.some((function(t){return e.indexOf(t)>=0}))}},{key:"__getSymbToUp",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[],r=this.em,o=e.changed,a=r&&r.config.symbols;if(e.fromInstance||e.noPropagate||e.fromUndo||!a||o&&this.__isSymbOvrd(o))return n;var s=this.__getSymbols()||[],l=this.__getSymbol(),c=l?[l].concat((0,i.Z)(l.__getSymbols()||[])):s;return n=c.filter((function(e){return e!==t})).filter((function(t){return!(o&&t.__isSymbOvrd(o))}))}},{key:"__getSymbTop",value:function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e}},{key:"__upSymbProps",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.changedAttributes(),i=r.attributes||{};if(delete r.status,delete r.open,delete r[R],delete r[D],delete r[M],delete r.attributes,delete i.id,(0,d.isEmptyObj)(i)||(r.attributes=i),!(0,d.isEmptyObj)(r)){var o=this.__getSymbToUp(n);(0,p.keys)(r).map((function(t){e.__isSymbOvrd(t)&&delete r[t]})),this.__logSymbol('props',o,{opts:n,changed:r}),o.forEach((function(t){var i=P({},r);(0,p.keys)(i).map((function(e){t.__isSymbOvrd(e)&&delete i[e]})),t.set(i,P({fromInstance:e},n))}))}}},{key:"__upSymbCls",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.__getSymbToUp(r);this.__logSymbol('classes',i,{opts:r}),i.forEach((function(t){t.set('classes',n.get('classes'),{fromInstance:n})})),this.__changesUp(r)}},{key:"__upSymbComps",value:function(t,e,n){var r=this,o=n||e||{},a={fromInstance:o.fromInstance,fromUndo:o.fromUndo},s=t.opt.temporary;if(n)if(n.add){var l=[],c=!!this.__getSymbols(),u=this.__getSymbToUp(P(P({},a),{},{changed:'components:add'}));if(u.length){var f=t.__getSymbol();l=(f?f.__getSymbols():t.__getSymbols())||[],(l=(0,i.Z)(l)).push(f||t)}!s&&this.__logSymbol('add',u,{opts:n,addedInstances:l.map((function(t){return t.cid})),added:t.cid}),u.forEach((function(e){var i=e.__getSymbTop(),o=l.filter((function(t){var e=t.__getSymbTop({prev:1});return i&&e&&e===i}))[0]||t.clone({symbol:1,symbolInv:c});e.append(o,P({fromInstance:r},n))}))}else{var h=t.__getSymbol();if(h&&!n.temporary&&h.set(R,h.__getSymbols().filter((function(e){return e!==t}))),!t.__isSymbolTop()){var p='components:remove',d=n.index,g=t.parent(),v=P({fromInstance:t},n),m=t.__isSymbolNested(),y=function(t){var e=t.parent();e&&!e.__isSymbOvrd(p)&&t.remove(v)},b=g.__isSymbOvrd(p)?[]:t.__getSymbToUp(a);m&&(b=g.__getSymbToUp(P(P({},a),{},{changed:p})),y=function(t){var e=t.components().at(d);e&&e.remove(P({fromInstance:g},v))}),!s&&this.__logSymbol('remove',b,{opts:n,removed:t.cid,isSymbNested:m}),b.forEach(y)}}else{var w=this.__getSymbToUp(P(P({},a),{},{changed:'components:reset'}));this.__logSymbol('reset',w,{components:t.models}),w.forEach((function(n){var i=t.models.map((function(t){return t.clone({symbol:1})}));n.components().reset(i,P({fromInstance:r},e))}))}this.__changesUp(o)}},{key:"initClasses",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r='change:classes',i=this.get('attributes').class||[],o=[this,r,this.initClasses],a=this.get('classes')||i,s=(0,p.isString)(a)?a.split(' '):a;this.stopListening.apply(this,o);var l=this.normalizeClasses(s),c=new b.Z([]);return this.set('classes',c,n),c.add(l),c.on('add remove reset',this.__upSymbCls),this.listenTo.apply(this,o),this}},{key:"initComponents",value:function(){var t=[this,'change:components',this.initComponents];this.stopListening.apply(this,t);var e=new m.Z(null,this.opt);e.parent=this;var n=this.get('components'),r=!this.opt.avoidChildren;return this.set('components',e),r&&n&&e.add((0,p.isFunction)(n)?n(this):n,this.opt),e.on('add remove reset',this.__upSymbComps),this.listenTo.apply(this,t),this}},{key:"initTraits",value:function(t){var e=this.em,n='change:traits';this.off(n,this.initTraits),this.__loadTraits();var r=P({},this.get('attributes')),i=this.get('traits');return i.each((function(t){if(!t.get('changeProp')){var e=t.get('name'),n=t.getInitValue();e&&n&&(r[e]=n)}})),i.length&&this.set('attributes',r),this.on(n,this.initTraits),t&&e&&e.trigger('component:toggled'),this}},{key:"initScriptProps",value:function(){if(!this.opt.temporary){var t='script-props',e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],r=this.get(t)||[],i=n.map((function(t){return"change:".concat(t)})).join(' '),o=r.map((function(t){return"change:".concat(t)})).join(' ');i&&this.off(i,this.__scriptPropsChange),o&&this.on(o,this.__scriptPropsChange),this.on.apply(this,e)}}},{key:"__scriptPropsChange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.avoidStore||this.trigger('rerender')}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,p.isArray)(t)?t:[t],r=n.map((function(t){return(0,p.isString)(t)||t.collection&&t.collection.remove(t,{temporary:1}),t})),i=this.components().add(r,e);return(0,p.isArray)(i)?i:[i]}},{key:"components",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('components');return(0,p.isUndefined)(t)?n:(n.reset(null,e),t?this.append(t,e):[])}},{key:"getChildAt",value:function(t){return this.components().at(t||0)||null}},{key:"getLastChild",value:function(){var t=this.components();return t.at(t.length-1)||null}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.components().reset(null,t),this}},{key:"parent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.collection||t.prev&&this.prevColl;return e?e.parent:null}},{key:"parents",value:function(){var t=this.parent();return t?[t].concat(t.parents()):[]}},{key:"scriptUpdated",value:function(){this.set('scriptUpdated',1)}},{key:"initToolbar",value:function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||'';if(!e.get('toolbar')&&t){var r=[];e.collection&&r.push({label:t.getIcon('arrowUp'),command:function(t){return t.runCommand('core:component-exit',{force:1})}}),e.get('draggable')&&r.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon('move'),command:'tlb-move'}),e.get('copyable')&&r.push({label:t.getIcon('copy'),command:'tlb-clone'}),e.get('removable')&&r.push({label:t.getIcon('delete'),command:'tlb-delete'}),e.set('toolbar',r)}}},{key:"__loadTraits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t||this.get('traits');if(!(n instanceof S)){n=(0,p.isFunction)(n)?n(this):n;var r=new S([],this.opt);r.setTarget(this),n.length&&(n.forEach((function(t){return t.attributes&&delete t.attributes.value})),r.add(n)),this.set({traits:r},e)}return this}},{key:"getTraits",value:function(){return this.__loadTraits(),(0,i.Z)(this.get('traits').models)}},{key:"setTraits",value:function(t){var e=(0,p.isArray)(t)?t:[t];return this.set({traits:e}),this.getTraits()}},{key:"getTrait",value:function(t){return this.getTraits().filter((function(e){return e.get('id')===t||e.get('name')===t}))[0]||null}},{key:"updateTrait",value:function(t,e){var n,r=this.getTrait(t);return r&&r.set(e),null===(n=this.em)||void 0===n||n.trigger('component:toggled'),this}},{key:"getTraitIndex",value:function(t){var e=this.getTrait(t);return e?this.get('traits').indexOf(e):-1}},{key:"removeTrait",value:function(t){var e,n=this,r=((0,p.isArray)(t)?t:[t]).map((function(t){return n.getTrait(t)})),i=this.get('traits'),o=r.length?i.remove(r):[];return null===(e=this.em)||void 0===e||e.trigger('component:toggled'),(0,p.isArray)(o)?o:[o]}},{key:"addTrait",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.__loadTraits();var r=this.get('traits').add(t,n);return null===(e=this.em)||void 0===e||e.trigger('component:toggled'),(0,p.isArray)(r)?r:[r]}},{key:"normalizeClasses",value:function(t){var e=[],n=this.em,r=n&&n.get('SelectorManager');if(r)return t.models?(0,i.Z)(t.models):(t.forEach((function(t){return e.push(r.add(t))})),e)}},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=P({},this.attributes),r=P({},this.opt),o=this.getId(),a=e&&e.get('CssComposer');n.attributes=P({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=1),this.get('components').each((function(e,r){n.components[r]=e.clone(P(P({},t),{},{_inner:1}))})),this.get('traits').each((function(t,e){n.traits[e]=t.clone()})),this.get('classes').each((function(t,e){n.classes[e]=t.get('name')})),n.status='',r.collection=null;var s=new this.constructor(n,r),l="#".concat(s.getId()),c=a?a.getRules("#".concat(o)):[];c.forEach((function(t){var e=t.clone();e.set('selectors',[l]),a.getAll().add(e)})),s.set(R,0);var u=this.__getSymbol(),f=this.__getSymbols();t.symbol||!u&&!f?u?(u.set(R,[].concat((0,i.Z)(u.__getSymbols()),[s])),s.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(R,[].concat((0,i.Z)(f),[s])),s.set(D,this),s.__initSymb()):t.symbolInv?(this.set(R,[s]),s.set(D,this),[this,s].map((function(t){return t.__initSymb()}))):(s.set(R,[this]),[this,s].map((function(t){return t.__initSymb()})),this.set(D,s))):(s.set(D,0),s.set(R,0));var h='component:clone';return e&&e.trigger(h,s),this.trigger(h,s),s}},{key:"getName",value:function(){var t=this.em,e=this.attributes,n=e.type,r=e.tagName,i=e.name,o=n||r,a=!n&&r,s='domComponents.names.',l=i&&(null==t?void 0:t.t("".concat(s).concat(i))),c=a&&(null==t?void 0:t.t("".concat(s).concat(a))),u=t&&(t.t("".concat(s).concat(n))||t.t("".concat(s).concat(r)));return this.get('custom-name')||l||i||c||(0,d.capitalize)(a)||u||(0,d.capitalize)(o)}},{key:"getIcon",value:function(){var t=this.get('icon');return t?t+' ':''}},{key:"toHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=[],r=t.tag,i=r||e.get('tagName'),o=e.get('void'),a=t.attributes,s=this.getAttrToHTML();if(delete t.tag,a&&((0,p.isFunction)(a)?s=a(e,s)||{}:(0,d.isObject)(a)&&(s=a)),t.withProps){var l=this.toJSON();(0,p.forEach)(l,(function(t,e){'_'!==e[0]&&['classes','attributes','components'].indexOf(e)<0&&(s["data-gjs-".concat(e)]=(0,p.isArray)(t)||(0,d.isObject)(t)?JSON.stringify(t):t)}))}for(var c in s){var u=s[c];if(!(0,p.isUndefined)(u)&&null!==u)if((0,p.isBoolean)(u))u&&n.push(c);else{var f='';if(t.altQuoteAttr&&(0,p.isString)(u)&&u.indexOf('"')>=0)f="'".concat(u.replace(/'/g,'&apos;'),"'");else{var h=(0,p.isString)(u)?u.replace(/"/g,'&quot;'):u;f="\"".concat(h,"\"")}n.push("".concat(c,"=").concat(f))}}var g=n.length?" ".concat(n.join(' ')):'',v=e.getInnerHTML(t),m="<".concat(i).concat(g).concat(o?'/':'',">").concat(v);return!o&&(m+="</".concat(i,">")),m}},{key:"getInnerHTML",value:function(t){return this.__innerHTML(t)}},{key:"__innerHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(''):this.get('content')}},{key:"getAttrToHTML",value:function(){var t=this.getAttributes();return delete t.style,t}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=v.Model.prototype.toJSON.call(this,t);if(e.attributes=this.getAttributes(),delete e.attributes.class,delete e.toolbar,delete e.traits,delete e.status,delete e.open,!t.fromUndo){var n=e[D],r=e[R];r&&(0,p.isArray)(r)&&(e[R]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),n&&!(0,p.isString)(n)&&(e[D]=n.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(e),e}},{key:"getChangedProps",value:function(t){var e=t||v.Model.prototype.toJSON.apply(this),n=(0,p.result)(this,'defaults');return(0,p.forEach)(n,(function(t,n){-1===['type'].indexOf(n)&&e[n]===t&&delete e[n]})),(0,p.isEmpty)(e.type)&&delete e.type,(0,p.forEach)(['attributes','style'],(function(t){(0,p.isEmpty)(n[t])&&(0,p.isEmpty)(e[t])&&delete e[t]})),(0,p.forEach)(['classes','components'],(function(t){(!e[t]||(0,p.isEmpty)(n[t])&&!e[t].length)&&delete e[t]})),e}},{key:"getId",value:function(){return(this.get('attributes')||{}).id||this.ccid||this.cid}},{key:"setId",value:function(t,e){var n=P({},this.get('attributes'));return n.id=t,this.set('attributes',n,e),this}},{key:"getEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=this.getView(t);return e&&e.el}},{key:"getView",value:function(t){var e=this.view,n=this.views;return t&&(e=n.filter((function(e){return e._getFrame()===t.view}))[0]),e}},{key:"getCurrentView",value:function(){var t=(this.em.get('currentFrame')||{}).model;return this.getView(t)}},{key:"__getScriptProps",value:function(){var t=this.props();return(this.get('script-props')||[]).reduce((function(e,n){return e[n]=t[n],e}),{})}},{key:"getScriptString",value:function(t){var e=this,n=t||this.get('script');if(!n)return n;if(this.get('script-props'))n=n.toString().trim();else{if('function'==typeof n){var i=n.toString().trim();n=(i=i.replace(/^function[\s\w]*\(\)\s?\{/,'').replace(/\}$/,'')).trim()}var o=this.em.getConfig(),a=E(o.tagVarStart||'{[ '),s=E(o.tagVarEnd||' ]}'),l=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),'g');n=n.replace(l,(function(t,n){e.scriptUpdated();var i=e.attributes[n]||'';return(0,p.isArray)(i)||'object'==(0,r.Z)(i)?JSON.stringify(i):i}))}return n}},{key:"emitUpdate",value:function(t){for(var e=this.em,n=Z+(t?":".concat(t):''),r=t&&this.get(t),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];t&&this.updated.apply(this,[t,r,t&&this.previous(t)].concat(o)),this.trigger.apply(this,[n].concat(o)),e&&e.trigger.apply(e,[n,this].concat(o)),['components','classes'].indexOf(t)>=0&&this.__propSelfToParent({component:this,changed:{[t]:r},options:o[2]||o[1]||{}})}},{key:"onAll",value:function(t){return(0,p.isFunction)(t)&&(t(this),this.components().forEach((function(e){return e.onAll(t)}))),this}},{key:"remove",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=this.collection,i=function(){r&&r.remove(t,P(P({},e),{},{action:'remove-component'})),r||(t.components('',e),t.components().removeChildren(t,null,e))},o=P({},e);return[this,n].map((function(e){return e.trigger('component:remove:before',t,i,o)})),!o.abort&&i(),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){var n=e.at,r=this.index(),i=t===this.parent(),o=r===n||r===n-1;i&&o||(i&&n&&n>r&&(e.at=n-1),this.remove({temporary:1}),t.append(this,e),this.emitUpdate())}return this}},{key:"isInstanceOf",value:function(t){var e,n,r=null===(e=this.em)||void 0===e||null===(n=e.get('DomComponents').getType(t))||void 0===n?void 0:n.model;return!!r&&this instanceof r}},{key:"isChildOf",value:function(t){for(var e=(0,p.isString)(t),n=this.parent();n;){if(e){if(n.isInstanceOf(t))return!0}else if(n===t)return!0;n=n.parent()}return!1}},{key:"resetId",value:function(){var t=this.em,e=this.getId();if(e){var r=n.createId(this);this.setId(r);var i=t&&t.get('CssComposer').getIdRule(e),o=i&&i.get('selectors').at(0);return o&&o.set('name',r),this}}},{key:"_getStyleRule",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.id,n=this.em,r=e||this.getId();return n&&n.get('CssComposer').getIdRule(r)}},{key:"_getStyleSelector",value:function(t){var e=this._getStyleRule(t);return e&&e.get('selectors').at(0)}},{key:"_idUpdated",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r.idUpdate){var i=this.ccid,o=this.get('attributes')||{},a=o.id,s=(this.previous('attributes')||{}).id||i,l=n.getList(this);if(l[a]||!a&&s)return this.setId(s,{idUpdate:1});delete l[s],l[a]=this,this.ccid=a;var c=this._getStyleSelector({id:s});c&&c.set({name:a,label:a})}}}]),n}(g.Z);N.getDefaults=function(){return(0,p.result)(this.prototype,'defaults')},N.isComponent=function(t){return{tagName:(0,d.toLowerCase)(t.tagName)}},N.ensureInList=function(t){var e=N.getList(t),n=t.getId(),r=e[n];if(r){if(r!==t){var i=N.getIncrementId(n,e);t.setId(i),e[i]=t}}else e[n]=t;t.components().forEach((function(t){return N.ensureInList(t)}))},N.createId=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=N.getList(t),i=n.idMap,o=void 0===i?{}:i,a=t.get('attributes'),s=a.id;return s?(e=N.getIncrementId(s,r,n),t.setId(e),s!==e&&(o[s]=e)):e=N.getNewId(r),r[e]=t,e},N.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),r="i".concat(n);t[r];)r=N.getNewId(t);return r},N.getIncrementId=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.keepIds,i=void 0===r?[]:r,o=1,a=t;if(i.indexOf(t)<0)for(;e[a];)o++,a="".concat(t,"-").concat(o);return a},N.getList=function(t){var e=t.opt,n=void 0===e?{}:e,r=n.domc,i=n.em,o=r||i&&i.get('DomComponents');return o?o.componentsById:{}},N.checkId=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,p.isArray)(t)?t:[t],o=r.keepIds,a=void 0===o?[]:o;i.forEach((function(t){var i=t.attributes,o=void 0===i?{}:i,s=t.components,l=o.id;if(l&&n[l]&&a.indexOf(l)<0){var c=N.getIncrementId(l,n);o.id=c,(0,p.isArray)(e)&&e.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(l)&&(e[n]="#".concat(c))}))}))}s&&N.checkId(s,e,n,r)}))}},8431:(t,e,n)=>{"use strict";n.d(e,{Z:()=>C});var r=n(1002),i=n(2982),o=n(5671),a=n(3144),s=n(7326),l=n(9340),c=n(2963),u=n(1120),f=n(4942),h=n(4925),p=n(2316),d=n.n(p),g=n(9050),v=n(9138),m=["id","draggable"],y=["at"];function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){(0,f.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var x=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return[];var r=(0,g.isArray)(e)||(0,g.isFunction)(e.map)?e:[e];return r.map((function(e){n.push(e.getId()),t(e.components().models,n)})),n},O=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.visitedCmps=r.visitedCmps||{};var i=r.visitedCmps,o=(0,g.isArray)(e)?e:[e];return o.map((function(e){var o=e.attributes,a=void 0===o?{}:o,s=e.components,l=e.tagName,c=a.id,u=(a.draggable,(0,h.Z)(a,m)),f=e;if(c&&(i[c]?(i[c].push(f),c=v.ZP.getNewId(n),f.attributes.id=c):(i[c]=[],n[c]&&(f=n[c],l&&f.set({tagName:l},k(k({},r),{},{silent:!0})),(0,g.keys)(u).length&&f.addAttributes(u,k({},r))))),s){var p=t(s,n);if((0,g.isFunction)(f.components)){var d=f.components();d.length>0&&d.reset(p,r)}else f.components=p}return f}))},C=function(t){(0,l.Z)(n,t);var e=b(n);function n(){var t;(0,o.Z)(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return t=e.call.apply(e,[this].concat(i)),(0,f.Z)((0,s.Z)(t),"__onAddEnd",(0,g.debounce)((function(){}))),t}return(0,a.Z)(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.opt=e,this.listenTo(this,'add',this.onAdd),this.listenTo(this,'remove',this.removeChildren),this.listenTo(this,'reset',this.resetChildren);var n=e.em,r=e.config;this.config=r,this.em=n,this.domc=e.domc||n&&n.get('DomComponents')}},{key:"resetChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this,i=n.previousModels||[],o=i.filter((function(e){return!t.get(e.cid)})),a=x(t);n.keepIds=x(i).filter((function(t){return a.indexOf(t)>=0})),o.forEach((function(t){return e.removeChildren(t,r,n)})),t.each((function(t){return e.onAdd(t)}))}},{key:"resetFromString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.keepIds=x(this);var n=this.domc,r=this.em,i=this.parent,o=null==r?void 0:r.get('CssComposer'),a=(null==n?void 0:n.allById())||{},s=this.parseString(t,e),l=O(s,a,e),c=e.visitedCmps,u=void 0===c?{}:c;Object.keys(u).forEach((function(t){var e=u[t];if(e.length){var n=(null==o?void 0:o.getRules("#".concat(t)))||[];n.length&&e.forEach((function(t){n.forEach((function(e){var n=e.clone();n.set('selectors',["#".concat(t.attributes.id)]),o.getAll().add(n)}))}))}})),this.reset(l,e),null==r||r.trigger('component:content',i,e,t)}},{key:"removeChildren",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var i=this.domc,o=this.em,a=r.temporary||r.fromUndo;if(t.prevColl=this,!a){var s=t.getId(),l=o.get('SelectorManager').getAll(),c=o.get('CssComposer').getAll(),u=(r.keepIds||[]).indexOf(s)<0,f=i?i.allById():{};delete f[s];var h=u?c.remove(c.filter((function(t){return t.getSelectors().getFullString()==="#".concat(s)})),r):[];l.remove(h.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(o.get('Commands').run('core:component-style-clear',{target:t}),t.removed(),t.trigger('removed'),o.trigger('component:remove',t));var p=t.components();p.forEach((function(t){return n.removeChildren(t,e,r)}))}var d=t.components();o.stopListening(d),o.stopListening(t),o.stopListening(t.get('classes')),t.__postRemove()}}},{key:"model",value:function(t,e){var n,r=e.collection.opt,i=r.em,o=i.get('DomComponents').componentTypes;e.em=i,e.config=r.config,e.componentTypes=o,e.domc=r.domc;for(var a=0;a<o.length;a++){if(o[a].id==t.type){n=o[a].model;break}}return n||(n=o[o.length-1].model,i&&t.type&&i.logWarning("Component type '".concat(t.type,"' not found"),{attrs:t,options:e})),new n(t,e)}},{key:"parseString",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.domc,i=n.get('CssComposer'),o=n.get('Parser').parseHtml(t);if(v.ZP.checkId(o.html,o.css,r.componentsById,e),o.css&&i&&!e.temporary){e.at;var a=(0,h.Z)(e,y);i.addCollection(o.css,k(k({},a),{},{extend:1}))}return o.html}},{key:"add",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.keepIds=[].concat((0,i.Z)(n.keepIds||[]),(0,i.Z)(x(n.previousModels))),(0,g.isString)(t)?t=this.parseString(t,n):(0,g.isArray)(t)&&(t=(0,i.Z)(t)).forEach((function(r,i){if((0,g.isString)(r)){var o=e.parseString(r,n);t[i]=(0,g.isArray)(o)&&!o.length?null:o}}));var r=(0,g.isArray)(t);t=(r?t:[t]).filter((function(t){return t})).map((function(t){return e.processDef(t)})),t=r?(0,g.flatten)(t,1):t[0];var o=d().Collection.prototype.add.apply(this,[t,n]);return this.__firstAdd=o,o}},{key:"processDef",value:function(t){if(t.cid&&t.ccid)return t;var e=this.em,n=this.config,i=(void 0===n?{}:n).processor,o=t;if(i){var a=i(o=k({},o));a&&((0,g.each)(o,(function(t,e){return delete o[e]})),(0,g.extend)(o,a))}if(o.$$typeof&&'object'==(0,r.Z)(o.props)){(o=k({},o)).props=k({},o.props);var s=e.get('DomComponents'),l=e.get('Parser').parserHtml;(0,g.each)(o,(function(t,e){(0,g.includes)(['props','type'],e)||delete o[e]}));var c=o.props,u=c.children;delete c.children,delete o.props;var f=l.splitPropsFromAttr(c);o.attributes=f.attrs,u&&(o.components=u),o.type?s.getType(o.type)||(o.tagName=o.type,delete o.type):o.type='textnode',(0,g.extend)(o,f.props)}return o}},{key:"onAdd",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.domc,i=this.em,o=t.getStyle(),a=i&&i.getConfig().avoidInlineStyle;if(r&&r.Component.ensureInList(t),!(0,g.isEmpty)(o)&&!a&&i&&i.get&&i.getConfig().forceClass&&!n.temporary){var s=t.cid;i.get('CssComposer').setClassRule(s,o);t.setStyle({}),t.addClass(s)}t.__postAdd({recursive:1}),this.__onAddEnd()}}]),n}(d().Collection)},2169:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var r=n(4942),i=n(5671),o=n(3144),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),f=n(9050),h=n(8431),p=n(3505),d=n(966),g=n(9283),v=n(1163);function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var w=function(t){(0,a.Z)(n,t);var e=b(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"className",value:function(){return this.getClasses()}},{key:"tagName",value:function(){return this.model.get('tagName')}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{},r=n.em,i=e.opt||{},o=this.$el,a=this.el;this.opts=t,this.modelOpt=i,this.config=n,this.em=r||'',this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.attr=e.get('attributes'),this.classe=this.attr.class||[],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 change:locked',this.updateStatus),this.listenTo(e,'change:script rerender',this.reset),this.listenTo(e,'change:content',this.updateContent),this.listenTo(e,'change',this.handleChange),this.listenTo(e,'active',this.onActive),this.listenTo(e,'disable',this.onDisable),o.data('model',e),(0,v.setViewEl)(a,this),e.view=this,this._getFrame()&&e.views.push(this),this.initClasses(),this.initComponents({avoidRender:1}),this.events=y(y({},this.constructor.getEvents()),{},{dragstart:'handleDragStart'}),this.delegateEvents(),!i.temporary&&this.init(this._clbObj())}},{key:"__isDraggable",value:function(){var t=this.model,e=this.config,n=t.attributes.draggable;return e.draggableComponents&&n}},{key:"_clbObj",value:function(){var t=this.em,e=this.model,n=this.el;return{editor:t&&t.getEditor(),model:e,el:n}}},{key:"init",value:function(){}},{key:"removed",value:function(){}},{key:"onActive",value:function(){}},{key:"onDisable",value:function(){}},{key:"remove",value:function(){var t;u().View.prototype.remove.apply(this,arguments);var e=this.model,n=this.$el,r=e.views,i=this._getFrame()||{};return e.components().forEach((function(t){var e=t.getView(i.model);null==e||e.remove()})),null===(t=this.childrenView)||void 0===t||t.remove(),r.splice(r.indexOf(this),1),this.removed(this._clbObj()),n.data({model:'',collection:'',view:''}),this}},{key:"handleDragStart",value:function(t){if(!this.__isDraggable())return!1;t.stopPropagation(),t.preventDefault(),this.em.get('Commands').run('tlb-move',{target:this.model,event:t})}},{key:"initClasses",value:function(){var t=this.model,e='change:classes',n=t.get('classes');n instanceof d.Z&&(this.stopListening(t,e,this.initClasses),this.listenTo(t,e,this.initClasses),this.listenTo(n,'add remove change',this.updateClasses),n.length&&this.importClasses())}},{key:"initComponents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.$el,r=this.childrenView,i='change:components',o=e.get('components'),a=[e,i,this.initComponents];o instanceof h.Z&&(n.data('collection',o),r&&r.remove(),this.stopListening.apply(this,a),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,a))}},{key:"handleChange",value:function(){var t=this.model,e=(0,f.keys)(t.changed);if(1!==e.length||'status'!==e[0])for(var n in t.emitUpdate(),t.changed)t.emitUpdate(n)}},{key:"importClasses",value:function(){var t=this.config.em.get('SelectorManager');t&&this.model.get('classes').each((function(e){t.add(e.get('name'))}))}},{key:"updateStatus",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=this.el,r=this.ppfx,i=this.model,o=e?e.get('Canvas').getConfig():{},a=o.extHl,s=i.get('status'),l="".concat(r,"selected"),c="".concat(l,"-parent"),u="".concat(r,"freezed"),f="".concat(r,"hovered"),h="".concat(r,"no-pointer"),p=[l,c,u,f,h],d=a&&!t.noExtHl?'':l;this.$el.removeClass(p.join(' '));var g=n.getAttribute('class')||'',v=[g];switch(s){case'selected':v.push(d);break;case'selected-parent':v.push(c);break;case'freezed':v.push(u);break;case'freezed-selected':v.push(u,d);break;case'hovered':!t.avoidHover&&v.push(f)}i.get('locked')&&v.push(h);var m=v.filter(Boolean).join(' ');m&&n.setAttribute('class',m)}},{key:"updateHighlight",value:function(){var t=this.model,e=t.get('textable'),n=t.get('highlightable')&&(e||!t.isChildOf('text'));this.setAttribute('data-gjs-highlightable',!!n||'')}},{key:"updateStyle",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.model,i=this.em;if(i&&i.getConfig().avoidInlineStyle&&!n.inline){var o=r.getStyle();!(0,f.isEmpty)(o)&&r.setStyle(o)}else this.setAttribute('style',r.styleToString(n))}},{key:"updateClasses",value:function(){var t=this.model.get('classes').pluck('name').join(' ');this.setAttribute('class',t),this.updateStatus(),this.onAttrUpdate()}},{key:"setAttribute",value:function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)}},{key:"getClasses",value:function(){return this.model.getClasses().join(' ')}},{key:"updateAttributes",value:function(){var t=[],e=this.model,n=this.$el,r=this.el,i=e.attributes,o=i.textable,a=i.type,s=y(y({id:e.getId(),'data-gjs-type':a||'default'},this.__isDraggable()&&{draggable:!0}),o&&{contenteditable:'false'});(0,f.each)(r.attributes,(function(e){return t.push(e.nodeName)})),t.forEach((function(t){return n.removeAttr(t)})),this.updateStyle(),this.updateHighlight();var l=y(y({},s),e.getAttributes());(0,f.keys)(l).forEach((function(t){return!1===l[t]&&delete l[t]})),n.attr(l)}},{key:"updateContent",value:function(){var t=this.model.get('content'),e=this.model.components().length;this.getChildrenContainer().innerHTML=e?'':t}},{key:"prevDef",value:function(t){t.preventDefault()}},{key:"updateScript",value:function(){var t=this.model,e=this.em;t.get('script')&&e&&e.get('Canvas').getCanvasView().updateScript(this)}},{key:"getChildrenContainer",value:function(){var t=this.el;return'function'==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t}},{key:"getOffsetRect",value:function(){var t={},e=this.el,n=0,r=0;return function i(o){var a=o.offsetParent;a?(n+=a.offsetTop,r+=a.offsetLeft,i(a)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+r,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)}(e),t}},{key:"isInViewport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.rect,n=this.el,r=n.ownerDocument,i=r.body,o=r.defaultView.frameElement,a=e||this.getOffsetRect(),s=a.top,l=a.left,c=this._getFrame().getOffsetRect();return s>=c.scrollTop&&l>=c.scrollLeft&&s<=c.scrollBottom&&l<=o.offsetWidth+i.scrollLeft}},{key:"scrollIntoView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getOffsetRect(),n=this.isInViewport({rect:e});if(!n||t.force){var r=this.el;'smooth'!==t.behavior?r.ownerDocument.defaultView.scrollTo(0,e.top):r.scrollIntoView(y({behavior:'smooth',block:'nearest'},t))}}},{key:"reset",value:function(){var t=this.el;this.el='',this._ensureElement(),this._setData(),(0,g.dL)(t,this.el),this.render()}},{key:"_setData",value:function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})}},{key:"_getFrame",value:function(){var t;return null===(t=this.config.em)||void 0===t?void 0:t.get('Canvas').config.frameView}},{key:"renderChildren",value:function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new p.Z({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),r=0,i=n.length;r<i;r++)t.appendChild(n.shift())}},{key:"renderAttributes",value:function(){this.updateAttributes(),this.updateClasses()}},{key:"onAttrUpdate",value:function(){}},{key:"render",value:function(){return this.renderAttributes(),this.modelOpt.temporary||(this.renderChildren(),this.updateScript(),(0,v.setViewEl)(this.el,this),this.postRender()),this}},{key:"postRender",value:function(){this.modelOpt.temporary||this.onRender(this._clbObj())}},{key:"onRender",value:function(){}}]),n}(u().View);w.getEvents=function(){return(0,f.result)(this.prototype,'events')}},3505:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var r=n(5671),i=n(3144),o=n(9340),a=n(2963),s=n(1120),l=n(2316),c=n.n(l),u=n(9050),f=n(9283);function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var p=function(t){(0,o.Z)(a,t);var e=h(a);function a(){return(0,r.Z)(this,a),e.apply(this,arguments)}return(0,i.Z)(a,[{key:"initialize",value:function(t){this.opts=t||{},this.config=t.config||{},this.em=this.config.em;var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.resetChildren),this.listenTo(e,'remove',this.removeChildren)}},{key:"removeChildren",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,f.L_)(n),t.remove.apply(t)}}));var i=t.components();i.forEach((function(t){return n.removeChildren(t,e,r)}))}},{key:"addTo",value:function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.config.em,r=this.collection.indexOf(t);if(this.addToCollection(t,null,r),n&&!e.temporary){var i=function t(e){n.trigger('component:add',e),e.components().forEach((function(e){return t(e)}))};i(t)}}},{key:"addToCollection",value:function(t,e,r){this.compView||(this.compView=n(2169).Z);for(var i=this.config,o=this.opts,a=this.em,s=e||null,l=i.frameView,c=void 0===l?{}:l,f=c.model&&t.getView(c.model),h=o.componentTypes||a&&a.get('DomComponents').getTypes(),p=t.get('type')||'default',d=this.compView,g=0;g<h.length;g++)if(h[g].id==p){d=h[g].view;break}var v,m=f||new d({model:t,config:i,componentTypes:h});try{v=m.render().el}catch(t){v=document.createTextNode(''),a.logError(t)}if(s)s.appendChild(v);else{var y=this.parentEl,b=y.childNodes;if((0,u.isUndefined)(r))y.appendChild(v);else{var w=b.length==r;w&&r--,w||!b.length?y.appendChild(v):y.insertBefore(v,b[r])}}return t.opt.temporary||null==a||a.trigger('component:mount',t),v}},{key:"resetChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels,i=void 0===r?[]:r;this.parentEl.innerHTML='',i.forEach((function(t){return e.removeChildren(t,e.collection)})),t.each((function(t){return e.addToCollection(t)}))}},{key:"render",value:function(t){var e=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each((function(t){return e.addToCollection(t,r)})),n.innerHTML='',n.appendChild(r),this}}]),a}(c().View)},9524:(t,e,n)=>{"use strict";n.d(e,{Z:()=>m});var r=n(4942),i=n(5671),o=n(3144),a=n(9340),s=n(2963),l=n(1120),c=n(9050),u=n(1163),f=n(5311),h=n(2316);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var v=(0,f.Z)(),m=function(t){(0,a.Z)(n,t);var e=g(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"parseStyle",value:function(t){return v.parseStyle(t)}},{key:"extendStyle",value:function(t){return d(d({},this.getStyle()),t)}},{key:"getStyle",value:function(t){var e=d({},this.get('style')||{});return t&&(0,c.isString)(t)?e[t]:e}},{key:"setStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,c.isString)(e)&&(e=this.parseStyle(e));var r=this.getStyle(n),i=d({},e),o=d({},i);(0,c.keys)(o).forEach((function(t){''===o[t]&&delete o[t]})),this.set('style',o,n);var a=(0,u.shallowDiff)(r,i);return delete a.__p,(0,c.keys)(a).forEach((function(e){var r=t.em;n.noEvent||(t.trigger("change:style:".concat(e)),r&&(r.trigger('styleable:change',t,e,n),r.trigger("styleable:change:".concat(e),t,e,n)))})),i}},{key:"addStyle",value: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)}},{key:"removeStyle",value:function(t){var e=this.getStyle();delete e[t],this.setStyle(e)}},{key:"styleToString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.getStyle(t);for(var r in n){var i=t.important,o=(0,c.isArray)(i)?i.indexOf(r)>=0:i,a="".concat(n[r]).concat(o?' !important':''),s='__'==r.substr(0,2);a&&!s&&e.push("".concat(r,":").concat(a,";"))}return e.join('')}},{key:"getSelectors",value:function(){return this.get('selectors')||this.get('classes')}},{key:"getSelectorsString",value:function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()}},{key:"_validate",value:function(t,e){return!0}}]),n}(h.Model)},793:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(4942),i=n(9050),o=n(2316);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const l={types:[],initialize:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.em;this.em=r,this.opts=n,this.model=function(){var t,n,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o&&o.type){var l=e.getBaseType();t=(i=e.getType(o.type))?i.model:l.model,n=i?i.view:l.view}else{var c=e.recognizeType(o);t=(i=c.type).model,n=i.view,o=c.attributes}var u=new t(o,s(s({},a),{},{em:r}));return u.typeView=n,u};var i=this.init&&this.init.bind(this);i&&i()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var r=e[n],i=r.isType(t);if(i='boolean'==typeof i&&i?{type:r.id}:i)return{type:r,attributes:i}}return{type:this.getBaseType(),attributes:t}},getBaseType:function(){var t=this.getTypes();return t[t.length-1]},getTypes:function(){return this.types},getType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var r=e[n];if(r.id===t)return r}},addType:function(t,e){var n=this.getType(t),r=this.getBaseType(),a=n?n.model:r.model,s=n?n.view:r.view,l=e.model,c=e.view,u=e.isType;l=l instanceof o.Model||(0,i.isFunction)(l)?l:a.extend(l||{}),c=c instanceof o.View||(0,i.isFunction)(c)?c:s.extend(c||{}),!this.extendViewApi||e.model||e.view||(c=c.extend(e)),n?(n.model=l,n.view=c,n.isType=u||n.isType):(e.id=t,e.model=l,e.view=c,e.isType=u||function(e){if(e&&e.type==t)return!0},this.getTypes().unshift(e))}}},8659:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var r=n(5671),i=n(3144),o=n(9340),a=n(2963),s=n(1120),l=n(2316),c=n.n(l);function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var f=c().$,h=function(t){(0,o.Z)(n,t);var e=u(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,n),t=e.call(this,i);var o=i.ppfx||'';return t.opts=i,t.ppfx=o,t.em=i.target||{},!i.onChange&&t.listenTo(t.model,'change:value',t.handleModelChange),t}return(0,i.Z)(n,[{key:"template",value:function(){return"<span class=\"".concat(this.holderClass(),"\"></span>")}},{key:"inputClass",value:function(){return"".concat(this.ppfx,"field")}},{key:"holderClass",value:function(){return"".concat(this.ppfx,"input-holder")}},{key:"elementUpdated",value:function(){this.model.trigger('el:change')}},{key:"setValue",value:function(t){var e=this.model,n=t||e.get('defaults'),r=this.getInputEl();r&&(r.value=n)}},{key:"handleModelChange",value:function(t,e,n){this.setValue(e,n)}},{key:"handleChange",value:function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()}},{key:"__onInputChange",value:function(t){this.model.set({value:t},{fromInput:1})}},{key:"getInputEl",value:function(){if(!this.inputEl){var t=this.model,e=this.opts.type||'text',n=t.get('placeholder')||t.get('defaults')||t.get('default')||'';this.inputEl=f("<input type=\"".concat(e,"\" placeholder=\"").concat(n,"\">"))}return this.inputEl.get(0)}},{key:"render",value:function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this}}]),n}(c().View);h.prototype.events={change:'handleChange'}},1511:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var r=n(4942),i=n(5671),o=n(3144),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),f=n(9050),h=n(1002),p=n(1163);var d=n(8659);function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var y=u().$;y&&function(t,e){if((0,p.hasWin)()){var n={beforeShow:T,move:T,change:T,show:T,hide:T,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:'body',maxSelectionSize:7,cancelText:'cancel',chooseText:'choose',togglePaletteMoreText:'more',togglePaletteLessText:'less',clearText:'Clear Color Selection',noColorSelectedText:'No Color Selected',preferredFormat:!1,className:'',containerClassName:'',replacerClassName:'',showAlpha:!1,theme:'sp-light',palette:[['#ffffff','#000000','#ff0000','#ff8000','#ffff00','#008000','#0000ff','#4b0082','#9400d3']],selectionPalette:[],disabled:!1,offset:null},r=[],i=!!/msie/i.exec(window.navigator.userAgent),o=function(){function t(t,e){return!!~(''+t).indexOf(e)}var e=document.createElement('div').style;return e.cssText='background-color:rgba(0,0,0,.5)',t(e.backgroundColor,'rgba')||t(e.backgroundColor,'hsla')}(),a=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>&#9660;</div>",'</div>'].join(''),s=function(){var t='';if(i)for(var e=1;e<=6;e++)t+="<div class='sp-"+e+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>",'</div>','</div>',"<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>",'</div>','</div>','</div>',"<div class='sp-clear sp-clear-display'>",'</div>',"<div class='sp-hue'>","<div class='sp-slider'></div>",t,'</div>','</div>',"<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>",'</div>',"<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false'  />",'</div>',"<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>",'</div>','</div>','</div>'].join('')}(),l='spectrum.id';t.fn.spectrum=function(e,n){if('string'==typeof e){var i=this,o=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=r[t(this).data(l)];if(n){var a=n[e];if(!a)throw new Error("Spectrum: no such method: '"+e+"'");'get'==e?i=n.get():'container'==e?i=n.container:'option'==e?i=n.option.apply(n,o):'destroy'==e?(n.destroy(),t(this).removeData(l)):a.apply(n,o)}})),i}return this.spectrum('destroy').each((function(){var n=P(this,t.extend({},e,t(this).data()));t(this).data(l,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=A,t.fn.spectrum.defaults=n,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t("<input type='color'/>")[0];e._cachedResult='color'===n.type&&''!==n.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t('input[type=color]');e.length&&!R()&&e.spectrum({preferredFormat:'hex6'})};var c=/^[\s,#]+/,u=/\s+$/,f=0,d=Math,g=d.round,v=d.min,m=d.max,y=d.random,b=function t(e,n){if(n=n||{},(e=e||'')instanceof t)return e;if(!(this instanceof t))return new t(e,n);var r=function(t){var e={r:0,g:0,b:0},n=1,r=!1,i=!1;'string'==typeof t&&(t=function(t){t=t.replace(c,'').replace(u,'').toLowerCase();var e,n=!1;if(O[t])t=O[t],n=!0;else if('transparent'==t)return{r:0,g:0,b:0,a:0,format:'name'};if(e=S.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=S.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=S.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=S.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=S.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=S.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=S.hex8.exec(t))return{a:nt(e[1]),r:Q(e[2]),g:Q(e[3]),b:Q(e[4]),format:n?'name':'hex8'};if(e=S.hex6.exec(t))return{r:Q(e[1]),g:Q(e[2]),b:Q(e[3]),format:n?'name':'hex'};if(e=S.hex3.exec(t))return{r:Q(e[1]+''+e[1]),g:Q(e[2]+''+e[2]),b:Q(e[3]+''+e[3]),format:n?'name':'hex'};return!1}(t));'object'==(0,h.Z)(t)&&(t.hasOwnProperty('r')&&t.hasOwnProperty('g')&&t.hasOwnProperty('b')?(o=t.r,a=t.g,s=t.b,e={r:255*X(o,255),g:255*X(a,255),b:255*X(s,255)},r=!0,i='%'===String(t.r).substr(-1)?'prgb':'rgb'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('v')?(t.s=et(t.s),t.v=et(t.v),e=function(t,e,n){t=6*X(t,360),e=X(e,100),n=X(n,100);var r=d.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),l=r%6;return{r:255*[n,a,o,o,s,n][l],g:255*[s,n,n,a,o,o][l],b:255*[o,o,s,n,n,a][l]}}(t.h,t.s,t.v),r=!0,i='hsv'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('l')&&(t.s=et(t.s),t.l=et(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=X(t,360),e=X(e,100),n=X(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),i=a(l,s,t),o=a(l,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,t.s,t.l),r=!0,i='hsl'),t.hasOwnProperty('a')&&(n=t.a));var o,a,s;return n=Y(n),{ok:r,format:t.format||i,r:v(255,m(e.r,0)),g:v(255,m(e.g,0)),b:v(255,m(e.b,0)),a:n}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=g(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=g(this._r)),this._g<1&&(this._g=g(this._g)),this._b<1&&(this._b=g(this._b)),this._ok=r.ok,this._tc_id=f++};b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=Y(t),this._roundA=g(100*this._a)/100,this},toHsv:function(){var t=M(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=M(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),r=g(100*t.v);return 1==this._a?'hsv('+e+', '+n+'%, '+r+'%)':'hsva('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHsl:function(){var t=D(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=D(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),r=g(100*t.l);return 1==this._a?'hsl('+e+', '+n+'%, '+r+'%)':'hsla('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHex:function(t){return Z(this._r,this._g,this._b,t)},toHexString:function(t){return'#'+this.toHex(t)},toHex8:function(){return L(this._r,this._g,this._b,this._a)},toHex8String:function(){return'#'+this.toHex8()},toRgb:function(){return{r:g(this._r),g:g(this._g),b:g(this._b),a:this._a}},toRgbString:function(){return 1==this._a?'rgb('+g(this._r)+', '+g(this._g)+', '+g(this._b)+')':'rgba('+g(this._r)+', '+g(this._g)+', '+g(this._b)+', '+this._roundA+')'},toPercentageRgb:function(){return{r:g(100*X(this._r,255))+'%',g:g(100*X(this._g,255))+'%',b:g(100*X(this._b,255))+'%',a:this._a}},toPercentageRgbString:function(){return 1==this._a?'rgb('+g(100*X(this._r,255))+'%, '+g(100*X(this._g,255))+'%, '+g(100*X(this._b,255))+'%)':'rgba('+g(100*X(this._r,255))+'%, '+g(100*X(this._g,255))+'%, '+g(100*X(this._b,255))+'%, '+this._roundA+')'},toName:function(){return 0===this._a?'transparent':!(this._a<1)&&(C[Z(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e='#'+L(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?'GradientType = 1, ':'';t&&(n=b(t).toHex8String());return'progid:DXImageTransform.Microsoft.gradient('+r+'startColorstr='+e+',endColorstr='+n+')'},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||'hex'!==t&&'hex6'!==t&&'hex3'!==t&&'name'!==t?('rgb'===t&&(n=this.toRgbString()),'prgb'===t&&(n=this.toPercentageRgbString()),'hex'!==t&&'hex6'!==t||(n=this.toHexString()),'hex3'===t&&(n=this.toHexString(!0)),'hex8'===t&&(n=this.toHex8String()),'name'===t&&(n=this.toName()),'hsl'===t&&(n=this.toHslString()),'hsv'===t&&(n=this.toHsvString()),n||this.toHexString()):'name'===t&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(V,arguments)},brighten:function(){return this._applyModification(B,arguments)},darken:function(){return this._applyModification(H,arguments)},desaturate:function(){return this._applyModification(N,arguments)},saturate:function(){return this._applyModification(I,arguments)},greyscale:function(){return this._applyModification(F,arguments)},spin:function(){return this._applyModification(z,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(G,arguments)},complement:function(){return this._applyCombination(U,arguments)},monochromatic:function(){return this._applyCombination(K,arguments)},splitcomplement:function(){return this._applyCombination(q,arguments)},triad:function(){return this._applyCombination(W,arguments)},tetrad:function(){return this._applyCombination($,arguments)}},b.fromRatio=function(t,e){if('object'==(0,h.Z)(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]='a'===r?t[r]:et(t[r]));t=n}return b(t,e)},b.equals=function(t,e){return!(!t||!e)&&b(t).toRgbString()==b(e).toRgbString()},b.random=function(){return b.fromRatio({r:y(),g:y(),b:y()})},b.mix=function(t,e,n){n=0===n?0:n||50;var r,i=b(t).toRgb(),o=b(e).toRgb(),a=n/100,s=2*a-1,l=o.a-i.a,c=1-(r=((r=s*l==-1?s:(s+l)/(1+s*l))+1)/2),u={r:o.r*r+i.r*c,g:o.g*r+i.g*c,b:o.b*r+i.b*c,a:o.a*a+i.a*(1-a)};return b(u)},b.readability=function(t,e){var n=b(t),r=b(e),i=n.toRgb(),o=r.toRgb(),a=n.getBrightness(),s=r.getBrightness(),l=Math.max(i.r,o.r)-Math.min(i.r,o.r)+Math.max(i.g,o.g)-Math.min(i.g,o.g)+Math.max(i.b,o.b)-Math.min(i.b,o.b);return{brightness:Math.abs(a-s),color:l}},b.isReadable=function(t,e){var n=b.readability(t,e);return n.brightness>125&&n.color>500},b.mostReadable=function(t,e){for(var n=null,r=0,i=!1,o=0;o<e.length;o++){var a=b.readability(t,e[o]),s=a.brightness>125&&a.color>500,l=3*(a.brightness/125)+a.color/500;(s&&!i||s&&i&&l>r||!s&&!i&&l>r)&&(i=s,r=l,n=b(e[o]))}return n};var w,k,x,O=b.names={aliceblue:'f0f8ff',antiquewhite:'faebd7',aqua:'0ff',aquamarine:'7fffd4',azure:'f0ffff',beige:'f5f5dc',bisque:'ffe4c4',black:'000',blanchedalmond:'ffebcd',blue:'00f',blueviolet:'8a2be2',brown:'a52a2a',burlywood:'deb887',burntsienna:'ea7e5d',cadetblue:'5f9ea0',chartreuse:'7fff00',chocolate:'d2691e',coral:'ff7f50',cornflowerblue:'6495ed',cornsilk:'fff8dc',crimson:'dc143c',cyan:'0ff',darkblue:'00008b',darkcyan:'008b8b',darkgoldenrod:'b8860b',darkgray:'a9a9a9',darkgreen:'006400',darkgrey:'a9a9a9',darkkhaki:'bdb76b',darkmagenta:'8b008b',darkolivegreen:'556b2f',darkorange:'ff8c00',darkorchid:'9932cc',darkred:'8b0000',darksalmon:'e9967a',darkseagreen:'8fbc8f',darkslateblue:'483d8b',darkslategray:'2f4f4f',darkslategrey:'2f4f4f',darkturquoise:'00ced1',darkviolet:'9400d3',deeppink:'ff1493',deepskyblue:'00bfff',dimgray:'696969',dimgrey:'696969',dodgerblue:'1e90ff',firebrick:'b22222',floralwhite:'fffaf0',forestgreen:'228b22',fuchsia:'f0f',gainsboro:'dcdcdc',ghostwhite:'f8f8ff',gold:'ffd700',goldenrod:'daa520',gray:'808080',green:'008000',greenyellow:'adff2f',grey:'808080',honeydew:'f0fff0',hotpink:'ff69b4',indianred:'cd5c5c',indigo:'4b0082',ivory:'fffff0',khaki:'f0e68c',lavender:'e6e6fa',lavenderblush:'fff0f5',lawngreen:'7cfc00',lemonchiffon:'fffacd',lightblue:'add8e6',lightcoral:'f08080',lightcyan:'e0ffff',lightgoldenrodyellow:'fafad2',lightgray:'d3d3d3',lightgreen:'90ee90',lightgrey:'d3d3d3',lightpink:'ffb6c1',lightsalmon:'ffa07a',lightseagreen:'20b2aa',lightskyblue:'87cefa',lightslategray:'789',lightslategrey:'789',lightsteelblue:'b0c4de',lightyellow:'ffffe0',lime:'0f0',limegreen:'32cd32',linen:'faf0e6',magenta:'f0f',maroon:'800000',mediumaquamarine:'66cdaa',mediumblue:'0000cd',mediumorchid:'ba55d3',mediumpurple:'9370db',mediumseagreen:'3cb371',mediumslateblue:'7b68ee',mediumspringgreen:'00fa9a',mediumturquoise:'48d1cc',mediumvioletred:'c71585',midnightblue:'191970',mintcream:'f5fffa',mistyrose:'ffe4e1',moccasin:'ffe4b5',navajowhite:'ffdead',navy:'000080',oldlace:'fdf5e6',olive:'808000',olivedrab:'6b8e23',orange:'ffa500',orangered:'ff4500',orchid:'da70d6',palegoldenrod:'eee8aa',palegreen:'98fb98',paleturquoise:'afeeee',palevioletred:'db7093',papayawhip:'ffefd5',peachpuff:'ffdab9',peru:'cd853f',pink:'ffc0cb',plum:'dda0dd',powderblue:'b0e0e6',purple:'800080',rebeccapurple:'663399',red:'f00',rosybrown:'bc8f8f',royalblue:'4169e1',saddlebrown:'8b4513',salmon:'fa8072',sandybrown:'f4a460',seagreen:'2e8b57',seashell:'fff5ee',sienna:'a0522d',silver:'c0c0c0',skyblue:'87ceeb',slateblue:'6a5acd',slategray:'708090',slategrey:'708090',snow:'fffafa',springgreen:'00ff7f',steelblue:'4682b4',tan:'d2b48c',teal:'008080',thistle:'d8bfd8',tomato:'ff6347',turquoise:'40e0d0',violet:'ee82ee',wheat:'f5deb3',white:'fff',whitesmoke:'f5f5f5',yellow:'ff0',yellowgreen:'9acd32'},C=b.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(O),S=(k='[\\s|\\(]+('+(w='(?:'+'[-\\+]?\\d*\\.\\d+%?'+')|(?:'+'[-\\+]?\\d+%?'+')')+')[,|\\s]+('+w+')[,|\\s]+('+w+')\\s*\\)?',x='[\\s|\\(]+('+w+')[,|\\s]+('+w+')[,|\\s]+('+w+')[,|\\s]+('+w+')\\s*\\)?',{rgb:new RegExp('rgb'+k),rgba:new RegExp('rgba'+x),hsl:new RegExp('hsl'+k),hsla:new RegExp('hsla'+x),hsv:new RegExp('hsv'+k),hsva:new RegExp('hsva'+x),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=b,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}function _(e,n,r,i){for(var a=[],s=0;s<e.length;s++){var l=e[s];if(l){var c=b(l),u=c.toHsl().l<.5?'sp-thumb-el sp-thumb-dark':'sp-thumb-el sp-thumb-light';u+=b.equals(n,l)?' sp-thumb-active':'';var f=c.toString(i.preferredFormat||'rgb'),h=o?'background-color:'+c.toRgbString():'filter:'+c.toFilter();a.push('<span title="'+f+'" data-color="'+c.toRgbString()+'" class="'+u+'"><span class="sp-thumb-inner" style="'+h+';"></span></span>')}else{a.push(t('<div />').append(t('<span data-color="" style="background-color:transparent;" class="'+'sp-clear-display'+'"></span>').attr('title',i.noColorSelectedText)).html())}}return"<div class='sp-cf "+r+"'>"+a.join('')+'</div>'}function P(l,c){var u,f,h,p,d=function(e,r){var i=t.extend({},n,e);return i.callbacks={move:j(i.move,r),change:j(i.change,r),show:j(i.show,r),hide:j(i.hide,r),beforeShow:j(i.beforeShow,r)},i}(c,l),g=d.flat,v=d.showSelectionPalette,m=d.localStorageKey,y=d.theme,w=d.callbacks,k=(u=Wt,f=10,function(){var t=this,e=arguments,n=function(){p=null,u.apply(t,e)};h&&clearTimeout(p),!h&&p||(p=setTimeout(n,f))}),x=!1,O=!1,C=!0,S=0,P=0,T=0,D=0,M=0,Z=0,L=0,N=0,I=0,F=0,V=1,B=[],H=[],z={},U=d.selectionPalette.slice(0),W=d.maxSelectionSize,$='sp-dragging',q=null,G=l.ownerDocument,K=(G.body,t(l)),Y=!1,X=t(s,G).addClass(y),J=X.find('.sp-picker-container'),Q=X.find('.sp-color'),tt=X.find('.sp-dragger'),et=X.find('.sp-hue'),nt=X.find('.sp-slider'),rt=X.find('.sp-alpha-inner'),it=X.find('.sp-alpha'),ot=X.find('.sp-alpha-handle'),at=X.find('.sp-input'),st=X.find('.sp-palette'),lt=X.find('.sp-initial'),ct=X.find('.sp-cancel'),ut=X.find('.sp-clear'),ft=X.find('.sp-choose'),ht=X.find('.sp-palette-toggle'),pt=K.is('input'),dt=pt&&'color'===K.attr('type')&&R(),gt=pt&&!g,vt=gt?t(a).addClass(y).addClass(d.className).addClass(d.replacerClassName):t([]),mt=gt?vt:K,yt=vt.find('.sp-preview-inner'),bt=d.color||pt&&K.val(),wt=!1,kt=d.preferredFormat,xt=!d.showButtons||d.clickoutFiresChange,Ot=!bt,Ct=d.allowEmpty&&!dt;function St(){if(d.showPaletteOnly&&(d.showPalette=!0),ht.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),d.palette){B=d.palette.slice(0),H=t.isArray(B[0])?B:[B],z={};for(var e=0;e<H.length;e++)for(var n=0;n<H[e].length;n++){var r=b(H[e][n]).toRgbString();z[r]=!0}}X.toggleClass('sp-flat',g),X.toggleClass('sp-input-disabled',!d.showInput),X.toggleClass('sp-alpha-enabled',d.showAlpha),X.toggleClass('sp-clear-enabled',Ct),X.toggleClass('sp-buttons-disabled',!d.showButtons),X.toggleClass('sp-palette-buttons-disabled',!d.togglePaletteOnly),X.toggleClass('sp-palette-disabled',!d.showPalette),X.toggleClass('sp-palette-only',d.showPaletteOnly),X.toggleClass('sp-initial-disabled',!d.showInitial),X.addClass(d.className).addClass(d.containerClassName),Wt()}function _t(){if(m&&window.localStorage){try{var e=window.localStorage[m].split(',#');e.length>1&&(delete window.localStorage[m],t.each(e,(function(t,e){Pt(e)})))}catch(t){}try{U=window.localStorage[m].split(';')}catch(t){}}}function Pt(e){if(v){var n=b(e).toRgbString();if(!z[n]&&-1===t.inArray(n,U))for(U.push(n);U.length>W;)U.shift();if(m&&window.localStorage)try{window.localStorage[m]=U.join(';')}catch(t){}}}function Tt(){var e=Vt(),n=t.map(H,(function(t,n){return _(t,e,'sp-palette-row sp-palette-row-'+n,d)}));_t(),U&&n.push(_(function(){var t=[];if(d.showPalette)for(var e=0;e<U.length;e++){var n=b(U[e]).toRgbString();z[n]||t.push(U[e])}return t.reverse().slice(0,d.maxSelectionSize)}(),e,'sp-palette-row sp-palette-row-selection',d)),st.html(n.join(''))}function Et(){if(d.showInitial){var t=wt,e=Vt();lt.html(_([t,e],e,'sp-palette-row-initial',d))}}function jt(){(P<=0||S<=0||D<=0)&&Wt(),O=!0,X.addClass($),q=null,K.trigger('dragstart.spectrum',[Vt()])}function At(){O=!1,X.removeClass($),K.trigger('dragstop.spectrum',[Vt()])}function Rt(){var t=at.val();if(null!==t&&''!==t||!Ct){var e=b(t);e.isValid()?(Ft(e),Ut(!0)):at.addClass('sp-validation-error')}else Ft(null),Ut(!0)}function Dt(){x?Nt():Mt()}function Mt(){var e=t.Event('beforeShow.spectrum');if(x)Wt();else if(K.trigger('beforeShow.spectrum',[Vt()]),!1!==w.beforeShow(Vt())&&!e.isDefaultPrevented()){!function(){for(var t=0;t<r.length;t++)r[t]&&r[t].hide()}(),x=!0;var n=t(G);n.bind('keydown.spectrum',Zt),n.bind('click.spectrum',Lt),t(window).bind('resize.spectrum',k),vt.addClass('sp-active'),X.removeClass('sp-hidden'),Wt(),Ht(),wt=Vt(),Et(),w.show(wt),K.trigger('show.spectrum',[wt])}}function Zt(t){27===t.keyCode&&Nt()}function Lt(t){2!=t.button&&(O||(xt?Ut(!0):It(),Nt()))}function Nt(){x&&!g&&(x=!1,t(G).unbind('keydown.spectrum',Zt),t(G).unbind('click.spectrum',Lt),t(window).unbind('resize.spectrum',k),vt.removeClass('sp-active'),X.addClass('sp-hidden'),w.hide(Vt()),K.trigger('hide.spectrum',[Vt()]))}function It(){Ft(wt,!0)}function Ft(t,e){var n,r;b.equals(t,Vt())?Ht():(!t&&Ct?Ot=!0:(Ot=!1,C=!t,r=(n=b(t)).toHsv(),N=r.h%360/360,I=r.s,F=r.v,V=r.a),Ht(),n&&n.isValid()&&!e&&(kt=d.preferredFormat||n.getFormat()))}function Vt(t){return t=t||{},Ct&&Ot?null:b.fromRatio({h:N,s:I,v:F,a:Math.round(100*V)/100},{format:t.format||kt})}function Bt(){Ht(),w.move(Vt()),K.trigger('move.spectrum',[Vt()])}function Ht(){at.removeClass('sp-validation-error'),zt();var t=b.fromRatio({h:N,s:1,v:1});Q.css('background-color',t.toHexString());var e=kt;V<1&&(0!==V||'name'!==e)&&('hex'!==e&&'hex3'!==e&&'hex6'!==e&&'name'!==e||(e='rgb'));var n=Vt({format:e}),r='';if(yt.removeClass('sp-clear-display'),yt.css('background-color','transparent'),!n&&Ct)yt.addClass('sp-clear-display');else{var a=n.toHexString(),s=n.toRgbString();if(o||1===n.alpha?yt.css('background-color',s):(yt.css('background-color','transparent'),yt.css('filter',n.toFilter())),d.showAlpha){var l=n.toRgb();l.a=0;var c=b(l).toRgbString(),u='linear-gradient(left, '+c+', '+a+')';i?rt.css('filter',b(c).toFilter({gradientType:1},a)):(rt.css('background','-webkit-'+u),rt.css('background','-moz-'+u),rt.css('background','-ms-'+u),rt.css('background','linear-gradient(to right, '+c+', '+a+')'))}r=n.toString(e)}d.showInput&&at.val(r),d.showPalette&&Tt(),Et()}function zt(){var t=I,e=F;if(Ct&&Ot)ot.hide(),nt.hide(),tt.hide();else{ot.show(),nt.show(),tt.show();var n=t*S,r=P-e*P;n=Math.max(-T,Math.min(S-T,n-T)),r=Math.max(-T,Math.min(P-T,r-T)),tt.css({top:r+'px',left:n+'px'});var i=V*M;ot.css({left:i-Z/2+'px'});var o=N*D;nt.css({top:o-L+'px'})}}function Ut(t){var e=Vt(),n='',r=!!C||!b.equals(e,wt);e&&(n=e.toString(kt),!x&&Pt(e)),pt&&K.val(n),t&&r&&(w.change(e),K.trigger('change',[e]))}function Wt(){x&&(S=Q.width(),P=Q.height(),T=tt.height(),et.width(),D=et.height(),L=nt.height(),M=it.width(),Z=ot.width(),g||(X.css('position','absolute'),d.offset?X.offset(d.offset):X.offset(function(e,n){var r=0,i=e.outerWidth(),o=e.outerHeight(),a=n.outerHeight(),s=e[0].ownerDocument,l=s.documentElement,c=l.clientWidth,u=l.clientHeight,f=t(s).scrollLeft(),h=t(s).scrollTop(),p=c+f,d=u+h,g=n.offset();return g.top+=a,g.left-=Math.min(g.left,g.left+i>p&&p>i?Math.abs(g.left+i-p):0),g.top-=Math.min(g.top,g.top+o>d&&d>o?Math.abs(o+a-r):r),g}(X,mt))),zt(),d.showPalette&&Tt(),K.trigger('reflow.spectrum'))}function $t(){Nt(),Y=!0,K.attr('disabled',!0),mt.addClass('sp-disabled')}!function(){if(i&&X.find('*:not(input)').attr('unselectable','on'),St(),gt&&K.after(vt).hide(),Ct||ut.hide(),g)K.after(X).hide();else{var e='parent'===d.appendTo?K.parent():t(d.appendTo);1!==e.length&&(e=t('body')),e.append(X)}function n(e){return e.data&&e.data.ignore?(Ft(t(e.target).closest('.sp-thumb-el').data('color')),Bt()):(Ft(t(e.target).closest('.sp-thumb-el').data('color')),Bt(),d.hideAfterPaletteSelect&&(Ut(!0),Nt())),!1}_t(),mt.bind('click.spectrum touchstart.spectrum',(function(e){Y||Dt(),e.stopPropagation(),t(e.target).is('input')||e.preventDefault()})),(K.is(':disabled')||!0===d.disabled)&&$t(),X.click(E),at.change(Rt),at.bind('paste',(function(){setTimeout(Rt,1)})),at.keydown((function(t){13==t.keyCode&&Rt()})),ct.text(d.cancelText),ct.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),It(),Nt()})),ut.attr('title',d.clearText),ut.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),Ot=!0,Bt(),g&&Ut(!0)})),ft.text(d.chooseText),ft.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),i&&at.is(':focus')&&at.trigger('change'),at.hasClass('sp-validation-error')||(Ut(!0),Nt())})),ht.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),ht.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),d.showPaletteOnly=!d.showPaletteOnly,d.showPaletteOnly||g||X.css('left','-='+(J.outerWidth(!0)+5)),St()})),A(it,(function(t,e,n){V=t/M,Ot=!1,n.shiftKey&&(V=Math.round(10*V)/10),Bt()}),jt,At),A(et,(function(t,e){N=parseFloat(e/D),Ot=!1,d.showAlpha||(V=1),Bt()}),jt,At),A(Q,(function(t,e,n){if(n.shiftKey){if(!q){var r=I*S,i=P-F*P,o=Math.abs(t-r)>Math.abs(e-i);q=o?'x':'y'}}else q=null;var a=!q||'y'===q;(!q||'x'===q)&&(I=parseFloat(t/S)),a&&(F=parseFloat((P-e)/P)),Ot=!1,d.showAlpha||(V=1),Bt()}),jt,At),bt?(Ft(bt),Ht(),kt=d.preferredFormat||b(bt).getFormat(),Pt(bt)):Ht(),g&&Mt();var r=i?'mousedown.spectrum':'click.spectrum touchstart.spectrum';st.delegate('.sp-thumb-el',r,n),lt.delegate('.sp-thumb-el:nth-child(1)',r,{ignore:!0},n)}();var qt={show:Mt,hide:Nt,toggle:Dt,reflow:Wt,option:function(n,r){return n===e?t.extend({},d):r===e?d[n]:(d[n]=r,'preferredFormat'===n&&(kt=d.preferredFormat),void St())},enable:function(){Y=!1,K.attr('disabled',!1),mt.removeClass('sp-disabled')},disable:$t,offset:function(t){d.offset=t,Wt()},set:function(t){Ft(t),Ut()},get:Vt,destroy:function(){K.show(),mt.unbind('click.spectrum touchstart.spectrum'),X.remove(),vt.remove(),r[qt.id]=null},container:X};return qt.id=r.push(qt)-1,qt}function T(){}function E(t){t.stopPropagation()}function j(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function A(e,n,r,o){n=n||function(){},r=r||function(){},o=o||function(){};var a=document,s=!1,l={},c=0,u=0,f='ontouchstart'in window,h={};function p(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function d(t){if(s){if(i&&a.documentMode<9&&!t.button)return g();var r=t&&t.touches&&t.touches[0],o=r&&r.pageX||t.pageX,h=r&&r.pageY||t.pageY,d=Math.max(0,Math.min(o-l.left,u)),v=Math.max(0,Math.min(h-l.top,c));f&&p(t),n.apply(e,[d,v,t])}}function g(){s&&(t(a).unbind(h),t(a.body).removeClass('sp-dragging'),setTimeout((function(){o.apply(e,arguments)}),0)),s=!1}h['selectstart']=p,h['dragstart']=p,h['touchmove mousemove']=d,h['touchend mouseup']=g,t(e).bind('touchstart mousedown',(function(n){var i=n.which?3==n.which:2==n.button;i||s||!1!==r.apply(e,arguments)&&(s=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(a).bind(h),t(a.body).addClass('sp-dragging'),d(n),p(n))}))}function R(){return t.fn.spectrum.inputTypeColorSupport()}function D(t,e,n){t=X(t,255),e=X(e,255),n=X(n,255);var r,i,o=m(t,e,n),a=v(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,l:s}}function M(t,e,n){t=X(t,255),e=X(e,255),n=X(n,255);var r,i,o=m(t,e,n),a=v(t,e,n),s=o,l=o-a;if(i=0===o?0:l/o,o==a)r=0;else{switch(o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,v:s}}function Z(t,e,n,r){var i=[tt(g(t).toString(16)),tt(g(e).toString(16)),tt(g(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join('')}function L(t,e,n,r){var i;return[tt((i=r,Math.round(255*parseFloat(i)).toString(16))),tt(g(t).toString(16)),tt(g(e).toString(16)),tt(g(n).toString(16))].join('')}function N(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.s-=e/100,n.s=J(n.s),b(n)}function I(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.s+=e/100,n.s=J(n.s),b(n)}function F(t){return b(t).desaturate(100)}function V(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.l+=e/100,n.l=J(n.l),b(n)}function B(t,e){e=0===e?0:e||10;var n=b(t).toRgb();return n.r=m(0,v(255,n.r-g(255*(-e/100)))),n.g=m(0,v(255,n.g-g(255*(-e/100)))),n.b=m(0,v(255,n.b-g(255*(-e/100)))),b(n)}function H(t,e){e=0===e?0:e||10;var n=b(t).toHsl();return n.l-=e/100,n.l=J(n.l),b(n)}function z(t,e){var n=b(t).toHsl(),r=(g(n.h)+e)%360;return n.h=r<0?360+r:r,b(n)}function U(t){var e=b(t).toHsl();return e.h=(e.h+180)%360,b(e)}function W(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+120)%360,s:e.s,l:e.l}),b({h:(n+240)%360,s:e.s,l:e.l})]}function $(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+90)%360,s:e.s,l:e.l}),b({h:(n+180)%360,s:e.s,l:e.l}),b({h:(n+270)%360,s:e.s,l:e.l})]}function q(t){var e=b(t).toHsl(),n=e.h;return[b(t),b({h:(n+72)%360,s:e.s,l:e.l}),b({h:(n+216)%360,s:e.s,l:e.l})]}function G(t,e,n){e=e||6,n=n||30;var r=b(t).toHsl(),i=360/n,o=[b(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(b(r));return o}function K(t,e){e=e||6;for(var n=b(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(b({h:r,s:i,v:o})),o=(o+s)%1;return a}function Y(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function X(t,e){(function(t){return'string'==typeof t&&-1!=t.indexOf('.')&&1===parseFloat(t)})(t)&&(t='100%');var n=function(t){return'string'==typeof t&&-1!=t.indexOf('%')}(t);return t=v(e,m(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),d.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function J(t){return v(1,m(0,t))}function Q(t){return parseInt(t,16)}function tt(t){return 1==t.length?'0'+t:''+t}function et(t){return t<=1&&(t=100*t+'%'),t}function nt(t){return Q(t)/255}}(y);var b=function(t){var e='name'===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,'')},w=function(t){(0,a.Z)(n,t);var e=m(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"template",value:function(){var t=this.ppfx;return"\n      <div class=\"".concat(this.holderClass(),"\"></div>\n      <div class=\"").concat(t,"field-colorp\">\n        <div class=\"").concat(t,"field-colorp-c\" data-colorp-c>\n          <div class=\"").concat(t,"checker-bg\"></div>\n        </div>\n      </div>\n    ")}},{key:"inputClass",value:function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")}},{key:"holderClass",value:function(){return"".concat(this.ppfx,"input-holder")}},{key:"remove",value:function(){d.Z.prototype.remove.apply(this,arguments),this.colorEl.spectrum('destroy')}},{key:"handleChange",value:function(t){t.stopPropagation();var e=t.target.value;(0,f.isUndefined)(e)||this.__onInputChange(e)}},{key:"__onInputChange",value:function(t){var e=this.model,n=this.opts.onChange,r=t,i=this.getColorEl();if(i){i.spectrum('set',r);var o=i.spectrum('get'),a=r&&b(o);a&&(r=a)}n?n(r):e.set({value:r},{fromInput:1})}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=(0,f.isUndefined)(e.def)?n.get('defaults'):e.def,i=(0,f.isUndefined)(t)?(0,f.isUndefined)(r)?'':r:t,o=this.getInputEl(),a=this.getColorEl(),s='none'!=i?i:'';o.value=i,a.get(0).style.backgroundColor=s,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(a.spectrum('set',s),this.noneColor='none'==i)}},{key:"getColorEl",value:function(){if(!this.colorEl){var t,e=this.em,n=this.model,r=this.opts,i=this,o=this.ppfx,a=r.onChange,s=y("<div class=\"".concat(this.ppfx,"field-color-picker\"></div>")),l=s.get(0).style,c=e&&e.config?e.config.el:'',u=e&&e.getConfig&&e.getConfig().colorPicker||{},f=!1,h='';this.$el.find('[data-colorp-c]').append(s);var p=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];a?a(t,!e):(e&&n.setValueFromInput(0,!1),n.setValueFromInput(t,e))};s.spectrum(v(v(v({color:n.getValue()||!1,containerClassName:"".concat(o,"one-bg ").concat(o,"two-color"),appendTo:c||'body',maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:'Ok',cancelText:'⨯',palette:[]},u),n.get('colorPicker')||{}),{},{move:function(t){var e=b(t);h=e,l.backgroundColor=e,p(e,!1)},change:function(t){f=!0;var e=b(t);l.backgroundColor=e,p(e),i.noneColor=0},show:function(e){f=!1,h='',t=a?n.getValue({noDefault:!0}):b(e)},hide:function(){f||!t&&!a||(i.noneColor&&(t=''),l.backgroundColor=t,s.spectrum('set',t),p(t,!1))}})),e&&e.on&&this.listenTo(e,'component:selected',(function(){h&&p(h),f=!0,h='',s.spectrum('hide')})),this.colorEl=s}return this.colorEl}},{key:"render",value:function(){return d.Z.prototype.render.call(this),this.getColorEl(),this}}]),n}(d.Z)},7610:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),f=n(9050),h=n(1163),p=n(8659);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}u().$;var g=function(t){(0,a.Z)(n,t);var e=d(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.Z)(this,n),t=e.call(this,i),(0,f.bindAll)((0,o.Z)(t),'moveIncrement','upIncrement'),t.doc=document,t.listenTo(t.model,'change:unit',t.handleModelChange),t}return(0,i.Z)(n,[{key:"template",value:function(){var t=this.ppfx;return"\n      <span class=\"".concat(t,"input-holder\"></span>\n      <span class=\"").concat(t,"field-units\"></span>\n      <div class=\"").concat(t,"field-arrows\" data-arrows>\n        <div class=\"").concat(t,"field-arrow-u\" data-arrow-up></div>\n        <div class=\"").concat(t,"field-arrow-d\" data-arrow-down></div>\n      </div>\n    ")}},{key:"inputClass",value:function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")}},{key:"setValue",value:function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),i={value:r.value};(r.unit||r.force)&&(i.unit=r.unit),this.model.set(i,n),n.silent&&this.handleModelChange()}},{key:"handleChange",value:function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()}},{key:"handleUnitChange",value:function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set('unit',e),this.elementUpdated()}},{key:"handleKeyDown",value:function(t){'ArrowUp'===t.key&&(t.preventDefault(),this.upArrowClick()),'ArrowDown'===t.key&&(t.preventDefault(),this.downArrowClick())}},{key:"elementUpdated",value:function(){this.model.trigger('el:change')}},{key:"handleModelChange",value:function(){var t=this.model;this.getInputEl().value=t.get('value');var e=this.getUnitEl();e&&(e.value=t.get('unit')||'')}},{key:"getUnitEl",value:function(){if(!this.unitEl){var t=this.model,e=t.get('units')||[];if(e.length){var n=['<option value="" disabled hidden>-</option>'];e.forEach((function(e){var r=e==t.get('unit')?'selected':'';n.push("<option ".concat(r,">").concat(e,"</option>"))}));var r=document.createElement('div');r.innerHTML="<select class=\"".concat(this.ppfx,"input-unit\">").concat(n.join(''),"</select>"),this.unitEl=r.firstChild}}return this.unitEl}},{key:"upArrowClick",value:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n+e)),this.elementUpdated()}},{key:"downArrowClick",value:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n-e)),this.elementUpdated()}},{key:"downIncrement",value:function(t){t.preventDefault(),this.moved=0;var e=this.model.get('value')||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,h.on)(this.doc,'mousemove',this.moveIncrement),(0,h.on)(this.doc,'mouseup',this.upIncrement)}},{key:"moveIncrement",value:function(t){this.moved=1;var e=this.model,n=e.get('step'),r=this.current,i=this.normalizeValue(r.val+(r.y-t.pageY)*n),o=this.validateInputValue(i),a=o.value,s=o.unit;return this.prValue=a,e.set({value:a,unit:s},{avoidStore:1}),!1}},{key:"upIncrement",value:function(){var t=this.model,e=t.get('step');if((0,h.off)(this.doc,'mouseup',this.upIncrement),(0,h.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()}}},{key:"normalizeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model,r=n.get('step'),i=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var o=r.toString().split('.')[1];i=o?o.length:0}return i?parseFloat(t.toFixed(i)):t}},{key:"validateInputValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=e||{},i=this.model,o='',a=(0,f.isUndefined)(t)?o:t,s=e.units||i.get('units')||[],l=i.get('unit')||s.length&&s[0]||'',c=(0,f.isUndefined)(e.max)?i.get('max'):e.max,u=(0,f.isUndefined)(e.min)?i.get('min'):e.min,h=!!i.get('limitlessMax'),p=!!i.get('limitlessMin');if(r.deepCheck){var d=i.get('fixedValues')||[];if(''===a&&(l=''),a){var g=new RegExp('^'+d.join('|'),'g');if(d.length&&g.test(a))a=a.match(g)[0],l='',n=1;else{var v=a+'';a+='',a=parseFloat(a.replace(',','.')),a=isNaN(a)?o:a;var m=v.replace(a,'');(0,f.indexOf)(s,m)>=0&&(l=m)}}}return h||(0,f.isUndefined)(c)||''===c||(a=a>c?c:a),p||(0,f.isUndefined)(u)||''===u||(a=a<u?u:a),{force:n,value:a,unit:l}}},{key:"render",value:function(){p.Z.prototype.render.call(this),this.unitEl=null;var t=this.getUnitEl();return t&&this.$el.find(".".concat(this.ppfx,"field-units")).get(0).appendChild(t),this}}]),n}(p.Z);g.prototype.events={'change input':'handleChange','change select':'handleUnitChange','click [data-arrow-up]':'upArrowClick','click [data-arrow-down]':'downArrowClick','mousedown [data-arrows]':'downIncrement',keydown:'handleKeyDown'}},6602:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(4942),u=n(9050),f=n(2316),h=n.n(f);function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var d=function(t){(0,a.Z)(n,t);var e=p(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.Z)(this,n),t=e.call(this,i),(0,c.Z)((0,o.Z)(t),"itemsView",''),(0,c.Z)((0,o.Z)(t),"itemType",'type'),(0,c.Z)((0,o.Z)(t),"reuseView",!1),t.config=a||i.config||{},s&&t.listenTo(t.collection,'add',t.addTo),t.items=[],t}return(0,i.Z)(n,[{key:"addTo",value:function(t){this.add(t)}},{key:"itemViewNotFound",value:function(t){var e=this.config,n=this.ns,r=e.em,i="".concat(n?"[".concat(n,"]: "):'',"'").concat(t,"' type not found");r&&r.logWarning(i)}},{key:"add",value:function(t,e){var n,r=this.config,i=this.reuseView,o=this.items,a=this.itemsView,s=void 0===a?{}:a,l=e||null,c=this.itemView,f=t.get(this.itemType);s[f]?c=s[f]:!f||s[f]||(0,u.includes)(['button','checkbox','color','date','datetime-local','email','file','hidden','image','month','number','password','radio','range','reset','search','submit','tel','text','time','url','week'],f)||this.itemViewNotFound(f),n=t.view&&i?t.view:new c({model:t,config:r},r),o&&o.push(n);var h=n.render().el;l?l.appendChild(h):this.$el.append(h)}},{key:"render",value:function(){var t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(e){this.add(e,t)}),this),this.$el.append(t),this.onRender(),this}},{key:"onRender",value:function(){}},{key:"onRemoveBefore",value:function(){}},{key:"onRemove",value:function(){}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.items;this.onRemoveBefore(e,t),this.clearItems(),h().View.prototype.remove.apply(this,arguments),this.onRemove(e,t)}},{key:"clearItems",value:function(){this.items}}]),n}(h().View);d.prototype.itemView=''},4836:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>h});var r=n(5671),i=n(3144),o=n(4942),a=n(9050),s=n(1163),l={placeholder:'eg. Text here'};const c={locale:'en',localeFallback:'en',detectLocale:!0,debug:!1,messages:{en:{assetManager:{addButton:'Add image',inputPlh:'http://path/to/the/image.jpg',modalTitle:'Select Image',uploadTitle:'Drop files here or click to upload'},blockManager:{labels:{},categories:{}},domComponents:{names:{'':'Box',wrapper:'Body',text:'Text',comment:'Comment',image:'Image',video:'Video',label:'Label',link:'Link',map:'Map',tfoot:'Table foot',tbody:'Table body',thead:'Table head',table:'Table',row:'Table row',cell:'Table cell'}},deviceManager:{device:'Device',devices:{desktop:'Desktop',tablet:'Tablet',mobileLandscape:'Mobile Landscape',mobilePortrait:'Mobile Portrait'}},panels:{buttons:{titles:{preview:'Preview',fullscreen:'Fullscreen','sw-visibility':'View components','export-template':'View code','open-sm':'Open Style Manager','open-tm':'Settings','open-layers':'Open Layer Manager','open-blocks':'Open Blocks'}}},selectorManager:{label:'Classes',selected:'Selected',emptyState:'- State -',states:{hover:'Hover',active:'Click','nth-of-type(2n)':'Even/Odd'}},styleManager:{empty:'Select an element before using Style Manager',layer:'Layer',fileButton:'Images',sectors:{general:'General',layout:'Layout',typography:'Typography',decorations:'Decorations',extra:'Extra',flex:'Flex',dimension:'Dimension'},properties:{'text-shadow-h':'X','text-shadow-v':'Y','text-shadow-blur':'Blur','text-shadow-color':'Color','box-shadow-h':'X','box-shadow-v':'Y','box-shadow-blur':'Blur','box-shadow-spread':'Spread','box-shadow-color':'Color','box-shadow-type':'Type','margin-top-sub':'Top','margin-right-sub':'Right','margin-bottom-sub':'Bottom','margin-left-sub':'Left','padding-top-sub':'Top','padding-right-sub':'Right','padding-bottom-sub':'Bottom','padding-left-sub':'Left','border-width-sub':'Width','border-style-sub':'Style','border-color-sub':'Color','border-top-left-radius-sub':'Top Left','border-top-right-radius-sub':'Top Right','border-bottom-right-radius-sub':'Bottom Right','border-bottom-left-radius-sub':'Bottom Left','transform-rotate-x':'Rotate X','transform-rotate-y':'Rotate Y','transform-rotate-z':'Rotate Z','transform-scale-x':'Scale X','transform-scale-y':'Scale Y','transform-scale-z':'Scale Z','transition-property-sub':'Property','transition-duration-sub':'Duration','transition-timing-function-sub':'Timing','background-image-sub':'Image','background-repeat-sub':'Repeat','background-position-sub':'Position','background-attachment-sub':'Attachment','background-size-sub':'Size'}},traitManager:{empty:'Select an element before using Trait Manager',label:'Component settings',traits:{labels:{},attributes:{id:l,alt:l,title:l,href:{placeholder:'eg. https://google.com'}},options:{target:{false:'This window',_blank:'New window'}}}},storageManager:{recover:'Do you want to recover unsaved changes?'}}},messagesAdd:null};function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h=function(){function t(){(0,r.Z)(this,t),(0,o.Z)(this,"name",'I18n')}return(0,i.Z)(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=f(f(f({},c),t),{},{messages:f(f({},c.messages),t.messages||{})});var e=this.config.messagesAdd;return e&&this.addMessages(e),this.config.detectLocale&&(this.config.locale=this._localLang()),this.em=t.em,this}},{key:"getConfig",value:function(){return this.config}},{key:"setLocale",value:function(t){var e=this.em,n=this.config,r={value:t,valuePrev:n.locale};return e&&e.trigger('i18n:locale',r),n.locale=t,this}},{key:"getLocale",value:function(){return this.config.locale}},{key:"getMessages",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config.messages;return t&&!n[t]&&this._debug("'".concat(t,"' i18n lang not found"),e),t?n[t]:n}},{key:"setMessages",value:function(t){var e=this.em;return this.config.messages=t,e&&e.trigger('i18n:update',t),this}},{key:"addMessages",value:function(t){var e=this.em,n=this.config.messages;return e&&e.trigger('i18n:add',t),this.setMessages((0,s.deepMerge)(n,t)),this}},{key:"t",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config,r=e.params||{},i=e.l||this.getLocale(),o=e.lFlb||n.localeFallback,s=this._getMsg(t,i,e);return s||(s=this._getMsg(t,o,e)),!s&&this._debug("'".concat(t,"' i18n key not found in '").concat(i,"' lang"),e),s=s&&(0,a.isString)(s)?this._addParams(s,r):s}},{key:"_localLang",value:function(){var t=(0,s.hasWin)()&&window.navigator||{},e=t.language||t.userLanguage;return e?e.split('-')[0]:'en'}},{key:"_addParams",value:function(t,e){var n=new RegExp('{([\\w\\d-]*)}','g');return t.replace(n,(function(t,n){return e[n]||''})).trim()}},{key:"_getMsg",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getMessages(e,n);if(r){var i=r[t];return!i&&t.indexOf('.')>0&&(i=t.split('.').reduce((function(t,e){if(!(0,a.isUndefined)(t))return t[e]}),r)),i}}},{key:"_debug",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.config;(e.debug||r.debug)&&n&&n.logWarning(t)}},{key:"destroy",value:function(){this.config={},this.em={}}}]),t}()},9788:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>E});var r,i=n(1002),o=n(4942),a=n(9050),s=n(1163),l={},c={16:!1,18:!1,17:!1,91:!1},u='all',f={'⇧':16,shift:16,'⌥':18,alt:18,option:18,'⌃':17,ctrl:17,control:17,'⌘':91,command:91},h={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},p=function(t){return h[t]||t.toUpperCase().charCodeAt(0)},d=[];for(r=1;r<20;r++)h['f'+r]=111+r;function g(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function v(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var m={16:'shiftKey',18:'altKey',17:'ctrlKey',91:'metaKey'};function y(t){for(r in c)c[r]=t[m[r]]}function b(t){var e,n=t.keyCode,r=g(d,n);if(r>=0&&d.splice(r,1),93!=n&&224!=n||(n=91),n in c)for(e in c[n]=!1,f)f[e]==n&&(k[e]=!1)}function w(){for(r in c)c[r]=!1;for(r in f)k[r]=!1}function k(t,e,n){var r,i;r=O(t),void 0===n&&(n=e,e='all');for(var o=0;o<r.length;o++)i=[],(t=r[o].split('+')).length>1&&(i=C(t),t=[t[t.length-1]]),t=t[0],(t=p(t))in l||(l[t]=[]),l[t].push({shortcut:r[o],scope:e,method:n,key:r[o],mods:i})}for(r in f)k[r]=!1;function x(){return u||'all'}function O(t){var e;return''==(e=(t=t.replace(/\s/g,'')).split(','))[e.length-1]&&(e[e.length-2]+=','),e}function C(t){for(var e=t.slice(0,t.length-1),n=0;n<e.length;n++)e[n]=f[e[n]];return e}function S(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent('on'+e,(function(){n(window.event)}))}k.setScope=function(t){u=t||'all'},k.getScope=x,k.deleteScope=function(t){var e,n,r;for(e in l)for(n=l[e],r=0;r<n.length;)n[r].scope===t?n.splice(r,1):r++},k.filter=function(t){var e=(t.target||t.srcElement).tagName;return!('INPUT'==e||'SELECT'==e||'TEXTAREA'==e)},k.isPressed=function(t){return'string'==typeof t&&(t=p(t)),-1!=g(d,t)},k.getPressedKeyCodes=function(){return d.slice(0)},k.unbind=function(t,e){var n,r,i,o,a,s=[];for(n=O(t),o=0;o<n.length;o++){if((r=n[o].split('+')).length>1&&(s=C(r)),t=r[r.length-1],t=p(t),void 0===e&&(e=x()),!l[t])return;for(i=0;i<l[t].length;i++)(a=l[t][i]).scope===e&&v(a.mods,s)&&(l[t][i]={})}},k.handlers=l,k.init=function(t){S(t.document,'keydown',(function(t){!function(t){var e,n,r,i,o,a;if(e=t.keyCode,-1==g(d,e)&&d.push(e),93!=e&&224!=e||(e=91),e in c)for(r in c[e]=!0,f)f[r]==e&&(k[r]=!0);else if(y(t),k.filter.call(this,t)&&e in l)for(a=x(),i=0;i<l[e].length;i++)if((n=l[e][i]).scope==a||'all'==n.scope){for(r in o=n.mods.length>0,c)(!c[r]&&g(n.mods,+r)>-1||c[r]&&-1==g(n.mods,+r))&&(o=!1);(0!=n.mods.length||c[16]||c[18]||c[17]||c[91])&&!o||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)})),S(t.document,'keyup',b),S(t,'focus',w)};const _=k;function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function T(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}(0,s.hasWin)()&&_.init(window);const E=function(){var t={defaults:{'core:undo':{keys:'⌘+z, ctrl+z',handler:'core:undo'},'core:redo':{keys:'⌘+shift+z, ctrl+shift+z',handler:'core:redo'},'core:copy':{keys:'⌘+c, ctrl+c',handler:'core:copy'},'core:paste':{keys:'⌘+v, ctrl+v',handler:'core:paste'},'core:component-next':{keys:'s',handler:'core:component-next'},'core:component-prev':{keys:'w',handler:'core:component-prev'},'core:component-enter':{keys:'d',handler:'core:component-enter'},'core:component-exit':{keys:'a',handler:'core:component-exit'},'core:component-delete':{keys:'backspace, delete',handler:'core:component-delete',opts:{prevent:1}}}};return{keymaster:_,name:'Keymaps',getConfig:function(){return this.config},init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.config=T(T({},t),e),this.em=this.config.em,this.keymaps={},this},onLoad:function(){var t=this.config.defaults;for(var e in t){var n=t[e];this.add(e,n.keys,n.handler,n.opts||{})}},add:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=this.em,s=o.get('Commands'),l=o.getEditor(),c=o.get('Canvas'),u={id:t,keys:e,handler:n},f=this.keymaps[t];return f&&this.remove(t),this.keymaps[t]=u,_(e,(function(e,u){var f={event:e,h:u};if(n=(0,a.isString)(n)?s.get(n):n,!o.isEditing()&&!l.Canvas.isInputFocused()||r.force){r.prevent&&c.getCanvasView().preventDefault(e),'object'==(0,i.Z)(n)?s.runCommand(n,f):n(l,0,f);var h=[t,u.shortcut,e];o.trigger.apply(o,['keymap:emit'].concat(h)),o.trigger.apply(o,["keymap:emit:".concat(t)].concat(h))}})),o.trigger('keymap:add',u),u},get:function(t){return this.keymaps[t]},getAll:function(){return this.keymaps},remove:function(t){var e=this.em,n=this.get(t);if(n)return delete this.keymaps[t],n.keys.split(', ').forEach((function(t){return _.unbind(t.trim())})),e&&e.trigger('keymap:remove',n),n},removeAll:function(){var t=this;return Object.keys(this.keymaps).forEach((function(e){return t.remove(e)})),_.handlers={},this},destroy:function(){this.removeAll(),this.keymaps={},this.em={}}}}},4424:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>w});var r=n(4942);const i={textTags:['br','b','i','u','a','ul','ol'],parserCss:null,parserHtml:null,optionsHtml:{htmlType:null,allowScripts:!1,allowUnsafeAttr:!1}};var o=n(9050),a={4:'media',5:'font-face',6:'page',7:'keyframes',11:'counter-style',12:'supports',13:'document',14:'font-feature-values',15:'viewport'},s=(0,o.keys)(a),l=['5','6','11','15'],c=['font-face','page','counter-style','viewport'],u=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=[],n=[],r=t.split(','),i=0,o=r.length;i<o;i++){var a=r[i].trim();if(/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(a)||/^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(a)){var s=a.split('.').filter(Boolean);n.push(s)}else e.push(a)}return{result:n,add:e}},f=function(t){for(var e=t.style,n={},r=0,i=e.length;r<i;r++){var o=e[r],a=e.getPropertyValue(o),s=e.getPropertyPriority(o);n[o]="".concat(a).concat(s?" !".concat(s):'')}return n},h=function(t){return(t.conditionText||t.media&&t.media.mediaText||t.name||t.selectorText||'').trim()},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=t.length,o=t[i-1],a=o?o.split(/:(.+)/):[],s=a[1],l=n.atRule,u=n.selectorsAdd,f=n.mediaText,h=c.indexOf(l)>=0;return h&&(r.singleAtRule=1),l&&(r.atRuleType=l),u&&(r.selectorsAdd=u),f&&(r.mediaText=f),s&&(t[i-1]=a[0],r.state=s,a.splice(a.length-1,1)),r.selectors=t,r.style=e,r},d=function t(e){for(var n=[],r=e.cssRules||[],i=0,o=r.length;i<o;i++){var c=r[i],d=c.type.toString(),g=0,v='',m='',y=c.selectorText||c.keyText,b=l.indexOf(d)>=0;if(b)g=1,v=a[d],m=h(c);else if(s.indexOf(d)>=0){var w=t(c);m=h(c);for(var k=0,x=w.length;k<x;k++){var O=w[k];m&&(O.mediaText=m),O.atRuleType=a[d]}n=n.concat(w)}if(y||b){for(var C=f(c),S=u(y),_=S.add,P=void 0,T=0,E=(y=S.result).length;T<E;T++){var j=p(y[T],C,{atRule:a[d]});n.push(j),P=j}if(_.length){var A=_.join(', ');if(P)P.selectorsAdd=A;else{var R={selectors:[],selectorsAdd:A,style:C};g&&(R.singleAtRule=g),v&&(R.atRuleType=v),m&&(R.mediaText=m),n.push(R)}}}}return n};const g=function(t){var e=document.createElement('style');e.innerHTML=t,document.head.appendChild(e);var n=e.sheet;return document.head.removeChild(e),d(n)},v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{parse:function(e){var n=this,r=[],i=t.parserCss,o=t.em,a=o&&o.get&&o.get('Editor');return(i?i(e,a):g(e)).forEach((function(t){return r=r.concat(n.checkNode(t))})),o&&o.trigger('parse:css',{input:e,output:r}),r},checkNode:function(t){var e=t,n=e.selectors,r=e.style;if((0,o.isString)(n)){var i=[],a=u(n),s=a.result,l=a.add.join(', '),c={atRule:t.atRule,mediaText:t.params};if(s.length?s.forEach((function(t){i.push(p(t,r,c))})):i.push(p([],r,c)),l)i[i.length-1].selectorsAdd=l;t=i}return t}}};var m=n(5311);function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const w=function(){var t,e,n={};return{compTypes:'',parserCss:null,parserHtml:null,name:'Parser',init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(n=b(b({},i),r)).Parser=this,t=new m.Z(n),e=new v(n),this.em=n.em,this.parserCss=e,this.parserHtml=t,this},getConfig:function(){return n},parseHtml:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,o=this.compTypes;return t.compTypes=i?i.get('DomComponents').getTypes():o,t.parse(n,e,r)},parseCss:function(t){return e.parse(t)},destroy:function(){var r=this;[n,t,e].forEach((function(t){return{}})),['em','parserCss','parserHtml'].forEach((function(t){return r[t]={}}))}}}},5311:(t,e,n)=>{"use strict";n.d(e,{Z:()=>f});var r=n(4942),i=n(1002),o=n(9050),a='text/html',s=a;const l=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new DOMParser,i=n.htmlType||s,l=i===a,c=l?t:"<div>".concat(t,"</div>"),u=r.parseFromString(c,i);if(l){var f=u.head,h=u.body,p=f.querySelectorAll('script');(0,o.each)(p,(function(t){return h.appendChild(t)}));var d=[];(0,o.each)(f.children,(function(t){return d.push(t)})),(0,o.each)(d,(function(t,e){return h.insertBefore(t,h.children[e])})),e=h}else e=u.firstChild;return e};function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const f=function(t){var e=t,n='data-gjs-',r='parse:html';return{compTypes:'',modelAttrStart:n,splitPropsFromAttr:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={},i={};return(0,o.each)(e,(function(e,a){if(0===a.indexOf(t.modelAttrStart)){var s=a.replace(n,''),l=e.length,c=e&&(0,o.isString)(e),u=c&&e.substr(0,1),f=c&&e.substr(l-1);e='false'!==(e='true'===e||e)&&e;try{e='{'==u&&'}'==f||'['==u&&']'==f?JSON.parse(e):e}catch(t){}r[s]=e}else i[a]=e})),{props:r,attrs:i}},parseStyle:function(t){for(var e={},n=t.split(';'),r=0,i=n.length;r<i;r++){var o=n[r].trim();if(o){var a=o.split(':');e[a[0].trim()]=a.slice(1).join(':').trim()}}return e},parseClass:function(t){for(var e=[],n=t.split(' '),r=0,i=n.length;r<i;r++){var o=n[r].trim();o&&e.push(o)}return e},parseNode:function(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=[],s=r.childNodes,l=0,c=s.length;l<c;l++){var f=s[l],h=f.attributes||[],p=h.length,d=a[a.length-1],g=f.childNodes.length,v=this.compTypes,m={};if(v){var y='',b=f.getAttribute&&f.getAttribute("".concat(n,"type"));if(b)m={type:b};else{for(var w=0;w<v.length;w++){var k=v[w];if(y=k.model.isComponent(f,o)){'object'!==(0,i.Z)(y)&&(y={type:k.id});break}}m=y}}if(!m.tagName){var x=f.tagName||'',O=f.namespaceURI||'';m.tagName=x&&'http://www.w3.org/1999/xhtml'===O?x.toLowerCase():x}p&&(m.attributes={});for(var C=0;C<p;C++){var S=h[C].nodeName,_=h[C].nodeValue;if('style'==S)m.style=this.parseStyle(_);else if('class'==S)m.classes=this.parseClass(_);else{if('contenteditable'==S)continue;if(0===S.indexOf(n)){var P=S.replace(n,''),T=_.length,E=_&&_.substr(0,1),j=_&&_.substr(T-1);_='false'!==(_='true'===_||_)&&_;try{_='{'==E&&'}'==j||'['==E&&']'==j?JSON.parse(_):_}catch(t){}m[P]=_}else''===_&&!0===f[S]&&(_=!0),m.attributes[S]=_}}if(g&&!m.components){var A=f.childNodes[0];1===g&&3===A.nodeType?(!m.type&&(m.type='text'),m.components={type:'textnode',content:A.nodeValue}):m.components=this.parseNode(f,u(u({},o),{},{inSvg:o.inSvg||'svg'===m.type}))}if('textnode'==m.type){if(d&&'textnode'==d.type){d.content+=m.content;continue}if(!t.keepEmptyTextNodes){var R=f.nodeValue;if(' '!=R&&!R.trim())continue}}g||'/>'!=="".concat(f.outerHTML).slice(-2)||(m.void=!0);var D=m.components;if(!m.type&&D){for(var M=1,Z=0,L=0;L<D.length;L++){var N=D[L],I=N.type;if(['text','textnode'].indexOf(I)<0&&e.textTags.indexOf(N.tagName)<0){M=0;break}'textnode'==I&&(Z=1)}M&&Z&&(m.type='text')}(m.tagName||'textnode'==m.type)&&a.push(m)}return a},parse:function(n,i){var a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=e.em,f=c&&c.get('Config')||{},h={html:null,css:null},p=u(u({},t),s),d=u(u({},t.optionsHtml),{},{htmlType:(null===(a=t.optionsHtml)||void 0===a?void 0:a.htmlType)||t.htmlType},s),g=(0,o.isFunction)(p.parserHtml)?p.parserHtml(n,d):l(n,d),v=g.querySelectorAll('script'),m=v.length,y=(0,o.isUndefined)(f.allowScripts)?d.allowScripts:f.allowScripts;if(!y)for(;m--;)v[m].parentNode.removeChild(v[m]);if(d.allowUnsafeAttr||this.__clearUnsafeAttr(g),i){for(var b=g.querySelectorAll('style'),w=b.length,k='';w--;)k=b[w].innerHTML+k,b[w].parentNode.removeChild(b[w]);k&&(h.css=i.parse(k))}c&&c.trigger("".concat(r,":root"),{input:n,root:g});var x=this.parseNode(g,p),O=1!==x.length||e.returnArray?x:x[0];return h.html=O,c&&c.trigger(r,{input:n,output:h}),h},__clearUnsafeAttr:function(t){var e=this,n=t.attributes||[],r=t.childNodes||[],i=[];(0,o.each)(n,(function(t){var e=t.nodeName||'';0===e.indexOf('on')&&i.push(e)})),i.map((function(e){return t.removeAttribute(e)})),(0,o.each)(r,(function(t){return e.__clearUnsafeAttr(t)}))}}}},2012:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>_});var r=n(5861),i=n(2982),o=n(4942),a=n(4687),s=n.n(a),l=n(1163),c=n(5671),u=n(3144),f=n(9050);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d='_rte',g=1,v=0,m=-1,y=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'A',n=t.selection(),r=n.anchorNode,i=n.focusNode,o=null==r?void 0:r.parentNode,a=null==i?void 0:i.parentNode;return(null==o?void 0:o.nodeName)==e||(null==a?void 0:a.nodeName)==e},b='data-selectme',w={bold:{name:'bold',icon:'<b>B</b>',attributes:{title:'Bold'},result:function(t){return t.exec('bold')}},italic:{name:'italic',icon:'<i>I</i>',attributes:{title:'Italic'},result:function(t){return t.exec('italic')}},underline:{name:'underline',icon:'<u>U</u>',attributes:{title:'Underline'},result:function(t){return t.exec('underline')}},strikethrough:{name:'strikethrough',icon:'<s>S</s>',attributes:{title:'Strike-through'},result:function(t){return t.exec('strikeThrough')}},link:{icon:"<svg viewBox=\"0 0 24 24\">\n          <path fill=\"currentColor\" d=\"M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z\" />\n        </svg>",name:'link',attributes:{style:'font-size:1.4rem;padding:0 4px 2px;',title:'Link'},state:function(t){return t&&t.selection()&&y(t)?g:v},result:function(t){y(t)?t.exec('unlink'):t.insertHTML("<a href=\"\" ".concat(b,">").concat(t.selection(),"</a>"),{select:!0})}},wrap:{name:'wrap',icon:"<svg viewBox=\"0 0 24 24\">\n            <path fill=\"currentColor\" d=\"M20.71,4.63L19.37,3.29C19,2.9 18.35,2.9 17.96,3.29L9,12.25L11.75,15L20.71,6.04C21.1,5.65 21.1,5 20.71,4.63M7,14A3,3 0 0,0 4,17C4,18.31 2.84,19 2,19C2.92,20.22 4.5,21 6,21A4,4 0 0,0 10,17A3,3 0 0,0 7,14Z\" />\n        </svg>",attributes:{title:'Wrap for style'},state:function(t){return null!=t&&t.selection()&&y(t,'SPAN')?m:v},result:function(t){!y(t,'SPAN')&&t.insertHTML("<span ".concat(b,">").concat(t.selection(),"</span>"),{select:!0})}}},k=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,c.Z)(this,t);var r=n.el,i=n.em;if(this.em=i,r[d])return r[d];r[d]=this,this.setEl(r),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var o=(n.actions||[]).map((function(t){var e=t;return'string'==typeof t?e=p({},w[t]):w[t.name]&&(e=p(p({},w[t.name]),t)),e})),a=o.length?o:Object.keys(w).map((function(t){return w[t]}));n.classes=p(p({},{actionbar:'actionbar',button:'action',active:'active',disabled:'disabled',inactive:'inactive'}),n.classes);var s=n.classes,l=n.actionbar;if(this.actionbar=l,this.settings=n,this.classes=s,this.actions=a,!l){var u=n.actionbarContainer;(l=document.createElement('div')).className=s.actionbar,u.appendChild(l),this.actionbar=l,a.forEach((function(t){return e.addAction(t)}))}return n.styleWithCSS&&this.exec('styleWithCSS'),this}return(0,u.Z)(t,[{key:"destroy",value:function(){this.el=0,this.doc=0,this.actionbar=0,this.settings={},this.classes={},this.actions=[]}},{key:"setEl",value:function(t){this.el=t,this.doc=t.ownerDocument}},{key:"updateActiveActions",value:function(){var t=this;this.getActions().forEach((function(e){var n=e.btn,r=e.update,i=p({},t.classes),o=i.active,a=i.inactive,s=i.disabled,l=e.state,c=e.name,u=t.doc;if(n.className=n.className.replace(o,'').trim(),n.className=n.className.replace(a,'').trim(),n.className=n.className.replace(s,'').trim(),l)switch(l(t,u)){case g:n.className+=" ".concat(o);break;case v:n.className+=" ".concat(a);break;case m:n.className+=" ".concat(s)}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(n.className+=" ".concat(o));r&&r(t,e)}))}},{key:"enable",value:function(t){return this.enabled?this:this.__toggleEffects(!0,t)}},{key:"disable",value:function(){return this.__toggleEffects(!1)}},{key:"__toggleEffects",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t?l.on:l.off,r=this.el,i=this.doc;if(this.actionbarEl().style.display=t?'':'none',r.contentEditable=!!t,n(r,'mouseup keyup',this.updateActiveActions),n(i,'keydown',this.__onKeydown),n(i,'paste',this.__onPaste),this.enabled=t,t){var o=e.event;if(this.syncActions(),this.updateActiveActions(),o){var a=null;if(i.caretRangeFromPoint){var s=(0,l.getPointerEvent)(o);a=i.caretRangeFromPoint(s.clientX,s.clientY)}else o.rangeParent&&(a=i.createRange()).setStart(o.rangeParent,o.rangeOffset);var c=i.getSelection();c.removeAllRanges(),a&&c.addRange(a)}r.focus()}return this}},{key:"__onKeydown",value:function(t){var e=this.doc;'Enter'!==t.key||['insertOrderedList','insertUnorderedList'].some((function(t){return e.queryCommandState(t)}))||(e.execCommand('insertLineBreak'),t.preventDefault())}},{key:"__onPaste",value:function(t){var e=t.clipboardData||window.clipboardData,n=e.getData('text'),r=e.getData('text/html');if(n&&!r){t.preventDefault();var i=n.replace(/(?:\r\n|\r|\n)/g,'<br/>');this.doc.execCommand('insertHTML',!1,i)}}},{key:"syncActions",value:function(){var t=this;this.getActions().forEach((function(e){if(t.actionbar&&(!e.state||e.state&&e.state(t,t.doc)>=0)){var n=e.event||'click';e.btn["on".concat(n)]=function(n){e.result(t,e),t.updateActiveActions()}}}))}},{key:"addAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.sync,r=document.createElement('span'),i=t.icon,o=t.attributes||{};for(var a in r.className=this.classes.button,t.btn=r,o)r.setAttribute(a,o[a]);'string'==typeof i?r.innerHTML=i:r.appendChild(i),this.actionbarEl().appendChild(r),n&&(this.actions.push(t),this.syncActions())}},{key:"getActions",value:function(){return this.actions}},{key:"selection",value:function(){return this.doc.getSelection()}},{key:"exec",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.doc.execCommand(t,!1,e)}},{key:"actionbarEl",value:function(){return this.actionbar}},{key:"insertHTML",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.select,r=this.em,i=this.doc,o=this.el,a=i.getSelection();if(a&&a.rangeCount){var s=(0,l.getModel)(o),c=i.createElement('div'),u=a.getRangeAt(0);u.deleteContents(),(0,f.isString)(t)?c.innerHTML=t:t&&c.appendChild(t),Array.prototype.slice.call(c.childNodes).forEach((function(t){u.insertNode(t)})),a.removeAllRanges(),a.addRange(u),o.focus(),n&&s&&(s.once('rte:disable',(function(){var t=s.find("[".concat(b,"]"))[0];t&&(r.setSelected(t),t.removeAttributes(b))})),s.trigger('disable'))}}}]),t}();const x={stylePrefix:'rte-',adjustToolbar:1,actions:['bold','italic','underline','strikethrough','link','wrap']};function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S='change:canvasOffset frame:scroll component:update';const _=function(){var t,e=function(){var e=t.style,n='-1000px';e.top=n,e.left=n,e.display='none'};return{customRte:null,name:'RichTextEditor',getConfig:function(){return this.config},init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=C(C({},x),e),r=n.pStylePrefix;return r&&(n.stylePrefix=r+n.stylePrefix),this.config=n,this.pfx=n.stylePrefix,this.em=n.em,this.actions=n.actions||[],(0,l.hasWin)()?((t=document.createElement('div')).className="".concat(r,"rte-toolbar ").concat(r,"one-bg"),this.initRte(document.createElement('div')),(0,l.on)(t,'mousedown',(function(t){return t.stopPropagation()})),this):this},destroy:function(){var e,n,r,i=this;null===(e=this.globalRte)||void 0===e||e.destroy(),null===(n=this.customRte)||void 0===n||null===(r=n.destroy)||void 0===r||r.call(n),t=0,['actionbar','actions','em','config','globalRte','lastEl'].map((function(t){delete i[t]}))},postRender:function(n){var r=n.model.get('Canvas');t.style.pointerEvents='all',e(),r.getToolsEl().appendChild(t)},initRte:function(e){var n=this.globalRte,r=this.em,o=this.pfx,a=this.actionbar,s=this.config,l=t,c=this.actions||(0,i.Z)(s.actions),u={actionbar:"".concat(o,"actionbar"),button:"".concat(o,"action"),active:"".concat(o,"active"),inactive:"".concat(o,"inactive"),disabled:"".concat(o,"disabled")};return n?(n.em=r,n.setEl(e)):(n=new k({em:r,el:e,classes:u,actions:c,actionbar:a,actionbarContainer:l}),this.globalRte=n),n.actionbar&&(this.actionbar=n.actionbar),n.actions&&(this.actions=n.actions),n},add:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.name=t,null===(e=this.globalRte)||void 0===e||e.addAction(n,{sync:1})},get:function(t){var e,n;return null===(e=this.globalRte)||void 0===e||e.getActions().forEach((function(e){e.name==t&&(n=e)})),n},getAll:function(){var t;return null===(t=this.globalRte)||void 0===t?void 0:t.getActions()},remove:function(t){var e=this.getAll(),n=this.get(t);if(n){var r=n.btn,i=e.indexOf(n);r.parentNode.removeChild(r),e.splice(i,1)}return n},getToolbarEl:function(){return t},updatePosition:function(){var e='px',n=this.em.get('Canvas'),r=t.style,i=n.getTargetToElementFixed(this.lastEl,t,{event:'rteToolbarPosUpdate',left:0});r.top=(i.top||0)+e,r.left=(i.left||0)+e},enable:function(e,n,i){var o=this;return(0,r.Z)(s().mark((function r(){var a,l,c,u;return s().wrap((function(r){for(;1;)switch(r.prev=r.next){case 0:return o.lastEl=e.el,a=o.customRte,l=o.em,c=e.getChildrenContainer(),t.style.display='',r.next=6,a?a.enable(c,n):o.initRte(c).enable(i);case 6:return u=r.sent,l&&(setTimeout(o.updatePosition.bind(o),0),l.off(S,o.updatePosition,o),l.on(S,o.updatePosition,o),l.trigger('rte:enable',e,u)),r.abrupt("return",u);case 9:case"end":return r.stop()}}),r)})))()},disable:function(t,n){var r=this.em,i=this.customRte,o=t.getChildrenContainer();i?i.disable(o,n):n&&n.disable(),e(),r&&(r.off(S,this.updatePosition,this),r.trigger('rte:disable',t,n))}}}},4859:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>A});var r=n(5861),i=n(5671),o=n(3144),a=n(7326),s=n(9340),l=n(2963),c=n(1120),u=n(4942),f=n(4687),h=n.n(f),p=n(9714);const d={id:'gjs-',type:'local',autosave:!0,autoload:!0,recovery:!1,stepsBeforeSave:1,onStore:function(t){return t},onLoad:function(t){return t},options:{local:{key:'gjsProject',checkLocal:!0},remote:{headers:{},urlStore:'',urlLoad:'',contentTypeJson:!0,fetchOptions:'',credentials:'include',onStore:function(t){return t},onLoad:function(t){return t}}}};var g=n(1163),v=function(){function t(){(0,i.Z)(this,t)}var e,n;return(0,o.Z)(t,[{key:"store",value:(n=(0,r.Z)(h().mark((function t(e){var n,r=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:n=r.length>1&&void 0!==r[1]?r[1]:{},this.hasLocal(n,!0)&&localStorage.setItem(n.key,JSON.stringify(e));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"load",value:(e=(0,r.Z)(h().mark((function t(){var e,n,r=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n={},this.hasLocal(e,!0)&&(n=JSON.parse(localStorage.getItem(e.key)||'{}')),t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"hasLocal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(t.checkLocal&&(!(0,g.hasWin)()||!localStorage)){if(e)throw new Error('localStorage not available');return!1}return!0}}]),t}(),m=n(9050),y=n(9661);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){(0,u.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var k=function(){function t(){(0,i.Z)(this,t)}var e,n;return(0,o.Z)(t,[{key:"store",value:(n=(0,r.Z)(h().mark((function t(e){var n,r=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.request(n.urlStore,this.__props(n,e),n);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"load",value:(e=(0,r.Z)(h().mark((function t(e){return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return t.next=2,this.request(e.urlLoad,this.__props(e),e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"request",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,y.Z)(t,e).then((function(t){var e=t.text();return 1==(t.status/200|0)?e:e.then(Promise.reject)})).then((function(t){var e=t&&(0,m.isString)(t);return n.contentTypeJson&&e?JSON.parse(t):t}))}},{key:"__props",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=e.contentTypeJson,i=e.headers||{},o=e.fetchOptions||{},a='X-Requested-With',s='Content-Type';if((0,m.isUndefined)(i[a])&&(i[a]='XMLHttpRequest'),(0,m.isUndefined)(i[s])&&r&&(i[s]='application/json; charset=utf-8'),n)if(r)t=JSON.stringify(n);else for(var l in t=new FormData,n)t.append(l,n[l]);var c={method:t?'POST':'GET',credentials:e.credentials,headers:i,body:t};return w(w({},c),(0,m.isFunction)(o)?o(c):o)}}]),t}();function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){(0,u.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.Z)(t);if(e){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.Z)(this,n)}}var S='storage:start',_='storage:after',P='storage:end',T='storage:error',E='local',j='remote',A=function(t){(0,s.Z)(f,t);var e,n,l,c=C(f);function f(){var t;(0,i.Z)(this,f);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t=c.call.apply(c,[this].concat(n)),(0,u.Z)((0,a.Z)(t),"name",'StorageManager'),t}return(0,o.Z)(f,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__initConfig(d,t);var e=this.getConfig();return e._disable&&(e.type=0),this.storages={},this.add(E,new v(e)),this.add(j,new k(e)),this.setCurrent(e.type),this}},{key:"isAutosave",value:function(){return!!this.getConfig().autosave}},{key:"setAutosave",value:function(t){return this.getConfig().autosave=!!t,this}},{key:"getStepsBeforeSave",value:function(){return this.getConfig().stepsBeforeSave}},{key:"setStepsBeforeSave",value:function(t){return this.getConfig().stepsBeforeSave=t,this}},{key:"add",value:function(t,e){return this.storages[t]=e,this}},{key:"get",value:function(t){return this.storages[t]||null}},{key:"getStorages",value:function(){return this.storages}},{key:"getCurrent",value:function(){return this.getConfig().currentStorage}},{key:"setCurrent",value:function(t){return this.getConfig().currentStorage=t,this}},{key:"getCurrentStorage",value:function(){return this.get(this.getCurrent())}},{key:"getStorageOptions",value:function(t){return this.getCurrentOptions(t)}},{key:"store",value:(l=(0,r.Z)(h().mark((function t(e){var n,r,i,o,a,s=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=this.getCurrentStorage(),i=O(O({},this.getCurrentOptions()),n),o=this.getRecoveryStorage(),a=this.getCurrentOptions(E),t.prev=5,t.next=8,this.__exec(r,i,e);case 8:if(t.t0=o,!t.t0){t.next=12;break}return t.next=12,this.__exec(o,a,{});case 12:case 19:t.next=22;break;case 14:if(t.prev=14,t.t1=t["catch"](5),!o){t.next=21;break}return t.next=19,this.__exec(o,a,e);case 21:throw t.t1;case 22:return t.abrupt("return",e);case 23:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t){return l.apply(this,arguments)})},{key:"load",value:(n=(0,r.Z)(h().mark((function t(){var e,n,r,i,o,a,s=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:{},n=this.getCurrentStorage(),r=O(O({},this.getCurrentOptions()),e),!(i=this.getRecoveryStorage())){t.next=17;break}return t.next=7,this.__exec(i,this.getCurrentOptions(E));case 7:if(a=t.sent,(0,m.isEmpty)(a)){t.next=17;break}return t.prev=9,t.next=12,this.__askRecovery();case 12:o=a,t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](9);case 17:if(o){t.next=21;break}return t.next=20,this.__exec(n,r);case 20:o=t.sent;case 21:return t.abrupt("return",o||{});case 22:case"end":return t.stop()}}),t,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"__askRecovery",value:function(){var t=this.em,e=this.getRecovery();return new Promise((function(n,r){(0,m.isFunction)(e)?e(n,r,null==t?void 0:t.getEditor()):confirm(null==t?void 0:t.t('storageManager.recover'))?n():r()}))}},{key:"getRecovery",value:function(){return this.getConfig().recovery}},{key:"getRecoveryStorage",value:function(){return this.getRecovery()&&this.getCurrent()===j&&this.get(E)}},{key:"__exec",value:(e=(0,r.Z)(h().mark((function t(e,n,r){var i,o,a,s,l,c,u,f;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(i=r?'store':'load',o=this.getConfig(),a=o.onStore,s=o.onLoad,this.onStart(i,r),e){t.next=5;break}return t.abrupt("return",r||{});case 5:if(t.prev=5,u=null===(c=this.em)||void 0===c?void 0:c.getEditor(),!r){t.next=31;break}if(t.t1=a,!t.t1){t.next=13;break}return t.next=12,a(r,u);case 12:t.t1=t.sent;case 13:if(t.t0=t.t1,t.t0){t.next=16;break}t.t0=r;case 16:if(f=t.t0,t.t3=n.onStore,!t.t3){t.next=22;break}return t.next=21,n.onStore(f,u);case 21:t.t3=t.sent;case 22:if(t.t2=t.t3,t.t2){t.next=25;break}t.t2=f;case 25:return f=t.t2,t.next=28,e.store(f,n);case 28:l=r,t.next=53;break;case 31:return t.next=33,e.load(n);case 33:if(l=t.sent,l=this.__clearKeys(l),t.t5=n.onLoad,!t.t5){t.next=40;break}return t.next=39,n.onLoad(l,u);case 39:t.t5=t.sent;case 40:if(t.t4=t.t5,t.t4){t.next=43;break}t.t4=l;case 43:if(l=t.t4,t.t7=s,!t.t7){t.next=49;break}return t.next=48,s(l,u);case 48:t.t7=t.sent;case 49:if(t.t6=t.t7,t.t6){t.next=52;break}t.t6=l;case 52:l=t.t6;case 53:this.onAfter(i,l),this.onEnd(i,l),t.next=61;break;case 57:throw t.prev=57,t.t8=t["catch"](5),this.onError(i,t.t8),t.t8;case 61:return t.abrupt("return",l);case 62:case"end":return t.stop()}}),t,this,[[5,57]])}))),function(t,n,r){return e.apply(this,arguments)})},{key:"__clearKeys",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getConfig(),n=new RegExp("^".concat(e.id)),r={};for(var i in t){var o=i.replace(n,'');r[o]=t[i]}return r}},{key:"getCurrentOptions",value:function(t){var e=this.getConfig(),n=t||this.getCurrent();return e.options[n]||{}}},{key:"onStart",value:function(t,e){var n=this.em;n&&(n.trigger(S),t&&n.trigger("".concat(S,":").concat(t),e))}},{key:"onAfter",value:function(t,e){var n=this.em;n&&(n.trigger(_),n.trigger("".concat(_,":").concat(t),e),n.trigger("storage:".concat(t),e))}},{key:"onEnd",value:function(t,e){var n=this.em;n&&(n.trigger(P),t&&n.trigger("".concat(P,":").concat(t),e))}},{key:"onError",value:function(t,e){var n=this.em;n&&(n.trigger(T,e),t&&n.trigger("".concat(T,":").concat(t),e),this.onEnd(t,e))}},{key:"canAutoload",value:function(){return this.getCurrentStorage()&&this.getConfig().autoload}},{key:"destroy",value:function(){this.__destroy(),this.storages={}}}]),f}(p.Z)},2326:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>Pe,evAll:()=>pe,evCustom:()=>Se,evLayerSelect:()=>Oe,evPfx:()=>de,evProp:()=>be,evPropAdd:()=>we,evPropRemove:()=>ke,evPropUp:()=>xe,evSector:()=>ge,evSectorAdd:()=>ve,evSectorRemove:()=>me,evSectorUpdate:()=>ye,evTarget:()=>Ce});var r=n(2982),i=n(4942),o=n(9050),a=n(1163),s=n(9304),l=n(2316),c=n.n(l);const u={sectors:[{name:'General',open:!1,properties:['display','float','position','top','right','left','bottom']},{name:'Flex',open:!1,properties:['flex-direction','flex-wrap','justify-content','align-items','align-content','order','flex-basis','flex-grow','flex-shrink','align-self']},{name:'Dimension',open:!1,properties:['width','height','max-width','min-height','margin','padding']},{name:'Typography',open:!1,properties:['font-family','font-size','font-weight','letter-spacing','color','line-height','text-align','text-shadow']},{name:'Decorations',open:!1,properties:['background-color','border-radius','border','box-shadow','background']},{name:'Extra',open:!1,properties:['opacity','transition','transform']}],appendTo:'',stylePrefix:'sm-',custom:!1,hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:!0,avoidComputed:['width','height']};var f=n(4925),h=n(5671),p=n(3144),d=n(9340),g=n(2963),v=n(1120),m=n(793),y=["partial"];function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var x=function(t){(0,d.Z)(n,t);var e=k(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em;var r=this.get('id')||'',i=this.get('name')||this.get('label')||'';!this.get('property')&&this.set('property',(i||r).replace(/ /g,'-'));var o=this.get('property');!this.get('id')&&this.set('id',o),!i&&this.set('name',(0,a.capitalize)(o).replace(/-/g,' ')),this.on('change',this.__upTargets),n.callInit(this,t,e)}},{key:"__getParentProp",value:function(){var t,e;return null===(t=this.collection)||void 0===t||null===(e=t.opts)||void 0===e?void 0:e.parentProp}},{key:"__upTargets",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,a=i.get('StyleManager'),s=this.getName(),l=n.__clear,c=l?'':this.__getFullValue(n),u=this.__getParentProp(),f=this.changedAttributes(),h=(0,o.keys)(f).reduce((function(t,n){return t[n]=e.previous(n),t}),{}),p=[].concat((0,r.Z)((0,o.keys)(this.__getClearProps())),['__p']),d=(0,o.keys)(f),g=!n.__up&&!u&&(l||p.some((function(t){return d.indexOf(t)>=0}))),v=this.get('onChange'),m={property:this,from:h,to:f,value:c,opts:n};a.__trgEv(a.events.propertyUpdate,m),v&&v(m),g&&this.__upTargetsStyle({[s]:c},n)}},{key:"__upTargetsStyle",value:function(t,e){var n,r=null===(n=this.em)||void 0===n?void 0:n.get('StyleManager');null==r||r.addStyleTargets(w(w({},t),{},{__p:!!e.avoidStore}),e)}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.noTarget&&(e.__up=!0);var n=e.partial,r=(0,f.Z)(e,y);return t.__p=!(!r.avoidStore&&!n),this.set(t,w(w({},r),{},{avoidStore:t.__p}))}},{key:"up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.set(t,w(w({},e),{},{__up:!0}))}},{key:"init",value:function(){}},{key:"getId",value:function(){return this.get('id')}},{key:"getType",value:function(){return this.get('type')}},{key:"getName",value:function(){return this.get('property')}},{key:"getLabel",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.locale,r=void 0===n||n,i=this.getId(),o=this.get('name')||this.get('label');return r&&(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.properties.".concat(i)))||o}},{key:"getValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noDefault,n=this.get('value');return this.hasValue()||e?n:this.getDefaultValue()}},{key:"hasValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noParent,n=e&&this.getParentTarget(),r=this.get('value');return!(0,o.isUndefined)(r)&&''!==r&&!n}},{key:"hasValueParent",value:function(){return this.hasValue()&&!this.hasValue({noParent:!0})}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=t.camelCase?(0,a.camelCase)(e):e;return{[n]:this.__getFullValue(t)}}},{key:"getDefaultValue",value:function(){var t=this.get('default');return"".concat((0,o.isUndefined)(t)?this.get('defaults'):t)}},{key:"upValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null===t||''===t?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)}},{key:"isVisible",value:function(){return!!this.get('visible')}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._up(this.__getClearProps(),w(w({},t),{},{__clear:!0}))}},{key:"canClear",value:function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})}},{key:"getParent",value:function(){return this.__getParentProp()||null}},{key:"isFull",value:function(){return!!this.get('full')}},{key:"__parseValue",value:function(t,e){return this.parseValue(t,e)}},{key:"__getClearProps",value:function(){return{value:''}}},{key:"setValue",value: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),i=!e;!i&&this.set({value:void 0},{avoidStore:i,silent:!0}),this.set(r,w({avoidStore:i},n))}},{key:"setValueFromInput",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,w(w({},n),{},{fromInput:1}))}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:t},r='!important';if((0,o.isString)(t)&&-1!==t.indexOf(r)&&(n.value=t.replace(r,'').trim(),n.important=1),!this.get('functionName')&&!e.complete)return n;var i=[],a="".concat(n.value),s=a.indexOf('(')+1,l=a.lastIndexOf(')'),c=a.substring(0,s-1);if(c&&(n.functionName=c),i.push(s),l>=0&&i.push(l),n.value=String.prototype.substring.apply(a,i),e.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,''),n.value=u}return n}},{key:"__getFullValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()}},{key:"getFullValue",value:function(t){var e=this.get('functionName'),n=this.getDefaultValue(),r=(0,o.isUndefined)(t)?this.get('value'):t,i=!(0,o.isUndefined)(r)&&''!==r;if(r&&n&&r===n)return n;if(e&&i){var a='url'===e?"'".concat(r.replace(/'|"/g,''),"'"):r;r="".concat(e,"(").concat(a,")")}return i&&this.get('important')&&(r="".concat(r," !important")),r||''}},{key:"__setParentTarget",value:function(t){this.up({parentTarget:t})}},{key:"getParentTarget",value:function(){return this.get('parentTarget')||null}},{key:"__parseFn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=t.indexOf('(')+1,n=t.lastIndexOf(')');return{name:t.substring(0,e-1).trim(),value:String.prototype.substring.apply(t,[e,n>=0?n:void 0]).trim()}}},{key:"__checkVisibility",value:function(t){var e=t.target,n=t.component,r=t.sectors,i=n||e;if(!i)return!1;var s=this.getId(),l=this.getName(),c=this.get('toRequire'),u=this.get('requires'),f=this.get('requiresParent'),h=i.get('unstylable'),p=i.get('stylable-require'),d=i.get('stylable');if((0,o.isArray)(d)&&(d=d.indexOf(l)>=0),(0,o.isArray)(h)&&(d=h.indexOf(l)<0),c&&(d=!e||p&&(p.indexOf(s)>=0||p.indexOf(l)>=0)),r&&u){var g=(0,o.keys)(u);r.forEach((function(t){t.getProperties().forEach((function(t){if((0,o.includes)(g,t.id)){var e=u[t.id];d=d&&(0,o.includes)(e,t.get('value'))}}))}))}if(f){var v=n&&n.parent(),m=v&&v.getEl();if(m){var y=(0,a.hasWin)()?window.getComputedStyle(m):{};(0,o.each)(f,(function(t,e){d=d&&y[e]&&(0,o.includes)(t,y[e])}))}else d=!1}return!!d}}]),n}(l.Model);function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}x.callParentInit=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.prototype.initialize.apply(e,[n,w(w({},r),{},{skipInit:1})])},x.callInit=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&t.init(e,n)},x.getDefaults=function(){return(0,o.result)(this.prototype,'defaults')},x.prototype.defaults={name:'',property:'',type:'',defaults:'',info:'',value:'',icon:'',functionName:'',status:'',visible:!0,fixedValues:['initial','inherit'],onChange:null,full:0,important:0,toRequire:0,requires:null,requiresParent:null,parentTarget:null};var _=function(t){return'integer'===t||'number'===t},P=function(t){(0,d.Z)(n,t);var e=S(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return C(C({},x.getDefaults()),{},{detached:!1,properties:[],separator:' ',join:null,fromStyle:null,toStyle:null,full:!0})}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x.callParentInit(x,this,t,e);var n=this.em,r=new Ht(this.get('properties')||[],{em:n,parentProp:this});this.set('properties',r,{silent:1}),this.listenTo(r,'change',this.__upProperties),x.callInit(this,t,e)}},{key:"getProperties",value:function(){return(0,r.Z)(this.get('properties').models)}},{key:"getProperty",value:function(t){return this.get('properties').filter((function(e){return e.getId()===t||e.getName()===t}))[0]||null}},{key:"getPropertyAt",value:function(t){return this.get('properties').at(t)}},{key:"isDetached",value:function(){return!!this.get('detached')}},{key:"getValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.byName;return this.getProperties().reduce((function(t,n){return t[e?n.getName():n.getId()]="".concat(n.__getFullValue()),t}),{})}},{key:"getSeparator",value:function(){return this.getSplitSeparator()}},{key:"getJoin",value:function(){return this.__getJoin()}},{key:"getStyleFromProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=this.__getJoin(),r=this.get('toStyle'),i=this.getValues(),o={};if(r)o=r(i,{join:n,name:e,property:this});else if(i=this.getValues({byName:!0}),this.isDetached())o=i;else{var a=this.getProperties().map((function(t){return t.__getFullValue({withDefault:1})})).filter(Boolean).join(n);o={[e]:a}}return this.isDetached()?o[e]='':(o[e]=o[e]||'',o=C(C({},o),this.getProperties().reduce((function(t,e){return t[e.getName()]='',t}),{}))),t.camelCase?Object.keys(o).reduce((function(t,e){return t[camelCase(e)]=o[e],t}),{}):o}},{key:"getSplitSeparator",value:function(){return new RegExp("".concat(this.get('separator'),"(?![^\\(]*\\))"))}},{key:"__upProperties",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.__up&&!e.__clearIn){var n=this.__getParentProp();if(n)return n.__upProperties(this,e);this.__upTargetsStyleProps(e,t)}}},{key:"__upTargetsStyleProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=this.getStyleFromProps();if(this.isDetached()&&e){var r=e.getName();n={[r]:n[r]}}this.__upTargetsStyle(n,t)}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__setProperties(this.__getSplitValue(t.value),e),x.prototype._up.call(this,t,e)}},{key:"getStyle",value:function(t){return this.getStyleFromProps(t)}},{key:"__getFullValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isDetached()||t.__clear?'':this.getStyleFromProps()[this.getName()]||''}},{key:"__getJoin",value:function(){var t=this.get('join');return(0,o.isString)(t)?t:this.get('separator')}},{key:"__styleHasProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=this.getProperties(),i=n.map((function(t){return t.getName()})),a=[e].concat((0,r.Z)(i));return a.some((function(e){return!(0,o.isUndefined)(t[e])&&''!==t[e]}))}},{key:"__splitValue",value:function(t,e){return t.split(e).map((function(t){return t.trim()})).filter(Boolean)}},{key:"__splitStyleName",value:function(t,e,n){return this.__splitValue(t[e]||'',n)}},{key:"__getSplitValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.byName,r=this.getProperties(),i=4===r.length&&r.every((function(t){return _(t.getType())})),a=this.__splitValue(t,this.getSplitSeparator()),s={};return r.forEach((function(t,e){var r=a[e],l=(0,o.isUndefined)(r)?'':r;if(i){var c=a.length;l=a[e]||a[e%c+(1!=c&&c%2?1:0)]||l}var u=n?t.getName():t.getId();s[u]=l||''})),s}},{key:"__getPropsFromStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.__styleHasProps(t))return null;var n=e.byName,r=this.getName(),i=this.getProperties(),a=this.getSplitSeparator(),s=this.get('fromStyle'),l=s?s(t,{property:this,name:r,separator:a}):{};return s||(l=this.__getSplitValue(t[r]||'',{byName:n}),i.forEach((function(e){var r=t[e.getName()],i=n?e.getName():e.getId();(0,o.isUndefined)(r)||''===r||(l[i]=r)}))),l}},{key:"__setProperties",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.getProperties().forEach((function(n){var r=t[n.getId()];n.__getFullValue()!==r&&n.upValue(r,e)}));var n=(0,o.keys)(t).map((function(e){return t[e]})).join(' ');this.set('value',n,{silent:!0})}},{key:"clear",value:function(){var t=this;return this.getProperties().map((function(e){return e.clear({__clearIn:!t.isDetached()})})),x.prototype.clear.call(this)}},{key:"hasValue",value:function(t){return this.getProperties().some((function(e){return e.hasValue(t)}))}},{key:"getFullValue",value:function(){return this.__getFullValue()}},{key:"__canClearProp",value:function(t){return this.isDetached()&&t.hasValue({noParent:!0})}}]),n}(x);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function j(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var A=function(t){(0,d.Z)(n,t);var e=j(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return{values:{}}}},{key:"initialize",value:function(){var t=this.collection;this.prop=null==t?void 0:t.prop}},{key:"getId",value:function(){return this.cid}},{key:"getIndex",value:function(){var t=this.collection;return t?t.indexOf(this):-1}},{key:"getValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('values');return t.camelCase?Object.keys(e).reduce((function(t,n){return t[(0,a.camelCase)(n)]=e[n],t}),{}):e}},{key:"getLabel",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.getLayerLabel(this)}},{key:"isSelected",value:function(){var t;return(null===(t=this.prop)||void 0===t?void 0:t.getSelectedLayer())===this}},{key:"select",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.selectLayer(this)}},{key:"remove",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.removeLayer(this)}},{key:"move",value:function(t){var e;return null===(e=this.prop)||void 0===e?void 0:e.moveLayer(this,t)}},{key:"getStylePreview",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null===(t=this.prop)||void 0===t?void 0:t.getStylePreview(this,e)}},{key:"hasPreview",value:function(){var t;return!(null===(t=this.prop)||void 0===t||!t.get('preview'))}},{key:"upValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set('values',E(E({},this.getValues()),t))}}]),n}(l.Model);function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var D=function(t){(0,d.Z)(n,t);var e=R(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prop=e.prop}}]),n}(l.Collection);D.prototype.model=A;var M=["__layers"];function Z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function L(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function N(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var I=/,(?![^\(]*\))/,F=/\s(?![^(]*\))/,V=function(t){(0,d.Z)(n,t);var e=N(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return L(L({},P.getDefaults()),{},{layers:[],layerSeparator:', ',layerJoin:'',prepend:0,preview:!1,layerLabel:null,selectedLayer:null})}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};P.callParentInit(P,this,t,e);var n=this.get('layers'),r=new D(n,{prop:this});r.property=this,r.properties=this.get('properties'),this.set('layers',r,{silent:!0}),this.on('change:selectedLayer',this.__upSelected),this.listenTo(r,'add remove',this.__upLayers),P.callInit(this,t,e)}},{key:"getLayers",value:function(){return this.__getLayers().models}},{key:"__getLayers",value:function(){return this.get('layers')}},{key:"getLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.__getLayers().at(t)||null}},{key:"getSelectedLayer",value:function(){var t=this.get('selectedLayer');return t&&t.getIndex()>=0?t:null}},{key:"selectLayer",value:function(t){return this.set('selectedLayer',t,{__select:!0})}},{key:"selectLayerAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getLayer(t);return e&&this.selectLayer(e)}},{key:"moveLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t?t.getIndex():-1;n>=0&&(0,o.isNumber)(e)&&e>=0&&e<this.getLayers().length&&n!==e&&(this.removeLayer(t),this.__getLayers().add(t,{at:e}))}},{key:"addLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};this.getProperties().forEach((function(e){var r=e.getId(),i=t[r];n[r]=(0,o.isUndefined)(i)?e.getDefaultValue():i}));var r=this.get('layers').push({values:n},e);return r}},{key:"removeLayer",value:function(t){return this.get('layers').remove(t)}},{key:"removeLayerAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getLayer(t);return e?this.removeLayer(e):null}},{key:"getLayerLabel",value:function(t){var e='';if(t){var n=this.get('layerLabel'),r=t.getValues(),i=t.getIndex();if(n)e=n(t,{index:i,values:r,property:this});else{var o=[];this.getProperties().map((function(t){o.push(r[t.getId()])})),e=o.filter(Boolean).join(' ')}}return e}},{key:"getStyleFromLayer",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.__getJoin(),i=this.__getJoinLayers(),s=this.get('toStyle'),l=this.getName(),c=t.getValues();if(s)e=s(c,{join:r,joinLayers:i,name:l,layer:t,property:this});else{var u=this.getProperties().map((function(t){var e=t.getName(),r=c[t.getId()],i=(0,o.isUndefined)(r)?t.getDefaultValue():r;if(n.number&&_(t.getType())){var a=t.parseValue(r,n.number);i="".concat(a.value).concat(a.unit)}return{name:e,value:i}}));e=this.isDetached()?u.reduce((function(t,e){return t[e.name]=e.value,t}),{}):{[this.getName()]:u.map((function(t){return t.value})).join(r)}}return n.camelCase?Object.keys(e).reduce((function(t,n){return t[(0,a.camelCase)(n)]=e[n],t}),{}):e}},{key:"getStylePreview",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=this.get('preview');return r&&(n=this.getStyleFromLayer(t,e)),n}},{key:"getLayerSeparator",value:function(){var t=this.get('layerSeparator');return(0,o.isString)(t)?new RegExp("".concat(t,"(?![^\\(]*\\))")):t}},{key:"__upProperties",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getSelectedLayer();n&&(n.upValues({[t.getId()]:t.__getFullValue()}),e.__up||this.__upTargetsStyleProps(e))}},{key:"__upLayers",value:function(t,e,n){this.__upTargetsStyleProps(n||e)}},{key:"__upTargets",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.__select)return x.prototype.__upTargets.call(this,t,e)}},{key:"__upTargetsStyleProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__upTargetsStyle(this.getStyleFromLayers(),t)}},{key:"__upTargetsStyle",value:function(t,e){return x.prototype.__upTargetsStyle.call(this,t,e)}},{key:"__upSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noEvent,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em.get('StyleManager'),i=this.getSelectedLayer(),o=null==i?void 0:i.getValues();o&&this.getProperties().forEach((function(t){var e,r=null!==(e=o[t.getId()])&&void 0!==e?e:'';t.__getFullValue()!==r&&t.upValue(r,L(L({},n),{},{__up:!0}))})),!e&&r.__trgEv(r.events.layerSelect,{property:this})}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.__layers,r=void 0===n?[]:n,i=(0,f.Z)(t,M);return!this.isDetached()&&this.__setLayers(r),this.__upSelected({noEvent:!0},e),x.prototype._up.call(this,i,e)}},{key:"__setLayers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.__getLayers(),n=t.map((function(t){return{values:t}}));e.length===n.length?n.map((function(t,n){var r;return null===(r=e.at(n))||void 0===r?void 0:r.upValues(t.values)})):this.__getLayers().reset(n),this.__upSelected({noEvent:!0})}},{key:"__parseValue",value:function(t){var e=this,n=this.parseValue(t);return n.__layers=t.split(I).map((function(t){return t.trim()})).map((function(t){return e.__parseLayer(t)})).filter(Boolean),n}},{key:"__parseLayer",value:function(t){var e=this.get('parseLayer'),n=t.split(F),r=this.getProperties();return e?e({value:t,values:n}):r.reduce((function(t,e,r){var i=n[r];return t[e.getId()]=(0,o.isUndefined)(i)?e.getDefaultValue():i,t}),{})}},{key:"__getLayersFromStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.__styleHasProps(e))return null;var n=this.getName(),r=this.getProperties(),i=this.getLayerSeparator(),a=this.get('fromStyle'),s=a?a(e,{property:this,name:n,separatorLayers:i}):[];if(!a){var l=this.__splitStyleName(e,n,i).map((function(e){return e.split(t.getSplitSeparator())})).map((function(t){var e={};return r.forEach((function(n,r){var i=t[r];e[n.getId()]=(0,o.isUndefined)(i)?n.getDefaultValue():i})),e}));r.forEach((function(n){var r=n.getId();t.__splitStyleName(e,n.getName(),i).map((function(t){return{[r]:t||n.getDefaultValue()}})).forEach((function(t,e){l[e]=l[e]?L(L({},l[e]),t):t}))})),s=l}return(0,o.isArray)(s)?s:[s]}},{key:"getStyle",value:function(t){return this.getStyleFromLayers(t)}},{key:"getStyleFromLayers",value:function(t){var e=this,n={},r=this.getName(),i=this.getLayers(),a=this.getProperties();if(i.map((function(n){return e.getStyleFromLayer(n,t)})).forEach((function(t){(0,o.keys)(t).map((function(e){n[e]||(n[e]=[]),n[e].push(t[e])}))})),(0,o.keys)(n).map((function(t){n[t]=n[t].join(e.__getJoinLayers())})),this.isDetached())n[r]='',!i.length&&a.map((function(t){n[t.getName()]=''}));else{var s=a.reduce((function(t,e){return t[e.getName()]='',t}),{});n[r]=n[r]||'',n=L(L({},n),s)}return n}},{key:"__getJoinLayers",value:function(){var t=this.get('layerJoin'),e=this.get('layerSeparator');return t||((0,o.isString)(e)?e:t)}},{key:"__getFullValue",value:function(){return this.get('detached')?'':this.getStyleFromLayers()[this.getName()]}},{key:"hasValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noParent,n=e&&this.getParentTarget();return this.getLayers().length>0&&!n}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.__getLayers().reset(),this.__upTargetsStyleProps(t),x.prototype.clear.call(this)}},{key:"__canClearProp",value:function(){return!1}}]),n}(P),B=["complete","partial"];function H(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function z(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?H(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function U(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var W='data-clear-style',$=function(t){(0,d.Z)(n,t);var e=U(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"template",value:function(){var t=this.pfx,e=this.ppfx;return"\n      <div class=\"".concat(t,"label\" data-sm-label></div>\n      <div class=\"").concat(e,"fields\" data-sm-fields></div>\n    ")}},{key:"templateLabel",value:function(t){var e=this.pfx,n=this.em,r=t.parent,i=t.attributes,o=i.icon,a=void 0===o?'':o,s=i.info,l=void 0===s?'':s,c=null==n?void 0:n.getConfig().icons,u=(null==c?void 0:c.close)||'';return"\n      <span class=\"".concat(e,"icon ").concat(a,"\" title=\"").concat(l,"\">\n        ").concat(t.getLabel(),"\n      </span>\n      ").concat(r?'':"<div class=\"".concat(e,"clear\" style=\"display: none\" ").concat(W,">").concat(u,"</div>"),"\n    ")}},{key:"templateInput",value:function(t){return"\n      <div class=\"".concat(this.ppfx,"field\">\n        <input placeholder=\"").concat(t.getDefaultValue(),"\"/>\n      </div>\n    ")}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.bindAll)(this,'__change','__updateStyle');var e=t.config||{},n=e.em;this.config=e,this.em=n,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.__destroyFn=this.destroy?this.destroy.bind(this):function(){};var r=this.model;r.view=this,this.onValueChange=(0,o.debounce)(this.onValueChange.bind(this),10),this.updateStatus=(0,o.debounce)(this.updateStatus.bind(this)),this.listenTo(r,'destroy remove',this.remove),this.listenTo(r,'change:visible',this.updateVisibility),this.listenTo(r,'change:name change:className change:full',this.render),this.listenTo(r,'change:value',this.onValueChange),this.listenTo(r,'change:parentTarget',this.updateStatus),this.listenTo(n,'change:device',this.onValueChange);var i=this.init&&this.init.bind(this);i&&i()}},{key:"remove",value:function(){var t=this;l.View.prototype.remove.apply(this,arguments),['em','input','$input','view'].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts())}},{key:"updateStatus",value:function(){var t,e=this.model,n=this.pfx,r=this.ppfx,i=this.config,o="".concat(r,"four-color"),a="".concat(r,"color-warn"),s=this.$el.children(".".concat(n,"label")),l=this.getClearEl(),c=l?l.style:{};s.removeClass("".concat(o," ").concat(a)),c.display='none',e.hasValue({noParent:!0})&&i.highlightChanged?(s.addClass(o),i.clearProperties&&(c.display='')):e.hasValue()&&i.highlightComputed&&s.addClass(a),null===(t=this.parent)||void 0===t||t.updateStatus()}},{key:"clear",value:function(t){t&&t.stopPropagation(),this.model.clear()}},{key:"getClearEl",value:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(W,"]"))),this.clearEl}},{key:"inputValueChanged",value:function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)}},{key:"onValueChange",value:function(t,e){this.setValue(this.model.getFullValue()),this.updateStatus()}},{key:"setValue",value:function(t){var e=this.model,n=(0,o.isUndefined)(t)||''===t?e.getDefaultValue():t;if(this.update)return this.__update(n);this.__setValueInput(n)}},{key:"__setValueInput",value:function(t){var e=this.getInputEl();e&&(e.value=t)}},{key:"getInputEl",value:function(){return this.input||(this.input=this.el.querySelector('input')),this.input}},{key:"updateVisibility",value:function(){this.el.style.display=this.model.isVisible()?'':'none'}},{key:"clearCached",value:function(){this.clearEl=null,this.input=null,this.$input=null}},{key:"__unset",value:function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())}},{key:"__update",value:function(t){var e=this.update&&this.update.bind(this);e&&e(z(z({},this._getClbOpts()),{},{value:t}))}},{key:"__change",value:function(){for(var t=this.emit&&this.emit.bind(this),e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t&&t.apply(void 0,[this._getClbOpts()].concat(n))}},{key:"__updateStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.complete,r=e.partial,i=((0,f.Z)(e,B),this.model),o=!1!==n&&!0!==r;(0,a.isObject)(t)?i.__upTargetsStyle(t,{avoidStore:!o}):i.upValue(t,{partial:!o})}},{key:"_getClbOpts",value:function(){var t=this.model;return{el:this.el,createdEl:this.createdEl,property:t,props:t.attributes,change:this.__change,updateStyle:this.__updateStyle}}},{key:"render",value:function(){this.clearCached();var t=this.pfx,e=this.model,n=this.el,r=this.$el,i=e.getName(),o=e.getType(),a=e.get('className')||'',s="".concat(t,"property"),l='number'===o?"".concat(t).concat(o," ").concat(t,"integer"):"".concat(t).concat(o);this.createdEl&&this.__destroyFn(this._getClbOpts()),r.empty().append(this.template(e)),r.find('[data-sm-label]').append(this.templateLabel(e));var c=this.create&&this.create.bind(this);this.createdEl=c&&c(this._getClbOpts()),r.find('[data-sm-fields]').append(this.createdEl||this.templateInput(e)),n.className="".concat(s," ").concat(l," ").concat(s,"__").concat(i," ").concat(a).trim(),n.className+=e.isFull()?" ".concat(s,"--full"):'';var u=this.onRender&&this.onRender.bind(this);u&&u(),this.setValue(e.getValue())}}]),n}(l.View);$.prototype.events={change:'inputValueChanged',["click [".concat(W,"]")]:'clear'};var q=n(9283);function G(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var K=function(t){(0,d.Z)(n,t);var e=G(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||'',this.properties=[],this.parent=t.parent;var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.render)}},{key:"addTo",value:function(t,e,n){this.add(t,null,n)}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parent,i=this.config,o=e||this.el,a=new t.typeView({model:t,config:i});r&&(a.parent=r),a.render();var s=a.el;this.properties.push(a),(0,q.$Q)(o,s,n.at)}},{key:"remove",value:function(){l.View.prototype.remove.apply(this,arguments),this.clearItems()}},{key:"clearItems",value:function(){this.properties.forEach((function(t){return t.remove()})),this.properties=[]}},{key:"render",value:function(){var t=this,e=this.$el,n=this.pfx;this.clearItems();var r=document.createDocumentFragment();return this.collection.forEach((function(e){return t.add(e,r)})),e.empty(),e.append(r),e.attr('class',"".concat(n,"properties")),this}}]),n}(l.View);function Y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function X(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function J(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var Q=function(t){(0,d.Z)(n,t);var e=J(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"templateInput",value:function(){var t=this.pfx;return"\n      <div class=\"".concat(t,"field ").concat(t,"composite\">\n        <span id=\"").concat(t,"input-holder\"></span>\n      </div>\n    ")}},{key:"remove",value:function(){var t;null===(t=this.props)||void 0===t||t.remove(),$.prototype.remove.apply(this,arguments)}},{key:"onValueChange",value:function(){}},{key:"onRender",value:function(){var t=this.model,e=this.pfx,n=t.get('properties');if(n.length&&!this.props){var r=t.isDetached(),i=new K({config:X(X({},this.config),{},{highlightComputed:r,highlightChanged:r}),collection:n,parent:this});i.render(),this.$el.find("#".concat(e,"input-holder")).append(i.el),this.props=i}}},{key:"clearCached",value:function(){$.prototype.clearCached.apply(this,arguments),this.props=null}}]),n}($);function tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var et=function(t){(0,d.Z)(n,t);var e=tt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"events",value:function(){return{click:'select','click [data-close-layer]':'removeItem','mousedown [data-move-layer]':'initSorter','touchstart [data-move-layer]':'initSorter'}}},{key:"template",value:function(){var t=this.pfx,e=this.ppfx,n=this.em,r=null==n?void 0:n.getConfig().icons,i=(null==r?void 0:r.close)||'',o=(null==r?void 0:r.move)||'';return"\n      <div class=\"".concat(t,"label-wrp\">\n        <div id=\"").concat(t,"move\" class=\"").concat(e,"no-touch-actions\" data-move-layer>\n          ").concat(o,"\n        </div>\n        <div id=\"").concat(t,"label\" data-label></div>\n        <div id=\"").concat(t,"preview-box\" class=\"").concat(t,"layer-preview\" style=\"display: none\" data-preview-box>\n          <div id=\"").concat(t,"preview\" class=\"").concat(t,"layer-preview-cnt\" data-preview></div>\n        </div>\n        <div id=\"").concat(t,"close-layer\" class=\"").concat(t,"btn-close\" data-close-layer>\n          ").concat(i,"\n        </div>\n      </div>\n      <div id=\"").concat(t,"inputs\" data-properties></div>\n    ")}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.propertyView=t.propertyView;var r=this.propertyView.model;this.listenTo(e,'destroy remove',this.remove),this.listenTo(e,'change:values',this.updateLabel),this.listenTo(r,'change:selectedLayer',this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data('model',e)}},{key:"initSorter",value:function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)}},{key:"removeItem",value:function(t){t&&t.stopPropagation(),this.model.remove()}},{key:"select",value:function(){this.model.select()}},{key:"getPropertiesWrapper",value:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector('[data-properties]')),this.propsWrapEl}},{key:"getPreviewEl",value:function(){return this.previewEl||(this.previewEl=this.el.querySelector('[data-preview]')),this.previewEl}},{key:"getLabelEl",value:function(){return this.labelEl||(this.labelEl=this.el.querySelector('[data-label]')),this.labelEl}},{key:"updateLabel",value:function(){var t=this.model,e=t.getLabel();if(this.getLabelEl().innerHTML=e,t.hasPreview()){var n=this.getPreviewEl(),r=t.getStylePreview({number:{min:-3,max:3}}),i=(0,o.keys)(r).map((function(t){return"".concat(t,":").concat(r[t])})).join(';');n.setAttribute('style',i)}}},{key:"updateVisibility",value:function(){var t=this.pfx,e=this.model,n=this.propertyView,r=this.getPropertiesWrapper(),i=e.isSelected();r.style.display=i?'':'none',this.$el[i?'addClass':'removeClass']("".concat(t,"active")),i&&r.appendChild(n.props.el)}},{key:"render",value:function(){var t=this.el,e=this.pfx,n=this.model;return t.innerHTML=this.template(),t.className="".concat(e,"layer"),n.hasPreview()&&(t.querySelector('[data-preview-box]').style.display=''),this.updateLabel(),this.updateVisibility(),this}}]),n}(l.View);function nt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var rt=function(t){(0,d.Z)(n,t);var e=nt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(t){var e=this.collection,n=t.config||{},r=n.em,i=n.stylePrefix||'',o=n.pStylePrefix||'';this.config=n,this.pfx=i,this.ppfx=o,this.propertyView=t.propertyView,this.className="".concat(i,"layers ").concat(o,"field"),this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.reset),this.items=[];var a=r?r.get('Utils'):'';this.sorter=a?new a.Sorter({container:this.el,ignoreViewChildren:1,containerSel:".".concat(i,"layers"),itemSel:".".concat(i,"layer"),pfx:n.pStylePrefix}):'',e.view=this,this.$el.data('model',e),this.$el.data('collection',e)}},{key:"addTo",value:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)}},{key:"addToCollection",value:function(t,e,n){var r=e||null,i=this.propertyView,o=this.config,a=this.sorter,s=this.$el,l=new et({model:t,config:o,sorter:a,propertyView:i}),c=l.render().el;if(this.items.push(l),r)r.appendChild(c);else if(void 0!==n){var u='before';s.children().length===n&&(n--,u='after'),n<0?s.append(c):s.children().eq(n)[u](c)}else s.append(c);return c}},{key:"reset",value:function(t,e){this.clearItems(e),this.render()}},{key:"remove",value:function(){this.clearItems(),l.View.prototype.remove.apply(this,arguments)}},{key:"clearItems",value:function(){this.items.forEach((function(t){return t.remove()})),this.items=[]}},{key:"render",value:function(){var t=this,e=this.$el,n=this.sorter,r=document.createDocumentFragment();return e.empty(),this.collection.forEach((function(e){return t.addToCollection(e,r)})),e.append(r),e.attr('class',this.className),n&&(n.plh=null),this}}]),n}(l.View);function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ot(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?it(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var st=function(t){(0,d.Z)(n,t);var e=at(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"events",value:function(){return ot(ot({},Q.prototype.events),{},{'click [data-add-layer]':'addLayer',change:''})}},{key:"templateInput",value:function(){var t=this.pfx,e=this.em,n=null==e?void 0:e.getConfig().icons,r=(null==n?void 0:n.plus)||'+';return"\n      <div class=\"".concat(t,"field ").concat(t,"stack\">\n        <button type=\"button\" id=\"").concat(t,"add\" data-add-layer>\n          ").concat(r,"\n        </button>\n        <div data-layers-wrapper></div>\n      </div>\n    ")}},{key:"init",value:function(){var t=this.model;this.listenTo(t.__getLayers(),'change reset',this.updateStatus)}},{key:"addLayer",value:function(){this.model.addLayer({},{at:0})}},{key:"setValue",value:function(){}},{key:"remove",value:function(){var t;null===(t=this.layersView)||void 0===t||t.remove(),Q.prototype.remove.apply(this,arguments)}},{key:"clearCached",value:function(){Q.prototype.clearCached.apply(this,arguments),this.layersView=null}},{key:"onRender",value:function(){var t=this.model,e=this.el,n=this.config,r=t.get('properties');if(r.length&&!this.props){var i=new K({config:ot(ot({},n),{},{highlightComputed:!1,highlightChanged:!1}),collection:r,parent:this});i.render();var o=new rt({collection:t.__getLayers(),config:n,propertyView:this});o.render(),e.querySelector('[data-layers-wrapper]').appendChild(o.el),this.props=i,this.layersView=o}}}]),n}(Q);function lt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ct(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lt(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var ft=function(t){(0,d.Z)(n,t);var e=ut(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"events",value:function(){return ct(ct({},$.prototype.events),{},{'click [data-clear-asset]':'clear','click [data-open-assets]':'openAssetManager'})}},{key:"templateInput",value:function(){var t,e=this.pfx,n=this.em,r=null===(t=this.em)||void 0===t?void 0:t.getConfig().icons,i=null==r?void 0:r.close;return"\n      <div class=\"".concat(e,"field ").concat(e,"file\">\n        <div id='").concat(e,"input-holder'>\n          <div class=\"").concat(e,"btn-c\">\n            <button class=\"").concat(e,"btn\" id=\"").concat(e,"images\" type=\"button\" data-open-assets>\n              ").concat(n.t('styleManager.fileButton'),"\n            </button>\n          </div>\n          <div style=\"clear:both;\"></div>\n        </div>\n        <div id=\"").concat(e,"preview-box\" class=\"").concat(e,"preview-file\" data-preview-box>\n          <div id=\"").concat(e,"preview-file\" class=\"").concat(e,"preview-file-cnt\" data-preview></div>\n          <div id=\"").concat(e,"close\" class=\"").concat(e,"preview-file-close\" data-clear-asset>").concat(i,"</div>\n        </div>\n      </div>\n    ")}},{key:"__setValueInput",value:function(t){var e=this.model,n=this.el,r=e.getDefaultValue(),i=n.querySelector('[data-preview-box]'),o=n.querySelector('[data-preview]');i.style.display=t&&t!==r?'':'none',o.style.backgroundImage=t||e.getDefaultValue()}},{key:"openAssetManager",value:function(){var t,e=this,n=null===(t=this.em)||void 0===t?void 0:t.get('AssetManager');null==n||n.open({select:function(t,r){var i=(0,o.isString)(t)?t:t.get('src');e.model.upValue(i,{partial:!r}),r&&n.close()},types:['image'],accept:'image/*'})}}]),n}($);function ht(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var pt=function(t){(0,d.Z)(n,t);var e=ht(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"templateInput",value:function(){return''}},{key:"init",value:function(){var t=this.model;this.listenTo(t,'change:unit',this.onValueChange),this.listenTo(t,'change:units',this.render)}},{key:"setValue",value:function(){}},{key:"onRender",value:function(){var t=this.ppfx,e=this.model,n=this.el;if(!this.inputInst){var r=e.input;r.ppfx=t,r.render(),n.querySelector(".".concat(t,"fields")).appendChild(r.el),this.input=r.inputEl.get(0),this.inputInst=r}}},{key:"clearCached",value:function(){$.prototype.clearCached.apply(this,arguments),this.inputInst=null}}]),n}($),dt=n(1511);function gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var vt=function(t){(0,d.Z)(n,t);var e=gt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"setValue",value:function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})}},{key:"remove",value:function(){var t=this;pt.prototype.remove.apply(this,arguments);var e=this.inputInst;e&&e.remove&&e.remove(),['inputInst','$color'].forEach((function(e){return t[e]=null}))}},{key:"__handleChange",value:function(t,e){this.model.upValue(t,{partial:e})}},{key:"onRender",value:function(){if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var t=this.ppfx,e=this.model,n=this.em,r=this.el,i=new dt.Z({target:n,model:e,ppfx:t,onChange:this.__handleChange}).render();r.querySelector(".".concat(t,"fields")).appendChild(i.el),this.input=i.inputEl.get(0),this.inputInst=i}}}]),n}(pt);function mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mt(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function bt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var wt=function(t){(0,d.Z)(n,t);var e=bt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return yt(yt({},x.getDefaults()),{},{options:[],full:0})}},{key:"getOptions",value:function(){var t=this.attributes,e=t.options,n=t.list;return(e&&e.length?e:n)||[]}},{key:"getOption",value:function(t){var e=this,n=t||this.getValue();return this.getOptions().filter((function(t){return e.getOptionId(t)===n}))[0]||null}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.set('options',t),this}},{key:"addOption",value:function(t){if(t){var e=this.getOptions();this.setOptions([].concat((0,r.Z)(e),[t]))}return this}},{key:"getOptionId",value:function(t){return(0,a.isDef)(t.id)?t.id:t.value}},{key:"getOptionLabel",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.locale,i=void 0===r||r,a=((0,o.isString)(t)?this.getOption(t):t)||{},s=this.getOptionId(a),l=a.label||a.name||s,c=this.getId();return i&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.options.".concat(c,".").concat(s)))||l}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];x.prototype.initialize.apply(this,e),this.listenTo(this,'change:options',this.__onOptionChange)}},{key:"__onOptionChange",value:function(){this.set('list',this.get('options'))}}]),n}(x);function kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var xt=function(t){(0,d.Z)(n,t);var e=kt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"templateInput",value:function(){var t=this.pfx,e=this.ppfx;return"\n      <div class=\"".concat(e,"field ").concat(e,"select\">\n        <span id=\"").concat(t,"input-holder\"></span>\n        <div class=\"").concat(e,"sel-arrow\">\n          <div class=\"").concat(e,"d-s-arrow\"></div>\n        </div>\n      </div>\n    ")}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];$.prototype.initialize.apply(this,e),this.listenTo(this.model,'change:options',this.updateOptions)}},{key:"updateOptions",value:function(){this.input=null,this.onRender()}},{key:"onRender",value:function(){var t=this.model,e=this.pfx,n=t.getOptions();if(!this.input){var r=[];n.forEach((function(e){var n=t.getOptionId(e),i=t.getOptionLabel(n),o=e.style?e.style.replace(/"/g,'&quot;'):'',a=o?"style=\"".concat(o,"\""):'',s=n.replace(/"/g,'&quot;');r.push("<option value=\"".concat(s,"\" ").concat(a,">").concat(i,"</option>"))}));var i=this.el.querySelector("#".concat(e,"input-holder"));i.innerHTML="<select>".concat(r.join(''),"</select>"),this.input=i.firstChild}}},{key:"__setValueInput",value:function(t){var e=this.model,n=this.getInputEl(),r=e.getOptions()[0],i=r?e.getOptionId(r):'';n&&(n.value=t||i)}}]),n}($);function Ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ct(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ot(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function St(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var _t=function(t){(0,d.Z)(n,t);var e=St(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return Ct(Ct({},wt.getDefaults()),{},{full:1})}}]),n}(wt);function Pt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var Tt=function(t){(0,d.Z)(n,t);var e=Pt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"templateInput",value:function(){var t=this.ppfx;return"<div class=\"".concat(t,"field ").concat(t,"field-radio\"></div>")}},{key:"onRender",value:function(){var t=this.pfx,e=this.ppfx,n=this.model,r="".concat(e,"radio-item-label"),i=n.getName(),o=n.getOptions(),a="".concat(t,"radio ").concat(t,"radio-").concat(i),s=n.cid;if(!this.input){var l=[];o.forEach((function(o){var c=o.className?"".concat(o.className," ").concat(t,"icon ").concat(r):'',u=n.getOptionId(o),f="".concat(i,"-").concat(u,"-").concat(s),h=c?'':n.getOptionLabel(u),p=o.title?"title=\"".concat(o.title,"\""):'',d=n.getValue()===u?'checked':'';l.push("\n          <div class=\"".concat(e,"radio-item\">\n            <input type=\"radio\" class=\"").concat(a,"\" id=\"").concat(f,"\" name=\"").concat(i,"-").concat(s,"\" value=\"").concat(u,"\" ").concat(d,"/>\n            <label class=\"").concat(c||r,"\" ").concat(p," for=\"").concat(f,"\">").concat(h,"</label>\n          </div>\n        "))}));var c=this.el.querySelector(".".concat(e,"field"));c.innerHTML="<div class=\"".concat(e,"radio-items\">").concat(l.join(''),"</div>"),this.input=c.firstChild}}},{key:"__setValueInput",value:function(t){var e,n=this.model,r=t||n.getDefaultValue(),i=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector("[value=\"".concat(r,"\"]"));i&&(i.checked=!0)}}]),n}(xt),Et=n(7610);function jt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function At(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jt(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Rt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var Dt=function(t){(0,d.Z)(n,t);var e=Rt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return At(At({},x.getDefaults()),{},{units:[],unit:'',min:'',max:'',step:1})}},{key:"getUnits",value:function(){return this.get('units')||[]}},{key:"getUnit",value:function(){return this.get('unit')}},{key:"getMin",value:function(){return this.get('min')}},{key:"getMax",value:function(){return this.get('max')}},{key:"getStep",value:function(){return this.get('step')}},{key:"upUnit",value:function(t,e){return this._up({unit:t},e)}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x.callParentInit(x,this,t,e);var n=this.get('unit'),r=this.get('units');this.input=(0,a.hasWin)()&&new Et.Z({model:this}),r.length&&!n&&this.set('unit',r[0],{silent:1}),x.callInit(this,t,e)}},{key:"__getClearProps",value:function(){return At(At({},x.prototype.__getClearProps()),{},{unit:''})}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=x.prototype.parseValue.apply(this,arguments),r=this.input.validateInputValue(n.value,At({deepCheck:1},e)),i=r.value,o=r.unit;return n.value=i,n.unit=o,n}},{key:"getFullValue",value:function(){var t=this.get('value'),e=this.get('unit');return t=(0,o.isUndefined)(t)?'':t,e=!(0,o.isUndefined)(e)&&t?e:'',t="".concat(t).concat(e),x.prototype.getFullValue.apply(this,[t])}}]),n}(x);function Mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mt(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var Nt=function(t){(0,d.Z)(n,t);var e=Lt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return Zt(Zt({},Dt.getDefaults()),{},{showInput:1})}}]),n}(Dt);function It(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ft(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?It(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Vt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var Bt=function(t){(0,d.Z)(n,t);var e=Vt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"events",value:function(){return Ft(Ft({},pt.prototype.events),{},{'change [type=range]':'inputValueChanged','input [type=range]':'inputValueChangedSoft',change:''})}},{key:"templateInput",value:function(t){var e=this.ppfx;return"\n      <div class=\"".concat(e,"field ").concat(e,"field-range\">\n        <input type=\"range\" min=\"").concat(t.get('min'),"\" max=\"").concat(t.get('max'),"\" step=\"").concat(t.get('step'),"\"/>\n      </div>\n    ")}},{key:"getSliderEl",value:function(){return this.slider||(this.slider=this.el.querySelector('input[type=range]')),this.slider}},{key:"inputValueChanged",value:function(){this.model.upValue(this.getSliderEl().value)}},{key:"inputValueChangedSoft",value:function(){this.model.upValue(this.getSliderEl().value,{partial:!0})}},{key:"setValue",value:function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=''===t?e.getDefaultValue():parseFloat(n.value),pt.prototype.setValue.apply(this,arguments)}},{key:"onRender",value:function(){pt.prototype.onRender.apply(this,arguments),this.model.get('showInput')||(this.inputInst.el.style.display='none')}},{key:"clearCached",value:function(){pt.prototype.clearCached.apply(this,arguments),this.slider=null}}]),n}(pt);const Ht=c().Collection.extend(m.Z).extend({extendViewApi:1,init:function(){var t=this.opts,e=this.em,n=t.module||(null==e?void 0:e.get('StyleManager'));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:'stack',model:V,view:st,isType:function(t){if(t&&'stack'==t.type)return t}},{id:'composite',model:P,view:Q,isType:function(t){if(t&&'composite'==t.type)return t}},{id:'file',model:x,view:ft,isType:function(t){if(t&&'file'==t.type)return t}},{id:'color',model:x,view:vt,isType:function(t){if(t&&'color'==t.type)return t}},{id:'select',model:wt,view:xt,isType:function(t){if(t&&'select'==t.type)return t}},{id:'radio',model:_t,view:Tt,isType:function(t){if(t&&'radio'==t.type)return t}},{id:'slider',model:Nt,view:Bt,isType:function(t){if(t&&'slider'==t.type)return t}},{id:'integer',model:Dt,view:pt,isType:function(t){if(t&&'integer'==t.type)return t}},{id:'number',model:Dt,view:pt,isType:function(t){if(t&&'number'==t.type)return t}},{id:'base',model:x,view:$,isType:function(t){return t.type='base',t}}]});var zt=["extend"];function Ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ut(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $t(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var qt=function(t){(0,d.Z)(n,t);var e=$t(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return{id:'',name:'',open:!0,visible:!0,buildProps:'',extendBuilded:1,properties:[]}}},{key:"initialize",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.em;this.em=r;var i=t||{},a=this.buildProperties(i.buildProps),s=this.get('name')||'',l=[];!this.get('id')&&this.set('id',s.replace(/ /g,'_').toLowerCase()),l=(l=a?this.extendProperties(a):this.get('properties').map((function(t){return(0,o.isString)(t)?e.buildProperties(t)[0]:t})).filter(Boolean)).map((function(t){return e.checkExtend(t)}));var c=new Ht(l,{em:r});c.sector=this,this.set('properties',c)}},{key:"getId",value:function(){return this.get('id')}},{key:"getName",value:function(){var t,e=this.getId();return(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.sectors.".concat(e)))||this.get('name')}},{key:"setName",value:function(t){return this.set('name',t)}},{key:"isOpen",value:function(){return!!this.get('open')}},{key:"setOpen",value:function(t){return this.set('open',t)}},{key:"isVisible",value:function(){return!!this.get('visible')}},{key:"getProperties",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('properties'),n=e.models?(0,r.Z)(e.models):e;return n.filter((function(e){var n=!0;(t.withValue&&(n=e.hasValue({noParent:!0})),t.withParentValue)&&(n=!e.hasValue({noParent:!0})&&e.hasValue());return n}))}},{key:"getProperty",value:function(t){return this.getProperties().filter((function(e){return e.get('id')===t}))[0]||null}},{key:"addProperty",value:function(t,e){return this.get('properties').add(this.checkExtend(t),e)}},{key:"extendProperties",value:function(t,e,n){for(var r=t.length,i=e||this.get('properties'),a=this.get('extendBuilded'),s=[],l=0,c=i.length;l<c;l++){for(var u=i[l],f=0,h=0;h<r;h++){var p=t[h];if(u.property!=p.property&&u.id!=p.property);else{var d=u.properties;d&&d.length&&(u.properties=this.extendProperties(p.properties||[],d,1)),t[h]=a?(0,o.extend)(p,u):u,s[h]=t[h],f=1}}f||(t.push(u),s.push(u))}return n?s.filter((function(t){return t})):t}},{key:"checkExtend",value:function(t){var e=((0,o.isString)(t)?{extend:t}:t)||{},n=e.extend,r=(0,f.Z)(e,zt);return n?Wt(Wt({},this.buildProperties([n])[0]||{}),r):t}},{key:"buildProperties",value:function(t){var e,n=t||[];if(!n.length)return[];var r=null===(e=this.em)||void 0===e?void 0:e.get('StyleManager').builtIn;return null==r?void 0:r.build(n)}}]),n}(l.Model);function Gt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gt(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Yt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var Xt=function(t){(0,d.Z)(n,t);var e=Yt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.module,r=e.em;this.em=r,this.module=n,this.listenTo(this,'reset',this.onReset)}},{key:"model",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.collection.em;return new qt(t,Kt(Kt({},e),{},{em:n}))}},{key:"onReset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels||[];n.forEach((function(t){return t.get('properties').reset()}))}}]),n}(l.Collection),Jt=n(885),Qt=["extend"];function te(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ee(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?te(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ne,re=function(t){return t.map((function(t){return{id:t}}))},ie=function(){function t(){(0,h.Z)(this,t),this.typeNumber='number',this.typeColor='color',this.typeRadio='radio',this.typeSelect='select',this.typeFile='file',this.typeSlider='slider',this.typeComposite='composite',this.typeStack='stack',this.unitsSize=['px','%','em','rem','vh','vw'],this.unitsSizeNoPerc=['px','em','rem','vh','vw'],this.unitsTime=['s','ms'],this.unitsAngle=['deg','rad','grad'],this.fixedValues=['initial','inherit','auto'];var e=', sans-serif',n=['flex-start','flex-end','center'],i=[].concat(n,['baseline','stretch']);this.optsBgSize=re(['auto','cover','contain']),this.optsBgAttach=re(['scroll','fixed','local']),this.optsBgRepeat=re(['repeat','repeat-x','repeat-y','no-repeat']),this.optsWrap=re(['nowrap','wrap','wrap-reverse']),this.optsOverflow=re(['visible','hidden','scroll','auto']),this.optsDir=re(['row','row-reverse','column','column-reverse']),this.opstDisplay=re(['block','inline','inline-block','flex','none']),this.optsTransitFn=re(['linear','ease','ease-in','ease-out','ease-in-out']),this.optsCursor=re(['auto','pointer','copy','crosshair','grab','grabbing','help','move','text']),this.optsFloat=re(['none','left','right']),this.optsPos=re(['static','relative','absolute','fixed']),this.optsTextAlign=re(['left','center','right','justify']),this.optsFlexAlign=re(i),this.optsJustCont=re([].concat(n,['space-between','space-around','space-evenly'])),this.optsAlignCont=re([].concat(n,['space-between','space-around','stretch'])),this.optsAlignSelf=re(['auto'].concat((0,r.Z)(i))),this.optsTransitProp=re(['all','width','height','background-color','transform','box-shadow','opacity']),this.optsBorderStyle=re(['none','solid','dotted','dashed','double','groove','ridge','inset','outset']),this.optsBgPos=re(['left top','left center','left bottom','right top','right center','right bottom','center top','center center','center bottom']),this.optsWeight=[{id:'100',label:'Thin'},{id:'200',label:'Extra-Light'},{id:'300',label:'Light'},{id:'400',label:'Normal'},{id:'500',label:'Medium'},{id:'600',label:'Semi-Bold'},{id:'700',label:'Bold'},{id:'800',label:'Extra-Bold'},{id:'900',label:'Ultra-Bold'}],this.optsShadowType=[{id:'',label:'Outside'},{id:'inset',label:'Inside'}],this.optsFonts=['Arial, Helvetica'+e,'Arial Black, Gadget'+e,'Brush Script MT'+e,'Comic Sans MS, cursive'+e,'Courier New, Courier, monospace','Georgia, serif','Helvetica'+e,'Impact, Charcoal'+e,'Lucida Sans Unicode, Lucida Grande'+e,'Tahoma, Geneva'+e,'Times New Roman, Times, serif','Trebuchet MS, Helvetica'+e,'Verdana, Geneva'+e].map((function(t){return{id:t,label:t.split(',')[0]}})),this.fixedFontSizes=['medium','xx-small','x-small','small','large','x-large','xx-large','smaller','larger','length','initial','inherit'],this.fixedLetSpace=['normal','initial','inherit'],this.requireFlex={display:['flex']},this.init()}return(0,p.Z)(t,[{key:"__sub",value:function(t){var e=this;return function(){return t.map((function(t){if((0,o.isString)(t))return e.get(t);var n=t.extend,r=(0,f.Z)(t,Qt);return ee(ee({},e.get(n)),r)}))}}},{key:"init",value:function(){var t=this,e=this.fixedValues,n=this.requireFlex,r=this.typeNumber;return this.props={},[['text-shadow-h',{type:r,default:'0',units:this.unitsSizeNoPerc}],['top',{default:'auto',units:this.unitsSize,fixedValues:e},'text-shadow-h'],['right',{},'top'],['bottom',{},'top'],['left',{},'top'],['margin-top',{default:'0'},'top'],['margin-right',{},'margin-top'],['margin-bottom',{},'margin-top'],['margin-left',{},'margin-top'],['padding-top',{min:0},'margin-top'],['padding-right',{},'padding-top'],['padding-bottom',{},'padding-top'],['padding-left',{},'padding-top'],['width',{min:0},'top'],['min-width',{},'width'],['max-width',{},'width'],['height',{},'width'],['min-height',{},'width'],['max-height',{},'width'],['flex-basis',{requiresParent:n},'width'],['font-size',{default:'medium',fixedValues:this.fixedFontSizes},'width'],['letter-spacing',{default:'normal',fixedValues:this.fixedLetSpace},'top'],['line-height',{},'letter-spacing'],['text-shadow-v',{},'text-shadow-h'],['text-shadow-blur',{min:0},'text-shadow-h'],['border-radius-c',{property:'border-radius',fixedValues:void 0},'padding-top'],['border-top-left-radius',{},'border-radius-c'],['border-top-right-radius',{},'border-radius-c'],['border-bottom-left-radius',{},'border-radius-c'],['border-bottom-right-radius',{},'border-radius-c'],['border-width',{units:this.unitsSizeNoPerc},'border-radius-c'],['box-shadow-h',{},'text-shadow-h'],['box-shadow-v',{},'text-shadow-h'],['box-shadow-blur',{default:'5px'},'text-shadow-blur'],['box-shadow-spread',{},'text-shadow-h'],['transition-duration',{default:'2s',units:this.unitsTime},'border-radius-c'],['perspective',{},'border-radius-c'],['order',{type:r,default:'0',requiresParent:n}],['flex-grow',{},'order'],['flex-shrink',{default:'1'},'order'],['float',{type:this.typeRadio,default:'none',options:this.optsFloat}],['position',{default:'static',options:this.optsPos},'float'],['text-align',{default:'left',options:this.optsTextAlign},'float'],['color',{type:this.typeColor,default:'black'}],['text-shadow-color',{},'color'],['border-color',{},'color'],['box-shadow-color',{},'color'],['background-color',{default:'none'},'color'],['background-image',{type:this.typeFile,functionName:'url',default:'none',full:!0}],['opacity',{type:this.typeSlider,default:'1',min:0,max:1,step:.01}],['display',{type:this.typeSelect,default:'block',options:this.opstDisplay}],['flex-direction',{default:'row',options:this.optsDir,requires:n},'display'],['flex-wrap',{default:'nowrap',options:this.optsWrap},'flex-direction'],['justify-content',{default:'flex-start',options:this.optsJustCont},'flex-wrap'],['align-items',{default:'stretch',options:this.optsFlexAlign},'flex-wrap'],['align-content',{options:this.optsAlignCont},'align-items'],['align-self',{default:'auto',options:this.optsAlignSelf,requiresParent:n},'display'],['font-family',{default:'Arial, Helvetica, sans-serif',options:this.optsFonts},'display'],['font-weight',{default:'400',options:this.optsWeight},'display'],['border-style',{default:'solid',options:this.optsBorderStyle},'display'],['box-shadow-type',{default:'',options:this.optsShadowType},'display'],['background-repeat',{default:'repeat',options:this.optsBgRepeat},'display'],['background-position',{default:'left top',options:this.optsBgPos},'display'],['background-attachment',{default:'scroll',options:this.optsBgAttach},'display'],['background-size',{default:'auto',options:this.optsBgSize},'display'],['transition-property',{default:'width',options:this.optsTransitProp},'display'],['transition-timing-function',{default:'ease',options:this.optsTransitFn},'display'],['cursor',{default:'auto',options:this.optsCursor},'display'],['overflow',{default:'visible',options:this.optsOverflow},'display'],['overflow-x',{},'overflow'],['overflow-y',{},'overflow'],['margin',{type:this.typeComposite,properties:this.__sub([{extend:'margin-top',id:'margin-top-sub'},{extend:'margin-right',id:'margin-right-sub'},{extend:'margin-bottom',id:'margin-bottom-sub'},{extend:'margin-left',id:'margin-left-sub'}])}],['padding',{properties:this.__sub([{extend:'padding-top',id:'padding-top-sub'},{extend:'padding-right',id:'padding-right-sub'},{extend:'padding-bottom',id:'padding-bottom-sub'},{extend:'padding-left',id:'padding-left-sub'}])},'margin'],['border',{properties:this.__sub([{extend:'border-width',id:'border-width-sub'},{extend:'border-style',id:'border-style-sub'},{extend:'border-color',id:'border-color-sub'}])},'margin'],['border-radius',{properties:this.__sub([{extend:'border-top-left-radius',id:'border-top-left-radius-sub'},{extend:'border-top-right-radius',id:'border-top-right-radius-sub'},{extend:'border-bottom-right-radius',id:'border-bottom-right-radius-sub'},{extend:'border-bottom-left-radius',id:'border-bottom-left-radius-sub'}])},'margin'],['transition',{type:this.typeStack,properties:this.__sub([{extend:'transition-property',id:'transition-property-sub'},{extend:'transition-duration',id:'transition-duration-sub'},{extend:'transition-timing-function',id:'transition-timing-function-sub'}])}],['box-shadow',{preview:!0,layerLabel:function(t,e){var n=e.values,r=n['box-shadow-h'],i=n['box-shadow-v'],o=n['box-shadow-blur'],a=n['box-shadow-spread'];return"".concat(r," ").concat(i," ").concat(o," ").concat(a)},properties:this.__sub(['box-shadow-h','box-shadow-v','box-shadow-blur','box-shadow-spread','box-shadow-color','box-shadow-type'])},'transition'],['text-shadow',{default:'none',layerLabel:function(t,e){var n=e.values,r=n['text-shadow-h'],i=n['text-shadow-v'],o=n['text-shadow-blur'];return"".concat(r," ").concat(i," ").concat(o)},properties:this.__sub(['text-shadow-h','text-shadow-v','text-shadow-blur','text-shadow-color'])},'box-shadow'],['background',{detached:!0,layerLabel:function(t,e){var n=e.values;return[n['background-repeat-sub']||'',n['background-position-sub']||'',n['background-attachment-sub']||'',n['background-size-sub']||''].join(' ')},properties:this.__sub([{extend:'background-image',id:'background-image-sub'},{extend:'background-repeat',id:'background-repeat-sub'},{extend:'background-position',id:'background-position-sub'},{extend:'background-attachment',id:'background-attachment-sub'},{extend:'background-size',id:'background-size-sub'}])},'box-shadow'],['transform',{type:'stack',layerSeparator:' ',fromStyle:function(t,e){var n=e.property,r=t[e.name]||'',i=n.getLayerSeparator();return r?r.split(i).map((function(t){var e=n.__parseFn(t);return{name:e.name,value:e.value}})):[]},toStyle:function(t,e){return{[e.name]:"".concat(t.name,"(").concat(t.value,")")}},properties:[{property:'name',name:'Type',type:this.typeSelect,default:'rotateZ',full:!0,options:[{id:'scaleX',propValue:{units:[''],step:.01}},{id:'scaleY',propValue:{units:[''],step:.01}},{id:'scaleZ',propValue:{units:[''],step:.01}},{id:'rotateX',propValue:{units:this.unitsAngle,step:1}},{id:'rotateY',propValue:{units:this.unitsAngle,step:1}},{id:'rotateZ',propValue:{units:this.unitsAngle,step:1}},{id:'translateX',propValue:{units:this.unitsSize,step:1}},{id:'translateY',propValue:{units:this.unitsSize,step:1}}],onChange:function(t){var e=t.property;if(t.to.value){var n=ee({},e.getOption().propValue||{}),r=e.getParent().getProperty('value'),i=r.getUnit();(!i||(null==n?void 0:n.units.indexOf(i))<0)&&(n.unit=(null==n?void 0:n.units[0])||''),r.up(n)}}},{property:'value',type:this.typeNumber,default:'0',full:!0}]}]].forEach((function(e){var n=(0,Jt.Z)(e,3),r=n[0],i=n[1],o=n[2];t.add(r,i||{},{from:o})})),this}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.from||'',i=this.props[r||t]||{},a=ee(ee({},i),{},{property:t},e);return a.properties&&(0,o.isFunction)(a.properties)&&(a.properties=a.properties()),this.props[t]=a,a}},{key:"get",value:function(t){return this.props[t]||null}},{key:"build",value:function(t){var e=this,n=[];return((0,o.isString)(t)?[t]:t).forEach((function(t){n.push(e.get(t)||{property:t})})),n}}]),t}(),oe=n(168),ae=n(7539);function se(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var le=function(t){(0,d.Z)(n,t);var e=se(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"template",value:function(t){var e,n=t.pfx,r=t.label,i=null===(e=this.em)||void 0===e?void 0:e.getConfig().icons,o=(null==i?void 0:i.caret)||'',a="".concat(n,"sector-");return(0,ae.Z)(ne||(ne=(0,oe.Z)(["\n      <div class=\"","title\" data-sector-title>\n        <div class=\"","caret\">$","</div>\n        <div class=\"","label\">","</div>\n      </div>\n    "])),a,a,o,a,r)}},{key:"events",value:function(){return{'click [data-sector-title]':'toggle'}}},{key:"initialize",value:function(t){var e=t.config||{},n=this.model,r=e.em;this.config=e,this.em=r,this.pfx=e.stylePrefix||'',this.listenTo(n,'destroy remove',this.remove),this.listenTo(n,'change:open',this.updateOpen),this.listenTo(n,'change:visible',this.updateVisibility)}},{key:"updateOpen",value:function(){var t=this.$el,e=this.model,n=this.pfx,r=e.isOpen();t[r?'addClass':'removeClass']("".concat(n,"open")),this.getPropertiesEl().style.display=r?'':'none'}},{key:"updateVisibility",value:function(){this.el.style.display=this.model.isVisible()?'':'none'}},{key:"getPropertiesEl",value:function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)}},{key:"toggle",value:function(){var t=this.model;t.setOpen(!t.get('open'))}},{key:"renderProperties",value:function(){var t=this.model,e=this.config,n=t.get('properties');if(n){var r=new K({collection:n,config:e});this.$el.append(r.render().el)}}},{key:"render",value:function(){var t=this.pfx,e=this.model,n=this.$el,r=e.getId(),i=e.getName();return n.html(this.template({pfx:t,label:i})),this.renderProperties(),n.attr('class',"".concat(t,"sector ").concat(t,"sector__").concat(r," no-select")),this.updateOpen(),this}}]),n}(l.View);function ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var ue=function(t){(0,d.Z)(n,t);var e=ce(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.module,n=t.config,r=void 0===n?{}:n,i=this.collection;this.pfx=r.stylePrefix||'',this.ppfx=r.pStylePrefix||'',this.config=r,this.module=e,this.listenTo(i,'add',this.addTo),this.listenTo(i,'reset',this.render)}},{key:"remove",value:function(){var t=this;l.View.prototype.remove.apply(this,arguments),['config','module','em'].forEach((function(e){return t[e]={}}))}},{key:"addTo",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.addToCollection(t,null,n)}},{key:"addToCollection",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.config,i=this.el,o=e||i,a=new le({model:t,config:r}).render().el;return(0,q.$Q)(o,a,n.at),a}},{key:"render",value:function(){var t=this,e=this.$el,n=this.pfx,r=this.ppfx;e.empty();var i=document.createDocumentFragment();return this.collection.each((function(e){return t.addToCollection(e,i)})),e.append(i),e.addClass("".concat(n,"sectors ").concat(r,"one-bg ").concat(r,"two-color")),this}}]),n}(l.View);function fe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function he(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fe(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var pe='style',de="".concat(pe,":"),ge="".concat(de,"sector"),ve="".concat(ge,":add"),me="".concat(ge,":remove"),ye="".concat(ge,":update"),be="".concat(de,"property"),we="".concat(be,":add"),ke="".concat(be,":remove"),xe="".concat(be,":update"),Oe="".concat(de,"layer:select"),Ce="".concat(de,"target"),Se="".concat(de,"custom"),_e=function(t){return t||0===t};const Pe=function(){var t,e,n;return he(he({},s.Z),{},{Sector:qt,events:{all:pe,sectorAdd:ve,sectorRemove:me,sectorUpdate:ye,propertyAdd:we,propertyRemove:ke,propertyUpdate:xe,layerSelect:Oe,target:Ce,custom:Se},name:'StyleManager',init:function(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.bindAll)(this,'__clearStateTarget'),this.__initConfig(u,r);var i=this.config,a=i.em,s=i.pStylePrefix;s&&(i.stylePrefix=s+i.stylePrefix),this.builtIn=new ie,t=new Ht([],{em:a,module:this}),e=new Xt([],he(he({},i),{},{module:this}));var c=new l.Model({targets:[]});this.model=c,this.__listenAdd(e,ve),this.__listenRemove(e,me),this.__listenUpdate(e,ye);var f='component:toggled component:update:classes change:state change:device frame:resized selector:type';this.upAll=(0,o.debounce)((function(){return n.__upSel()})),c.listenTo(a,f,this.upAll),c.listenTo(a,'component:toggled',this.__clearStateTarget);var h=(0,o.debounce)((function(){n.__upProps(),n.__trgCustom()}));c.listenTo(a,'styleable:change undo redo',h);var p=(0,o.debounce)((function(){return n.__trgCustom()}));return c.listenTo(a,"".concat(Oe," ").concat(Ce),p),c.on('change:lastTarget',(function(){return a.trigger(Ce,n.getSelected())})),this},__upSel:function(){this.select(this.em.getSelectedAll())},__trgCustom:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},__trgEv:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=this.em).trigger.apply(e,[t].concat(r))},__clearStateTarget:function(){var t=this,e=this.em,n=this.__getStateTarget();n&&(null==e||e.skip((function(){e.get('CssComposer').remove(n),t.model.set({stateTarget:null})})))},onLoad:function(){e.add(this.config.sectors,{silent:!0})},postRender:function(){this.__appendTo()},addSector:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getSector(t);return i||(n.id=t,i=e.add(n,r)),i},getSector:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.where({id:t})[0];return!r&&n.warn&&this._logNoSector(t),r||null},getSectors:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e&&e.models?t.array?(0,r.Z)(e.models):e:[];return t.visible?n.filter((function(t){return t.isVisible()})):n},removeSector:function(t){return this.getSectors().remove(this.getSector(t,{warn:1}))},addProperty:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getSector(t,{warn:1}),i=null;return r&&(i=r.addProperty(e,n)),i},getProperty:function(t,e){var n,r=this.getSector(t,{warn:1});return r&&(n=r.get('properties').filter((function(t){return t.get('property')===e||t.get('id')===e}))[0]),n||null},getProperties:function(t){var e=null,n=this.getSector(t,{warn:1});return n&&(e=n.get('properties')),e},removeProperty:function(t,e){var n=this.getProperties(t);return n?n.remove(this.getProperty(t,e)):null},select:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=(0,o.isArray)(t)?t:[t],s=n.stylable,l=r.get('CssComposer'),c=[];i.filter(Boolean).forEach((function(t){var e=t;if((0,o.isString)(t)){var n=l.getRule(t)||l.setRule(t);!(0,o.isUndefined)(s)&&n.set({stylable:s}),e=n}c.push(e)}));var u=n.component||c.filter((function(t){return(0,a.isComponent)(t)})).reverse()[0];c=c.map((function(t){return e.getModelToStyle(t)}));var f=r.getState(),h=c.slice().reverse()[0],p=this.getParentRules(h,{state:f,component:u}),d=this.__getStateTarget();return r.skip((function(){var t;if(f&&null!=h&&null!==(t=h.getState)&&void 0!==t&&t.call(h)){var e=h.getStyle();d?d.setStyle(e):d=l.getAll().add({selectors:'gjs-selected',style:e,shallow:!0,important:!0})}else d&&(l.remove(d),d=null)})),this.model.set({targets:c,lastTarget:h,lastTargetParents:p,stateTarget:d,component:u}),this.__upProps(n),c},getSelected:function(){return this.model.get('lastTarget')||null},getSelectedAll:function(){return this.model.get('targets')},getSelectedParents:function(){return this.model.get('lastTargetParents')||[]},__getStateTarget:function(){return this.model.get('stateTarget')||null},addStyleTargets:function(t,e){this.getSelectedAll().map((function(n){return n.addStyle(t,e)}));var n=this.getSelected(),r=this.__getStateTarget();n&&(null==r||r.setStyle(n.getStyle(),e))},getBuiltIn:function(t){return this.builtIn.get(t)},getBuiltInAll:function(){return this.builtIn.props},addBuiltIn:function(t,e){return this.builtIn.add(t,e)},getModelToStyle:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=n.skipAdd;if(r&&null!==(e=t)&&void 0!==e&&e.toHTML){var o,a=r.getConfig(),s=r.get('UndoManager'),l=r.get('CssComposer'),c=r.get('SelectorManager'),u=c?c.getConfig():{},f=a.devicePreviewMode?'':r.get('state'),h=t.get('classes'),p=h.getStyleable(),d=p.length,g=!u.componentFirst||n.useClasses,v={noCount:1},m={state:f,addOpts:v};if(s.stop(),d&&g){var y=r.getCurrentMedia();(o=l.get(p,f,y))||i||(o=l.add(p,f,y,{},v))}else if(a.avoidInlineStyle){var b=t.getId();!(o=l.getIdRule(b,m))&&!i&&(o=l.setIdRule(b,{},m)),t.is('wrapper')&&o.set('wrapper',1,v)}o&&(t=o),s.start()}return t},getParentRules:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state,r=e.component,i=this.em,a=[];if(i&&t){var s=r,l=i.get('CssComposer'),c=i.get('CodeManager').getGenerator('css'),u=t.toHTML?t:t.getComponent(),f={combination:!0,array:!0},h=[],p=[],d=[];u?(h=l.getRules("#".concat(u.getId())),d=(p=s?l.getRules(s.getSelectors().getFullName(f)):[]).concat(h)):(h=s?l.getRules("#".concat(s.getId())):[],p=l.getRules(t.getSelectors().getFullName(f)),d=h.concat(p));var g=d.filter((function(t){return(0,o.isUndefined)(n)?1:t.get('state')===n})).sort(c.sortRules).reverse();a=g.slice(g.indexOf(t)+1)}return a},addType:function(e,n){t.addType(e,n)},getType:function(e){return t.getType(e)},getTypes:function(){return t.getTypes()},createType:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.model,r=void 0===n?{}:n,i=e.view,o=void 0===i?{}:i,a=this.config,s=this.getType(t);if(s)return new s.view(he({model:new s.model(r),config:a},o))},render:function(){var t=this.config,r=this.em,i=n&&n.el;return(n=new ue({el:i,em:r,config:t,collection:e,module:this})).render().el},_logNoSector:function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},__upProps:function(t){var n=this,r=this.getSelected();if(r){var i=this.model.get('component'),o=this.getSelectedParents(),a=r.getStyle(),s=o.map((function(t){return{target:t,style:t.getStyle()}}));e.map((function(e){e.getProperties().map((function(e){n.__upProp(e,a,s,t)}))})),e.forEach((function(t){var n=t.getProperties();n.forEach((function(t){var n=t.__checkVisibility({target:r,component:i,sectors:e});t.set('visible',n)}));var o=n.some((function(t){return t.isVisible()}));t.set('visible',o)}))}},__upProp:function(t,e,n,r){var i=this,o=t.getName(),a=e[o],s=_e(a),l='stack'===t.getType(),c='composite'===t.getType(),u=he(he({},r),{},{__up:!0}),f=!c&&!l,h=l?t.__getLayersFromStyle(e):[],p=c?t.__getPropsFromStyle(e):{},d=s?a:null,g=null;if(l&&null===h||c&&null===p){var v=l?'__getLayersFromStyle':'__getPropsFromStyle',m=n.filter((function(e){return null!==t[v](e.style)}))[0];if(m){d=m.style[o],g=m.target;var y=t[v](m.style);l?h=y:p=y}}else if(!s){d=null;var b=n.filter((function(t){return _e(t.style[o])}))[0];b&&(d=b.style[o],g=b.target)}if(t.__setParentTarget(g),f&&t.__getFullValue()!==d&&t.upValue(d,u),l&&t.__setLayers(h||[]),c){var w=t.getProperties();if(t.isDetached()){var k=t.__getPropsFromStyle(e,{byName:!0})||{},x=n.map((function(e){return he(he({},e),{},{style:t.__getPropsFromStyle(e.style,{byName:!0})||{}})}));w.map((function(t){return i.__upProp(t,k,x,r)}))}else t.__setProperties(p||{},u),t.getProperties().map((function(t){return t.__setParentTarget(g)}))}},destroy:function(){[t,e].forEach((function(t){t.reset(),t.stopListening()})),n&&n.remove(),this.model.stopListening(),this.upAll.cancel(),this.em={},this.config={},this.builtIn={},this.model={}}})}},6388:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>z,evAll:()=>V,evCustom:()=>H,evPfx:()=>B});var r=n(4942),i=n(9050),o=n(9304),a=n(2316),s=n.n(a);const l={stylePrefix:'trt-',appendTo:'',optionsTarget:[{value:!1},{value:'_blank'}]};var c=n(5671),u=n(3144),f=n(7326),h=n(9340),p=n(2963),d=n(1120),g=n(6602),v=n(885),m=n(1163);function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var k=s().$,x=function(t){(0,h.Z)(n,t);var e=w(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,c.Z)(this,n),t=e.call(this,i),(0,r.Z)((0,f.Z)(t),"events",{}),(0,r.Z)((0,f.Z)(t),"appendInput",!0);var o=i.config,a=void 0===o?{}:o,s=(0,f.Z)(t),l=s.model,u=s.eventCapture,h=l.target,p=l.attributes.type;t.config=a,t.em=a.em,t.pfx=a.stylePrefix||'',t.ppfx=a.pStylePrefix||'',t.target=h;var d=(0,f.Z)(t),g=d.ppfx;return t.clsField="".concat(g,"field ").concat(g,"field-").concat(p),[['change:value',t.onValueChange],['remove',t.removeView]].forEach((function(e){var n=(0,v.Z)(e,2),r=n[0],i=n[1];l.off(r,i),t.listenTo(l,r,i)})),l.view=(0,f.Z)(t),t.listenTo(l,'change:label',t.render),t.listenTo(l,'change:placeholder',t.rerender),t.events={},u.forEach((function(e){return t.events[e]='onChange'})),t.delegateEvents(),t.init(),t}return(0,u.Z)(n,[{key:"attributes",value:function(){return this.model.get('attributes')}},{key:"templateLabel",value:function(){var t=this.ppfx,e=this.getLabel();return"<div class=\"".concat(t,"label\" title=\"").concat(e,"\">").concat(e,"</div>")}},{key:"templateInput",value:function(){var t=this.clsField;return"<div class=\"".concat(t,"\" data-input></div>")}},{key:"getClbOpts",value:function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}}},{key:"removeView",value:function(){this.remove(),this.removed()}},{key:"init",value:function(){}},{key:"removed",value:function(){}},{key:"onRender",value:function(){}},{key:"onUpdate",value:function(){}},{key:"onEvent",value:function(){}},{key:"onChange",value:function(t){var e=this.getInputElem();e&&!(0,i.isUndefined)(e.value)&&this.model.set('value',e.value),this.onEvent(b(b({},this.getClbOpts()),{},{event:t}))}},{key:"getValueForTarget",value:function(){return this.model.get('value')}},{key:"setInputValue",value:function(t){var e=this.getInputElem();e&&(e.value=t)}},{key:"onValueChange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.fromTarget)this.setInputValue(t.get('value')),this.postUpdate();else{var r=this.getValueForTarget();t.setTargetValue(r,n)}}},{key:"renderLabel",value:function(){var t=this.$el,e=this.target,n=this.getLabel(),r=this.templateLabel(e);this.createLabel&&(r=this.createLabel({label:n,component:e,trait:this})||''),t.find('[data-label]').append(r)}},{key:"getLabel",value:function(){var t=this.em,e=this.model.attributes,n=e.label,r=e.name;return t.t("traitManager.traits.labels.".concat(r))||(0,m.capitalize)(n||r).replace(/-/g,' ')}},{key:"getComponent",value:function(){return this.target}},{key:"getInputEl",value:function(){if(!this.$input){var t=this.em,e=this.model,n=e,r=e.attributes.name,o=n.get('placeholder')||n.get('default')||'',a=n.get('type')||'text',s=n.get('min'),l=n.get('max'),c=this.getModelValue(),u=k("<input type=\"".concat(a,"\" placeholder=\"").concat(o,"\">")),f=t.t("traitManager.traits.attributes.".concat(r))||{};u.attr(f),(0,i.isUndefined)(c)||(n.set({value:c},{silent:!0}),u.prop('value',c)),s&&u.prop('min',s),l&&u.prop('max',l),this.$input=u}return this.$input.get(0)}},{key:"getInputElem",value:function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()}},{key:"getModelValue",value:function(){var t,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}},{key:"getElInput",value:function(){return this.elInput}},{key:"renderField",value:function(){var t=this.$el,e=this.appendInput,n=this.model,r=t.find('[data-input]'),o=r[r.length-1],a=n.el;a||(a=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,i.isString)(a)?(o.innerHTML=a,this.elInput=o.firstChild):(e?o.appendChild(a):o.insertBefore(a,o.firstChild),this.elInput=a),n.el=this.elInput}},{key:"hasLabel",value:function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t}},{key:"rerender",value:function(){this.model.el=null,this.render()}},{key:"postUpdate",value:function(){this.onUpdate(this.getClbOpts())}},{key:"render",value:function(){var t=this.$el,e=this.pfx,n=this.ppfx,r=this.model.attributes,o=r.type,a=r.id,s=this.hasLabel&&this.hasLabel(),l="".concat(e,"trait");this.$input=null;var c="<div class=\"".concat(l," ").concat(l,"--").concat(o,"\">\n      ").concat(s?"<div class=\"".concat(n,"label-wrp\" data-label></div>"):'',"\n      <div class=\"").concat(n,"field-wrp ").concat(n,"field-wrp--").concat(o,"\" data-input>\n        ").concat(this.templateInput?(0,i.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:'',"\n      </div>\n    </div>");return t.empty().append(c),s&&this.renderLabel(),this.renderField(),this.el.className="".concat(l,"__wrp ").concat(l,"__wrp-").concat(a),this.postUpdate(),this.onRender(this.getClbOpts()),this}}]),n}(s().View);function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}x.prototype.eventCapture=['change'];var C=function(t){(0,h.Z)(n,t);var e=O(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;(0,c.Z)(this,n),t=e.call(this,i),(0,r.Z)((0,f.Z)(t),"reuseView",!0),t.itemsView=o;var a=i.config||{},s=a.stylePrefix||'',l=i.editor;return t.config=a,t.em=l,t.pfx=s,t.ppfx=a.pStylePrefix||'',t.className="".concat(s,"traits"),t.listenTo(l,'component:toggled',t.updatedCollection),t.updatedCollection(),t}return(0,u.Z)(n,[{key:"updatedCollection",value:function(){var t=this.ppfx,e=this.className,n=this.em.getSelected();this.el.className="".concat(e," ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=n?n.get('traits'):[],this.render()}}]),n}(g.Z);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}C.prototype.itemView=x;var _=s().$,P=function(t){(0,h.Z)(n,t);var e=S(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,c.Z)(this,n),(t=e.call(this,r)).listenTo(t.model,'change:options',t.rerender),t}return(0,u.Z)(n,[{key:"templateInput",value:function(){var t=this.ppfx,e=this.clsField;return"<div class=\"".concat(e,"\">\n      <div data-input></div>\n      <div class=\"").concat(t,"sel-arrow\">\n        <div class=\"").concat(t,"d-s-arrow\"></div>\n      </div>\n    </div>")}},{key:"getInputEl",value:function(){if(!this.$input){var t=this.model,e=this.em,n=t.get('name'),r=t.get('options')||[],o=[],a='<select>';r.forEach((function(t){var r,s,l,c='';(0,i.isString)(t)?(r=t,s=t):(r=t.name||t.label||t.value,s="".concat((0,i.isUndefined)(t.value)?t.id:t.value).replace(/"/g,'&quot;'),c+=(l=t.style?t.style.replace(/"/g,'&quot;'):'')?" style=\"".concat(l,"\""):'');var u=e.t("traitManager.traits.options.".concat(n,".").concat(s))||r;a+="<option value=\"".concat(s,"\"").concat(c,">").concat(u,"</option>"),o.push(s)})),a+='</select>',this.$input=_(a);var s=t.getTargetValue(),l=o.indexOf(s)>=0?s:t.get('default');!(0,i.isUndefined)(l)&&this.$input.val(l)}return this.$input.get(0)}}]),n}(x);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var E=function(t){(0,h.Z)(n,t);var e=T(n);function n(){var t;(0,c.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),(0,r.Z)((0,f.Z)(t),"appendInput",!1),t}return(0,u.Z)(n,[{key:"templateInput",value:function(){var t=this.ppfx,e=this.clsField;return"<label class=\"".concat(e,"\" data-input>\n    <i class=\"").concat(t,"chk-icon\"></i>\n  </label>")}},{key:"onChange",value:function(){var t=this.getInputElem().checked;this.model.set('value',this.getCheckedValue(t))}},{key:"getCheckedValue",value:function(t){var e=t,n=this.model.attributes,r=n.valueTrue,o=n.valueFalse;return e&&!(0,i.isUndefined)(r)&&(e=r),e||(0,i.isUndefined)(o)||(e=o),e}},{key:"getInputEl",value:function(){for(var t=!this.$input,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=x.prototype.getInputEl.apply(this,n);if(t){var a,s,l=this.model,c=this.target,u=l.attributes,f=(u.valueTrue,u.valueFalse),h=l.get('name');l.get('changeProp')?s=a=c.get(h):a=!(!(s=c.get('attributes')[h])&&''!==s),(0,i.isUndefined)(f)||s!==f||(a=!1),o.checked=a}return o}}]),n}(x),j=n(7610);function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var R=function(t){(0,h.Z)(n,t);var e=A(n);function n(){return(0,c.Z)(this,n),e.apply(this,arguments)}return(0,u.Z)(n,[{key:"getValueForTarget",value:function(){var t=this.model,e=t.attributes,n=e.value,r=e.unit;return(0,i.isUndefined)(n)||''===n?t.get('default'):n+r}},{key:"getInputEl",value:function(){if(!this.input){var t=this.ppfx,e=this.model,n=this.getModelValue(),r=new j.Z({contClass:"".concat(t,"field-int"),type:'number',model:e,ppfx:t});this.input=r.render(),this.$input=this.input.inputEl,this.$unit=this.input.unitEl,e.set('value',n,{fromTarget:1}),this.$input.val(n),this.input=r.el}return this.input}}]),n}(x),D=n(1511);function M(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var Z=function(t){(0,h.Z)(n,t);var e=M(n);function n(){var t;(0,c.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),(0,r.Z)((0,f.Z)(t),"templateInput",''),t}return(0,u.Z)(n,[{key:"getInputEl",value:function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new D.Z({model:t,target:this.config.em,contClass:this.ppfx+'field-color',ppfx:this.ppfx}).render();n.setValue(e,{fromTarget:1}),this.input=n.el}return this.input}}]),n}(x);function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var N=function(t){(0,h.Z)(n,t);var e=L(n);function n(){var t;(0,c.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),(0,r.Z)((0,f.Z)(t),"templateInput",''),t}return(0,u.Z)(n,[{key:"onChange",value:function(){this.handleClick()}},{key:"handleClick",value:function(){var t=this.model,e=this.em,n=t.get('command');n&&((0,i.isString)(n)?e.get('Commands').run(n):n(e.get('Editor'),t))}},{key:"renderLabel",value:function(){this.model.get('label')&&x.prototype.renderLabel.apply(this,arguments)}},{key:"getInputEl",value:function(){var t=this.model,e=this.ppfx,n=t.props(),r=n.labelButton,i=n.text,o=n.full,a=r||i,s="".concat(e,"btn");return"<button type=\"button\" class=\"".concat(s,"-prim").concat(o?" ".concat(s,"--full"):'',"\">").concat(a,"</button>")}}]),n}(x);function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}N.prototype.eventCapture=['click button'];var V='trait',B="".concat(V,":"),H="".concat(B,"custom");const z=function(){var t={text:x,number:R,select:P,checkbox:E,color:Z,button:N};return F(F({},o.Z),{},{TraitsView:C,events:{all:V,custom:H},name:'TraitManager',init:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__initConfig(l,n);var r=this.config,o=new a.Model;this.model=o;var s=this.em,c=r.pStylePrefix;this.types=F({},t),c&&(r.stylePrefix="".concat(c).concat(r.stylePrefix));var u=(0,i.debounce)((function(){return e.__upSel()}));o.listenTo(s,'component:toggled',u);var f=(0,i.debounce)((function(){return e.__onUp()}));return o.listenTo(s,'trait:update',f),this},__upSel:function(){this.select(this.em.getSelected())},__onUp:function(){this.select(this.getSelected())},select:function(t){var e=t?t.getTraits():[];this.model.set({component:t,traits:e}),this.__trgCustom()},getSelected:function(){return this.model.get('component')||null},getCurrent:function(){return this.model.get('traits')||[]},__trgCustom:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},postRender:function(){this.__appendTo()},getTraitsViewer:function(){return this.view},addType:function(t,e){var n=this.getType('text');this.types[t]=n.extend(e)},getType:function(t){return this.getTypes()[t]},getTypes:function(){return this.types},render:function(){var t=this.view,e=this.getConfig(),n=t&&t.el;return t=new C({el:n,collection:[],editor:e.em,config:e},this.getTypes()),this.view=t,t.el},destroy:function(){this.__destroy()}})}},8202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(2982),i=n(4942),o=n(3410),a=n.n(o),s=n(9050);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){(0,i.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const u=function(){var t,e,n,i,o={maximumStackLength:500,trackSelection:1},l=function(t){return t.avoidStore||t.noUndo},u=function(t){return Object.keys(t.changedAttributes())};return{name:'UndoManager',init:function(){var f=this,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=c(c({},o),h),t=n.em,this.em=t,n._disable&&(n=c(c({},n),{},{maximumStackLength:0}));var p=!0;return(e=new(a())(c({track:!0,register:[]},n))).changeUndoType('change',{condition:function(t){var e=t.get('_undo');if(e){var n=t.get('_undoexc');if((0,s.isArray)(n)&&u(t).some((function(t){return n.indexOf(t)>=0})))return!1;if((0,s.isBoolean)(e))return!0;if((0,s.isArray)(e)&&u(t).some((function(t){return e.indexOf(t)>=0})))return!0}return!1},on:function(t,e,n){!i&&(i=t.previousAttributes());var r=n||e||{};if(r.noUndo&&setTimeout((function(){i=null})),!l(r)){var o=t.toJSON({fromUndo:p}),a={object:t,before:i,after:o};if(i=null,!(0,s.isEmpty)(o))return a}}}),e.changeUndoType('add',{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!l(n)&&f.isRegistered(e))return{object:e,before:void 0,after:t,options:c(c({},n),{},{fromUndo:p})}}}),e.changeUndoType('remove',{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!l(n)&&f.isRegistered(e))return{object:e,before:t,after:void 0,options:c(c({},n),{},{fromUndo:p})}}}),e.changeUndoType('reset',{undo:function(t,e){t.reset(e,{fromUndo:p})},redo:function(t,e,n){t.reset(n,{fromUndo:p})},on:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!l(e)&&f.isRegistered(t))return{object:t,before:e.previousModels,after:(0,r.Z)(t.models),options:c(c({},e),{},{fromUndo:p})}}}),e.on('undo redo',(function(){t.trigger('change:canvasOffset'),t.getSelectedAll().map((function(t){return t.trigger('rerender:layer')}))})),['undo','redo'].forEach((function(n){return e.on(n,(function(){return t.trigger(n)}))})),this},postLoad:function(){n.trackSelection&&t&&this.add(t.get('selected'))},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(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!t.isEditing()&&e.undo(n),this},undoAll:function(){return e.undoAll(),this},redo:function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!t.isEditing()&&e.redo(n),this},redoAll:function(){return e.redoAll(),this},hasUndo:function(){return e.isAvailable('undo')},hasRedo:function(){return e.isAvailable('redo')},isRegistered:function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},getStack:function(){return e.stack},getStackGroup:function(){var t=[],e=[];return this.getStack().forEach((function(n){var r=n.get('magicFusionIndex');e.indexOf(r)<0&&(e.push(r),t.push(n))})),t},skip:function(t){this.stop(),t(),this.start()},getGroupedStack:function(){var t={},e=this.getStack();return e.forEach((function(e,n){var r=e.get('magicFusionIndex'),i=function(t,e){var n=t.attributes,r=n.type,i=n.after,o=n.before,a=n.object,s=n.options;return{index:e,type:r,after:i,before:o,object:a,options:void 0===s?{}:s}}(e,n);t[r]?t[r].push(i):t[r]=[i]})),Object.keys(t).map((function(e){var n=t[e];return{index:n[n.length-1].index,actions:n,labels:(0,s.unique)(n.reduce((function(t,e){var n,r=null===(n=e.options)||void 0===n?void 0:n.action;return r&&t.push(r),t}),[]))}}))},goToGroup:function(t){var e=this;if(t){var n=this.getPointer(),r=t.index-n;(0,s.times)(Math.abs(r),(function(){e[r<0?'undo':'redo'](!1)}))}},getPointer:function(){return this.getStack().pointer},clear:function(){return e.clear(),this},getInstance:function(){return e},destroy:function(){this.clear().removeAll(),[t,e,n,i].forEach((function(t){return{}})),this.em={}}}}},5610:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(4942),i=n(5671),o=n(3144),a=n(9050),s=n(1163);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,i.Z)(this,t),this.opts={container:null,onStart:null,onDrag:null,onEnd:null,setPosition:null,getPosition:null,guidesStatic:null,guidesTarget:null,snapOffset:5,doc:0,scale:1},(0,a.bindAll)(this,'drag','stop','keyHandle','handleScroll'),this.setOptions(e),this.delta={x:0,y:0},this}return(0,o.Z)(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=c(c({},this.opts),t)}},{key:"toggleDrag",value:function(t){var e=this.getDocumentEl(),n=this.getContainerEl(),r=this.getWindowEl(),i=t?'on':'off',o={on:s.on,off:s.off};o[i](n,'mousemove dragover',this.drag),o[i](e,'mouseup dragend touchend',this.stop),o[i](e,'keydown',this.keyHandle),o[i](r,'scroll',this.handleScroll)}},{key:"handleScroll",value:function(){var t=this.lastScroll,e=this.delta,n=this.getScrollInfo(),r={x:n.x-t.x,y:n.y-t.y};this.move(e.x+r.x,e.y+r.y),this.lastScrollDiff=r}},{key:"start",value:function(t){var e=this.opts,n=e.onStart;this.toggleDrag(1),this.startPointer=this.getPointerPos(t),this.guidesStatic=(0,a.result)(e,'guidesStatic')||[],this.guidesTarget=(0,a.result)(e,'guidesTarget')||[],(0,a.isFunction)(n)&&n(t,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff={x:0,y:0},this.globScrollDiff={x:0,y:0},this.drag(t)}},{key:"drag",value:function(t){var e=this,n=this.opts,r=this.lastScrollDiff,i=this.globScrollDiff,o=n.onDrag,s=this.startPointer,l=this.getPointerPos(t),u={x:i.x+r.x,y:i.y+r.y};this.globScrollDiff=u;var f={x:l.x-s.x+u.x,y:l.y-s.y+u.y};this.lastScrollDiff={x:0,y:0};var h=this.lockedAxis;'x'===(h=t.shiftKey?!h&&this.detectAxisLock(f.x,f.y):null)?f.x=s.x:'y'===h&&(f.y=s.y);var p=function(r){['x','y'].forEach((function(t){return r[t]=r[t]*(0,a.result)(n,'scale')})),e.delta=r,e.move(r.x,r.y),(0,a.isFunction)(o)&&o(t,e)},d=c({},f);if(this.currentPointer=l,this.lockedAxis=h,this.lastScroll=this.getScrollInfo(),p(f),this.guidesTarget.length){var g=this.snapGuides(d),v=g.newDelta,m=g.trgX,y=g.trgY;(m||y)&&p(v)}0===t.which&&this.stop(t)}},{key:"snapGuides",value:function(t){var e=this,n=t,r=this.trgX,i=this.trgY;return this.guidesTarget.forEach((function(n){n.x&&e.trgX||n.y&&e.trgY||(n.active=0,e.guidesStatic.forEach((function(o){if(!(n.y&&o.x||n.x&&o.y)){var s=n.y&&o.y,l=s?'y':'x',c=n[l],u=o[l],f=t[l],h=s?i:r;if(e.isPointIn(c,u)&&(0,a.isUndefined)(h)){var p=f-(c-u);e.setGuideLock(n,p)}}})))})),r=this.trgX,i=this.trgY,['x','y'].forEach((function(r){var i=r.toUpperCase(),o=e["trg".concat(i)];o&&!e.isPointIn(t[r],o.lock)&&(e.setGuideLock(o,null),o=null),o&&!(0,a.isUndefined)(o.lock)&&(n[r]=o.lock)})),{newDelta:n,trgX:this.trgX,trgY:this.trgY}}},{key:"isPointIn",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.offset,i=r||this.opts.snapOffset;return t>=e&&t<=e+i||t<=e&&t>=e-i}},{key:"setGuideLock",value:function(t,e){var n=(0,a.isUndefined)(t.x)?'Y':'X',r="trg".concat(n);return null!==e?(t.active=1,t.lock=e,this[r]=t):(delete t.active,delete t.lock,delete this[r]),t}},{key:"stop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.delta,r=e.cancel,i=r?0:n.x,o=r?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,o,1);var s=this.opts.onEnd;(0,a.isFunction)(s)&&s(t,this,{cancelled:r})}},{key:"keyHandle",value:function(t){(0,s.isEscKey)(t)&&this.stop(t,{cancel:1})}},{key:"move",value:function(t,e,n){var r=this.el,i=this.opts,o=this.startPosition;if(o){var s=i.setPosition,l=o.x+t,c=o.y+e;this.position={x:l,y:c,end:n},(0,a.isFunction)(s)&&s(this.position),r&&(r.style.left="".concat(l,"px"),r.style.top="".concat(c,"px"))}}},{key:"getContainerEl",value:function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()}},{key:"getWindowEl",value:function(){return this.getContainerEl().map((function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow}))}},{key:"getDocumentEl",value:function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs}},{key:"getPointerPos",value:function(t){var e=this.opts.getPointerPosition,n=(0,s.getPointerEvent)(t);return e?e(t):{x:n.clientX,y:n.clientY}}},{key:"getStartPosition",value:function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return(0,a.isFunction)(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n}},{key:"getScrollInfo",value:function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}}},{key:"detectAxisLock",value:function(t,e){var n=t,r=e,i=Math.abs(n),o=Math.abs(r);return r>=i||r<=-i?'x':n>o||n<-o?'y':void 0}}]),t}()},2579:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>vt});var r='undefined'!=typeof document?document:null,i='undefined'!=typeof window?window:null,o=Array.prototype,a=o.filter,s=o.indexOf,l=o.map,c=o.push,u=o.reverse,f=o.slice,h=o.splice,p=/^#[\w-]*$/,d=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function m(t,e){return void 0===e&&(e=r),d.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function y(t,e){if(void 0===e&&(e=r),t){if(t.__cash)return t;var n=t;if(T(t)){if(e.__cash&&(e=e[0]),!(n=p.test(t)?e.getElementById(t.slice(1)):g.test(t)?pt(t):m(t,e)))return}else if(P(t))return this.ready(t);(n.nodeType||n===i)&&(n=[n]),this.length=n.length;for(var o=0,a=this.length;o<a;o++)this[o]=n[o]}}function b(t,e){return new y(t,e)}var w=b.fn=b.prototype=y.prototype={constructor:b,__cash:!0,length:0,splice:h};w.get=function(t){return void 0===t?f.call(this):this[t<0?t+this.length:t]},w.eq=function(t){return b(this.get(t))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)},w.map=function(t){return b(l.call(this,(function(e,n){return t.call(e,n,e)})))},w.slice=function(){return b(f.apply(this,arguments))};var k=/(?:^\w|[A-Z]|\b\w)/g,x=/[\s-_]+/g;function O(t){return t.replace(k,(function(t,e){return t[e?'toUpperCase':'toLowerCase']()})).replace(x,'')}function C(t,e){for(var n=0,r=t.length;n<r&&!1!==e.call(t[n],t[n],n,t);n++);}b.camelCase=O,b.each=C,w.each=function(t){return C(this,(function(e,n){return t.call(e,n,e)})),this},w.removeProp=function(t){return this.each((function(e,n){delete n[t]}))},b.extend=w.extend=function(t){void 0===t&&(t=this);for(var e=arguments,n=e.length,r=n<2?0:1;r<n;r++)for(var i in e[r])t[i]=e[r][i];return t};var S=1;function _(t,e){var n=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!n&&n.call(t,e)}function P(t){return'function'==typeof t}function T(t){return'string'==typeof t}function E(t){return!isNaN(parseFloat(t))&&isFinite(t)}b.guid=S,b.matches=_,b.isFunction=P,b.isString=T,b.isNumeric=E;var j=Array.isArray;function A(t){return T(t)?function(e,n){return _(n,t)}:t.__cash?function(e,n){return t.is(n)}:function(t,e,n){return e===n}}b.isArray=j,w.prop=function(t,e){if(t){if(T(t))return arguments.length<2?this[0]&&this[0][t]:this.each((function(n,r){r[t]=e}));for(var n in t)this.prop(n,t[n]);return this}},w.filter=function(t){if(!t)return b();var e=P(t)?t:A(t);return b(a.call(this,(function(n,r){return e.call(n,r,n,t)})))};var R=/\S+/g;function D(t){return T(t)&&t.match(R)||[]}function M(t){return t.filter((function(t,e,n){return n.indexOf(t)===e}))}function Z(t,e,n){if(1===t.nodeType){var r=i.getComputedStyle(t,null);return e?n?r.getPropertyValue(e):r[e]:r}}function L(t,e){return parseInt(Z(t,e),10)||0}w.hasClass=function(t){var e=D(t),n=!1;return e.length&&this.each((function(t,r){return!(n=r.classList.contains(e[0]))})),n},w.removeAttr=function(t){var e=D(t);return e.length?this.each((function(t,n){C(e,(function(t){n.removeAttribute(t)}))})):this},w.attr=function(t,e){if(t){if(T(t)){if(arguments.length<2){if(!this[0])return;var n=this[0].getAttribute(t);return null===n?void 0:n}return null===e?this.removeAttr(t):this.each((function(n,r){r.setAttribute(t,e)}))}for(var r in t)this.attr(r,t[r]);return this}},w.toggleClass=function(t,e){var n=D(t),r=void 0!==e;return n.length?this.each((function(t,i){C(n,(function(t){r?e?i.classList.add(t):i.classList.remove(t):i.classList.toggle(t)}))})):this},w.addClass=function(t){return this.toggleClass(t,!0)},w.removeClass=function(t){return arguments.length?this.toggleClass(t,!1):this.attr('class','')},b.unique=M,w.add=function(t,e){return b(M(this.get().concat(b(t,e).get())))};var N=/^--/;function I(t){return N.test(t)}var F={},V=r&&r.createElement('div'),B=V?V.style:{},H=['webkit','moz','ms','o'];function z(t,e){if(void 0===e&&(e=I(t)),e)return t;if(!F[t]){var n=O(t),r=''+n.charAt(0).toUpperCase()+n.slice(1);C((n+' '+H.join(r+' ')+r).split(' '),(function(e){if(e in B)return F[t]=e,!1}))}return F[t]}b.prefixedProp=z;var U={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function W(t,e,n){return void 0===n&&(n=I(t)),n||U[t]||!E(e)?e:e+'px'}w.css=function(t,e){if(T(t)){var n=I(t);return t=z(t,n),arguments.length<2?this[0]&&Z(this[0],t,n):t?(e=W(t,e,n),this.each((function(r,i){1===i.nodeType&&(n?i.style.setProperty(t,e):i.style[t]=e)}))):this}for(var r in t)this.css(r,t[r]);return this};var $='__cashData',q=/^data-(.*)/;function G(t){return t[$]=t[$]||{}}function K(t,e){var n=G(t);if(e){if(!(e in n)){var r=t.dataset?t.dataset[e]||t.dataset[O(e)]:b(t).attr('data-'+e);if(void 0!==r){try{r=JSON.parse(r)}catch(t){}n[e]=r}}return n[e]}return n}function Y(t,e){return L(t,'border'+(e?'Left':'Top')+'Width')+L(t,'padding'+(e?'Left':'Top'))+L(t,'padding'+(e?'Right':'Bottom'))+L(t,'border'+(e?'Right':'Bottom')+'Width')}function X(t,e){for(var n=0,r=e.length;n<r;n++)if(t.indexOf(e[n])<0)return!1;return!0}function J(t,e,n){C(t[n],(function(t){t[0];var r=t[1];e.removeEventListener(n,r)})),delete t[n]}b.hasData=function(t){return $ in t},w.data=function(t,e){var n=this;if(!t){if(!this[0])return;return C(this[0].attributes,(function(t){var e=t.name.match(q);e&&n.data(e[1])})),K(this[0])}if(T(t))return void 0===e?this[0]&&K(this[0],t):this.each((function(n,r){return function(t,e,n){G(t)[e]=n}(r,t,e)}));for(var r in t)this.data(r,t[r]);return this},w.removeData=function(t){return this.each((function(e,n){return function(t,e){void 0===e?delete t[$]:delete G(t)[e]}(n,t)}))},C(['Width','Height'],(function(t){w['inner'+t]=function(){if(this[0])return this[0]===i?i['inner'+t]:this[0]['client'+t]}})),C(['width','height'],(function(t,e){w[t]=function(n){return this[0]?arguments.length?(n=parseInt(n,10),this.each((function(r,i){if(1===i.nodeType){var o=Z(i,'boxSizing');i.style[t]=W(t,n+('border-box'===o?Y(i,!e):0))}}))):this[0]===i?this[0][O('outer-'+t)]:this[0].getBoundingClientRect()[t]-Y(this[0],!e):void 0===n?void 0:this}})),C(['Width','Height'],(function(t,e){w['outer'+t]=function(n){if(this[0])return this[0]===i?i['outer'+t]:this[0]['offset'+t]+(n?L(this[0],'margin'+(e?'Top':'Left'))+L(this[0],'margin'+(e?'Bottom':'Right')):0)}}));var Q='__cashEvents',tt='.';function et(t){return t[Q]=t[Q]||{}}function nt(t){var e=t.split(tt);return[e[0],e.slice(1).sort()]}function rt(t,e,n,r){var i=et(t);if(e){var o=i[e];if(!o)return;r&&(r.guid=r.guid||S++),i[e]=o.filter((function(i){var o=i[0],a=i[1];if(r&&a.guid!==r.guid||!X(o,n))return!0;t.removeEventListener(e,a)}))}else if(n&&n.length)for(e in i)rt(t,e,n,r);else for(e in i)J(i,t,e)}w.off=function(t,e){var n=this;return void 0===t?this.each((function(t,e){return rt(e)})):C(D(t),(function(t){var r=nt(t),i=r[0],o=r[1];n.each((function(t,n){return rt(n,i,o,e)}))})),this},w.on=function(t,e,n,r){var i=this;if(!T(t)){for(var o in t)this.on(o,e,t[o]);return this}return P(e)&&(n=e,e=!1),C(D(t),(function(t){var o=nt(t),a=o[0],s=o[1];i.each((function(t,i){var o=function t(o){if(!o.namespace||X(s,o.namespace.split(tt))){var l=i;if(e){for(var c=o.target;!_(c,e);){if(c===i)return;if(!(c=c.parentNode))return}l=c}o.namespace=o.namespace||'';var u=n.call(l,o,o.data);r&&rt(i,a,s,t),!1===u&&(o.preventDefault(),o.stopPropagation())}};o.guid=n.guid=n.guid||S++,function(t,e,n,r){r.guid=r.guid||S++;var i=et(t);i[e]=i[e]||[],i[e].push([n,r]),t.addEventListener(e,r)}(i,a,s,o)}))})),this},w.one=function(t,e,n){return this.on(t,e,n,!0)},w.ready=function(t){var e=function(){return t(b)};return'loading'!==r.readyState?setTimeout(e):r.addEventListener('DOMContentLoaded',e),this},w.trigger=function(t,e){var n=t;if(T(t)){var i=nt(t),o=i[0],a=i[1];(n=r.createEvent('HTMLEvents')).initEvent(o,!0,!0),n.namespace=a.join(tt)}return n.data=e,this.each((function(t,e){e.dispatchEvent(n)}))};var it=/select-one/i,ot=/select-multiple/i;function at(t){var e=t.type;return it.test(e)?function(t){return t.selectedIndex<0?null:t.options[t.selectedIndex].value}(t):ot.test(e)?function(t){var e=[];return C(t.options,(function(t){!t.selected||t.disabled||t.parentNode.disabled||e.push(t.value)})),e}(t):t.value}var st=/%20/g;var lt=/file|reset|submit|button|image/i,ct=/radio|checkbox/i;w.serialize=function(){var t='';return this.each((function(e,n){C(n.elements||[n],(function(e){if(!e.disabled&&e.name&&'FIELDSET'!==e.tagName&&!lt.test(e.type)&&(!ct.test(e.type)||e.checked)){var n=at(e);if(void 0!==n)C(j(n)?n:[n],(function(n){t+=function(t,e){return'&'+encodeURIComponent(t)+'='+encodeURIComponent(e).replace(st,'+')}(e.name,n)}))}}))})),t.substr(1)},w.val=function(t){return void 0===t?this[0]&&at(this[0]):this.each((function(e,n){var r=ot.test(n.type),i=null===t?r?[]:'':t;r&&j(i)?C(n.options,(function(t){t.selected=i.indexOf(t.value)>=0})):n.value=i}))},w.clone=function(){return this.map((function(t,e){return e.cloneNode(!0)}))},w.detach=function(){return this.each((function(t,e){e.parentNode&&e.parentNode.removeChild(e)}))};var ut,ft=/^\s*<(\w+)[^>]*>/,ht=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function pt(t){if(function(){if(!ut){var t=r.createElement('table'),e=r.createElement('tr');ut={'*':r.createElement('div'),tr:r.createElement('tbody'),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!T(t))return[];if(ht.test(t))return[r.createElement(RegExp.$1)];var e=ft.test(t)&&RegExp.$1,n=ut[e]||ut['*'];return n.innerHTML=t,b(n.childNodes).detach().get()}function dt(t,e,n){if(void 0!==e){var r=T(e);!r&&e.length?C(e,(function(e){return dt(t,e,n)})):C(t,r?function(t){t.insertAdjacentHTML(n?'afterbegin':'beforeend',e)}:function(t,r){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,r?e.cloneNode(!0):e,n)})}}b.parseHTML=pt,w.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},w.append=function(){var t=this;return C(arguments,(function(e){dt(t,e)})),this},w.appendTo=function(t){return dt(b(t),this),this},w.html=function(t){if(void 0===t)return this[0]&&this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each((function(t,n){n.innerHTML=e}))},w.insertAfter=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,i){r.insertBefore(t?i.cloneNode(!0):i,n.nextSibling)}))})),this},w.after=function(){var t=this;return C(u.apply(arguments),(function(e){u.apply(b(e).slice()).insertAfter(t)})),this},w.insertBefore=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,i){r.insertBefore(t?i.cloneNode(!0):i,n)}))})),this},w.before=function(){var t=this;return C(arguments,(function(e){b(e).insertBefore(t)})),this},w.prepend=function(){var t=this;return C(arguments,(function(e){dt(t,e,!0)})),this},w.prependTo=function(t){return dt(b(t),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(t){var e=this;return this.each((function(n,r){var i=r.parentNode;if(i){var o=n?b(t).clone():b(t);if(!o[0])return e.remove(),!1;i.replaceChild(o[0],r),b(o[0]).after(o.slice(1))}}))},w.replaceAll=function(t){return b(t).replaceWith(this),this},w.text=function(t){return void 0===t?this[0]?this[0].textContent:'':this.each((function(e,n){n.textContent=t}))};var gt=r&&r.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+i.pageYOffset-gt.clientTop,left:e.left+i.pageXOffset-gt.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},w.children=function(t){var e=[];return this.each((function(t,n){c.apply(e,n.children)})),e=b(M(e)),t?e.filter((function(e,n){return _(n,t)})):e},w.contents=function(){var t=[];return this.each((function(e,n){c.apply(t,'IFRAME'===n.tagName?[n.contentDocument]:n.childNodes)})),b(t.length&&M(t))},w.find=function(t){for(var e=[],n=0,r=this.length;n<r;n++){var i=m(t,this[n]);i.length&&c.apply(e,i)}return b(e.length&&M(e))},w.has=function(t){var e=T(t)?function(e,n){return!!m(t,n).length}:function(e,n){return n.contains(t)};return this.filter(e)},w.is=function(t){if(!t||!this[0])return!1;var e=A(t),n=!1;return this.each((function(r,i){return!(n=e(r,i,t))})),n},w.next=function(){return b(this[0]&&this[0].nextElementSibling)},w.not=function(t){if(!t||!this[0])return this;var e=A(t);return this.filter((function(n,r){return!e(n,r,t)}))},w.parent=function(){var t=[];return this.each((function(e,n){n&&n.parentNode&&t.push(n.parentNode)})),b(M(t))},w.index=function(t){var e=t?b(t)[0]:this[0],n=t?this:b(e).parent().children();return s.call(n,e)},w.closest=function(t){return t&&this[0]?this.is(t)?this.filter(t):this.parent().closest(t):b()},w.parents=function(t){var e,n=[];return this.each((function(i,o){for(e=o;e&&e.parentNode&&e!==r.body.parentNode;)e=e.parentNode,(!t||t&&_(e,t))&&n.push(e)})),b(M(n))},w.prev=function(){return b(this[0]&&this[0].previousElementSibling)},w.siblings=function(){var t=this[0];return this.parent().children().filter((function(e,n){return n!==t}))};const vt=b},9283:(t,e,n)=>{"use strict";n.d(e,{$Q:()=>p,FW:()=>u,G1:()=>a,L_:()=>l,Mx:()=>s,R3:()=>d,SJ:()=>y,dL:()=>h,pn:()=>f,rw:()=>v,sE:()=>c,t3:()=>m,ut:()=>g});var r=n(9050),i='tag',o='attributes',a='transitionend oTransitionEnd transitionend webkitTransitionEnd',s=function(t){return t&&9===t.nodeType},l=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},c=function(t,e){return t.querySelectorAll(e)},u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&t.setAttribute&&(0,r.each)(e,(function(e,n){return t.setAttribute(n,e)}))},f=function(t){return t&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},h=function(t,e){t.parentNode.replaceChild(e,t)},p=function(t,e,n){var i=t.childNodes,o=i.length,a=(0,r.isUndefined)(n)?o:n;(0,r.isString)(e)&&(t.insertAdjacentHTML('beforeEnd',e),e=t.lastChild,t.removeChild(e)),a>=o?t.appendChild(e):t.insertBefore(e,i[a])},d=function(t,e){return p(t,e)},g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=document.createElement(t);return e&&(0,r.each)(e,(function(t,e){return i.setAttribute(e,t)})),n&&((0,r.isString)(n)?i.innerHTML=n:i.appendChild(n)),i},v=function(t){return document.createTextNode(t)},m=function(t,e){var n,r=t.type;try{n=new window[e](r,t)}catch(t){(n=document.createEvent(e)).initEvent(r,!0,!0)}return n._parentEvent=t,0===r.indexOf('key')&&(n.keyCodeVal=t.keyCode,['keyCode','which'].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})}))),n},y=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(e)?e:[e];n.forEach((function(e){var n=e[i]||'div',a=e[o]||{},s=document.createElement(n);(0,r.each)(a,(function(t,e){s.setAttribute(e,t)})),t.appendChild(s)}))}},9661:(t,e,n)=>{"use strict";n.d(e,{Z:()=>m});var r=n(1002);const i=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))};const o=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError((0,r.Z)(t)+' '+t+' is not iterable(cannot read property Symbol(Symbol.iterator))'));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var o=i.length;function a(t,n){if(n&&('object'===(0,r.Z)(n)||'function'==typeof n)){var s=n.then;if('function'==typeof s)return void s.call(n,(function(e){a(t,e)}),(function(n){i[t]={status:'rejected',reason:n},0==--o&&e(i)}))}i[t]={status:'fulfilled',value:n},0==--o&&e(i)}for(var s=0;s<i.length;s++)a(s,i[s])}))};var a=setTimeout;function s(t){return Boolean(t&&void 0!==t.length)}function l(){}function c(t){if(!(this instanceof c))throw new TypeError('Promises must be constructed via new');if('function'!=typeof t)throw new TypeError('not a function');this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],g(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,c._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void h(e.promise,t)}f(e.promise,r)}else(1===t._state?f:h)(e.promise,t._value)}))):t._deferreds.push(e)}function f(t,e){try{if(e===t)throw new TypeError('A promise cannot be resolved with itself.');if(e&&('object'===(0,r.Z)(e)||'function'==typeof e)){var n=e.then;if(e instanceof c)return t._state=3,t._value=e,void p(t);if('function'==typeof n)return void g((i=n,o=e,function(){i.apply(o,arguments)}),t)}t._state=1,t._value=e,p(t)}catch(e){h(t,e)}var i,o}function h(t,e){t._state=2,t._value=e,p(t)}function p(t){2===t._state&&0===t._deferreds.length&&c._immediateFn((function(){t._handled||c._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function d(t,e,n){this.onFulfilled='function'==typeof t?t:null,this.onRejected='function'==typeof e?e:null,this.promise=n}function g(t,e){var n=!1;try{t((function(t){n||(n=!0,f(e,t))}),(function(t){n||(n=!0,h(e,t))}))}catch(t){if(n)return;n=!0,h(e,t)}}c.prototype['catch']=function(t){return this.then(null,t)},c.prototype.then=function(t,e){var n=new this.constructor(l);return u(this,new d(t,e,n)),n},c.prototype['finally']=i,c.all=function(t){return new c((function(e,n){if(!s(t))return n(new TypeError('Promise.all accepts an array'));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var o=i.length;function a(t,s){try{if(s&&('object'===(0,r.Z)(s)||'function'==typeof s)){var l=s.then;if('function'==typeof l)return void l.call(s,(function(e){a(t,e)}),n)}i[t]=s,0==--o&&e(i)}catch(t){n(t)}}for(var l=0;l<i.length;l++)a(l,i[l])}))},c.allSettled=o,c.resolve=function(t){return t&&'object'===(0,r.Z)(t)&&t.constructor===c?t:new c((function(e){e(t)}))},c.reject=function(t){return new c((function(e,n){n(t)}))},c.race=function(t){return new c((function(e,n){if(!s(t))return n(new TypeError('Promise.race accepts an array'));for(var r=0,i=t.length;r<i;r++)c.resolve(t[r]).then(e,n)}))},c._immediateFn='function'==typeof setImmediate&&function(t){setImmediate(t)}||function(t){a(t,0)},c._unhandledRejectionFn=function(t){'undefined'!=typeof console&&console&&console.warn('Possible Unhandled Promise Rejection:',t)};const v=c;(0,n(1163).hasWin)()&&(window.Promise=window.Promise||v);const m='function'==typeof fetch?fetch.bind():function(t,e){return new v((function(n,r){var i=new XMLHttpRequest;for(var o in i.open(e.method||'get',t),i.withCredentials='include'==e.credentials,e.headers||{})i.setRequestHeader(o,e.headers[o]);i.onload=function(t){return n({status:i.status,statusText:i.statusText,text:function(){return v.resolve(i.responseText)}})},i.onerror=r,i.upload&&e.onProgress&&(i.upload.onprogress=e.onProgress),e.body?i.send(e.body):i.send()}))}},6718:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>C});var r=n(4942),i=n(5610),o=n(2316),a=n.n(o),s=n(9050),l=n(1163);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f=a().$,h=function(){};const p=a().View.extend({initialize:function(t){this.opt=t||{},(0,s.bindAll)(this,'startSort','onMove','endMove','rollback','updateOffset','moveDragHelper');var e=t||{};this.elT=0,this.elL=0,this.borderOffset=e.borderOffset||10;var n=e.container;this.el='string'==typeof n?document.querySelector(n):n,this.$el=f(this.el),this.containerSel=e.containerSel||'div',this.itemSel=e.itemSel||'div',this.draggable=e.draggable||!0,this.nested=e.nested||0,this.pfx=e.pfx||'',this.ppfx=e.ppfx||'',this.freezeClass=e.freezeClass||this.pfx+'freezed',this.onStart=e.onStart||h,this.onEndMove=e.onEndMove||'',this.customTarget=e.customTarget,this.onEnd=e.onEnd,this.direction=e.direction||'v',this.onMoveClb=e.onMove||'',this.relative=e.relative||0,this.ignoreViewChildren=e.ignoreViewChildren||0,this.ignoreModels=e.ignoreModels||0,this.plh=e.placer||'',this.wmargin=e.wmargin||0,this.offTop=e.offsetTop||0,this.offLeft=e.offsetLeft||0,this.document=e.document||document,this.$document=f(this.document),this.dropContent=null,this.em=e.em||null,this.dragHelper=null,this.canvasRelative=e.canvasRelative||0,this.selectOnEnd=!e.avoidSelectOnEnd,this.scale=e.scale,this.activeTextModel=null,this.em&&this.em.on&&(this.em.on('change:canvasOffset',this.updateOffset),this.updateOffset())},getScale:function(){return(0,s.result)(this,scale)||1},getContainerEl:function(t){if(t&&(this.el=t),!this.el){var e=this.opt.container;this.el='string'==typeof e?document.querySelector(e):e,this.$el=f(this.el)}return this.el},getDocuments:function(t){var e=this.em,n=t?t.ownerDocument:e&&e.get('Canvas').getBody().ownerDocument,r=[document];return n&&r.push(n),r},updateOffset:function(){var t,e=(null===(t=this.em)||void 0===t?void 0:t.get('canvasOffset'))||{};this.offTop=e.top,this.offLeft=e.left},setDropContent:function(t){this.dropModel=null,this.dropContent=t},updateTextViewCursorPosition:function(t){var e=this.em;if(e){var n=e.get('Canvas'),r=n.getDocument(),i=null;if(r.caretRangeFromPoint){var o=(0,l.getPointerEvent)(t);i=r.caretRangeFromPoint(o.clientX,o.clientY)}else t.rangeParent&&(i=r.createRange()).setStart(t.rangeParent,t.rangeOffset);var a=n.getWindow().getSelection();n.getFrameEl().focus(),a.removeAllRanges(),i&&a.addRange(i),this.setContentEditable(this.activeTextModel,!0)}},setContentEditable:function(t,e){if(t){var n=t.getEl();n.contentEditable!=e&&(n.contentEditable=e)}},toggleSortCursor:function(t){var e=this.em,n=e&&e.get('Canvas');n&&(t?n.startAutoscroll():n.stopAutoscroll())},setDragHelper:function(t,e){for(var n=e||'',r=t.cloneNode(1),i=t.getBoundingClientRect(),o=getComputedStyle(t),a='',s=0;s<o.length;s++){var l=o[s];a+="".concat(l,":").concat(o.getPropertyValue(l),";")}document.body.appendChild(r),r.className+=" ".concat(this.pfx,"bdrag"),r.setAttribute('style',a),this.dragHelper=r,r.style.width="".concat(i.width,"px"),r.style.height="".concat(i.height,"px"),n&&this.moveDragHelper(n),this.em&&f(this.em.get('Canvas').getBody().ownerDocument).off('mousemove',this.moveDragHelper).on('mousemove',this.moveDragHelper),f(document).off('mousemove',this.moveDragHelper).on('mousemove',this.moveDragHelper)},moveDragHelper:function(t){var e=t.target.ownerDocument;if(this.dragHelper&&e){var n=t.pageY,r=t.pageX,i=0,o=0,a=(e.defaultView||e.parentWindow).frameElement,s=this.dragHelper.style;if(a){var l=a.getBoundingClientRect();i=l.top+document.documentElement.scrollTop,o=l.left+document.documentElement.scrollLeft,n=t.clientY,r=t.clientX}s.top=n+i+'px',s.left=r+o+'px'}},matches:function(t,e,n){return l.matches.call(t,e)},closest:function(t,e){if(t){for(var n=t.parentNode;n&&1===n.nodeType;){if(this.matches(n,e))return n;n=n.parentNode}return null}},offset:function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},createPlaceholder:function(){var t=this.pfx,e=document.createElement('div'),n=document.createElement('div');return e.className=t+'placeholder',e.style.display='none',e.style['pointer-events']='none',n.className=t+'placeholder-int',e.appendChild(n),e},startSort:function(t){var e,n,r,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=this.em,c=this.itemSel,u=this.containerSel,f=this.plh,h=this.getContainerEl(a.container),p=this.getDocuments(t);this.dropModel=null,this.target=null,this.prevTarget=null,this.moved=0,t&&!this.matches(t,"".concat(c,", ").concat(u))&&(t=this.closest(t,c)),this.sourceEl=t,f||(this.plh=this.createPlaceholder(),h.appendChild(this.plh)),t&&((o=this.getSourceModel(t))&&o.set&&o.set('status','freezed'),this.srcModel=o),(0,l.on)(h,'mousemove dragover',this.onMove),(0,l.on)(p,'mouseup dragend touchend',this.endMove),(0,l.on)(p,'keydown',this.rollback),this.onStart({sorter:this,target:o,parent:o&&(null===(e=(n=o).parent)||void 0===e?void 0:e.call(n)),index:o&&(null===(r=(i=o).index)||void 0===r?void 0:r.call(i))}),null==s||s.clearSelection(),this.toggleSortCursor(1),null==s||s.trigger('sorter:drag:start',t,o)},getTargetModel:function(t){var e=t||this.target;return f(e).data('model')},getSourceModel:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.target,i=n.avoidChildren,o=void 0===i?1:i,a=this.em,s=this.sourceEl,l=t||s,c=this.dropModel,h=this.dropContent,p=function(t){return t&&r&&t.opt&&t.opt.avoidChildren&&e.isTextableActive(t,r)};if(h&&a){if(p(c)&&(c=null),!c){var d=a.get('DomComponents').getComponents(),g={avoidChildren:o,avoidStore:1,avoidUpdateStyle:1},v=d.add(h,u(u({},g),{},{temporary:1}));if(c=(c=d.remove(v,g))instanceof Array?c[0]:c,this.dropModel=c,p(c))return this.getSourceModel(l,{target:r,avoidChildren:0})}return c}return l&&f(l).data('model')},selectTargetModel:function(t,e){if(!(t instanceof a().Collection||e&&e===t)){var n=this.targetModel;n&&n!==this.srcModel&&n.set('status',''),t&&t.set&&(t.set('status','selected-parent'),this.targetModel=t)}},onMove:function(t){var e=t,n=this.em,r=this.onMoveClb,i=this.plh,o=this.customTarget;this.moved=1;var a=i.style.display;a&&'none'!==a||(i.style.display='block');var l=this.offset(this.el);this.elT=this.wmargin?Math.abs(l.top):l.top,this.elL=this.wmargin?Math.abs(l.left):l.left;var c=t.pageY-this.elT+this.el.scrollTop,u=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&n){var h=n.get('Canvas').getMouseRelativeCanvas(t,{noScroll:1});u=h.x,c=h.y}this.rX=u,this.rY=c,this.eventMove=t;var p=this.getSourceModel(),d=o?o({sorter:this,event:t}):t.target,g=this.dimsFromTarget(d,u,c),v=this.target,m=v&&this.getTargetModel(v);if(this.selectTargetModel(m,p),m||(i.style.display='none'),v){this.lastDims=g;var y=this.findPosition(g,u,c);this.isTextableActive(p,m)?(this.activeTextModel=m,i.style.display='none',this.lastPos=y,this.updateTextViewCursorPosition(e)):(this.disableTextable(),this.activeTextModel=null,this.lastPos&&this.lastPos.index==y.index&&this.lastPos.method==y.method||(this.movePlaceholder(this.plh,g,y,this.prevTargetDim),this.$plh||(this.$plh=f(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css('top','+='+this.offTop+'px'),this.offLeft&&this.$plh.css('left','+='+this.offLeft+'px')),this.lastPos=y)),(0,s.isFunction)(r)&&r({event:t,target:p,parent:m,index:y.index+('after'==y.method?1:0)}),n&&n.trigger('sorter:drag',{target:v,targetModel:m,sourceModel:p,dims:g,pos:y,x:u,y:c})}},isTextableActive:function(t,e){var n;return(null==t||null===(n=t.get)||void 0===n?void 0:n.call(t,'textable'))&&(null==e?void 0:e.isInstanceOf('text'))},disableTextable:function(){var t=this.activeTextModel;t&&t.getView().disableEditing(),this.setContentEditable(t,!1)},isInFlow:function(t,e){if(!t)return!1;e=e||document.body;var n=t;return n.offsetHeight,!!this.styleInFlow(n,e)},styleInFlow:function(t,e){if(!(0,l.isTextNode)(t)){var n=t.style||{},r=f(t),i=e&&f(e);if(!n.overflow||'visible'===n.overflow){var o=r.css('float');if(!(o&&'none'!==o||i&&'flex'==i.css('display')&&'column'!==i.css('flex-direction'))){switch(n.position){case'static':case'relative':case'':break;default:return}switch(t.tagName){case'TR':case'TBODY':case'THEAD':case'TFOOT':return!0}switch(r.css('display')){case'block':case'list-item':case'table':case'flex':return!0}}}}},validTarget:function(t,e){var n=this.getTargetModel(t),r=this.getSourceModel(e,{target:n}),i={valid:!0,src:e=r&&r.view&&r.view.el,srcModel:r,trg:t=n&&n.view&&n.view.el,trgModel:n};if(!e||!t)return i.valid=!1,i;var o=r.get('draggable');if((0,s.isFunction)(o)){var l=o(r,n);i.dragInfo=l,i.draggable=l,o=l}else o=o instanceof Array?o.join(', '):o,i.dragInfo=o,o=(0,s.isString)(o)?this.matches(t,o):o,i.draggable=o;var c=n.get('droppable');if((0,s.isFunction)(c)){var u=c(r,n);i.droppable=u,i.dropInfo=u,c=u}else c=(c=c instanceof a().Collection?1:c)instanceof Array?c.join(', '):c,i.dropInfo=c,c=(0,s.isString)(c)?this.matches(e,c):c,c=o&&this.isTextableActive(r,n)?1:c,i.droppable=c;return c&&o||(i.valid=!1),i},dimsFromTarget:function(t,e,n){var r=this.em,i=[];if(!t)return i;if(this.matches(t,"".concat(this.itemSel,", ").concat(this.containerSel))||(t=this.closest(t,this.itemSel)),this.draggable instanceof Array&&(t=this.closest(t,this.draggable.join(','))),!t)return i;if(this.prevTarget&&this.prevTarget!=t&&(this.prevTarget=null),!this.prevTarget){this.targetP=this.closest(t,this.containerSel);var o=this.validTarget(t);if(r&&r.trigger('sorter:drag:validation',o),!o.valid&&this.targetP)return this.dimsFromTarget(this.targetP,e,n);this.prevTarget=t,this.prevTargetDim=this.getDim(t),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(t)}if(this.prevTarget==t&&(i=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,e,n)||!this.nested&&!this.cacheDims.length){var a=this.targetP;a&&this.validTarget(a).valid&&(i=this.cacheDimsP,this.target=a)}return this.lastPos=null,i},getTargetFromEl:function(t){var e,n=t,r=this.targetPrev,i=this.em,o=this.containerSel,a=this.itemSel;if(this.matches(n,"".concat(a,", ").concat(o))||(n=this.closest(n,a)),this.draggable instanceof Array&&(n=this.closest(n,this.draggable.join(','))),r&&r!=n&&(this.targetPrev=''),!this.targetPrev){e=this.closest(n,o);var s=this.validTarget(n);if(i&&i.trigger('sorter:drag:validation',s),!s.valid&&e)return this.getTargetFromEl(e);this.targetPrev=n}return this.nearElBorders(n)&&(e=this.closest(n,o))&&this.validTarget(e).valid&&(n=e),n},nearElBorders:function(t){var e=10,n=t.getBoundingClientRect(),r=t.ownerDocument.body,i=this.getCurrentPos(),o=i.x,a=i.y,s=n.top+r.scrollTop,l=n.left+r.scrollLeft,c=n.width,u=n.height;if(a<s+e||a>s+u-e||o<l+e||o>l+c-e)return 1},getCurrentPos:function(){var t=this.eventMove;return{x:t.pageX||0,y:t.pageY||0}},getDim:function(t){var e,n,r,i,o=this.em,a=this.canvasRelative,s=o&&o.get('Canvas'),l=s?s.getElementOffsets(t):{};if(a&&o){var c=s.getElementPos(t,{noScroll:1});e=c.top,n=c.left,r=c.height,i=c.width}else{var u=this.offset(t);e=this.relative?t.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=t.offsetHeight,i=t.offsetWidth}return{top:e,left:n,height:r,width:i,offsets:l}},getChildrenDim:function(t){var e=this,n=[];if(!t)return n;var r=this.getTargetModel(t);if(r&&r.view&&!this.ignoreViewChildren){var i=r.getCurrentView?r.getCurrentView():r.view;t=i.getChildrenContainer()}return(0,s.each)(t.children,(function(r,i){var o=(0,l.getModel)(r,f),a=o&&o.index?o.index():i;if((0,l.isTextNode)(r)||e.matches(r,e.itemSel)){var s=e.getDim(r),c=e.direction;c='v'==c||'h'!=c&&e.isInFlow(r,t),s.dir=c,s.el=r,s.indexEl=a,n.push(s)}})),n},nearBorders:function(t,e,n){var r=0,i=this.borderOffset,o=e||0,a=n||0,s=t.top,l=t.left,c=t.height,u=t.width;return(s+i>a||a>s+c-i||l+i>o||o>l+u-i)&&(r=1),!!r},findPosition:function(t,e,n){for(var r={index:0,indexEl:0,method:'before'},i=0,o=0,a=0,s=0,l=0,c=0,u=0,f=0,h=t.length;f<h;f++){var p=u=t[f],d=p.top,g=p.left,v=p.height,m=p.width;if(c=d+v,s=g+m/2,l=d+v/2,!(o&&g>o||a&&l>=a||i&&g+m<i))if(r.index=f,r.indexEl=u.indexEl,u.dir){if(n<l){r.method='before';break}r.method='after'}else n<c&&(a=c),e<s?(o=s,r.method='before'):(i=s,r.method='after')}return r},movePlaceholder:function(t,e,n,r){var i=0,o=0,a=0,s=0,l=0,c='px',u=5,f=n.method,h=e[n.index];if(t.classList.remove('vertical'),t.classList.add('horizontal'),h){var p=h.top,d=h.left,g=h.height,v=h.width;h.dir?(s=v+c,l='auto',o='before'==f?p-i:p+g-i,a=d):(s='auto',l=g-2*i+c,o=p+i,a='before'==f?d-i:d+v-i,t.classList.remove('horizontal'),t.classList.add('vertical'))}else{if(!this.nested)return void(t.style.display='none');if(r){var m=r.offsets||{},y=m.paddingTop||u,b=m.paddingLeft||u;o=r.top+y,a=r.left+b,s=parseInt(r.width)-2*b+c,l='auto'}}t.style.top=o+c,t.style.left=a+c,s&&(t.style.width=s),l&&(t.style.height=l)},parents:function(t){return t?[t].concat(this.parents(t.parent())):[]},sort:function(t,e){var n=t.parents.filter((function(t){return e.parents.includes(t)}))[0];if(!n)return e.model.index()-t.model.index();var r=t.parents[t.parents.indexOf(n)-1];return e.parents[e.parents.indexOf(n)-1].index()-r.index()},endMove:function(t){var e,n=this,r=this.sourceEl,i=[],o=this.getDocuments(),a=this.getContainerEl(),c=this.onEndMove,f=this.onEnd,h=this.target,p=this.lastPos;if((0,l.off)(a,'mousemove dragover',this.onMove),(0,l.off)(o,'mouseup dragend touchend',this.endMove),(0,l.off)(o,'keydown',this.rollback),this.plh.style.display='none',r&&(e=this.getSourceModel(),this.selectOnEnd&&e&&e.set&&(e.set('status',''),e.set('status','selected'))),this.moved&&h){var d=this.toMove,g=(0,s.isArray)(d)?d:d?[d]:[r],v=0;1===g.length?i.push(this.move(h,g[0],p)):g.map((function(t){return{model:t,parents:n.parents(t)}})).sort(this.sort).forEach((function(t){var e=t.model,r=e.index(),o=e.parent().getEl();i.push(n.move(h,e,u(u({},p),{},{indexEl:p.indexEl-v,index:p.index-v}))),o===h&&r<=p.index&&v++}))}this.plh&&(this.plh.style.display='none');var m=this.dragHelper;if(m&&(m.parentNode.removeChild(m),this.dragHelper=null),this.disableTextable(),this.selectTargetModel(),this.toggleSortCursor(),this.toMove=null,this.eventMove=0,this.dropModel=null,(0,s.isFunction)(c)){var y={target:e,parent:e&&e.parent(),index:e&&e.index()};i.length?i.forEach((function(t){return c(t,n,y)})):c(null,this,u(u({},y),{},{cancelled:1}))}(0,s.isFunction)(f)&&f({sorter:this})},move:function(t,e,n){var r,i,o=this.em,c=this.dropContent,u=(0,l.getElement)(e),h=[],p='after'===n.method?n.indexEl+1:n.indexEl,d=this.validTarget(t,u),g=f(t).data('collection'),v=d.trgModel,m=d.srcModel,y=d.draggable,b=v instanceof a().Collection?1:d.droppable;if(g&&b&&y){var w={at:p,action:'move-component'},k=this.isTextableActive(m,v);if(c)r=(0,s.isFunction)(c)?c():c,w.avoidUpdateStyle=!0,w.action='add-component';else{var x=m.collection.indexOf(m),O=g===m.collection;(!O||!(x===p||x===p-1)||k)&&(r=m.collection.remove(m,{temporary:!0}),O&&p>x&&(w.at=p-1))}r&&(k?(delete w.at,i=v.getView().insertComponent(r,w)):i=g.add(r,w)),this.dropContent=null,this.prevTarget=null}else if(o){var C=d.dropInfo||(null==v?void 0:v.get('droppable')),S=d.dragInfo||(null==m?void 0:m.get('draggable'));!g&&h.push('Target collection not found'),!b&&C&&h.push("Target is not droppable, accepts [".concat(C,"]")),!y&&S&&h.push("Component not draggable, acceptable by [".concat(S,"]")),o.logWarning('Invalid target position',{errors:h,model:m,context:'sorter',target:v})}return null==o||o.trigger('sorter:drag:end',{targetCollection:g,modelToDrop:r,warns:h,validResult:d,dst:t,srcEl:u}),i},rollback:function(t){(0,l.off)(this.getDocuments(),'keydown',this.rollback),27==(t.which||t.keyCode)&&(this.moved=0,this.endMove())}});var d=n(5671),g=n(3144);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var y={mousePosFetcher:null,updateTarget:null,ratioDefault:0,posFetcher:null,onStart:null,onMove:null,onEnd:null,onUpdateContainer:function(){},step:1,minDim:10,maxDim:'',unitHeight:'px',unitWidth:'px',keyHeight:'height',keyWidth:'width',currentUnit:1,silentFrames:0,avoidContainerUpdate:0,keepAutoHeight:!1,keepAutoWidth:!1,autoHeight:!1,autoWidth:!1,tl:1,tc:1,tr:1,cl:1,cr:1,bl:1,bc:1,br:1},b=function(t,e){var n=e||window,r=t.getBoundingClientRect();return{left:r.left+n.pageXOffset,top:r.top+n.pageYOffset,width:r.width,height:r.height}},w=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,d.Z)(this,t),this.setOptions(e),(0,s.bindAll)(this,'handleKeyDown','handleMouseDown','move','stop'),this}return(0,g.Z)(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,s.defaults)(t,y),this.setup()}},{key:"setup",value:function(){var t=this.opts,e=t.prefix||'',n=t.appendTo||document.body,r=this.container;for(r||((r=document.createElement('div')).className="".concat(e,"resizer-c"),n.appendChild(r),this.container=r);r.firstChild;)r.removeChild(r.firstChild);var i={};for(var o in['tl','tc','tr','cl','cr','bl','bc','br'].forEach((function(e){return i[e]=t[e]?function(t,e){var n=e.prefix||'',r=document.createElement('i');return r.className=n+'resizer-h '+n+'resizer-h-'+t,r.setAttribute('data-'+n+'handler',t),r}(e,t):''})),i){var a=i[o];a&&r.appendChild(a)}this.handlers=i,this.mousePosFetcher=t.mousePosFetcher,this.updateTarget=t.updateTarget,this.posFetcher=t.posFetcher,this.onStart=t.onStart,this.onMove=t.onMove,this.onEnd=t.onEnd,this.onUpdateContainer=t.onUpdateContainer}},{key:"toggleFrames",value:function(t){if(this.opts.silentFrames){var e=document.querySelectorAll('iframe');(0,s.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:"getParentEl",value:function(){return this.el.parentElement}},{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):b(t)}},{key:"focus",value:function(t){t&&t===this.el||(this.el=t,this.updateContainer({forceShow:1}),(0,l.on)(this.getDocumentEl(),'pointerdown',this.handleMouseDown))}},{key:"blur",value:function(){this.container.style.display='none',this.el&&((0,l.off)(this.getDocumentEl(),'pointerdown',this.handleMouseDown),this.el=null)}},{key:"start",value:function(t){if(0===t.button){t.preventDefault(),t.stopPropagation();var e=this.el,n=this.getParentEl(),r=this.opts||{},i=this.mousePosFetcher,o='data-'+r.prefix+'handler',a=this.getElementPos(e,{target:'el'}),c=this.getElementPos(n);this.handlerAttr=t.target.getAttribute(o),this.clickedHandler=t.target,this.startDim={t:a.top,l:a.left,w:a.width,h:a.height},this.rectDim={t:a.top,l:a.left,w:a.width,h:a.height},this.startPos=i?i(t):{x:t.clientX,y:t.clientY},this.parentDim={t:c.top,l:c.left,w:c.width,h:c.height};var u=this.getDocumentEl();this.docs=u,(0,l.on)(u,'pointermove',this.move),(0,l.on)(u,'keydown',this.handleKeyDown),(0,l.on)(u,'pointerup',this.stop),(0,s.isFunction)(this.onStart)&&this.onStart(t,{docs:u,config:r,el:e,resizer:this}),this.toggleFrames(1),this.move(t)}}},{key:"move",value:function(t){var e=this.onMove,n=this.mousePosFetcher,r=n?n(t):{x:t.clientX,y:t.clientY};this.currentPos=r,this.delta={x:r.x-this.startPos.x,y:r.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)}},{key:"stop",value:function(t){var e=this.el,n=this.opts,r=this.docs||this.getDocumentEl();(0,l.off)(r,'pointermove',this.move),(0,l.off)(r,'keydown',this.handleKeyDown),(0,l.off)(r,'pointerup',this.stop),this.updateRect(1),this.toggleFrames(),(0,s.isFunction)(this.onEnd)&&this.onEnd(t,{docs:r,config:n,el:e,resizer:this}),delete this.docs}},{key:"updateRect",value:function(t){var e=this.el,n=this.opts,r=this.rectDim,i=this.updateTarget,o=this.getSelectedHandler(),a=n.unitHeight,l=n.unitWidth,c=n.keyWidth,u=n.keyHeight;if((0,s.isFunction)(i))i(e,r,{store:t,selectedHandler:o,resizer:this,config:n});else{var f=e.style;f[c]=r.w+l,f[u]=r.h+a}this.updateContainer()}},{key:"updateContainer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.opts,n=this.container,r=this.el,i=n.style;!e.avoidContainerUpdate&&r&&t.forceShow&&(i.display='block'),this.onUpdateContainer({el:n,resizer:this,opts:m(m({},e),t)})}},{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,n=this.opts||{},r=n.step,i=this.startDim,o=n.minDim,a=n.maxDim,s=t.delta.x,c=t.delta.y,u=this.parentDim.w,f=this.parentDim.h,h=this.opts.unitWidth,p=this.opts.unitHeight,d='%'===h?i.w/100*u:i.w,g='%'===p?i.h/100*f:i.h,v={t:0,l:0,w:d,h:g};if(t){var m=t.handlerAttr;~m.indexOf('r')&&(e='%'===h?(0,l.normalizeFloat)((d+s*r)/u*100,.01):(0,l.normalizeFloat)(d+s*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.w=e),~m.indexOf('b')&&(e='%'===p?(0,l.normalizeFloat)((g+c*r)/f*100,.01):(0,l.normalizeFloat)(g+c*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.h=e),~m.indexOf('l')&&(e='%'===h?(0,l.normalizeFloat)((d-s*r)/u*100,.01):(0,l.normalizeFloat)(d-s*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.w=e),~m.indexOf('t')&&(e='%'===p?(0,l.normalizeFloat)((g-c*r)/f*100,.01):(0,l.normalizeFloat)(g-c*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.h=e);var y=n.ratioDefault?!t.keys.shift:t.keys.shift;if(m.indexOf('c')<0&&y){var b=i.w/i.h;v.w/v.h>b?v.h=Math.round(v.w/b):v.w=Math.round(v.h*b)}return~m.indexOf('l')&&(v.l=i.w-v.w),~m.indexOf('t')&&(v.t=i.h-v.h),v}}}]),t}();const k={init:function(t){return new w(t)}};function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){(0,r.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const C=function(){return{name:'Utils',init:function(){return this},destroy:function(){},Sorter:p,Resizer:k,Dragger:i.Z,helpers:O({},l)}}},7116:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r,i=n(2316),o=n.n(i),a=n(9050),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(e,n,r){return t.call(this,n,{module:e,modelConstructor:r})||this}return s(e,t),e.prototype.add=function(e,n){var r,i=this,o=(0,a.isArray)(e)?e:(0,a.isUndefined)(e)?void 0:[e];return o=null!==(r=null==o?void 0:o.map((function(t){return t instanceof i.newModel?t:new i.newModel(i.module,t)})))&&void 0!==r?r:[void 0],t.prototype.add.call(this,(0,a.isArray)(e)?o:o[0],n)},e.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},e}(o().Collection)},7904:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r,i=n(2316),o=n.n(i),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(e,n,r){var i=t.call(this,n,r)||this;return i._module=e,i}return a(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),e}(o().Model)},6434:(t,e,n)=>{"use strict";n.d(e,{O:()=>f,Z:()=>u});var r,i=n(9050),o=n(1163),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=void 0&&(void 0).__assign||function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)},l=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},c=function(){function t(t,e,n){this.cls=[],this.isPrivate=!1,this._em=t,this._name=e;var r=this.name.charAt(0).toLowerCase()+this.name.slice(1),a=(0,i.isUndefined)(t.config[r])?t.config[this.name]:t.config[r],s=!0===a?{}:a||{};s.pStylePrefix=t.config.pStylePrefix||'',(0,i.isUndefined)(a)||a||(s._disable=1),s.em=t,this._config=(0,o.deepMerge)(n||{},s)}return Object.defineProperty(t.prototype,"em",{get:function(){return this._em},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),t.prototype.init=function(t){},t.prototype.postLoad=function(t){},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t.prototype.getConfig=function(t){return t?this.config[t]:this.config},t.prototype.__logWarn=function(t,e){void 0===e&&(e={}),this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)},t.prototype.__appendTo=function(){var t=this.getConfig().appendTo;if(t){var e=(0,i.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},t}();const u=c;var f=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.cls=[],o.private=!1,o.all=r,o.events=i,o.__initListen(),o}return a(e,t),e.prototype.postLoad=function(t){},e.prototype.render=function(){},e.prototype.getProjectData=function(t){var e={},n=this.storageKey;return n&&(e[n]=t||this.getAll()),e},e.prototype.loadProjectData=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n=e.all,r=e.onResult,i=e.reset,a=this.storageKey,s={action:'load'},l=n||this.all,c=t[a];if('string'==typeof c)try{c=JSON.parse(c)}catch(t){this.__logWarn('Data parsing failed',{input:c})}return i&&c&&l.reset(void 0,s),r?c&&r(c,s):c&&(0,o.isDef)(c.length)&&l.reset(c,s),c},e.prototype.clear=function(t){void 0===t&&(t={});var e=this.all;return e&&e.reset(void 0,t),this},e.prototype.getAll=function(){return l([],this.all.models,!0)},e.prototype.getAllMap=function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})},e.prototype.__initListen=function(t){void 0===t&&(t={});var e=this,n=e.all,r=e.em,i=e.events;n&&r&&n.on('add',(function(t,e,n){return r.trigger(i.add,t,n)})).on('remove',(function(t,e,n){return r.trigger(i.remove,t,n)})).on('change',(function(t,e){return r.trigger(i.update,t,t.changedAttributes(),e)})).on('all',this.__catchAllEvent,this),this.cls=[n].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var e=t.entity,i=t.event;e.on('all',(function(t,e,o,a){var l=s({event:t},a||o);[r,n].map((function(t){return t.trigger(i,e,l)}))}))}))},e.prototype.__remove=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,i=isString(t)?this.get(t):t,o=function(){return i&&n.all.remove(i,e),i};return!e.silent&&(null==r||r.trigger(this.events.removeBefore,i,o,e)),!e.abort&&o()},e.prototype.__catchAllEvent=function(t,e,n,r){var i=this.em,o=this.events,a=r||n;i&&o.all&&i.trigger(o.all,{event:t,model:e,options:a}),this.__onAllEvent()},e.prototype.__appendTo=function(){var t=this.config.appendTo;if(t){var e=(0,i.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},e.prototype.__onAllEvent=function(){},e.prototype._createId=function(t){void 0===t&&(t=16);var e,n=this.getAll().length+t,r=this.getAllMap();do{e=(0,o.createId)(n)}while(r[e]);return e},e.prototype.__listenAdd=function(t,e){var n=this;t.on('add',(function(t,r,i){return n.em.trigger(e,t,i)}))},e.prototype.__listenRemove=function(t,e){var n=this;t.on('remove',(function(t,r,i){return n.em.trigger(e,t,i)}))},e.prototype.__listenUpdate=function(t,e){var n=this;t.on('change',(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))},e.prototype.__destroy=function(){var t;this.cls.forEach((function(t){t.stopListening(),t.reset()})),null===(t=this.view)||void 0===t||t.remove(),this.view=void 0},e}(c)},3059:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r,i=n(2316),o=n.n(i),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.ppfx+this.config.stylePrefix||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.config.stylePrefix||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"module",{get:function(){var t,e;return null!==(e=null===(t=this.model)||void 0===t?void 0:t.module)&&void 0!==e?e:this.collection.module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.module.config},enumerable:!1,configurable:!0}),e.prototype.preinitialize=function(t){this.className=''},e}(o().View)},7287:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>q});var r=n(9050),i=n(6434),o=n(1163);const a={stylePrefix:'cv-',scripts:[],styles:[],customBadgeLabel:'',autoscrollLimit:50,extHl:0,frameContent:'<!DOCTYPE html>',frameStyle:"\n    body { background-color: #fff }\n    * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n    * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n    * ::-webkit-scrollbar { width: 10px }\n  ",notTextable:['button','a','input[type=checkbox]','input[type=radio]']};var s,l=n(7904),c=n(7948),u=n(2004),f=n(3560),h=void 0&&(void 0).__extends||(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){var n=this,r=e.em,i=e.config,o=i.scripts,a=i.styles;return(n=t.call(this,e,{scripts:o,styles:a})||this).set('frames',new f.Z(e)),n.listenTo(n,'change:zoom',n.onZoomChange),n.listenTo(r,"change:device ".concat(u.evUpdate),n.updateDevice),n.listenTo(r,c.evPageSelect,n._pageUpdated),n}return h(e,t),e.prototype.defaults=function(){return{frame:'',frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[]}},Object.defineProperty(e.prototype,"frames",{get:function(){return this.get('frames')},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this.em.get('PageManager').getMain();this.set('frames',t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype._pageUpdated=function(t,e){var n=this.em;n.setSelected(),n.get('readyCanvas')&&n.stopDefault(),null==e||e.getFrames().map((function(t){return t.disable()})),this.set('frames',t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype.updateDevice=function(t){void 0===t&&(t={});var e=this.em,n=e.getDeviceModel(),r=t.frame||e.getCurrentFrameModel();if(r&&n){var i=n.attributes,o=i.width,a=i.height;r.set({width:o,height:a},{noUndo:1})}},e.prototype.onZoomChange=function(){this.get('zoom')<1&&this.set('zoom',1)},e}(l.Z);const d=p;var g=n(6840),v=n(3059),m=n(9283),y=n(2316),b=n.n(y),w=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const k=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n=!1);var r=t.call(this,e)||this;return r.itemsView='',r.itemType='type',r.reuseView=!1,r.viewCollection=[],n&&r.listenTo(r.collection,'add',r.addTo),r}return w(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){},e.prototype.add=function(t,e){var n,r=this,i=r.reuseView,o=r.viewCollection,a=(r.itemsView,e||null),s=t.get(this.itemType);n=t.view&&i?t.view:this.renderView(t,s),o.push(n);var l=n.render().el;a?a.appendChild(l):this.$el.append(l)},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(n){return t.add(n,e)})),this.$el.append(e),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(t){void 0===t&&(t={});var e=this.viewCollection;return this.onRemoveBefore(e,t),this.clearItems(),b().View.prototype.remove.apply(this,t),this.onRemove(e,t),this},e.prototype.clearItems=function(){this.viewCollection},e}(v.Z);var x=n(4868),O=n(4942),C=n(5671),S=n(3144);function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var P=function(){function t(e,n){var i=this;(0,C.Z)(this,t),this.em=e;var o=n||e.get('Canvas').getFrames().map((function(t){return t.getComponent().getEl()})),a=Array.isArray(o)?o:[o];return this.el=o,this.counter=0,(0,r.bindAll)(this,'handleDragEnter','handleDragOver','handleDrop','handleDragLeave'),a.forEach((function(t){return i.toggleEffects(t,1)})),this}return(0,S.Z)(t,[{key:"toggleEffects",value:function(t,e){var n={on:o.on,off:o.off},r=e?'on':'off';n[r](t,'dragenter',this.handleDragEnter),n[r](t,'dragover',this.handleDragOver),n[r](t,'drop',this.handleDrop),n[r](t,'dragleave',this.handleDragLeave)}},{key:"__customTglEff",value:function(t){var e=t?o.on:o.off,n=this.el.ownerDocument,r=n.defaultView.frameElement;this.sortOpts=t?{onStart:function(t){var e=t.sorter;(0,o.on)(r,'pointermove',e.onMove)},onEnd:function(t){var e=t.sorter;(0,o.off)(r,'pointermove',e.onMove)},customTarget:function(t){var e=t.event;return n.elementFromPoint(e.clientX,e.clientY)}}:null,e(r,'pointerenter',this.handleDragEnter),e(r,'pointermove',this.handleDragOver),e(document,'pointerup',this.handleDrop),e(r,'pointerout',this.handleDragLeave)}},{key:"startCustom",value:function(){this.__customTglEff(!0)}},{key:"endCustom",value:function(t){this.over?this.endDrop(t):this.__customTglEff(!1)}},{key:"endDrop",value:function(t,e){var n=this.em,r=this.dragStop;this.counter=0,r&&r(t),this.__customTglEff(!1),n.trigger('canvas:dragend',e)}},{key:"handleDragLeave",value:function(t){this.updateCounter(-1,t)}},{key:"updateCounter",value:function(t,e){this.counter+=t,0===this.counter&&this.endDrop(1,e)}},{key:"handleDragEnter",value:function(t){var e=this,n=this.em,r=t.dataTransfer;if(this.updateCounter(1,t),!this.over){this.over=1;var i,o,a=n.get('Utils'),s=n.get('Canvas'),l=n.get('dragContent')||'<br>';if(n.stopDefault(),n.inAbsoluteMode()){var c=n.get('DomComponents').getWrapper(),u=c.append({})[0],f=n.get('Commands').run('core:component-drag',{event:t,guidesInfo:1,center:1,target:u,onEnd:function(t,n,i){var o;if(!i.cancelled){o=c.append(l)[0];var a=s.getOffset(),f=u.getStyle(),h=f.top,p=f.left,d=f.position;o.addStyle({left:parseFloat(p)-a.left+'px',top:parseFloat(h)-a.top+'px',position:d})}e.handleDragEnd(o,r),u.remove()}});i=function(e){return f.stop(t,{cancel:e})},o=function(t){return l=t}}else{var h=new a.Sorter(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){(0,O.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({em:n,wmargin:1,nested:1,canvasRelative:1,direction:'a',container:this.el,placer:s.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:'gjs-',onEndMove:function(t){return e.handleDragEnd(t,r)},document:this.el.ownerDocument},this.sortOpts||{}));h.setDropContent(l),h.startSort(),this.sorter=h,i=function(t){t&&(h.moved=0),h.endMove()},o=function(t){return h.setDropContent(t)}}this.dragStop=i,this.dragContent=o,n.trigger('canvas:dragenter',r,l)}}},{key:"handleDragEnd",value:function(t,e){var n=this.em;this.over=0,t&&(n.set('dragResult',t),n.trigger('canvas:drop',e,t)),n.runDefault({preserveSelected:1})}},{key:"handleDragOver",value:function(t){t.preventDefault(),this.em.trigger('canvas:dragover',t)}},{key:"handleDrop",value:function(t){t.preventDefault();var e=this.dragContent,n=t.dataTransfer,r=this.getContentByData(n).content;t.target.style.border='',r&&e&&e(r),this.endDrop(!r,t)}},{key:"getContentByData",value:function(t){var e=this.em,n=t&&t.types,i=t&&t.files||[],o=e.get('dragContent'),a=t&&t.getData('text');if(i.length){a=[];for(var s=0;s<i.length;s++){var l=i[s],c=l.type.split('/')[0];'image'==c&&a.push({type:c,file:l,attributes:{alt:l.name}})}}else if(o)a=o;else if((0,r.indexOf)(n,'text/html')>=0)a=t&&t.getData('text/html').replace(/<\/?meta[^>]*>/g,'');else if((0,r.indexOf)(n,'text/uri-list')>=0)a={type:'link',attributes:{href:a},content:a};else if((0,r.indexOf)(n,'text/json')>=0){var u=t&&t.getData('text/json');u&&(a=JSON.parse(u))}else 1===n.length&&'text/plain'===n[0]&&(a="<div>".concat(a,"</div>"));var f={content:a};return e.trigger('canvas:dragdata',t,f),f}}]),t}(),T=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=void 0&&(void 0).__assign||function(){return E=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},E.apply(this,arguments)},j=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},A=function(t){function e(e,n){var i=t.call(this,{model:e})||this;i.dragging=!1,i.lastMaxHeight=0,i.tools={},(0,r.bindAll)(i,'updateClientY','stopAutoscroll','autoscroll','_emitUpdate');var a=i,s=a.el;a.em;i.module._config=E(E({},i.config||{}),{frameView:i}),i.frameWrapView=n,i.showGlobalTools=(0,r.debounce)(i.showGlobalTools.bind(i),50);var l=i.getCanvasModel();return i.listenTo(e,'change:head',i.updateHead),i.listenTo(l,'change:styles',i.renderStyles),e.view=i,(0,o.setViewEl)(s,i),i}return T(e,t),Object.defineProperty(e.prototype,"tagName",{get:function(){return'iframe'},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){return{allowfullscreen:'allowfullscreen'}},enumerable:!1,configurable:!0}),e.prototype.updateHead=function(){var t=this.model,e=this.getHead(),n=[],r=[],i=t.head,o=t.previous('head'),a=function(t){return void 0===t&&(t={}),Object.keys(t).sort().map((function(e){return"[".concat(e,"=\"").concat(t[e],"\"]")})).join('')},s=function(t,e,n){t.forEach((function(t){var r=t.tag,i=t.attributes;!e.some((function(t){return t.tag===r&&a(t.attributes)===a(i)}))&&n.push(t)}))};s(i,o,r),s(o,i,n),n.forEach((function(t){var n,r=e.querySelector("".concat(t.tag).concat(a(t.attributes)));null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r)})),(0,m.SJ)(e,r)},e.prototype.getEl=function(){return this.el},e.prototype.getCanvasModel=function(){return this.em.get('Canvas').getModel()},e.prototype.getWindow=function(){return this.getEl().contentWindow},e.prototype.getDoc=function(){return this.getEl().contentDocument},e.prototype.getHead=function(){return this.getDoc().querySelector('head')},e.prototype.getBody=function(){return this.getDoc().querySelector('body')},e.prototype.getWrapper=function(){return this.getBody().querySelector('[data-gjs-type=wrapper]')},e.prototype.getJsContainer=function(){return this.jsContainer||(this.jsContainer=(0,m.ut)('div',{class:"".concat(this.ppfx,"js-cont")})),this.jsContainer},e.prototype.getToolsEl=function(){var t;return null===(t=this.frameWrapView)||void 0===t?void 0:t.elTools},e.prototype.getGlobalToolsEl=function(){return this.em.get('Canvas').getGlobalToolsEl()},e.prototype.getHighlighter=function(){return this._getTool('[data-hl]')},e.prototype.getBadgeEl=function(){return this._getTool('[data-badge]')},e.prototype.getOffsetViewerEl=function(){return this._getTool('[data-offset]')},e.prototype.getRect=function(){return this.rect||(this.rect=this.el.getBoundingClientRect()),this.rect},e.prototype.getOffsetRect=function(){var t=this.el,e=this.getBody(),n=e.scrollTop,r=e.scrollLeft,i=t.offsetHeight,o=t.offsetWidth;return{top:t.offsetTop,left:t.offsetLeft,height:i,width:o,scrollTop:n,scrollLeft:r,scrollBottom:n+i,scrollRight:r+o}},e.prototype._getTool=function(t){var e=this.tools,n=this.getToolsEl();return e[t]||(e[t]=n.querySelector(t)),e[t]},e.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.wrapper;return this._toggleEffects(!1),this.tools={},n&&n.remove(),v.Z.prototype.remove.apply(this,t),this},e.prototype.startAutoscroll=function(){var t=this;this.lastMaxHeight=this.getWrapper().offsetHeight-this.el.offsetHeight,setTimeout((function(){t._toggleAutoscrollFx(!0),requestAnimationFrame(t.autoscroll)}),0)},e.prototype.autoscroll=function(){if(this.dragging){var t=this.lastClientY,e=this.em.get('Canvas'),n=this.getWindow(),i=n.pageYOffset,o=t||0,a=e.getConfig().autoscrollLimit,s=this.getRect().height-a,l=i;if(o<a&&(l-=a-o),o>s&&(l+=o-s),!(0,r.isUndefined)(t)&&l!==i&&l>0&&l<this.lastMaxHeight)this.getGlobalToolsEl().style.opacity=0,this.showGlobalTools(),n.scrollTo(0,l);requestAnimationFrame(this.autoscroll)}},e.prototype.updateClientY=function(t){t.preventDefault(),this.lastClientY=(0,o.getPointerEvent)(t).clientY*this.em.getZoomDecimal()},e.prototype.showGlobalTools=function(){this.getGlobalToolsEl().style.opacity=''},e.prototype.stopAutoscroll=function(){this.dragging&&this._toggleAutoscrollFx(!1)},e.prototype._toggleAutoscrollFx=function(t){this.dragging=t;var e=this.getWindow(),n=t?'on':'off',r={on:o.on,off:o.off};r[n](e,'mousemove dragover',this.updateClientY),r[n](e,'mouseup',this.stopAutoscroll)},e.prototype.render=function(){var t=this.$el,e=this.ppfx;return t.attr({class:"".concat(e,"frame")}),this.renderScripts(),this},e.prototype.renderScripts=function(){var t=this,e=this,n=e.el,i=e.model,o=e.em,a='frame:load',s={el:n,model:i,view:this},l=this.getCanvasModel(),c=function(e){var i;if(e.length>0){var l=e.shift(),u=(0,m.ut)('script',E({type:'text/javascript'},(0,r.isString)(l)?{src:l}:l));u.onerror=u.onload=c.bind(null,e),null===(i=n.contentDocument)||void 0===i||i.head.appendChild(u)}else t.renderBody(),o&&o.trigger(a,s)};n.onload=function(){var e=t.config.frameContent;if(e){var n=t.getDoc();n.open(),n.write(e),n.close()}o&&o.trigger("".concat(a,":before"),s),c(j([],l.get('scripts'),!0))}},e.prototype.renderStyles=function(t){void 0===t&&(t={});var e=this.getHead(),n=this.getCanvasModel(),i=function(t){return t.map((function(t){return{tag:'link',attributes:E({rel:'stylesheet'},(0,r.isString)(t)?{href:t}:t)}}))},o=i(t.prev||n.previous('styles')),a=i(n.get('styles')),s=[],l=[],c=function(t,e,n){t.forEach((function(t){var r=t.attributes.href;!e.some((function(t){return t.attributes.href===r}))&&n.push(t)}))};c(a,o,l),c(o,a,s),s.forEach((function(t){var n,r=e.querySelector("link[href=\"".concat(t.attributes.href,"\"]"));null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r)})),(0,m.SJ)(e,l)},e.prototype.renderBody=function(){var t,e,n=this,r=this,i=r.config,a=r.em,s=r.model,l=r.ppfx,c=this.getDoc(),u=this.getBody(),f=this.getWindow(),h=a.config;f._isEditor=!0,this.renderStyles({prev:[]});(0,m.R3)(u,"<style>\n      ".concat(h.baseCss||i.frameStyle||'',"\n\n      [data-gjs-type=\"wrapper\"] {\n        min-height: 100vh;\n        padding-top: 0.001em;\n      }\n\n      .").concat(l,"dashed *[data-gjs-highlightable] {\n        outline: 1px dashed rgba(170,170,170,0.7);\n        outline-offset: -2px;\n      }\n\n      .").concat(l,"selected {\n        outline: 2px solid #3b97e3 !important;\n        outline-offset: -2px;\n      }\n\n      .").concat(l,"selected-parent {\n        outline: 2px solid ").concat('#ffca6f'," !important\n      }\n\n      .").concat(l,"no-select {\n        user-select: none;\n        -webkit-user-select:none;\n        -moz-user-select: none;\n      }\n\n      .").concat(l,"freezed {\n        opacity: 0.5;\n        pointer-events: none;\n      }\n\n      .").concat(l,"no-pointer {\n        pointer-events: none;\n      }\n\n      .").concat(l,"plh-image {\n        background: #f5f5f5;\n        border: none;\n        height: 100px;\n        width: 100px;\n        display: block;\n        outline: 3px solid #ffca6f;\n        cursor: pointer;\n        outline-offset: -2px\n      }\n\n      .").concat(l,"grabbing {\n        cursor: grabbing;\n        cursor: -webkit-grabbing;\n      }\n\n      .").concat(l,"is__grabbing {\n        overflow-x: hidden;\n      }\n\n      .").concat(l,"is__grabbing,\n      .").concat(l,"is__grabbing * {\n        cursor: grabbing !important;\n      }\n\n      ").concat(h.canvasCss||'',"\n      ").concat(h.protectedCss||'',"\n    </style>"));var p=s.getComponent(),d=a.get('DomComponents').getType('wrapper').view;this.wrapper=new d({model:p,config:E(E({},p.config),{em:a,frameView:this})}).render(),(0,m.R3)(u,null===(t=this.wrapper)||void 0===t?void 0:t.el),(0,m.R3)(u,new x.Z({collection:s.getStyles(),config:E(E({},a.get('CssComposer').getConfig()),{frameView:this})}).render().el),(0,m.R3)(u,this.getJsContainer()),(0,o.on)(u,'click',(function(t){var e;return t&&'A'==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()})),(0,o.on)(u,'submit',(function(t){return t&&t.preventDefault()})),[{event:'keydown keyup keypress',class:'KeyboardEvent'},{event:'mousedown mousemove mouseup',class:'MouseEvent'},{event:'pointerdown pointermove pointerup',class:'PointerEvent'},{event:'wheel',class:'WheelEvent'}].forEach((function(t){return t.event.split(' ').forEach((function(e){c.addEventListener(e,(function(e){return n.el.dispatchEvent((0,m.t3)(e,t.class))}))}))})),this._toggleEffects(!0),this.droppable=(0,o.hasDnd)(a)&&new P(a,null===(e=this.wrapper)||void 0===e?void 0:e.el),s.trigger('loaded')},e.prototype._toggleEffects=function(t){var e=t?o.on:o.off,n=this.getWindow();n&&e(n,"".concat(m.G1," resize"),this._emitUpdate)},e.prototype._emitUpdate=function(){this.model._emitUpdated()},e}(v.Z);const R=A;var D=n(5610),M=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Z=void 0&&(void 0).__assign||function(){return Z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Z.apply(this,arguments)};const L=function(t){function e(e,n){var i=t.call(this,{model:e})||this;(0,r.bindAll)(i,'onScroll','frameLoaded','updateOffset','remove','startDrag');Z(Z({},e.config),{frameWrapView:i});return i.cv=n,i.frame=new R(e,i),i.classAnim="".concat(i.ppfx,"frame-wrapper--anim"),i.updateOffset=(0,r.debounce)(i.updateOffset.bind(i),0),i.updateSize=(0,r.debounce)(i.updateSize.bind(i),0),i.listenTo(e,'loaded',i.frameLoaded),i.listenTo(e,'change:x change:y',i.updatePos),i.listenTo(e,'change:width change:height',i.updateSize),i.listenTo(e,'destroy remove',i.remove),i.updatePos(),i.setupDragger(),i}return M(e,t),e.prototype.events=function(){return{'click [data-action-remove]':'remove','mousedown [data-action-move]':'startDrag'}},e.prototype.setupDragger=function(){var t,e,n,r=this,i=this.module,o=this.model,a=function(t){i.toggleFramesEvents(t)};this.dragger=new D.Z({onStart:function(){var i=o.attributes,s=i.x,l=i.y;n=r.em.getZoomMultiplier(),t=s,e=l,a(!1)},onEnd:function(){return a(!0)},setPosition:function(r){o.set({x:t+r.x*n,y:e+r.y*n})}})},e.prototype.startDrag=function(t){var e;t&&(null===(e=this.dragger)||void 0===e||e.start(t))},e.prototype.__clear=function(t){var e=this.frame;e&&e.remove(t),(0,m.L_)(this.elTools)},e.prototype.remove=function(t){var e=this;return this.__clear(t),v.Z.prototype.remove.apply(this,t),['frame','dragger','cv','elTools'].forEach((function(t){return e[t]=0})),this},e.prototype.updateOffset=function(){var t,e=this,n=e.em,r=e.$el,i=e.frame;n&&(n.runDefault({preserveSelected:1}),r.removeClass(this.classAnim),null===(t=null==i?void 0:i.model)||void 0===t||t._emitUpdated())},e.prototype.updatePos=function(t){var e=this.model,n=this.el,r=e.attributes,i=r.x,o=r.y,a=n.style;this.frame.rect=void 0,a.left=isNaN(i)?i:"".concat(i,"px"),a.top=isNaN(o)?o:"".concat(o,"px"),t&&this.updateOffset()},e.prototype.updateSize=function(){this.updateDim()},e.prototype.updateDim=function(){var t=this,e=t.em,n=t.el,i=t.$el,o=t.model,a=t.classAnim,s=t.frame;if(s){s.rect=void 0,i.addClass(a);var l=this.__handleSize(),c=l.noChanges,u=l.width,f=l.height;((0,r.isNull)(u)||(0,r.isNull)(f))&&o.set(Z(Z({},u?{}:{width:n.offsetWidth}),f?{}:{height:n.offsetHeight}),{silent:1}),e.stopDefault({preserveSelected:1}),c?this.updateOffset():setTimeout(this.updateOffset,350)}},e.prototype.onScroll=function(){var t=this.frame;this.em.trigger('frame:scroll',{frame:t,body:t.getBody(),target:t.getWindow()})},e.prototype.frameLoaded=function(){this.frame.getWindow().onscroll=this.onScroll,this.updateDim()},e.prototype.__handleSize=function(){var t='px',e=this.model,n=this.el.style,i=e.attributes,o=i.width,a=i.height,s=n.width||'',l=n.height||'',c=o||'',u=a||'',f=s==c&&l==u;return n.width=(0,r.isNumber)(c)?"".concat(c).concat(t):c,n.height=(0,r.isNumber)(u)?"".concat(u).concat(t):u,{noChanges:f,width:o,height:a,newW:c,newH:u}},e.prototype.render=function(){var t=this,e=t.frame,n=t.$el,r=t.ppfx,i=t.cv,o=t.model,a=t.el,s=o.attributes.onRender;this.__clear(),this.__handleSize(),e.render(),n.empty().attr({class:"".concat(r,"frame-wrapper")}).append("\n      <div class=\"".concat(r,"frame-wrapper__top gjs-two-color\" data-frame-top>\n        <div class=\"").concat(r,"frame-wrapper__name\" data-action-move>\n          ").concat(o.get('name')||'',"\n        </div>\n        <div class=\"").concat(r,"frame-wrapper__top-r\">\n          <div class=\"").concat(r,"frame-wrapper__icon\" data-action-remove style=\"display: none\">\n            <svg viewBox=\"0 0 24 24\"><path d=\"M19 4h-3.5l-1-1h-5l-1 1H5v2h14M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12z\"></path></svg>\n          </div>\n        </div>\n      </div>\n      <div class=\"").concat(r,"frame-wrapper__right\" data-frame-right></div>\n      <div class=\"").concat(r,"frame-wrapper__left\" data-frame-left></div>\n      <div class=\"").concat(r,"frame-wrapper__bottom\" data-frame-bottom></div>\n      ")).append(e.el);var l=(0,m.ut)('div',{class:"".concat(r,"tools"),style:'pointer-events:none; display: none'},"\n      <div class=\"".concat(r,"highlighter\" data-hl></div>\n      <div class=\"").concat(r,"badge\" data-badge></div>\n      <div class=\"").concat(r,"placeholder\">\n        <div class=\"").concat(r,"placeholder-int\"></div>\n      </div>\n      <div class=\"").concat(r,"ghost\"></div>\n      <div class=\"").concat(r,"toolbar\" style=\"pointer-events:all\"></div>\n      <div class=\"").concat(r,"resizer\"></div>\n      <div class=\"").concat(r,"offset-v\" data-offset>\n        <div class=\"gjs-marginName\" data-offset-m>\n          <div class=\"gjs-margin-v-el gjs-margin-v-top\" data-offset-m-t></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-bottom\" data-offset-m-b></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-left\" data-offset-m-l></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-right\" data-offset-m-r></div>\n        </div>\n        <div class=\"gjs-paddingName\" data-offset-m>\n          <div class=\"gjs-padding-v-el gjs-padding-v-top\" data-offset-p-t></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-bottom\" data-offset-p-b></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-left\" data-offset-p-l></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-right\" data-offset-p-r></div>\n        </div>\n      </div>\n      <div class=\"").concat(r,"offset-fixed-v\"></div>\n    "));this.elTools=l;var c=null==i?void 0:i.toolsWrapper;return c&&c.appendChild(l),s&&s({el:a,elTop:a.querySelector('[data-frame-top]'),elRight:a.querySelector('[data-frame-right]'),elBottom:a.querySelector('[data-frame-bottom]'),elLeft:a.querySelector('[data-frame-left]'),frame:o,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},e}(v.Z);var N=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),I=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,!0)||this;return r.listenTo(r.collection,'reset',r.render),r.canvasView=n.canvasView,r._module=n.module,r}return N(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach((function(t){return t.remove(e)}))},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.renderView=function(t,e){return new L(t,this.canvasView)},e}(k);const F=I;var V=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),B=void 0&&(void 0).__assign||function(){return B=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},B.apply(this,arguments)},H=function(t){function e(e){var n=t.call(this,{model:e})||this;n.ready=!1,(0,r.bindAll)(n,'clearOff','onKeyPress','onCanvasMove'),n.className=n.pfx+'canvas';var i=n.em;return n._initFrames(),n.listenTo(i,'change:canvasOffset',n.clearOff),n.listenTo(i,'component:selected',n.checkSelected),n.listenTo(e,'change:zoom change:x change:y',n.updateFrames),n.listenTo(e,'change:frames',n._onFramesUpdate),n.toggleListeners(!0),n}return V(e,t),e.prototype.events=function(){return{wheel:'onWheel'}},e.prototype.template=function(){var t=this.pfx;return"\n      <div class=\"".concat(t,"canvas__frames\" data-frames></div>\n      <div id=\"").concat(t,"tools\" class=\"").concat(t,"canvas__tools\" data-tools></div>\n    ")},e.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},e.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,r=t.config,i=t.em,o=n.frames;i.set('readyCanvas',0),o.once('loaded:all',(function(){return i.set('readyCanvas',1)})),null==e||e.remove(),this.frames=new F({collection:o},B(B({},r),{canvasView:this}))},e.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var r=e.scroll,i=this.em.get('currentFrame');r&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t._getFrame()===i&&t.scrollIntoView(r)})))},e.prototype.remove=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return null===(t=this.frames)||void 0===t||t.remove(),this.frames=void 0,v.Z.prototype.remove.apply(this,e),this.toggleListeners(!1),this},e.prototype.preventDefault=function(t){var e;t&&(t.preventDefault(),null===(e=t._parentEvent)||void 0===e||e.preventDefault())},e.prototype.onCanvasMove=function(t){},e.prototype.toggleListeners=function(t){this.el;var e=t?o.on:o.off;e(document,'keypress',this.onKeyPress),e(window,'scroll resize',this.clearOff)},e.prototype.onKeyPress=function(t){var e=this.em;' '!==(0,o.getKeyChar)(t)||1===e.getZoomDecimal()||e.get('Canvas').isInputFocused()||(this.preventDefault(t),e.get('Editor').runCommand('core:canvas-move'))},e.prototype.onWheel=function(t){if((t.ctrlKey||t.metaKey)&&this.em.getConfig().multiFrames){this.preventDefault(t);var e=this.model,n=Math.max(-1,Math.min(1,t.wheelDelta||-t.detail)),r=e.get('zoom');e.set('zoom',r+2*n)}},e.prototype.updateFrames=function(t){var e=this.em,n=this.model.attributes,r=n.x,i=n.y,o=this.getZoom(),a={preserveSelected:1},s=o?1/o:1;this.framesArea.style.transform="scale(".concat(o,") translate(").concat(r*s,"px, ").concat(i*s,"px)"),this.clearOff(),e.stopDefault(a),e.trigger('canvas:update',t),this.timerZoom&&clearTimeout(this.timerZoom),this.timerZoom=setTimeout((function(){return e.runDefault(a)}),300)},e.prototype.getZoom=function(){return this.em.getZoomDecimal()},e.prototype.isElInViewport=function(t){var e=(0,o.getElement)(t),n=(0,o.getElRect)(e),r=this.getFrameOffset(e),i=n.top,a=n.left;return i>=0&&a>=0&&i<=r.height&&a<=r.width},e.prototype.offset=function(t,e){var n,r;void 0===e&&(e={});var i=(0,o.getElRect)(t),a=null==t?void 0:t.ownerDocument.body,s=e.noScroll;return{top:i.top+(s?0:null!==(n=null==a?void 0:a.scrollTop)&&void 0!==n?n:0),left:i.left+(s?0:null!==(r=null==a?void 0:a.scrollLeft)&&void 0!==r?r:0),width:i.width,height:i.height}},e.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},e.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,r=null==t?void 0:t.ownerDocument.defaultView,i=r?r.frameElement:n;this.frmOff=this.offset(i||n)}return this.frmOff},e.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},e.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.getZoom(),r=e||{},i=this.getFrameOffset(t),o=this.el,a=this.getCanvasOffset(),s=this.offset(t,e),l=r.avoidFrameOffset?0:i.top,c=r.avoidFrameOffset?0:i.left;return{top:s.top*n+l-a.top+o.scrollTop,left:s.left*n+c-a.left+o.scrollLeft,height:s.height*n,width:s.width*n,zoom:n,rect:s}},e.prototype.getElementOffsets=function(t){var e=this;if(!t||(0,o.isTextNode)(t))return{};var n={},r=window.getComputedStyle(t);return['marginTop','marginRight','marginBottom','marginLeft','paddingTop','paddingRight','paddingBottom','paddingLeft'].forEach((function(t){n[t]=parseFloat(r[t])*e.getZoom()})),n},e.prototype.getPosition=function(t){var e;void 0===t&&(t={});var n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(n){var r=n.body,i=this.getZoom(),o=this.getFrameOffset(),a=this.getCanvasOffset(),s=t.noScroll;return{top:o.top+(s?0:r.scrollTop)*i-a.top,left:o.left+(s?0:r.scrollLeft)*i-a.left,width:a.width,height:a.height}}},e.prototype.updateScript=function(t){var e=t.model,n=e.getId();t.scriptContainer||(t.scriptContainer=(0,m.ut)('div',{'data-id':n}),this.getJsContainer().appendChild(t.scriptContainer)),t.el.id=n,t.scriptContainer.innerHTML='';var r=document.createElement('script'),i=e.getScriptString(),o=e.get('script-props')?i:"function(){\n".concat(i,"\n;}"),a=JSON.stringify(e.__getScriptProps());r.innerHTML="\n      setTimeout(function() {\n        var item = document.getElementById('".concat(n,"');\n        if (!item) return;\n        (").concat(o,".bind(item))(").concat(a,")\n      }, 1);"),setTimeout((function(){var e=t.scriptContainer;null==e||e.appendChild(r)}),0)},e.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return e&&e.getJsContainer()},e.prototype.getFrameView=function(t){return(null==t?void 0:t._getFrame())||this.em.get('currentFrame')},e.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,r=t.em,i=t.framesArea,o=e.frames;o.listenToLoad(),n.render();var a=o.at(0),s=null==a?void 0:a.view;r.setCurrentFrame(s),null==i||i.appendChild(n.el),this.frame=s}},e.prototype.render=function(){var t=this,e=t.el,n=t.$el,r=t.ppfx,i=t.config,a=t.em;n.html(this.template());var s=n.find('[data-frames]');this.framesArea=s.get(0);var l=n.find('[data-tools]');this.toolsWrapper=l.get(0),l.append("\n      <div class=\"".concat(r,"tools ").concat(r,"tools-gl\" style=\"pointer-events:none\">\n        <div class=\"").concat(r,"placeholder\">\n          <div class=\"").concat(r,"placeholder-int\"></div>\n        </div>\n      </div>\n      <div id=\"").concat(r,"tools\" style=\"pointer-events:none\">\n        ").concat(i.extHl?"<div class=\"".concat(r,"highlighter-sel\"></div>"):'',"\n        <div class=\"").concat(r,"badge\"></div>\n        <div class=\"").concat(r,"ghost\"></div>\n        <div class=\"").concat(r,"toolbar\" style=\"pointer-events:all\"></div>\n        <div class=\"").concat(r,"resizer\"></div>\n        <div class=\"").concat(r,"offset-v\"></div>\n        <div class=\"").concat(r,"offset-fixed-v\"></div>\n      </div>\n    "));var c=e.querySelector("#".concat(r,"tools"));return this.hlEl=e.querySelector(".".concat(r,"highlighter")),this.badgeEl=e.querySelector(".".concat(r,"badge")),this.placerEl=e.querySelector(".".concat(r,"placeholder")),this.ghostEl=e.querySelector(".".concat(r,"ghost")),this.toolbarEl=e.querySelector(".".concat(r,"toolbar")),this.resizerEl=e.querySelector(".".concat(r,"resizer")),this.offsetEl=e.querySelector(".".concat(r,"offset-v")),this.fixedOffsetEl=e.querySelector(".".concat(r,"offset-fixed-v")),this.toolsGlobEl=e.querySelector(".".concat(r,"tools-gl")),this.toolsEl=c,this.el.className=(0,o.getUiClass)(a,this.className),this.ready=!0,this._renderFrames(),this},e}(v.Z);const z=H;var U=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),W=void 0&&(void 0).__assign||function(){return W=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},W.apply(this,arguments)},$=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};const q=function(t){function e(e){var n=t.call(this,e,'Canvas',a)||this;return n.canvas=new d(n),n.model=n.canvas,n.startAutoscroll=n.startAutoscroll.bind(n),n.stopAutoscroll=n.stopAutoscroll.bind(n),n}return U(e,t),e.prototype.getCanvasView=function(){return this.canvasView},e.prototype.init=function(){},e.prototype.onLoad=function(){this.model.init()},e.prototype.getModel=function(){return this.canvas},e.prototype.getElement=function(){return this.getCanvasView().el},e.prototype.getFrame=function(t){return this.getFrames()[t||0]},e.prototype.getFrameEl=function(){var t=(this.canvasView||{}).frame;return null==t?void 0:t.el},e.prototype.getFramesEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.framesArea},e.prototype.getWindow=function(){var t=(this.canvasView||{}).frame;return null==t?void 0:t.getWindow()},e.prototype.getDocument=function(){var t=this.getFrameEl();return null==t?void 0:t.contentDocument},e.prototype.getBody=function(){var t=this.getDocument();return null==t?void 0:t.body},e.prototype._getLocalEl=function(t,e,n){var r=t,i=null==e?void 0:e._getFrame();return r=i?i[n]():r},e.prototype.getGlobalToolsEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.toolsGlobEl},e.prototype.getToolsEl=function(t){return this._getLocalEl(this.getCanvasView().toolsEl,t,'getToolsEl')},e.prototype.getHighlighter=function(t){return this._getLocalEl(this.getCanvasView().hlEl,t,'getHighlighter')},e.prototype.getBadgeEl=function(t){return this._getLocalEl(this.getCanvasView().badgeEl,t,'getBadgeEl')},e.prototype.getPlacerEl=function(){return this.getCanvasView().placerEl},e.prototype.getGhostEl=function(){return this.getCanvasView().ghostEl},e.prototype.getToolbarEl=function(){return this.getCanvasView().toolbarEl},e.prototype.getResizerEl=function(){return this.getCanvasView().resizerEl},e.prototype.getOffsetViewerEl=function(t){return this._getLocalEl(this.getCanvasView().offsetEl,t,'getOffsetViewerEl')},e.prototype.getFixedOffsetViewerEl=function(){return this.getCanvasView().fixedOffsetEl},e.prototype.render=function(){var t;return null===(t=this.canvasView)||void 0===t||t.remove(),this.canvasView=new z(this.canvas),this.canvasView.render().el},e.prototype.getOffset=function(){var t=this.offset(this.getFrameEl()),e=this.offset(this.getElement());return{top:t.top-e.top,left:t.left-e.left}},e.prototype.offset=function(t){return this.getCanvasView().offset(t)},e.prototype.setCustomBadgeLabel=function(t){this.config.customBadgeLabel=t},e.prototype.getElementPos=function(t,e){return this.getCanvasView().getElementPos(t,e)},e.prototype.getElementOffsets=function(t){return this.getCanvasView().getElementOffsets(t)},e.prototype.getRect=function(){var t,e=null!==(t=this.getCanvasView().getPosition())&&void 0!==t?t:{},n=e.top,r=void 0===n?0:n,i=e.left,o=void 0===i?0:i;return W(W({},this.getCanvasView().getCanvasOffset()),{topScroll:r,leftScroll:o})},e.prototype.getTargetToElementDim=function(t,e,n){void 0===n&&(n={});var r=n||{},i=this.getCanvasView().getPosition();if(i){var o=r.elPos||this.getCanvasView().getElementPos(e),a=n.toRight||0,s=r.targetHeight||t.offsetHeight,l=r.targetWidth||t.offsetWidth,c=r.event||null,u=o.top-s,f=o.left;f+=a?o.width:0;var h=(f=a?f-l:f)<i.left?i.left:f,p=u<i.top?i.top:u,d={top:p=p>o.top+o.height?o.top+o.height:p,left:h,elementTop:o.top,elementLeft:o.left,elementWidth:o.width,elementHeight:o.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:i.top,canvasLeft:i.left,canvasWidth:i.width,canvasHeight:i.height};return c&&this.em&&this.em.trigger(c,d),d}},e.prototype.canvasRectOffset=function(t,e,n){var r=this;void 0===n&&(n={});var i=function(t,e,i){void 0===e&&(e=1);var o=r.em.getZoomDecimal(),a=e?'top':'left',s=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(s):{},c=l.offsetTop,u=void 0===c?0:c,f=l.offsetLeft,h=void 0===f?0:f,p=s.body||{},d=p.scrollTop,g=void 0===d?0:d,v=p.scrollLeft,m=e?g:void 0===v?0:v,y=e?u:h;return i[a]-(m-y)*o};return{top:i(t,1,e),left:i(t,0,e)}},e.prototype.getTargetToElementFixed=function(t,e,n){var i;void 0===n&&(n={});var o=n.pos||this.getElementPos(t),a=n.canvasOff||this.canvasRectOffset(t,o),s=e.offsetHeight||0,l=e.offsetWidth||0,c=o.left+o.width,u=this.getCanvasView(),f=u.getPosition(),h=u.getFrameOffset(t),p=n.event,d=-s,g=(0,r.isUndefined)(n.left)?o.width-l:n.left;g=o.left<-g?-o.left:g;var v=null!==(i=null==f?void 0:f.width)&&void 0!==i?i:0;g=c>v?g-(c-v):g;var m=o.height+s,y=m<h.height;a.top<s&&(y?d+=m:d=-a.top<o.height?-a.top:o.height);var b={top:d,left:g,canvasOffsetTop:a.top,canvasOffsetLeft:a.left};return p&&this.em.trigger(p,b),b},e.prototype.getMouseRelativePos=function(t,e){void 0===e&&(e={});var n=0,r=0,i=e.subWinOffset,o=t.target.ownerDocument,a=o.defaultView||o.parentWindow,s=a.frameElement,l=i?a.pageYOffset:0,c=i?a.pageXOffset:0;if(s){var u=s.getBoundingClientRect();n=u.top||0,r=u.left||0}return{y:t.clientY+n-l,x:t.clientX+r-c}},e.prototype.getMouseRelativeCanvas=function(t,e){var n,r=this.getZoomDecimal(),i=null!==(n=this.getCanvasView().getPosition(e))&&void 0!==n?n:{},o=i.top,a=void 0===o?0:o,s=i.left,l=void 0===s?0:s;return{y:t.clientY*r+a,x:t.clientX*r+l}},e.prototype.hasFocus=function(){return this.getDocument().hasFocus()},e.prototype.isInputFocused=function(){var t=this.getDocument(),e=this.getFrameEl(),n=$(['body'],this.config.notTextable,!0),r=e&&document.activeElement===e?t&&t.activeElement:document.activeElement;return r&&!n.some((function(t){return r.matches(t)}))},e.prototype.scrollTo=function(t,e){void 0===e&&(e={});var n=(0,o.getElement)(t),r=n&&(0,o.getViewEl)(n);r&&r.scrollIntoView(e)},e.prototype.startAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.startAutoscroll()},e.prototype.stopAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.stopAutoscroll()},e.prototype.setZoom=function(t){return this.canvas.set('zoom',parseFloat(t)),this},e.prototype.getZoom=function(){return parseFloat(this.canvas.get('zoom'))},e.prototype.setCoords=function(t,e){return this.canvas.set({x:parseFloat(t),y:parseFloat(e)}),this},e.prototype.getCoords=function(){var t=this.canvas.attributes;return{x:t.x,y:t.y}},e.prototype.getZoomDecimal=function(){return this.getZoom()/100},e.prototype.getZoomMultiplier=function(){var t=this.getZoomDecimal();return t?1/t:1},e.prototype.toggleFramesEvents=function(t){this.getFramesEl().style.pointerEvents=t?'':'none'},e.prototype.getFrames=function(){return this.canvas.frames.map((function(t){return t}))},e.prototype.addFrame=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.canvas.frames.add(new g.Z(this,W({},t)),e)},e.prototype.destroy=function(){var t,e=this;this.canvas.stopListening(),null===(t=this.canvasView)||void 0===t||t.remove(),['model','droppable'].forEach((function(t){return e[t]={}}))},e}(i.Z)},6840:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var r,i=n(9050),o=n(7904),a=n(1163),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=void 0&&(void 0).__assign||function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},l.apply(this,arguments)},c=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},u='__aw',f='__ah';const h=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=r.em,s=r.attributes,l=s.styles,c=s.component,h=o.get('DomComponents'),p=h.getConfig(),d=o.get('CssComposer').getAll(),g={},v={em:o,config:p,frame:r,idMap:g};if(!(0,a.isComponent)(c)){var m=(0,a.isObject)(c)?c:{components:c};!m.type&&(m.type='wrapper');var y=h.getType('wrapper').model;r.set('component',new y(m,v))}if(l){if(!(0,a.isObject)(l)){Object.keys(g).length&&Array.isArray(l)&&l.forEach((function(t){var e=t.selectors;if(e&&1==e.length){var n=e[0],r=n.name&&2===n.type&&n;if(r&&g[r.name])r.name=g[r.name];else if((0,i.isString)(n)&&'#'===n[0]){var o=n.substring(1);o&&g[o]&&(e[0]="#".concat(g[o]))}}})),d.add(l),r.set('styles',d)}}else r.set('styles',d);return!n.width&&r.set(u,1),!n.height&&r.set(f,1),r}return s(e,t),e.prototype.defaults=function(){return{x:0,y:0,changesCount:0,attributes:{},width:null,height:null,head:[],component:'',styles:'',_undo:!0,_undoexc:['changesCount']}},Object.defineProperty(e.prototype,"head",{get:function(){return this.get('head')},enumerable:!1,configurable:!0}),e.prototype.onRemove=function(){this.getComponent().remove({root:1})},e.prototype.changesUp=function(t){void 0===t&&(t={}),t.temporary||t.noCount||t.avoidStore||this.set('changesCount',this.get('changesCount')+1)},e.prototype.getComponent=function(){return this.get('component')},e.prototype.getStyles=function(){return this.get('styles')},e.prototype.disable=function(){this.trigger('disable')},e.prototype.remove=function(){this.view=void 0;var t=this.collection;return t&&t.remove(this)},e.prototype.getHead=function(){return c([],this.head,!0)},e.prototype.setHead=function(t){return this.set('head',c([],t,!0))},e.prototype.addHeadItem=function(t){this.head.push(t)},e.prototype.getHeadByAttr=function(t,e,n){return this.head.filter((function(r){return r.attributes&&r.attributes[t]==e&&(!n||n===r.tag)}))[0]},e.prototype.removeHeadByAttr=function(t,e,n){var r=this.getHeadByAttr(t,e,n),i=this.head.indexOf(r);i>=0&&this.head.splice(i,1)},e.prototype.addLink=function(t){var e='link';!this.getHeadByAttr('href',t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:'stylesheet'}})},e.prototype.removeLink=function(t){this.removeHeadByAttr('href',t,'link')},e.prototype.addScript=function(t){var e='script';!this.getHeadByAttr('src',t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},e.prototype.removeScript=function(t){this.removeHeadByAttr('src',t,'script')},e.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},e.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger('frame:updated',l({frame:this},t))},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=o.Z.prototype.toJSON.call(this,t),n=(0,i.result)(this,'defaults');return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[u]&&delete e.width,e[f]&&delete e.height,(0,i.forEach)(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),(0,i.forEach)(n,(function(t,n){e[n]===t&&delete e[n]})),(0,i.forEach)(['attributes','head'],(function(t){(0,i.isEmpty)(e[t])&&delete e[t]})),e},e}(o.Z)},3560:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r,i=n(9050),o=n(7116),a=n(6840),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(e,n){void 0===n&&(n=[]);var r=t.call(this,e,n,a.Z)||this;return r.loadedItems=0,r.itemsToLoad=0,(0,i.bindAll)(r,'itemLoaded'),r.on('reset',r.onReset),r.on('remove',r.onRemove),r}return s(e,t),e.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map((function(t){return n.onRemove(t)}))},e.prototype.onRemove=function(t){null==t||t.onRemove()},e.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger('loaded:all'),this.listenToLoadItems(!1))},e.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},e.prototype.listenToLoadItems=function(t){var e=this;this.forEach((function(n){return n[t?'on':'off']('loaded',e.itemLoaded)}))},e}(o.Z)},5819:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>Ue});var r=n(9050);const i={stylePrefix:'comp-',components:[],draggableComponents:1,processor:0,voidElements:['area','base','br','col','embed','hr','img','input','keygen','link','menuitem','meta','param','source','track','wbr']};var o=n(9138),a=n(8431),s=n(2169),l=n(5671),c=n(3144),u=n(9340),f=n(2963),h=n(1120);function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var d=function(t){(0,u.Z)(n,t);var e=p(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'div'}}]),n}(s.Z),g=n(3505),v=n(4942),m=n(1752),y=n(1163);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var x=function(t){(0,u.Z)(n,t);var e=k(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return w(w({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:'cell',tagName:'td',draggable:['tr']})}}]),n}(o.ZP);x.isComponent=function(t){return['td','th'].indexOf((0,y.toLowerCase)(t.tagName))>=0};const O=s.Z.extend({});function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var P='tr',T=function(t){(0,u.Z)(n,t);var e=_(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return S(S({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{tagName:P,draggable:['thead','tbody','tfoot'],droppable:['th','td']})}}]),n}(o.ZP);T.isComponent=function(t){return(0,y.toLowerCase)(t.tagName)===P};const E=s.Z.extend({});function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var D='table',M=function(t){(0,u.Z)(n,t);var e=R(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return A(A({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:D,tagName:D,droppable:['tbody','thead','tfoot']})}},{key:"initialize",value:function(t,e){o.ZP.prototype.initialize.apply(this,arguments);var n=this.get('components');!n.length&&n.add({type:'tbody'})}}]),n}(o.ZP);M.isComponent=function(t){return(0,y.toLowerCase)(t.tagName)===D};const Z=s.Z.extend({events:{}});function L(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function N(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function I(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var F='tbody',V=function(t){(0,u.Z)(n,t);var e=I(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return N(N({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:F,tagName:F,draggable:['table'],droppable:['tr'],columns:1,rows:1})}},{key:"initialize",value:function(t,e){o.ZP.prototype.initialize.apply(this,arguments);var n=this.get('components'),r=this.get('columns'),i=this.get('rows');if(!n.length){for(var a=[];i--;){for(var s=[],l=r;l--;)s.push({type:'cell',classes:['cell']});a.push({type:'row',classes:['row'],components:s})}n.add(a)}}}]),n}(o.ZP);function B(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function H(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?B(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}V.isComponent=function(t){return(0,y.toLowerCase)(t.tagName)===F};var U='thead',W=function(t){(0,u.Z)(n,t);var e=z(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return H(H({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:U,tagName:U})}}]),n}(V);W.isComponent=function(t){return(0,y.toLowerCase)(t.tagName)===U};const $=s.Z.extend({});function q(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var G=function(t){(0,u.Z)(n,t);var e=q(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n)}(s.Z);function K(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?K(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function X(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var J='tfoot',Q=function(t){(0,u.Z)(n,t);var e=X(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return Y(Y({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:J,tagName:J})}}]),n}(V);Q.isComponent=function(t){return(0,y.toLowerCase)(t.tagName)===J};const tt=s.Z.extend({});function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?et(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function rt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var it='xmlns="http://www.w3.org/2000/svg" width="100" viewBox="0 0 24 24" style="fill: rgba(0,0,0,0.15); transform: scale(0.75)"',ot=function(t){(0,u.Z)(n,t);var e=rt(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return nt(nt({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:'image',tagName:'img',void:!0,droppable:0,editable:1,highlightable:0,resizable:{ratioDefault:1},traits:['alt'],src:"<svg ".concat(it,">\n        <path d=\"M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2z\"></path>\n      </svg>"),fallback:"<svg ".concat(it,">\n        <path d=\"M2.28 3L1 4.27l2 2V19c0 1.1.9 2 2 2h12.73l2 2L21 21.72 2.28 3m2.55 0L21 19.17V5a2 2 0 0 0-2-2H4.83M8.5 13.5l2.5 3 1-1.25L14.73 18H5l3.5-4.5z\"></path>\n      </svg>"),file:''})}},{key:"initialize",value:function(t,e){o.ZP.prototype.initialize.apply(this,arguments);var n=this.get('attributes'),i=n.src;i&&(0,y.buildBase64UrlFromSvg)((0,r.result)(this,'defaults').src)!==i&&this.set('src',i,{silent:1})}},{key:"initToolbar",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];o.ZP.prototype.initToolbar.apply(this,e);var r=this.em;if(r){var i=r.get('Commands'),a='image-editor';if(i.has(a)){for(var s=!1,l=this.get('toolbar'),c=0;c<l.length;c++)if('image-editor'===l[c].command){s=!0;break}s||(l.push({attributes:{class:'fa fa-pencil'},command:a}),this.set('toolbar',l))}}}},{key:"getAttrToHTML",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=o.ZP.prototype.getAttrToHTML.apply(this,e),i=this.getSrcResult();return i&&(r.src=i),r}},{key:"getSrcResult",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get(t.fallback?'fallback':'src')||'',n=e;return e&&'<svg'===e.substr(0,4)&&(n=(0,y.buildBase64UrlFromSvg)(e)),n}},{key:"isDefaultSrc",value:function(){var t=this.get('src'),e=(0,r.result)(this,'defaults').src;return t===e||t===(0,y.buildBase64UrlFromSvg)(e)}},{key:"toJSON",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=o.ZP.prototype.toJSON.apply(this,e);return r.attributes&&r.src===r.attributes.src&&delete r.src,r}},{key:"parseUri",value:function(t){var e={};if((0,y.hasWin)())(e=document.createElement('a')).href=t;else if('undefined'!=typeof URL)try{e=new URL(t)}catch(t){}return{hostname:e.hostname||'',pathname:e.pathname||'',protocol:e.protocol||'',search:e.search||'',hash:e.hash||'',port:e.port||'',query:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e={},n=t.substring(1).split('&'),r=0;r<n.length;r++){var i=n[r].split('='),o=decodeURIComponent(i[0]);o&&(e[o]=decodeURIComponent(i[1]||''))}return e}(e.search)}}}]),n}(o.ZP);function at(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function st(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?at(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}ot.isComponent=function(t){return'img'===(0,y.toLowerCase)(t.tagName)};var ct=function(t){(0,u.Z)(n,t);var e=lt(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return st(st({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:'map',src:'',void:0,mapUrl:'https://maps.google.com/maps',tagName:'iframe',mapType:'q',address:'',zoom:'1',attributes:{frameborder:0},toolbar:(0,m.Z)((0,h.Z)(n.prototype),"defaults",this).toolbar,traits:[{label:'Address',name:'address',placeholder:'eg. London, UK',changeProp:1},{type:'select',label:'Map type',name:'mapType',changeProp:1,options:[{value:'q',name:'Roadmap'},{value:'w',name:'Satellite'}]},{label:'Zoom',name:'zoom',type:'range',min:'1',max:'20',changeProp:1}]})}},{key:"initialize",value:function(t,e){this.get('src')?this.parseFromSrc():this.updateSrc(),ot.prototype.initialize.apply(this,arguments),this.listenTo(this,'change:address change:zoom change:mapType',this.updateSrc)}},{key:"updateSrc",value:function(){this.set('src',this.getMapUrl())}},{key:"getMapUrl",value:function(){var t=this,e=t.get('address'),n=t.get('zoom'),r=t.get('mapType');e=e?'&q='+e:'',n=n?'&z='+n:'',r=r?'&t='+r:'';var i=t.get('mapUrl')+'?'+e+n+r;return i+='&output=embed'}},{key:"parseFromSrc",value:function(){var t=this.parseUri(this.get('src')).query;t.q&&this.set('address',t.q),t.z&&this.set('zoom',t.z),t.t&&this.set('mapType',t.t)}}]),n}(ot);function ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}ct.isComponent=function(t){var e='';return'iframe'==(0,y.toLowerCase)(t.tagName)&&/maps\.google\.com/.test(t.src)&&(e={type:'map',src:t.src}),e};var ft=function(t){(0,u.Z)(n,t);var e=ut(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'img'}},{key:"events",value:function(){return{dblclick:'onActive',click:'initResize',error:'onError',load:'onLoad',dragstart:'noDrag'}}},{key:"initialize",value:function(t){s.Z.prototype.initialize.apply(this,arguments),this.listenTo(this.model,'change:src',this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image"),this.fetchFile()}},{key:"fetchFile",value:function(){if(!this.modelOpt.temporary){var t=this.model,e=this.em,n=t.get('file');if(n&&e){var i=e.get('AssetManager').FileUploader();null==i||i.uploadFile({dataTransfer:{files:[n]}},(function(e){var n=e&&e.data&&e.data[0],i=n&&((0,r.isString)(n)?n:n.src);i&&t.set({src:i})})),t.set('file','')}}}},{key:"updateSrc",value:function(){var t=this.model,e=this.classEmpty,n=this.$el,r=t.getSrcResult(),i=r&&!t.isDefaultSrc();t.addAttributes({src:r}),n[i?'removeClass':'addClass'](e)}},{key:"onActive",value:function(t){t&&t.stopPropagation();var e=this.em,n=this.model,r=e&&e.get('AssetManager');r&&n.get('editable')&&r.open({select:function(t,e){n.set({src:t.getSrc()}),e&&r.close()},target:n,types:['image'],accept:'image/*'})}},{key:"onError",value:function(){var t=this.model.getSrcResult({fallback:1});t&&(this.el.src=t)}},{key:"onLoad",value:function(){this.em.trigger('change:canvasOffset')}},{key:"noDrag",value:function(t){return t.preventDefault(),!1}},{key:"render",value:function(){if(this.renderAttributes(),this.modelOpt.temporary)return this;this.updateSrc();var t=this.$el,e=this.model,n=t.attr('class')||'';return!e.get('src')&&t.attr('class',"".concat(n," ").concat(this.classEmpty).trim()),this.postRender(),this}}]),n}(s.Z);function ht(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var pt=function(t){(0,u.Z)(n,t);var e=ht(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'div'}},{key:"events",value:function(){return{}}},{key:"initialize",value:function(t){ft.prototype.initialize.apply(this,arguments),this.classEmpty=this.ppfx+'plh-map'}},{key:"updateSrc",value:function(){this.getIframe().src=this.model.get('src')}},{key:"getIframe",value:function(){if(!this.iframe){var t=document.createElement('iframe');t.src=this.model.get('src'),t.frameBorder=0,t.style.height='100%',t.style.width='100%',t.className=this.ppfx+'no-pointer',this.iframe=t}return this.iframe}},{key:"render",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ft.prototype.render.apply(this,e),this.updateClasses(),this.el.appendChild(this.getIframe()),this}}]),n}(ft);function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function gt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function vt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var mt=function(t){(0,u.Z)(n,t);var e=vt(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return gt(gt({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:'text',droppable:!1,editable:!0})}}]),n}(o.ZP);function yt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var kt='link',xt=function(t){(0,u.Z)(n,t);var e=wt(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return bt(bt({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:kt,tagName:'a',traits:['title','href','target']})}}]),n}(mt);xt.isComponent=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if('a'===(0,y.toLowerCase)(t.tagName)){var i=n.textTags||[];e={type:kt,editable:!1};var o=t.childNodes,a=o.length;a||delete e.editable,(0,r.forEach)(o,(function(t){var n=t.tagName;(3==t.nodeType&&''!==t.textContent.trim()||n&&i.indexOf((0,y.toLowerCase)(n))>=0)&&delete e.editable}))}return e};var Ot=n(5861),Ct=n(4687),St=n.n(Ct);function _t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var Et=s.Z.prototype,jt=function(t){(0,u.Z)(o,t);var e,n,i=Tt(o);function o(){return(0,l.Z)(this,o),i.apply(this,arguments)}return(0,c.Z)(o,[{key:"events",value:function(){return{dblclick:'onActive',input:'onInput'}}},{key:"initialize",value:function(t){Et.initialize.apply(this,arguments),(0,r.bindAll)(this,'disableEditing','onDisable');var e=this.model,n=this.em;this.listenTo(e,'focus',this.onActive),this.listenTo(e,'change:content',this.updateContentText),this.listenTo(e,'sync:content',this.syncContent),this.rte=n&&n.get('RichTextEditor')}},{key:"updateContentText",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.fromDisable&&this.disableEditing()}},{key:"canActivate",value:function(){var t,e=this.model,n=this.rteEnabled,r=this.em,i=(null==r?void 0:r.getEditing())===e,o=!0,a=!1;if((n||!e.get('editable')||i||(a=e.isChildOf('text')))&&(o=!1,a&&!e.get('textable'))){for(var s=e.parent();s&&!s.isInstanceOf('text');)s=s.parent();s&&s.get('editable')?t=s:o=!0}return{result:o,delegate:t}}},{key:"onActive",value:(n=(0,Ot.Z)(St().mark((function t(e){var n,r,i,o,a,s,l;return St().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(r=this.rte,i=this.em,o=this.canActivate(),a=o.result,s=o.delegate,a){t.next=5;break}return s&&(null==e||null===(l=e.stopPropagation)||void 0===l||l.call(e),i.setSelected(s),s.trigger('active',e)),t.abrupt("return");case 5:if(null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.lastContent=this.getContent(),!r){t.next=17;break}return t.prev=8,t.next=11,r.enable(this,this.activeRte,{event:e});case 11:this.activeRte=t.sent,t.next=17;break;case 14:t.prev=14,t.t0=t["catch"](8),i.logError(t.t0);case 17:this.toggleEvents(1);case 18:case"end":return t.stop()}}),t,this,[[8,14]])}))),function(t){return n.apply(this,arguments)})},{key:"onDisable",value:function(){this.disableEditing()}},{key:"disableEditing",value:(e=(0,Ot.Z)(St().mark((function t(){var e,n,r,i,o,a,s=arguments;return St().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:{},n=this.model,r=this.rte,i=this.activeRte,o=this.em,a=n&&n.get('editable'),!r){t.next=13;break}return t.prev=4,t.next=7,r.disable(this,i);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](4),o.logError(t.t0);case 12:a&&this.getContent()!==this.lastContent&&(this.syncContent(e),this.lastContent='');case 13:this.toggleEvents();case 14:case"end":return t.stop()}}),t,this,[[4,9]])}))),function(){return e.apply(this,arguments)})},{key:"getContent",value:function(){var t=this.activeRte;return t&&'function'==typeof t.getContent?t.getContent():this.getChildrenContainer().innerHTML}},{key:"syncContent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.rte,r=this.rteEnabled;if(r||t.force){var i=this.getContent(),o=e.components(),a=Pt({fromDisable:1},t);e.set('content','',a),n.customRte?(o.length&&o.reset(null,t),e.set('content',i,a)):o.resetFromString(i,t)}}},{key:"insertComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=this.el,i=r.ownerDocument,o=i.getSelection();if(null!=o&&o.rangeCount){var a,s=o.getRangeAt(0),l=s.startContainer,c=s.startOffset,u=(0,y.getModel)(l),f=[];if(u&&null!==(a=u.is)&&void 0!==a&&a.call(u,'textnode')){var h=u.collection;h.forEach((function(e){if(e===u){var n='textnode',r=e.get('content');f.push({type:n,content:r.slice(0,c)}),f.push(t),f.push({type:n,content:r.slice(c)})}else f.push(e)}));var p=f.filter(Boolean),d=p.indexOf(t);return h.reset(p,e),h.at(d)}}return n.append(t,e)}},{key:"onInput",value:function(){var t=this.em,e='component',n=["".concat(e,":update"),"".concat(e,":input")].join(' ');t&&t.trigger(n,this.model)}},{key:"disablePropagation",value:function(t){t.stopPropagation()}},{key:"toggleEvents",value:function(t){var e=this.em,n=this.model,r=this.$el,i={on:y.on,off:y.off},o=t?'on':'off';e.setEditing(t?this:0),this.rteEnabled=!!t;var a=[this.el.ownerDocument,document];if(i.off(a,'mousedown',this.onDisable),i[o](a,'mousedown',this.onDisable),e[o]('toolbar:run:before',this.onDisable),n&&(n[o]('removed',this.onDisable),n.trigger("rte:".concat(t?'enable':'disable'))),r&&r.off('mousedown',this.disablePropagation),r&&r[o]('mousedown',this.disablePropagation),this.config.draggableComponents)for(var s=this.el;s;)s.draggable=!t,(s=s.parentNode)&&'BODY'==s.tagName&&(s=0)}}]),o}(s.Z);function At(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var Rt=function(t){(0,u.Z)(n,t);var e=At(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"render",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return jt.prototype.render.apply(this,e),this.el.addEventListener('click',this.prevDef,!0),this}}]),n}(jt);function Dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dt(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Zt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var Lt='label',Nt=function(t){(0,u.Z)(n,t);var e=Zt(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return Mt(Mt({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:Lt,tagName:Lt,traits:['id','title','for']})}}]),n}(mt);function It(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}Nt.isComponent=function(t){return(0,y.toLowerCase)(t.tagName)===Lt};var Ft=function(t){(0,u.Z)(n,t);var e=It(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'span'}}]),n}(Rt);function Vt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vt(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ht(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var zt='video',Ut='yt',Wt='vi',$t='ytnc',qt=function(t){return t&&'0'!==t},Gt=function(t){(0,u.Z)(n,t);var e=Ht(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return Bt(Bt({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:zt,tagName:zt,videoId:'',void:0,provider:'so',ytUrl:'https://www.youtube.com/embed/',ytncUrl:'https://www.youtube-nocookie.com/embed/',viUrl:'https://player.vimeo.com/video/',loop:0,poster:'',muted:0,autoplay:0,controls:1,color:'',list:'',rel:1,modestbranding:0,sources:[],attributes:{allowfullscreen:'allowfullscreen'}})}},{key:"initialize",value:function(t,e){this.em=e.em,this.get('src')&&this.parseFromSrc(),this.updateTraits(),this.listenTo(this,'change:provider',this.updateTraits),this.listenTo(this,'change:videoId change:provider',this.updateSrc),ot.prototype.initialize.apply(this,arguments)}},{key:"updateTraits",value:function(){var t,e=this.em,n='iframe';switch(this.get('provider')){case Ut:case $t:t=this.getYoutubeTraits();break;case Wt:t=this.getVimeoTraits();break;default:n='video',t=this.getSourceTraits()}this.set({tagName:n},{silent:1}),this.set({traits:t}),e.get('ready')&&e.trigger('component:toggled')}},{key:"parseFromSrc",value:function(){var t=this.get('provider'),e=this.parseUri(this.get('src')),n=e.query;switch(t){case Ut:case $t:case Wt:this.set('videoId',e.pathname.split('/').pop()),n.list&&this.set('list',n.list),qt(n.autoplay)&&this.set('autoplay',1),qt(n.loop)&&this.set('loop',1),0===parseInt(n.controls)&&this.set('controls',0),qt(n.color)&&this.set('color',n.color),'0'===n.rel&&this.set('rel',0),'1'===n.modestbranding&&this.set('modestbranding',1)}}},{key:"updateSrc",value:function(){var t='';switch(this.get('provider')){case Ut:t=this.getYoutubeSrc();break;case $t:t=this.getYoutubeNoCookieSrc();break;case Wt:t=this.getVimeoSrc()}this.set({src:t})}},{key:"getAttrToHTML",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=ot.prototype.getAttrToHTML.apply(this,e),i=this.get('provider');switch(i){case Ut:case $t:case Wt:break;default:this.get('loop')&&(r.loop='loop'),this.get('autoplay')&&(r.autoplay='autoplay'),this.get('controls')&&(r.controls='controls')}return r}},{key:"getProviderTrait",value:function(){return{type:'select',label:'Provider',name:'provider',changeProp:1,options:[{value:'so',name:'HTML5 Source'},{value:Ut,name:'Youtube'},{value:$t,name:'Youtube (no cookie)'},{value:Wt,name:'Vimeo'}]}}},{key:"getSourceTraits",value:function(){return[this.getProviderTrait(),{label:'Source',name:'src',placeholder:'eg. ./media/video.mp4',changeProp:1},{label:'Poster',name:'poster',placeholder:'eg. ./media/image.jpg'},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait()]}},{key:"getYoutubeTraits",value:function(){return[this.getProviderTrait(),{label:'Video ID',name:'videoId',placeholder:'eg. jNQXAC9IVRw',changeProp:1},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait(),{type:'checkbox',label:'Related',name:'rel',changeProp:1},{type:'checkbox',label:'Modest',name:'modestbranding',changeProp:1}]}},{key:"getVimeoTraits",value:function(){return[this.getProviderTrait(),{label:'Video ID',name:'videoId',placeholder:'eg. 123456789',changeProp:1},{label:'Color',name:'color',placeholder:'eg. FF0000',changeProp:1},this.getAutoplayTrait(),this.getLoopTrait()]}},{key:"getAutoplayTrait",value:function(){return{type:'checkbox',label:'Autoplay',name:'autoplay',changeProp:1}}},{key:"getLoopTrait",value:function(){return{type:'checkbox',label:'Loop',name:'loop',changeProp:1}}},{key:"getControlsTrait",value:function(){return{type:'checkbox',label:'Controls',name:'controls',changeProp:1}}},{key:"getYoutubeSrc",value:function(){var t=this.get('videoId'),e=this.get('ytUrl'),n=this.get('list');return e+=t+(t.indexOf('?')<0?'?':''),e+=n?"&list=".concat(n):'',e+=this.get('autoplay')?'&autoplay=1':'',e+=this.get('controls')?'':'&controls=0&showinfo=0',e+=this.get('loop')?"&loop=1&playlist=".concat(t):'',e+=this.get('rel')?'':'&rel=0',e+=this.get('modestbranding')?'&modestbranding=1':''}},{key:"getYoutubeNoCookieSrc",value:function(){var t=this.getYoutubeSrc();return t=t.replace(this.get('ytUrl'),this.get('ytncUrl'))}},{key:"getVimeoSrc",value:function(){var t=this.get('viUrl');return t+=this.get('videoId')+'?',t+=this.get('autoplay')?'&autoplay=1':'',t+=this.get('loop')?'&loop=1':'',t+=this.get('controls')?'':'&title=0&portrait=0&badge=0',t+=this.get('color')?'&color='+this.get('color'):''}}]),n}(ot);function Kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}Gt.isComponent=function(t){var e='',n=t.tagName,r=t.src,i=/youtube\.com\/embed/.test(r),o=/youtube-nocookie\.com\/embed/.test(r),a=/player\.vimeo\.com\/video/.test(r),s=i||o||a;return((0,y.toLowerCase)(n)==zt||'iframe'==(0,y.toLowerCase)(n)&&s)&&(e={type:'video'},r&&(e.src=r),s&&(i?e.provider=Ut:o?e.provider=$t:a&&(e.provider=Wt))),e};var Yt=function(t){(0,u.Z)(n,t);var e=Kt(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'div'}},{key:"events",value:function(){return{}}},{key:"initialize",value:function(t){s.Z.prototype.initialize.apply(this,arguments);var e=this.model,n=['loop','autoplay','controls','color','rel','modestbranding','poster'],r=n.map((function(t){return"change:".concat(t)})).join(' ');this.listenTo(e,'change:provider',this.updateProvider),this.listenTo(e,'change:src',this.updateSrc),this.listenTo(e,r,this.updateVideo)}},{key:"updateProvider",value:function(){var t=this.model.get('provider');this.el.innerHTML='',this.el.appendChild(this.renderByProvider(t))}},{key:"updateSrc",value:function(){var t=this.model,e=this.videoEl;if(e){var n=t.get('provider'),r=t.get('src');switch(n){case'yt':r=t.getYoutubeSrc();break;case'ytnc':r=t.getYoutubeNoCookieSrc();break;case'vi':r=t.getVimeoSrc()}e.src=r}}},{key:"updateVideo",value:function(){var t=this.model.get('provider'),e=this.videoEl,n=this.model;switch(t){case'yt':case'ytnc':case'vi':this.model.trigger('change:videoId');break;default:e.loop=n.get('loop'),e.autoplay=n.get('autoplay'),e.controls=n.get('controls'),e.poster=n.get('poster')}}},{key:"renderByProvider",value:function(t){var e;switch(t){case'yt':e=this.renderYoutube();break;case'ytnc':e=this.renderYoutubeNoCookie();break;case'vi':e=this.renderVimeo();break;default:e=this.renderSource()}return this.videoEl=e,e}},{key:"renderSource",value:function(){var t=document.createElement('video');return t.src=this.model.get('src'),this.initVideoEl(t),t}},{key:"renderYoutube",value:function(){var t=document.createElement('iframe');return t.src=this.model.getYoutubeSrc(),t.frameBorder=0,t.setAttribute('allowfullscreen',!0),this.initVideoEl(t),t}},{key:"renderYoutubeNoCookie",value:function(){var t=document.createElement('iframe');return t.src=this.model.getYoutubeNoCookieSrc(),t.frameBorder=0,t.setAttribute('allowfullscreen',!0),this.initVideoEl(t),t}},{key:"renderVimeo",value:function(){var t=document.createElement('iframe');return t.src=this.model.getVimeoSrc(),t.frameBorder=0,t.setAttribute('allowfullscreen',!0),this.initVideoEl(t),t}},{key:"initVideoEl",value:function(t){t.className=this.ppfx+'no-pointer',t.style.height='100%',t.style.width='100%'}},{key:"render",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];ft.prototype.render.apply(this,e),this.updateClasses();var r=this.model.get('provider');return this.el.appendChild(this.renderByProvider(r)),this.updateVideo(),this}}]),n}(ft);function Xt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Jt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xt(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var te='script',ee=function(t){(0,u.Z)(n,t);var e=Qt(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return Jt(Jt({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:te,tagName:te,droppable:!1,draggable:!1,layerable:!1})}}]),n}(o.ZP);function ne(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}ee.isComponent=function(t){if((0,y.toLowerCase)(t.tagName)==te){var e={type:te};return t.src&&(e.src=t.src,e.onload=t.onload),e}};var re=function(t){(0,u.Z)(n,t);var e=ne(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'script'}},{key:"events",value:function(){return{}}},{key:"render",value:function(){var t=this.model,e=this.em,n=t.get('src'),r=e&&e.get('scriptCount'),i=r||0,o='';if(n){var a=t.get('onload'),s="script".concat(i),l="script".concat(i+1),c="".concat(s,"Start"),u="".concat(l,"Start");o="\n        var ".concat(s," = document.createElement('script');\n        ").concat(s,".onload = function() {\n          ").concat(a?"".concat(a,"();\n"):'',"\n          typeof ").concat(u," == 'function' && ").concat(u,"();\n        };\n        ").concat(s,".src = '").concat(n,"';\n        function ").concat(c,"() { document.body.appendChild(").concat(s,"); };\n        ").concat(i?'':"".concat(c,"();"),"\n      "),e&&e.set('scriptCount',i+1)}else o=t.__innerHTML();return this.el.innerHTML=o,this.postRender(),this}}]),n}(ft);function ie(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function oe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ie(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ae(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var se='svg',le=function(t){(0,u.Z)(n,t);var e=ae(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return oe(oe({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:se,tagName:se,highlightable:0,resizable:{ratioDefault:1}})}},{key:"getName",value:function(){var t=this.get('tagName'),e=this.get('custom-name');return t=t.charAt(0).toUpperCase()+t.slice(1),e||t}}]),n}(o.ZP);function ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ue(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ce(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}le.isComponent=function(t){return(0,y.toLowerCase)(t.tagName)===se};var he=function(t){(0,u.Z)(n,t);var e=fe(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return ue(ue({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{selectable:!1,hoverable:!1,layerable:!1})}}]),n}(le);function pe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}he.isComponent=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!e.inSvg};var de=function(t){(0,u.Z)(n,t);var e=pe(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"_createElement",value:function(t){return document.createElementNS('http://www.w3.org/2000/svg',t)}}]),n}(s.Z);function ge(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ve(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ge(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var ye=function(t){(0,u.Z)(n,t);var e=me(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return ve(ve({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{tagName:'',droppable:!1,layerable:!1,selectable:!1,editable:!0})}},{key:"toHTML",value:function(){var t=this.parent(),e=this.get('content');return t&&t.is('script')?e:(0,y.escape)(e)}}]),n}(o.ZP);function be(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function we(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}ye.isComponent=function(t){var e='';return 3===t.nodeType&&(e={type:'textnode',content:t.textContent}),e};var ke=function(t){(0,u.Z)(n,t);var e=we(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?be(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this))}},{key:"toHTML",value:function(){return"\x3c!--".concat(this.get('content'),"--\x3e")}}]),n}(ye);function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}ke.isComponent=function(t){if(8==t.nodeType)return{tagName:'NULL',type:'comment',content:t.textContent}};var Oe=function(t){(0,u.Z)(n,t);var e=xe(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"initialize",value:function(){s.Z.prototype.initialize.apply(this,arguments)}},{key:"_setAttributes",value:function(){}},{key:"renderAttributes",value:function(){}},{key:"updateStatus",value:function(){}},{key:"updateClasses",value:function(){}},{key:"setAttribute",value:function(){}},{key:"updateAttributes",value:function(){}},{key:"initClasses",value:function(){}},{key:"initComponents",value:function(){}},{key:"delegateEvents",value:function(){}},{key:"_createElement",value:function(){return document.createTextNode('')}},{key:"render",value:function(){var t=this.model,e=this.el;return t.opt.temporary||(e.textContent=t.get('content')),this}}]),n}(s.Z);function Ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var Se=function(t){(0,u.Z)(n,t);var e=Ce(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"_createElement",value:function(){return document.createComment(this.model.get('content'))}}]),n}(Oe);function _e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_e(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Te(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var Ee=function(t){(0,u.Z)(n,t);var e=Te(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",value:function(){return Pe(Pe({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{tagName:'body',removable:!1,copyable:!1,draggable:!1,components:[],traits:[],stylable:['background','background-color','background-image','background-repeat','background-attachment','background-position','background-size']})}},{key:"__postAdd",value:function(){var t=this.em&&this.em.get('UndoManager');return t&&!this.__hasUm&&t.add(this),o.ZP.prototype.__postAdd.call(this,arguments)}},{key:"__postRemove",value:function(){var t=this.em&&this.em.get('UndoManager');return t&&t.remove(this),o.ZP.prototype.__postRemove.call(this,arguments)}}]),n}(o.ZP);function je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ae(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?je(Object(n),!0).forEach((function(e){(0,v.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}Ee.isComponent=function(){return!1};var De='iframe',Me=function(t){(0,u.Z)(n,t);var e=Re(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"defaults",get:function(){return Ae(Ae({},(0,m.Z)((0,h.Z)(n.prototype),"defaults",this)),{},{type:De,tagName:De,droppable:!1,resizable:!0,traits:['id','title','src'],attributes:{frameborder:'0'}})}}]),n}(o.ZP);Me.isComponent=function(t){return(0,y.toLowerCase)(t.tagName)===De};var Ze=n(9283);function Le(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var Ne,Ie=function(t){(0,u.Z)(n,t);var e=Le(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'div'}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];s.Z.prototype.initialize.apply(this,e),this.listenTo(this.model,'change:attributes:src',this.updateSrc)}},{key:"updateSrc",value:function(){var t=(0,Ze.sE)(this.el,'iframe')[0];t&&(0,Ze.FW)(t,{src:this.__getSrc()})}},{key:"render",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];s.Z.prototype.render.apply(this,e);var r=(0,Ze.ut)('iframe',{class:"".concat(this.ppfx,"no-pointer"),style:'width: 100%; height: 100%; border: none',src:this.__getSrc()});return this.el.appendChild(r),this}},{key:"__getSrc",value:function(){return this.model.getAttributes().src||''}}]),n}(s.Z),Fe=n(6434),Ve=void 0&&(void 0).__extends||(Ne=function(t,e){return Ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ne(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ne(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),Be=void 0&&(void 0).__assign||function(){return Be=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Be.apply(this,arguments)},He=void 0&&(void 0).__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},ze=function(t){function e(e){var n=t.call(this,e,'DomComponents',new a.Z(void 0,{em:e}))||this;for(var r in n.componentTypes=[{id:'cell',model:x,view:O},{id:'row',model:T,view:E},{id:'table',model:M,view:Z},{id:'thead',model:W,view:$},{id:'tbody',model:V,view:G},{id:'tfoot',model:Q,view:tt},{id:'map',model:ct,view:pt},{id:'link',model:xt,view:Rt},{id:'label',model:Nt,view:Ft},{id:'video',model:Gt,view:Yt},{id:'image',model:ot,view:ft},{id:'script',model:ee,view:re},{id:'svg-in',model:he,view:de},{id:'svg',model:le,view:de},{id:'iframe',model:Me,view:Ie},{id:'comment',model:ke,view:Se},{id:'textnode',model:ye,view:Oe},{id:'text',model:mt,view:jt},{id:'wrapper',model:Ee,view:d},{id:'default',model:o.ZP,view:s.Z}],n.componentsById={},n.Component=o.ZP,n.Components=a.Z,n.ComponentsView=g.Z,n.storageKey='components',e&&(n.config.components=e.config.components||n.config.components),i)r in n.config||(n.config[r]=i[r]);var l=n.config.pStylePrefix;if(l&&(n.config.stylePrefix=l+n.config.stylePrefix),e){n.config.modal=e.get('Modal')||'',n.config.am=e.get('AssetManager')||'',e.get('Parser').compTypes=n.componentTypes,e.on('change:componentHovered',n.componentHovered,n);var c=e.get('selected');e.listenTo(c,'add',(function(t,e,r){return n.selectAdd(c.getComponent(t),r)})),e.listenTo(c,'remove',(function(t,e,r){return n.selectRemove(c.getComponent(t),r)}))}return n}return Ve(e,t),e.prototype.load=function(t){var e=this;return this.loadProjectData(t,{onResult:function(t){var n=e.getWrapper();if(n||(e.em.get('PageManager').add({},{select:!0}),n=e.getWrapper()),(0,r.isArray)(t))t.length&&n.components(t);else{var i=t.components,o=void 0===i?[]:i,a=He(t,["components"]);n.set(a),n.components(o)}}})},e.prototype.store=function(){return{}},e.prototype.getComponent=function(){var t=this.em.get('PageManager').getSelected(),e=t&&t.getMainFrame();return e&&e.getComponent()},e.prototype.getWrapper=function(){return this.getComponent()},e.prototype.getComponents=function(){var t=this.getWrapper();return t&&t.get('components')},e.prototype.addComponent=function(t,e){return void 0===e&&(e={}),this.getComponents().add(t,e)},e.prototype.render=function(){var t;return null===(t=this.componentView)||void 0===t?void 0:t.render().el},e.prototype.clear=function(t){void 0===t&&(t={});var e=this.getComponents();return null==e||e.filter(Boolean).forEach((function(e){return e.remove(t)})),this},e.prototype.setComponents=function(t,e){void 0===e&&(e={}),this.clear(e).addComponent(t,e)},e.prototype.addType=function(t,e){var n=this.em,i=e.model,o=void 0===i?{}:i,a=e.view,s=void 0===a?{}:a,l=e.isComponent,c=e.extend,u=e.extendView,f=e.extendFn,h=void 0===f?[]:f,p=e.extendFnView,d=void 0===p?[]:p,g=this.getType(t),v=this.getType(c),m=this.getType(u),y=v||(g||this.getType('default')),b=y.model,w=m?m.view:y.view,k=function(t,e,n){return t.reduce((function(t,r){var i=e[r],o=n.prototype[r];return i&&o&&(t[r]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o.bind(this).apply(void 0,t),i.bind(this).apply(void 0,t)}),t}),{})};if('object'==typeof o){var x=(0,r.result)(o,'defaults');delete o.defaults,e.model=b.extend(Be(Be({},o),k(h,o,b)),{isComponent:!g||v||l?l||function(){return 0}:b.isComponent}),Object.defineProperty(e.model.prototype,'defaults',{value:Be(Be({},(0,r.result)(b.prototype,'defaults')||{}),x||{})})}'object'==typeof s&&(e.view=w.extend(Be(Be({},s),k(d,s,w)))),g?(g.model=e.model,g.view=e.view):(e.id=t,this.componentTypes.unshift(e));var O="component:type:".concat(g?'update':'add');return null==n||n.trigger(O,g||e),this},e.prototype.getType=function(t){for(var e=this.componentTypes,n=0;n<e.length;n++){if(e[n].id==t)return e[n]}},e.prototype.removeType=function(t){var e=this.componentTypes,n=this.getType(t);if(n){var r=e.indexOf(n);return e.splice(r,1),n}},e.prototype.getTypes=function(){return this.componentTypes},e.prototype.selectAdd=function(t,e){var n=this;void 0===e&&(e={}),t&&(t.set({status:'selected'}),['component:selected','component:toggled'].forEach((function(r){return n.em.trigger(r,t,e)})))},e.prototype.selectRemove=function(t,e){var n=this;if(void 0===e&&(e={}),t){this.em;t.set({status:'',state:''}),['component:deselected','component:toggled'].forEach((function(r){return n.em.trigger(r,t,e)}))}},e.prototype.componentHovered=function(){var t=this.em,e=t.get('componentHovered'),n=t.previous('componentHovered'),i='hovered';n&&n.get('status')==i&&n.set({status:'',state:''}),e&&(0,r.isEmpty)(e.get('status'))&&e.set('status',i)},e.prototype.getShallowWrapper=function(){var t=this.shallow,e=this.em;if(!t&&e){var n=e.shallow;if(!n)return;var i=n.get('DomComponents');if(i.componentTypes=this.componentTypes,t=i.getWrapper()){var a=[o.GN,o.xH].join(' ');t.on(a,(0,r.debounce)((function(){return null==t?void 0:t.components('')}),100))}this.shallow=t}return t},e.prototype.canMove=function(t,e,n){var i=n||0===n?n:null,o={result:!1,reason:0,target:t,source:null};if(!e||!t)return o;var a=e.toHTML?e:null;if(!a){var s=this.getShallowWrapper();a=null==s?void 0:s.append(e)[0]}if(o.source=a,!a)return o;var l=a.get('draggable');if((0,r.isFunction)(l))l=!!l(a,t,i);else{var c=t.getEl();l=(0,r.isArray)(l)?l.join(','):l,l=(0,r.isString)(l)?null==c?void 0:c.matches(l):l}if(!l)return Be(Be({},o),{reason:1});var u=t.get('droppable');if((0,r.isFunction)(u))u=!!u(a,t,i);else if(!1===u&&t.isInstanceOf('text')&&a.get('textable'))u=!0;else{c=a.getEl();u=(0,r.isArray)(u)?u.join(','):u,u=(0,r.isString)(u)?null==c?void 0:c.matches(u):u}var f=[t].concat(t.parents()).indexOf(a)>-1;return Be(Be({},o),!u||f?{reason:2}:{result:!0})},e.prototype.allById=function(){return this.componentsById},e.prototype.getById=function(t){return this.componentsById[t]||null},e.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach((function(t){return e[t]&&e[t].remove()})),null===(t=this.componentView)||void 0===t||t.remove(),[this.em,this.componentsById,this.componentView].forEach((function(t){return{}}))},e}(Fe.O);const Ue=ze},8588:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var r=n(9050),i=n(6434),o=n(9283);const a={stylePrefix:'mdl-',title:'',content:'',backdrop:!0,custom:!1,extend:{}};var s,l=n(7904),c=void 0&&(void 0).__extends||(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.defaults=function(){return{title:'',content:'',attributes:{},open:!1}},e.prototype.open=function(){this.set('open',!0)},e.prototype.close=function(){this.set('open',!1)},e}(l.Z);var f=n(3059),h=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),p=void 0&&(void 0).__assign||function(){return p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},p.apply(this,arguments)};const d=function(t){function e(e){var n=t.call(this,e)||this,r=n.model;return n.listenTo(r,'change:open',n.updateOpen),n.listenTo(r,'change:title',n.updateTitle),n.listenTo(r,'change:content',n.updateContent),n}return h(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.ppfx,r=t.content,i=t.title;return"<div class=\"".concat(e,"dialog ").concat(n,"one-bg ").concat(n,"two-color\">\n      <div class=\"").concat(e,"header\">\n        <div class=\"").concat(e,"title\">").concat(i,"</div>\n        <div class=\"").concat(e,"btn-close\" data-close-modal>&Cross;</div>\n      </div>\n      <div class=\"").concat(e,"content\">\n        <div id=\"").concat(e,"c\">").concat(r,"</div>\n        <div style=\"clear:both\"></div>\n      </div>\n    </div>\n    <div class=\"").concat(e,"collector\" style=\"display: none\"></div>")},e.prototype.events=function(){return{click:'onClick','click [data-close-modal]':'hide'}},e.prototype.onClick=function(t){this.config.backdrop&&t.target===this.el&&this.hide()},e.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find('.'+this.pfx+'collector')),this.$collector},e.prototype.getContent=function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},e.prototype.getTitle=function(t){return void 0===t&&(t={}),this.$title||(this.$title=this.$el.find('.'+this.pfx+'title')),t.$?this.$title:this.$title.get(0)},e.prototype.updateContent=function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),r=this.model.get('content');e.length&&n.append(e),t.empty().append(r)},e.prototype.updateTitle=function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get('title'))},e.prototype.updateOpen=function(){this.el.style.display=this.model.get('open')?'':'none'},e.prototype.hide=function(){this.model.close()},e.prototype.show=function(){this.model.open()},e.prototype.updateAttr=function(t){var e=this,n=e.pfx,r=e.$el,i=e.el,o=[].slice.call(i.attributes).map((function(t){return t.name}));r.removeAttr(o.join(' ')),r.attr(p(p({},t||{}),{class:"".concat(n,"container ").concat(t&&t.class||'').trim()}))},e.prototype.render=function(){var t=this.$el,e=this.model.toJSON();return e.pfx=this.pfx,e.ppfx=this.ppfx,t.html(this.template(e)),this.updateAttr(),this.updateOpen(),this},e}(f.Z);var g=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=t.call(this,e,'Modal',a)||this;return n.model=new u(n),n.model.on('change:open',(function(t,n){e.trigger("modal:".concat(n?'open':'close'))})),n.model.on('change',(0,r.debounce)((function(){var t=n._evData(),i=n.config.custom;(0,r.isFunction)(i)&&i(t),e.trigger('modal',t)}),0)),n}return g(e,t),e.prototype._evData=function(){var t=this,e=this.getTitle(),n=this.getContent(),i=this.model.attributes;return{open:i.open,attributes:i.attributes,title:(0,r.isString)(e)?(0,o.rw)(e):e,content:(0,r.isString)(n)?(0,o.rw)(n):n.get?n.get(0):n,close:function(){return t.close()}}},e.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},e.prototype.open=function(t){void 0===t&&(t={});var e=t.attributes||{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),this.model.set('attributes',e),this.model.open(),this.modal&&this.modal.updateAttr(e),this},e.prototype.close=function(){return this.model.close(),this},e.prototype.onceClose=function(t){return this.em.once('modal:close',t),this},e.prototype.onceOpen=function(t){return this.em.once('modal:open',t),this},e.prototype.isOpen=function(){return!!this.model.get('open')},e.prototype.setTitle=function(t){return this.model.set('title',t),this},e.prototype.getTitle=function(){return this.model.get('title')},e.prototype.setContent=function(t){return this.model.set('content',' '),this.model.set('content',t),this},e.prototype.getContent=function(){return this.model.get('content')},e.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},e.prototype.getModel=function(){return this.model},e.prototype.render=function(){var t;if(!this.config.custom){var e=d.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new e({el:n,model:this.model,config:this.config}),null===(t=this.modal)||void 0===t?void 0:t.render().el}},e.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},e}(i.Z);const m=v},7892:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>j,evAll:()=>k,evComponent:()=>C,evCustom:()=>S,evPfx:()=>x,evRoot:()=>O});var r=n(9050),i=n(7904),o=n(6434),a=n(1163);const s={stylePrefix:'',appendTo:'',sortable:!0,hidable:!0,hideTextnode:!0,root:'',showWrapper:!0,showHover:!0,scrollCanvas:{behavior:'smooth',block:'nearest'},scrollLayers:{behavior:'auto',block:'nearest'},highlightHover:!0,custom:!1,onInit:function(){},onRender:function(){},extend:{}};var l,c=n(2316),u=n(2169),f=n(9138),h=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.items=[],n.opt=e;var r=e.config||{};n.config=r,n.parentView=e.parentView;var i=r.stylePrefix||'',o=r.pStylePrefix||'',a=n.collection;n.listenTo(a,'add',n.addTo),n.listenTo(a,'reset resetNavigator',n.render),n.listenTo(a,'remove',n.removeChildren),n.className="".concat(i,"layers");var s=r.em;if(r.sortable&&!n.opt.sorter){var l=s.get('Utils');n.opt.sorter=new l.Sorter({container:r.sortContainer||n.el,containerSel:".".concat(n.className),itemSel:".".concat(i,"layer"),ignoreViewChildren:1,onEndMove:function(t,e,n){var r=e.getSourceModel();s.setSelected(r,{forceChange:1}),s.trigger("".concat(f.OA,":end"),n)},avoidSelectOnEnd:1,nested:1,ppfx:o,pfx:i})}return n.$el.data('collection',a),e.parent&&n.$el.data('model',e.parent),n}return h(e,t),e.prototype.removeChildren=function(t){var e=t.viewLayer;e&&(e.remove(),delete t.viewLayer)},e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var r=this,i=r.parentView,o=r.opt,a=r.config,s=o.ItemView,l=o.opened,c=o.module,u=e||null,f=new s({ItemView:s,level:o.level,model:t,parentView:i,config:a,sorter:o.sorter,opened:l,module:c}),h=f.render().el;if(u)u.appendChild(h);else if(void 0!==n){var p='before';this.$el.children().length==n&&(n--,p='after'),n<0?this.$el.append(h):this.$el.children().eq(n)[p](h)}else this.$el.append(h);return this.items.push(f),h},e.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return c.View.prototype.remove.apply(this,t),this.items.map((function(t){return t.remove()})),this},e.prototype.render=function(){var t=this,e=document.createDocumentFragment(),n=this.el;return n.innerHTML='',this.collection.each((function(n){return t.addToCollection(n,e)})),n.appendChild(e),n.className=this.className,this},e}(c.View);const d=p;var g=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v='contentEditable',m=function(t){function e(e){var n=t.call(this,e)||this;(0,r.bindAll)(n,'__render'),n.opt=e,n.module=e.module,n.config=e.config||{},n.sorter=e.sorter||'',n.parentView=e.parentView;var i=n,o=i.model,a=i.pfx,s=i.ppfx,l=o.get('type')||'default';return n.className="".concat(a,"layer ").concat(a,"layer__t-").concat(l," no-select ").concat(s,"two-color"),n.inputNameCls="".concat(s,"layer-name"),n.clsTitleC="".concat(a,"layer-title-c"),n.clsTitle="".concat(a,"layer-title"),n.clsCaret="".concat(a,"layer-caret"),n.clsCount="".concat(a,"layer-count"),n.clsMove="".concat(a,"layer-move"),n.clsChildren="".concat(a,"layer-children"),n.clsNoChild="".concat(a,"layer-no-chld"),n.clsEdit="".concat(n.inputNameCls,"--edit"),n.clsNoEdit="".concat(n.inputNameCls,"--no-edit"),n.initComponent(),n}return g(e,t),e.prototype.events=function(){return{'mousedown [data-toggle-move]':'startSort','touchstart [data-toggle-move]':'startSort','click [data-toggle-visible]':'toggleVisibility','click [data-toggle-open]':'toggleOpening','click [data-toggle-select]':'handleSelect','mouseover [data-toggle-select]':'handleHover','mouseout [data-toggle-select]':'handleHoverOut','dblclick [data-name]':'handleEdit','keydown [data-name]':'handleEditKey','focusout [data-name]':'handleEditEnd'}},e.prototype.template=function(t){var e=this,n=e.pfx,r=e.ppfx,i=e.config,o=e.clsNoEdit,a=e.module,s=e.opt,l=e.em,c=i.hidable,u=a.getComponents(t).length,f=u?'':this.clsNoChild,h="".concat(this.clsTitle," ").concat(f),p="".concat(this.clsTitleC," ").concat(r,"one-bg"),d="".concat(this.inputNameCls," ").concat(o," ").concat(r,"no-app"),g=s.level+1,v="".concat(30+10*g,"px"),m=t.getName(),y=t.getIcon(),b="".concat(n,"layer"),w=(null==l?void 0:l.getConfig()).icons,k=w.move,x=w.eye,O=w.eyeOff,C=w.chevron;return"\n      ".concat(c?"<i class=\"".concat(n,"layer-vis\" data-toggle-visible>\n            <i class=\"").concat(n,"layer-vis-on\">").concat(x,"</i>\n            <i class=\"").concat(n,"layer-vis-off\">").concat(O,"</i>\n          </i>"):'',"\n      <div class=\"").concat(p,"\">\n        <div class=\"").concat(h,"\" style=\"padding-left: ").concat(v,"\" data-toggle-select>\n          <div class=\"").concat(n,"layer-title-inn\" title=\"").concat(m,"\">\n            <i class=\"").concat(this.clsCaret,"\" data-toggle-open>").concat(C,"</i>\n            ").concat(y?"<span class=\"".concat(b,"__icon\">").concat(y,"</span>"):'',"\n            <span class=\"").concat(d,"\" data-name>").concat(m,"</span>\n          </div>\n        </div>\n      </div>\n      <div class=\"").concat(this.clsCount,"\" data-count>").concat(u||'',"</div>\n      <div class=\"").concat(this.clsMove,"\" data-toggle-move>").concat(k||'',"</div>\n      <div class=\"").concat(this.clsChildren,"\"></div>")},Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),e.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,r=e.components();this.listenTo(r,'remove add reset',this.checkChildren),[['change:status',this.updateStatus],['change:open',this.updateOpening],['change:layerable',this.updateLayerable],['change:style:display',this.updateVisibility],['rerender:layer',this.render],['change:name change:custom-name',this.updateName]].forEach((function(n){return t.listenTo(e,n[0],n[1])})),this.$el.data('model',e),this.$el.data('collection',r),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},e.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},e.prototype.getVisibilityEl=function(){return this.eyeEl||(this.eyeEl=this.$el.children(".".concat(this.pfx,"layer-vis"))),this.eyeEl},e.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,r=t.module,i="".concat(e,"layer-hidden"),o=!r.isVisible(n)?'addClass':'removeClass';this.$el[o](i),this.getVisibilityEl()[o]("".concat(e,"layer-off"))},e.prototype.toggleVisibility=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},e.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,i=e.clsNoEdit,o=e.clsEdit,a=this.getInputName();a[v]='true',a.focus(),document.execCommand('selectAll',!1),n.setEditing(!0),r.find(".".concat(this.inputNameCls)).removeClass(i).addClass(o)},e.prototype.handleEditKey=function(t){t.stopPropagation(),((0,a.isEscKey)(t)||(0,a.isEnterKey)(t))&&this.handleEditEnd(t)},e.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,i=e.clsNoEdit,o=e.clsEdit,a=this.getInputName(),s=a.textContent;a.scrollLeft=0,a[v]='false',this.setName(s,{component:this.model,propName:'custom-name'}),n.setEditing(!1),r.find(".".concat(this.inputNameCls)).addClass(i).removeClass(o),this.updateName()},e.prototype.setName=function(t,e){var n=e.propName;this.model.set(n,t)},e.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},e.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,i='open',o="".concat(r,"layer-open"),a=this.getCaret();this.module.isOpen(n)?(e.addClass(i),a.addClass(o)):(e.removeClass(i),a.removeClass(o))},e.prototype.toggleOpening=function(t){var e=this.model,n=this.module;null==t||t.stopImmediatePropagation(),e.get('components').length&&n.setOpen(e,!n.isOpen(e))},e.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},e.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},e.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},e.prototype.startSort=function(t){t.stopPropagation();var e=this.em,n=this.sorter;t.button&&0!==t.button||n&&(n.onStart=function(t){return e.trigger("".concat(f.OA,":start"),t)},n.onMoveClb=function(t){return e.trigger(f.OA,t)},n.startSort(t.target))},e.prototype.updateStatus=function(){u.Z.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:1}])},e.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,r=t.$el,i=t.module,o=i.getComponents(e).length,a=r.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)),s=this.cnt;s||(s=r.children('[data-count]').get(0),this.cnt=s),a[o?'removeClass':'addClass'](n),s&&(s.innerHTML=o||''),!o&&i.setOpen(e,!1)},e.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))),this.caret},e.prototype.setRoot=function(t){t=(0,r.isString)(t)?this.em.getWrapper().find(t)[0]:t;var e=(0,a.getModel)(t,0);e&&(this.stopListening(),this.model=e,this.initComponent(),this._rendered&&this.render())},e.prototype.updateLayerable=function(){(this.parentView||this).render()},e.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},e.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return c.View.prototype.remove.apply(this,t),this.__clearItems(),this},e.prototype.render=function(){var t=this,e=t.model,n=t.config,r=t.pfx,i=t.ppfx,o=t.opt,a=t.sorter;this.__clearItems();var s=o.opened,l=o.module,c=o.ItemView,u=!l.__isLayerable(e),f=this.$el.empty(),h=o.level+1;delete this.inputName,this.items=new d({ItemView:c,collection:e.get('components'),config:n,sorter:a,opened:s,parentView:this,parent:e,level:h,module:l});var p=this.items.render().$el;return n.showWrapper||1!==h?(f.html(this.template(e)),f.find(".".concat(this.clsChildren)).append(p)):f.append(p),e.get('draggable')&&n.sortable||f.children(".".concat(this.clsMove)).remove(),!l.isVisible(e)&&(this.className+=" ".concat(r,"hide")),u&&(this.className+=" ".concat(i,"hidden")),f.attr('class',this.className),this.updateStatus(),this.updateOpening(),this.updateVisibility(),this.__render(),this._rendered=!0,this},e.prototype.__render=function(){var t=this,e=t.model,n=t.config,r={component:e,el:t.el};n.onRender.bind(this)(r),this.em.trigger('layer:render',r)},e}(c.View);const y=m;var b=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w=void 0&&(void 0).__assign||function(){return w=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},w.apply(this,arguments)},k='layer',x="".concat(k,":"),O="".concat(x,"root"),C="".concat(x,"component"),S="".concat(x,"custom"),_={all:k,root:O,component:C,custom:S},P={mediaText:''},T=['open','status','locked','custom-name','components','classes'].map((function(t){return"component:update:".concat(t)})).join(' '),E=function(t){function e(e){var n=t.call(this,e,'LayerManager',s)||this;return n.events=_,(0,r.bindAll)(n,'componentChanged','__onRootChange','__onComponent'),n.model=new i.Z(n,{opened:{}}),n.config.stylePrefix=n.config.pStylePrefix,n}return b(e,t),e.prototype.onLoad=function(){var t=this,e=this,n=e.em,r=e.config,i=e.model;i.listenTo(n,'component:selected',this.componentChanged),i.on('change:root',this.__onRootChange),i.listenTo(n,T,this.__onComponent),this.componentChanged(),i.listenToOnce(n,'load',(function(){t.setRoot(r.root),t.__appendTo()}))},e.prototype.setRoot=function(t){var e=this.em.getWrapper(),n=(0,a.isComponent)(t)?t:e;return t&&(0,r.isString)(t)&&(0,a.hasWin)()&&(n=e.find(t)[0]||e),this.model.set('root',n),n},e.prototype.getRoot=function(){return this.model.get('root')},e.prototype.getComponents=function(t){var e=this;return t.components().filter((function(t){return e.__isLayerable(t)}))},e.prototype.setOpen=function(t,e){t.set('open',e)},e.prototype.isOpen=function(t){return!!t.get('open')},e.prototype.setVisible=function(t,e){var n='__prev-display',r=t.getStyle(P),i=r.display;if(e){var o=t.get(n);delete r.display,o&&(r.display=o,t.unset(n))}else i&&t.set(n,i),r.display='none';t.setStyle(r,P),this.updateLayer(t),this.em.trigger('component:toggled')},e.prototype.isVisible=function(t){return void 0===(e=t.getStyle(P))&&(e={}),!(0===(e.display||'').trim().indexOf('none'));var e},e.prototype.setLocked=function(t,e){t.set('locked',e)},e.prototype.isLocked=function(t){return t.get('locked')},e.prototype.setName=function(t,e){t.set('custom-name',e)},e.prototype.getName=function(t){return t.getName()},e.prototype.getLayerData=function(t){var e=t.get('status');return{name:t.getName(),open:this.isOpen(t),selected:'selected'===e,hovered:'hovered'===e,visible:this.isVisible(t),locked:this.isLocked(t),components:this.getComponents(t)}},e.prototype.setLayerData=function(t,e,n){var r;void 0===n&&(n={});var i=this.em,o=this.config,s=e.open,l=e.selected,c=e.hovered,u=e.visible,f=e.locked,h=e.name,p=w({fromLayers:!0},n);if((0,a.isDef)(s)&&this.setOpen(t,s),(0,a.isDef)(l))if(l){i.setSelected(t,p);var d=o.scrollCanvas;d&&(null===(r=t.views)||void 0===r||r.forEach((function(t){return t.scrollIntoView(d)})))}else i.removeSelected(t,p);(0,a.isDef)(c)&&o.showHover&&(c?i.setHovered(t,p):i.setHovered(null,p)),(0,a.isDef)(u)&&u!==this.isVisible(t)&&this.setVisible(t,u),(0,a.isDef)(f)&&this.setLocked(t,f),(0,a.isDef)(h)&&this.setName(t,h)},e.prototype.componentChanged=function(t,e){var n;if(void 0===e&&(e={}),!e.fromLayers){var r=this.em,i=this.config.scrollLayers,o=this.model.get('opened'),a=r.getSelected(),s=null==a?void 0:a.parent();for(var l in o)o[l].set('open',!1),delete o[l];for(;s;)s.set('open',!0),o[s.cid]=s,s=s.parent();if(a&&i){var c=null===(n=a.viewLayer)||void 0===n?void 0:n.el;null==c||c.scrollIntoView(i)}}},e.prototype.getAll=function(){return this.view},e.prototype.render=function(){var t,e,n=this.config,r=this.model,i=y.extend(n.extend);return this.view=new i({el:null===(t=this.view)||void 0===t?void 0:t.el,ItemView:i,level:0,config:n,opened:r.get('opened'),model:this.getRoot(),module:this}),null===(e=this.view)||void 0===e?void 0:e.render().el},e.prototype.destroy=function(){var t;null===(t=this.view)||void 0===t||t.remove()},e.prototype.__onRootChange=function(){var t,e=this.getRoot();null===(t=this.view)||void 0===t||t.setRoot(e),this.em.trigger(O,e)},e.prototype.__onComponent=function(t){this.updateLayer(t)},e.prototype.__isLayerable=function(t){var e=t.get('tagName');return(!this.config.hideTextnode||!t.is('textnode')&&'br'!==e)&&t.get('layerable')},e.prototype.__trgCustom=function(t){this.em.trigger(this.events.custom,{container:t.container,root:this.getRoot()})},e.prototype.updateLayer=function(t,e){this.em.trigger(C,t,e)},e}(o.Z);const j=E},7948:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>E,evAll:()=>v,evPageAdd:()=>k,evPageAddBefore:()=>x,evPageRemove:()=>O,evPageRemoveBefore:()=>C,evPageSelect:()=>y,evPageSelectBefore:()=>b,evPageUpdate:()=>w,evPfx:()=>m});var r,i=n(9050),o=n(1163),a=n(7904),s=n(6434),l=n(2316),c=n(3560),u=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const f=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e,n)||this,i=n.em,o={};r.em=i,e.frames||(o.component=e.component,o.styles=e.styles,['component','styles'].map((function(t){return r.unset(t)})));var a=e.frames||[o],s=new c.Z(i.get('Canvas'),a);s.page=r,r.set('frames',s),!r.getId()&&r.set('id',null==i?void 0:i.get('PageManager')._createId());var l=null==i?void 0:i.get('UndoManager');return null==l||l.add(s),r}return u(e,t),e.prototype.defaults=function(){return{frames:[],_undo:!0}},e.prototype.onRemove=function(){this.getFrames().reset()},e.prototype.getFrames=function(){return this.get('frames')},e.prototype.getId=function(){return this.id},e.prototype.getName=function(){return this.get('name')},e.prototype.setName=function(t){return this.set({name:t})},e.prototype.getAllFrames=function(){return this.getFrames().models||[]},e.prototype.getMainFrame=function(){return this.getFrames().at(0)},e.prototype.getMainComponent=function(){var t=this.getMainFrame();return null==t?void 0:t.getComponent()},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=l.Model.prototype.toJSON.call(this,t),n=(0,i.result)(this,'defaults');return(0,i.forEach)(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),(0,i.forEach)(n,(function(t,n){e[n]===t&&delete e[n]})),e},e}(l.Model);var h=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),p=void 0&&(void 0).__assign||function(){return p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},p.apply(this,arguments)};const d=function(t){function e(e,n){var r=t.call(this,e)||this;return r.on('reset',r.onReset),r.on('remove',r.onRemove),r.model=function(t,e){return void 0===e&&(e={}),new f(t,p(p({},e),{em:n}))},r}return h(e,t),e.prototype.onReset=function(t,e){var n,r=this;null===(n=null==e?void 0:e.previousModels)||void 0===n||n.map((function(t){return r.onRemove(t)}))},e.prototype.onRemove=function(t){null==t||t.onRemove()},e}(l.Collection);var g=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v='page',m="".concat(v,":"),y="".concat(m,"select"),b="".concat(y,":before"),w="".concat(m,"update"),k="".concat(m,"add"),x="".concat(k,":before"),O="".concat(m,"remove"),C="".concat(O,":before"),S='change:selected',_='main',P={all:v,select:y,selectBefore:b,update:w,add:k,addBefore:x,remove:O,removeBefore:C},T=function(t){function e(e){var n=t.call(this,e,'PageManager',new d([],e),P)||this;n.storageKey='pages',(0,i.bindAll)(n,'_onPageChange');var r=new a.Z({_undo:!0});return n.model=r,n.pages.on('reset',(function(t){return t.at(0)&&n.select(t.at(0))})),n.pages.on('all',n.__onChange,n),r.on(S,n._onPageChange),n}return g(e,t),Object.defineProperty(e.prototype,"pages",{get:function(){return this.all},enumerable:!1,configurable:!0}),e.prototype.__onChange=function(t,e,n,r){var i=r||n;this.em.trigger(v,{event:t,page:e,options:i})},e.prototype.onLoad=function(){var t,e=this,n=this.pages,r={silent:!0};n.add((null===(t=this.config.pages)||void 0===t?void 0:t.map((function(t){return new f(t,{em:e.em,config:e.config})})))||[],r);var i=n.length?this.getMain():this.add({type:_},r);i&&this.select(i,r)},e.prototype._onPageChange=function(t,e,n){var r=this.em,i=r.get('LayerManager'),o=e.getMainComponent();i&&o&&i.setRoot(o),r.trigger(y,e,t.previous('selected')),this.__onChange(S,e,n)},e.prototype.postLoad=function(){var t=this.em,e=this.model,n=t.get('UndoManager');n&&n.add(e),n&&n.add(this.pages)},e.prototype.add=function(t,e){var n=this;void 0===e&&(e={});var r=this.em;t.id=t.id||this._createId();var i=function(){var r=n.pages.add(new f(t,{em:n.em,config:n.config}),e);return e.select&&n.select(r),r};return!e.silent&&r.trigger(x,t,i,e),!e.abort&&i()},e.prototype.remove=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,o=(0,i.isString)(t)?this.get(t):t,a=function(){return o&&n.pages.remove(o,e),o};return!e.silent&&r.trigger(C,o,a,e),!e.abort&&a()},e.prototype.get=function(t){return this.pages.filter((function(e){return e.get(e.idAttribute)===t}))[0]},e.prototype.getMain=function(){var t=this.pages;return t.filter((function(t){return t.get('type')===_}))[0]||t.at(0)},e.prototype.getAllWrappers=function(){var t=this.getAll();return(0,i.unique)((0,i.flatten)(t.map((function(t){return t.getAllFrames().map((function(t){return t.getComponent()}))}))))},e.prototype.select=function(t,e){void 0===e&&(e={});var n=(0,i.isString)(t)?this.get(t):t;return n&&(this.em.trigger(b,n,e),this.model.set('selected',n,e)),this},e.prototype.getSelected=function(){return this.model.get('selected')},e.prototype.destroy=function(){var t=this;this.pages.off().reset(),this.model.stopListening(),this.model.clear({silent:!0}),['selected','model'].map((function(e){return t[e]=0}))},e.prototype.store=function(){return this.getProjectData()},e.prototype.load=function(t){return this.loadProjectData(t,{all:this.pages,reset:!0})},e.prototype._createId=function(){var t,e=this.getAll().length+16,n=this.getAllMap();do{t=(0,o.createId)(e)}while(n[t]);return t},e}(s.O);const E=T},899:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>V});var r=n(6434),i='sw-visibility',o='export-template',a='open-sm',s='open-tm',l='open-layers',c='open-blocks',u='fullscreen',f='preview';const h={stylePrefix:'pn-',defaults:[{id:'commands',buttons:[{}]},{id:'options',buttons:[{active:!0,id:i,className:'fa fa-square-o',command:i,context:i,attributes:{title:'View components'}},{id:f,className:'fa fa-eye',command:f,context:f,attributes:{title:'Preview'}},{id:u,className:'fa fa-arrows-alt',command:u,context:u,attributes:{title:'Fullscreen'}},{id:o,className:'fa fa-code',command:o,attributes:{title:'View code'}}]},{id:'views',buttons:[{id:a,className:'fa fa-paint-brush',command:a,active:!0,togglable:0,attributes:{title:'Open Style Manager'}},{id:s,className:'fa fa-cog',command:s,togglable:0,attributes:{title:'Settings'}},{id:l,className:'fa fa-bars',command:l,togglable:0,attributes:{title:'Open Layer Manager'}},{id:c,className:'fa fa-th-large',command:c,togglable:0,attributes:{title:'Open Blocks'}}]}],em:null,delayBtnsShow:300};var p,d=n(7116),g=n(7904),v=void 0&&(void 0).__extends||(p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const m=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.get('buttons').length&&r.set('buttons',new w(r.module,r.get('buttons'))),r}return v(e,t),e.prototype.defaults=function(){return{id:'',label:'',tagName:'span',className:'',command:'',context:'',buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1}},Object.defineProperty(e.prototype,"className",{get:function(){return this.get('className')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.get('command')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this.get('active')},set:function(t){this.set('active',t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"togglable",{get:function(){return this.get('togglable')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runDefaultCommand",{get:function(){return this.get('runDefaultCommand')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stopDefaultCommand",{get:function(){return this.get('stopDefaultCommand')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disable",{get:function(){return this.get('disable')},enumerable:!1,configurable:!0}),e}(g.Z);var y=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(t){function e(e,n){return t.call(this,e,n,m)||this}return y(e,t),e.prototype.deactivateAllExceptOne=function(t,e){this.forEach((function(n,r){n!==t&&(n.set('active',!1),e&&n.get('buttons').length&&n.get('buttons').deactivateAllExceptOne(t,e))}))},e.prototype.deactivateAll=function(t,e){var n=t||'';this.forEach((function(t){t.get('context')==n&&t!==e&&t.set('active',!1,{fromCollection:!0})}))},e.prototype.disableAllButtons=function(t){var e=t||'';this.forEach((function(t,n){t.get('context')==e&&t.set('disable',!0)}))},e.prototype.disableAllButtonsExceptOne=function(t,e){this.forEach((function(n,r){n!==t&&(n.set('disable',!0),e&&n.get('buttons').length&&n.get('buttons').disableAllButtonsExceptOne(t,e))}))},e}(d.Z);const w=b;b.prototype.model=m;var k=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const x=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=r.get('buttons')||[];return r.buttons=new w(e,i),r}return k(e,t),e.prototype.defaults=function(){return{id:'',content:'',visible:!0,buttons:[],attributes:{}}},Object.defineProperty(e.prototype,"buttons",{get:function(){return this.get('buttons')},set:function(t){this.set('buttons',t)},enumerable:!1,configurable:!0}),e}(g.Z);var O=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(e,n){return t.call(this,e,n,x)||this}return O(e,t),e}(d.Z);const S=C;C.prototype.model=x;var _=n(3059),P=n(9050),T=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=void 0&&(void 0).__assign||function(){return E=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},E.apply(this,arguments)};const j=function(t){function e(e){var n=t.call(this,e)||this,r=n,i=r.model,o=r.em,a=r.pfx,s=r.ppfx,l=i.className,c=i.attributes,u=c.command,f=c.listen;if(n.id=a+i.get('id'),n.activeCls="".concat(a,"active ").concat(s,"four-color"),n.disableCls="".concat(s,"disabled"),n.btnsVisCls="".concat(a,"visible"),n.className=a+'btn'+(l?' '+l:''),n.listenTo(i,'change',n.render),n.listenTo(i,'change:active updateActive',n.updateActive),n.listenTo(i,'checkActive',n.checkActive),n.listenTo(i,'change:bntsVis',n.updateBtnsVis),n.listenTo(i,'change:attributes',n.updateAttributes),n.listenTo(i,'change:className',n.updateClassName),n.listenTo(i,'change:disable',n.updateDisable),o&&(0,P.isString)(u)&&f){var h={fromListen:!0};n.listenTo(o,"run:".concat(u),(function(){return i.set('active',!0,h)})),n.listenTo(o,"stop:".concat(u),(function(){return i.set('active',!1,h)}))}return o&&o.get&&(n.commands=o.get('Commands')),n}return T(e,t),e.prototype.tagName=function(){return this.model.get('tagName')},e.prototype.events=function(){return{click:'clicked'}},e.prototype.updateClassName=function(){var t=this.model,e=this.pfx,n=t.className,r=t.get('attributes').class,i="".concat(r||''," ").concat(e,"btn ").concat(n||'');this.$el.attr('class',i.trim())},e.prototype.updateAttributes=function(){var t=this,e=t.em,n=t.model,r=t.$el,i=n.get('attributes')||{},o=e&&e.t&&e.t("panels.buttons.titles.".concat(n.id));r.attr(i),o&&r.attr({title:o}),this.updateClassName()},e.prototype.updateBtnsVis=function(){this.$buttons&&(this.model.get('bntsVis')?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},e.prototype.updateActive=function(t,e,n){var r;void 0===n&&(n={});var i=this,o=i.model,a=i.commands,s=i.$el,l=i.activeCls,c=n.fromCollection,u=n.fromListen,f=o.get('context'),h=o.get('options'),p=o.command,d={};p&&(a&&(0,P.isString)(p)?d=a.get(p)||{}:(0,P.isFunction)(p)?d=a.create({run:p}):null!==p&&(0,P.isObject)(p)&&(d=a.create(p)),o.active?(!c&&(null===(r=o.collection)||void 0===r||r.deactivateAll(f,o)),o.set('active',!0,{silent:!0}).trigger('checkActive'),!u&&a.runCommand(d,E(E({},h),{sender:o})),d.noStop&&o.set('active',!1)):(s.removeClass(l),!u&&a.stopCommand(d,E(E({},h),{sender:o,force:1}))))},e.prototype.updateDisable=function(){var t=this.disableCls,e=this.model.disable;this.$el[e?'addClass':'removeClass'](t)},e.prototype.checkActive=function(){var t=this,e=t.model,n=t.$el,r=t.activeCls;e.active?n.addClass(r):n.removeClass(r)},e.prototype.clicked=function(t){var e=this.model;e.get('bntsVis')||e.disable||!e.command||this.toggleActive()},e.prototype.toggleActive=function(){var t=this.model,e=this.em,n=t.active,r=t.togglable;n&&!r||(t.active=!n,n?t.runDefaultCommand&&e.runDefault():t.stopDefaultCommand&&e.stopDefault())},e.prototype.render=function(){var t=this.model,e=t.get('label'),n=this.$el;return!t.get('el')&&n.empty(),this.updateAttributes(),e&&n.append(e),this.checkActive(),this.updateDisable(),this},e}(_.Z);var A=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const R=function(t){function e(e){var n=t.call(this,{collection:e})||this;return n.listenTo(n.collection,'add',n.addTo),n.listenTo(n.collection,'reset remove',n.render),n.className=n.pfx+'buttons',n}return A(e,t),e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){var n=e||null,r=t.get('el'),i=new j({el:r,model:t}).render().el;return n?n.appendChild(i):this.$el.append(i),i},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.$el.empty(),this.collection.each((function(n){return t.addToCollection(n,e)})),this.$el.append(e),this.$el.attr('class',(0,P.result)(this,'className')),this},e}(_.Z);var D=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=void 0&&(void 0).__assign||function(){return M=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},M.apply(this,arguments)},Z=function(t){function e(e){var n=t.call(this,{model:e,el:e.get('el')})||this;return n.className=n.pfx+'panel',n.id=n.pfx+e.get('id'),n.listenTo(e,'change:appendContent',n.appendContent),n.listenTo(e,'change:content',n.updateContent),n.listenTo(e,'change:visible',n.toggleVisible),e.view=n,n}return D(e,t),e.prototype.appendContent=function(){this.$el.append(this.model.get('appendContent'))},e.prototype.updateContent=function(){this.$el.html(this.model.get('content'))},e.prototype.toggleVisible=function(){this.model.get('visible')?this.$el.removeClass("".concat(this.ppfx,"hidden")):this.$el.addClass("".concat(this.ppfx,"hidden"))},e.prototype.attributes=function(){return this.model.get('attributes')},e.prototype.initResize=function(){var t=this.em,e=t?t.get('Editor'):'',n=this.model.get('resizable');if(e&&n){var r,i,o,a=!0===n?[1,1,1,1]:n,s=a.length,l=0;2==s?(r=a[0],o=a[0],i=a[1],l=a[1]):4==s&&(r=a[0],i=a[1],o=a[2],l=a[3]);var c=e.Utils.Resizer.init(M({tc:r,cr:i,bc:o,cl:l,tl:0,tr:0,bl:0,br:0,appendTo:this.el,silentFrames:1,avoidContainerUpdate:1,prefix:e.getConfig().stylePrefix,onEnd:function(){t&&t.trigger('change:canvasOffset')},posFetcher:function(t,e){var n=e.target,r=t.style,i=c.getConfig(),o=i.keyWidth,a=i.keyHeight,s=t.getBoundingClientRect(),l='container'==n,u=r[o],f=r[a];return{left:0,top:0,width:u&&!l?parseFloat(u):s.width,height:f&&!l?parseFloat(f):s.height}}},n));c.blur=function(){},c.focus(this.el)}},e.prototype.render=function(){var t=this.model.buttons,e=this.$el,n=this.ppfx,r="".concat(this.className," ").concat(this.id," ").concat(n,"one-bg ").concat(n,"two-color");if(e.addClass(r),this.toggleVisible(),t.length){var i=new R(t);e.append(i.render().el)}return e.append(this.model.get('content')),this},e}(_.Z);const L=Z;var N=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const I=function(t){function e(e){var n=t.call(this,{collection:e})||this;return n.listenTo(e,'add',n.addTo),n.listenTo(e,'reset',n.render),n.listenTo(e,'remove',n.onRemove),n.className=n.pfx+'panels',n}return N(e,t),e.prototype.onRemove=function(t){var e=t.view;e&&e.remove()},e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){var n=e||null,r=(this.config,t.get('el')),i=new L(t),o=i.render().el,a=t.get('appendTo');if(r);else if(a){document.querySelector(a).appendChild(o)}else n?n.appendChild(o):this.$el.append(o);return i.initResize(),o},e.prototype.render=function(){var t=this,e=this.$el,n=document.createDocumentFragment();return e.empty(),this.collection.each((function(e){return t.addToCollection(e,n)})),e.append(n),e.attr('class',this.className),this},e}(_.Z);var F=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const V=function(t){function e(e){var n=t.call(this,e,'Panels',h)||this;for(var r in n.panels=new S(n,n.config.defaults),h)r in n.config||(n.config[r]=h[r]);return n}return F(e,t),e.prototype.getPanels=function(){return this.panels},e.prototype.getPanelsEl=function(){return this.PanelsViewObj&&this.PanelsViewObj.el},e.prototype.addPanel=function(t){return this.panels.add(t)},e.prototype.removePanel=function(t){return this.panels.remove(t)},e.prototype.getPanel=function(t){var e=this.panels.where({id:t});return e.length?e[0]:null},e.prototype.addButton=function(t,e){var n=this.getPanel(t);return n?n.get('buttons').add(e):null},e.prototype.removeButton=function(t,e){var n=this.getPanel(t);return n&&n.get('buttons').remove(e)},e.prototype.getButton=function(t,e){var n=this.getPanel(t);if(n){var r=n.get('buttons').where({id:e});return r.length?r[0]:null}return null},e.prototype.render=function(){return this.PanelsViewObj&&this.PanelsViewObj.remove(),this.PanelsViewObj=new I(this.panels),this.PanelsViewObj.render().el},e.prototype.active=function(){this.getPanels().each((function(t){t.get('buttons').each((function(t){t.get('active')&&t.trigger('updateActive')}))}))},e.prototype.disableButtons=function(){this.getPanels().each((function(t){t.get('buttons').each((function(t){t.get('disable')&&t.trigger('change:disable')}))}))},e.prototype.destroy=function(){this.panels.reset(),this.panels.stopListening(),this.PanelsViewObj&&this.PanelsViewObj.remove()},e}(r.Z)},3463:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>B,evAdd:()=>Z,evAll:()=>D,evCustom:()=>F,evPfx:()=>M,evRemove:()=>N,evRemoveBefore:()=>I,evState:()=>V,evUpdate:()=>L});var r=n(9050),i=n(1163),o=n(9714),a=n(2316);const s={stylePrefix:'clm-',appendTo:'',selectors:[],states:[{name:'hover'},{name:'active'},{name:'nth-of-type(2n)'}],escapeName:0,selectedName:0,iconAdd:'<svg viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></svg>',iconSync:'<svg viewBox="0 0 24 24"><path d="M12 18c-3.31 0-6-2.69-6-6 0-1 .25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4m0-11V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8z"></path></svg>',iconTagOn:'<svg viewBox="0 0 24 24"><path d="M19 19H5V5h10V3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8h-2m-11.09-.92L6.5 11.5 11 16 21 6l-1.41-1.42L11 13.17l-3.09-3.09z"></path></svg>',iconTagOff:'<svg viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',iconTagRemove:'<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',render:0,componentFirst:!1,custom:!1};var l,c=n(5963),u=n(966),f=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.defaults=function(){return{name:'',label:''}},e.prototype.getName=function(){return this.get('name')},e.prototype.getLabel=function(){return this.get('label')||this.getName()},e}(a.Model);const p=h;h.prototype.idAttribute='name';var d=n(7539),g=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},m='contentEditable';const y=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.config||{};return n.config=r,n.module=e.module,n.coll=e.coll||null,n.pfx=r.stylePrefix||'',n.ppfx=r.pStylePrefix||'',n.em=r.em,n.listenTo(n.model,'change:active',n.updateStatus),n}return g(e,t),e.prototype.template=function(){var t=this,e=t.pfx,n=t.model,r=t.config,i=n.get('label')||'';return(0,d.Z)(b||(b=v(["\n      <span id=\"","checkbox\" class=\"","tag-status\" data-tag-status></span>\n      <span id=\"","tag-label\" data-tag-name>","</span>\n      <span id=\"","close\" class=\"","tag-close\" data-tag-remove> $"," </span>\n    "],["\n      <span id=\"","checkbox\" class=\"","tag-status\" data-tag-status></span>\n      <span id=\"","tag-label\" data-tag-name>","</span>\n      <span id=\"","close\" class=\"","tag-close\" data-tag-remove> $"," </span>\n    "])),e,e,e,i,e,e,r.iconTagRemove)},e.prototype.events=function(){return{'click [data-tag-remove]':'removeTag','click [data-tag-status]':'changeStatus','dblclick [data-tag-name]':'startEditTag','focusout [data-tag-name]':'endEditTag'}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector('[data-tag-name]')),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[m]='true',e.focus(),t&&t.setEditing(1)},e.prototype.endEditTag=function(){var t=this.model,e=this.getInputEl(),n=e.textContent,r=this.em,i=r&&r.get('SelectorManager');if(e[m]='false',r&&r.setEditing(0),i){var o=i.escapeName(n);i.get(o)?e.innerText=t.get('label'):t.set({name:o,label:n})}},e.prototype.changeStatus=function(){var t=this.model;t.set('active',!t.get('active'))},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,r=t.config,i=r.iconTagOn,o=r.iconTagOff,a=n.find('[data-tag-status]');e.get('active')?(a.html(i),n.removeClass('opac50')):(a.html(o),n.addClass('opac50'))},e.prototype.render=function(){var t=this.pfx,e=this.ppfx;return this.$el.html(this.template()),this.$el.attr('class',"".concat(t,"tag ").concat(e,"three-bg")),this.updateStatus(),this},e}(a.View);var b,w=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t};const x=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{},n.pfx=n.config.stylePrefix||'',n.ppfx=n.config.pStylePrefix||'',n.className=n.pfx+'tags',n.stateInputId=n.pfx+'states',n.stateInputC=n.pfx+'input-c',n.states=n.config.states||[];var i=n.config.em,o=n.collection;n.target=i;var a=i.get('SelectorManager');n.module=a,n.em=i,n.componentChanged=(0,r.debounce)(n.componentChanged.bind(n),0),n.checkSync=(0,r.debounce)(n.checkSync.bind(n),0);return n.listenTo(i,'component:toggled component:update:classes',n.componentChanged),n.listenTo(i,'styleManager:update',n.componentChanged),n.listenTo(i,'component:update:classes change:state',n.__handleStateChange),n.listenTo(i,'styleable:change change:device',n.checkSync),n.listenTo(o,'add',n.addNew),n.listenTo(o,'reset',n.renderClasses),n.listenTo(o,'remove',n.tagRemoved),n.listenTo(a.getAll(),a.events.state,(0,r.debounce)((function(){return n.renderStates()}),0)),n.delegateEvents(),n}return w(e,t),e.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,r=t.iconSync,i=t.iconAdd,o=t.pfx,a=t.ppfx;return(0,d.Z)(O||(O=k([" <div id=\"","up\" class=\"","header\">\n        <div id=\"","label\" class=\"","header-label\">","</div>\n        <div id=\"","status-c\" class=\"","header-status\">\n          <span id=\"","input-c\" data-states-c>\n            <div class=\"","field ","select\">\n              <span id=\"","input-holder\">\n                <select id=\"","states\" data-states></select>\n              </span>\n              <div class=\"","sel-arrow\">\n                <div class=\"","d-s-arrow\"></div>\n              </div>\n            </div>\n          </span>\n        </div>\n      </div>\n      <div id=\"","tags-field\" class=\"","field\">\n        <div id=\"","tags-c\" data-selectors></div>\n        <input id=\"","new\" data-input />\n        <span id=\"","add-tag\" class=\"","tags-btn ","tags-btn__add\" data-add> $"," </span>\n        <span class=\"","tags-btn ","tags-btn__sync\" style=\"display: none\" data-sync-style> $"," </span>\n      </div>\n      <div class=\"","sels-info\">\n        <div class=\"","label-sel\">",":</div>\n        <div class=\"","sels\" data-selected></div>\n      </div>"],[" <div id=\"","up\" class=\"","header\">\n        <div id=\"","label\" class=\"","header-label\">","</div>\n        <div id=\"","status-c\" class=\"","header-status\">\n          <span id=\"","input-c\" data-states-c>\n            <div class=\"","field ","select\">\n              <span id=\"","input-holder\">\n                <select id=\"","states\" data-states></select>\n              </span>\n              <div class=\"","sel-arrow\">\n                <div class=\"","d-s-arrow\"></div>\n              </div>\n            </div>\n          </span>\n        </div>\n      </div>\n      <div id=\"","tags-field\" class=\"","field\">\n        <div id=\"","tags-c\" data-selectors></div>\n        <input id=\"","new\" data-input />\n        <span id=\"","add-tag\" class=\"","tags-btn ","tags-btn__add\" data-add> $"," </span>\n        <span class=\"","tags-btn ","tags-btn__sync\" style=\"display: none\" data-sync-style> $"," </span>\n      </div>\n      <div class=\"","sels-info\">\n        <div class=\"","label-sel\">",":</div>\n        <div class=\"","sels\" data-selected></div>\n      </div>"])),o,o,o,o,n,o,o,o,a,a,a,o,a,a,o,a,o,o,o,o,o,i,o,o,r,o,o,e,o)},e.prototype.events=function(){return{'change [data-states]':'stateChanged','click [data-add]':'startNewTag','focusout [data-input]':'endNewTag','keyup [data-input]':'onInputKeyUp','click [data-sync-style]':'syncStyle'}},e.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),r=e.get('CssComposer'),i=this.getCommonSelectors({opts:{noDisabled:1}}),o=e.get('state'),a=e.getCurrentMedia(),s=[],l=r.get(i,o,a)||r.add(i,o,a);this.getTargets().forEach((function(e){var n=r.getIdRule(e.getId(),{state:o,mediaText:a});t=n.getStyle(),n.setStyle({}),s.push(n)})),t&&l.addStyle(t),e.trigger('component:toggled'),e.trigger('component:sync-style',{component:n,selectors:i,mediaText:a,rule:l,ruleComponents:s,state:o})},e.prototype.tagRemoved=function(t){this.updateStateVis()},e.prototype.addNew=function(t){this.addToClasses(t)},e.prototype.startNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:'none'}),null===(e=this.$input)||void 0===e||e.show().focus()},e.prototype.endNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:''}),null===(e=this.$input)||void 0===e||e.hide().val('')},e.prototype.onInputKeyUp=function(t){var e;13===t.keyCode?(t.preventDefault(),this.addNewTag(null===(e=this.$input)||void 0===e?void 0:e.val())):27===t.keyCode&&this.endNewTag()},e.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},e.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},e.prototype.updateSelection=function(t){var e=t||this.getTargets(),n=[];return(e=(0,r.isArray)(e)?e:[e])&&e.length&&(n=this.getCommonSelectors({targets:e}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(e),this.module.__trgCustom(),n},e.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,r=e.opts,i=void 0===r?{}:r,o=n||this.getTargets();return this.module.__getCommonSelectors(o,i)},e.prototype._commonSelectors=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.module).__common.apply(t,e)},e.prototype.checkSync=function(){var t,e=this,n=e.$btnSyncEl,i=e.config,o=e.collection,a=this.getTarget();if(a&&i.componentFirst&&o.length){var s=a.getStyle();t=!(0,r.isEmpty)(s)}n&&n[t?'show':'hide']()},e.prototype.getTarget=function(){return this.target.getSelected()},e.prototype.getTargets=function(){return this.target.getSelectedAll()},e.prototype.updateStateVis=function(t){var e=this.em,n=e&&e.getConfig().avoidInlineStyle,r=this.collection.length||n?'':'none';this.getStatesC().css('display',r),this.updateSelector(t)},e.prototype.__handleStateChange=function(){this.updateSelector(this.getTargets())},e.prototype.updateSelector=function(t){var e=this,n=this.el.querySelector('[data-selected]'),i=[],o=t||this.getTargets();(o=(0,r.isArray)(o)?o:[o]).forEach((function(t){return i.push(e.__getName(t))})),n&&(n.innerHTML=i.join(', ')),this.checkStates()},e.prototype.__getName=function(t){var e,n=this,i=n.pfx,o=n.config,a=n.em,s=o.selectedName,l=o.componentFirst;if((0,r.isString)(t))e=(0,d.Z)(C||(C=k(["<span class=\"","sel-gen\">","</span>"],["<span class=\"","sel-gen\">","</span>"])),i,t);else{var c=null==t?void 0:t.getSelectors();if(!c)return'';var u=c.getStyleable(),f=a.get('state'),h=t.getId?(0,d.Z)(S||(S=k(["<span class=\"","sel-cmp\">","</span>\n            <span class=\"","sel-id\">#","</span>"],["<span class=\"","sel-cmp\">","</span>\n            <span class=\"","sel-id\">#","</span>"])),i,t.getName(),i,t.getId()):'';e=(e=this.collection.getFullString(u))?(0,d.Z)(_||(_=k(["<span class=\"","sel-rule\">","</span>"],["<span class=\"","sel-rule\">","</span>"])),i,e):t.get('selectorsAdd')||h,e=l&&h?h:e,e+=f?(0,d.Z)(P||(P=k(["<span class=\"","sel-state\">:","</span>"],["<span class=\"","sel-state\">:","</span>"])),i,f):'',e=s?s({result:e,state:f,target:t}):e}return e&&"<span class=\"".concat(i,"sel\">").concat(e,"</span>")},e.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set('state',n)},e.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},e.prototype.addToClasses=function(t,e){var n=e,r=this.getClasses(),i=new y({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(i):r.append(i),i},e.prototype.renderClasses=function(){var t=this,e=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each((function(n){return t.addToClasses(n,e)})),n.append(e)},e.prototype.getClasses=function(){return this.$el.find('[data-selectors]')},e.prototype.getStates=function(){if(!this.$states){var t=this.$el.find('[data-states]');this.$states=t[0]&&t}return this.$states},e.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find('#'+this.stateInputC)),this.$statesC},e.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t('selectorManager.emptyState'),r=t.getStates().map((function(t){var n=e.t("selectorManager.states.".concat(t.id))||t.getLabel()||t.id;return"<option value=\"".concat(t.id,"\">").concat(n,"</option>")})).join(''),i=this.getStates();i&&i.html("<option value=\"\">".concat(n,"</option>").concat(r)),this.checkStates()},e.prototype.render=function(){var t=this,e=t.em,n=t.pfx,r=t.ppfx,i=t.config,o=t.$el,a=t.el,s=i.render,l={iconSync:i.iconSync,iconAdd:i.iconAdd,labelHead:e.t('selectorManager.label'),labelInfo:e.t('selectorManager.selected'),ppfx:r,pfx:n,el:a};o.html(this.template(l));var c=s&&s(l);return c&&c!==a&&o.empty().append(c),this.$input=o.find('[data-input]'),this.$addBtn=o.find('[data-add]'),this.$classes=o.find('#'+n+'tags-c'),this.$btnSyncEl=o.find('[data-sync-style]'),this.$input.hide(),this.renderStates(),this.renderClasses(),o.attr('class',"".concat(this.className," ").concat(r,"one-bg ").concat(r,"two-color")),this},e}(a.View);var O,C,S,_,P,T=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=void 0&&(void 0).__assign||function(){return E=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},E.apply(this,arguments)},j=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},A=function(t){return(0,r.isString)(t)&&'#'==t[0]},R=function(t){return(0,r.isString)(t)&&'.'==t[0]},D='selector',M="".concat(D,":"),Z="".concat(M,"add"),L="".concat(M,"update"),N="".concat(M,"remove"),I="".concat(N,":before"),F="".concat(M,"custom"),V="".concat(M,"state");const B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name='SelectorManager',e.Selector=c.Z,e.Selectors=u.Z,e.events={all:D,update:L,add:Z,remove:N,removeBefore:I,state:V,custom:F},e.__update=(0,r.debounce)((function(){e.__trgCustom()}),0),e}return T(e,t),e.prototype.init=function(t){var e=this;void 0===t&&(t={}),this.__initConfig(s,t);var n=this.getConfig(),r=this.em,i=n.pStylePrefix;i&&(n.stylePrefix=i+n.stylePrefix),this.all=new u.Z(n.selectors),this.selected=new u.Z([],{em:r,config:n}),this.states=new a.Collection(n.states.map((function(t){return new p(t)})),{model:p}),this.model=new a.Model({cFirst:n.componentFirst,_undo:!0}),this.__initListen({collections:[this.states,this.selected],propagate:[{entity:this.states,event:this.events.state}]}),r.on('change:state',(function(t,e){return r.trigger(V,e)})),this.model.on('change:cFirst',(function(t,e){return r.trigger('selector:type',e)}));return this.model.listenTo(r,'component:toggled component:update:classes change:device styleManager:update selector:state selector:type',(function(){return e.__update()})),this},e.prototype.__trgCustom=function(t){this.em.trigger(this.events.custom,this.__customData(t))},e.prototype.__customData=function(t){void 0===t&&(t={});var e=t.container;return{states:this.getStates(),selected:this.getSelected(),container:e}},e.prototype.postRender=function(){this.__appendTo(),this.__trgCustom()},e.prototype.select=function(t,e){void 0===e&&(e={});var n=Array.isArray(t)?t:[t],r=this.em.get('StyleManager').select(n,e),o=this.selectorTags,a=r.filter((function(t){return t})).map((function(t){return(0,i.isComponent)(t)||(0,i.isRule)(t)&&!t.get('selectorsAdd')?t:t.getSelectorsString()}));return o&&o.componentChanged({targets:a}),this},e.prototype.addSelector=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var i=E({},e);(0,r.isObject)(t)?i=t:i.name=t,A(i.name)?(i.name=i.name.substr(1),i.type=c.Z.TYPE_ID):R(i.name)&&(i.name=i.name.substr(1)),i.label&&!i.name&&(i.name=this.escapeName(i.label));var o=i.name,a=this.getConfig(),s=this.getAll(),l=this.em,u=o?this.get(o,i.type):s.where(i)[0];if(!u){var f=i instanceof c.Z?i:new c.Z(i,E(E({},n),{config:a,em:l}));return s.add(f,n)}return u},e.prototype.getSelector=function(t,e){return void 0===e&&(e=c.Z.TYPE_CLASS),A(t)?(t=t.substr(1),e=c.Z.TYPE_ID):R(t)&&(t=t.substr(1)),this.getAll().where({name:t,type:e})[0]},e.prototype.add=function(t,e){var n=this;void 0===e&&(e={});var i=(0,r.isString)(t)?{}:e;return(0,r.isArray)(t)?t.map((function(t){return n.addSelector(t,e,i)})):this.addSelector(t,e,i)},e.prototype.addClass=function(t){var e=this,n=[];return(0,r.isString)(t)&&(t=t.trim().split(' ')),t.forEach((function(t){return n.push(e.addSelector(t))})),n},e.prototype.get=function(t,e){var n=this;if((0,r.isArray)(t)){var i=[];return t.map((function(t){return n.getSelector(t)})).filter((function(t){return t})).forEach((function(t){return i.indexOf(t)<0&&i.push(t)})),i}return this.getSelector(t,e)||null},e.prototype.remove=function(t,e){return this.__remove(t,e)},e.prototype.setState=function(t){return this.em.setState(t),this},e.prototype.getState=function(){return this.em.getState()},e.prototype.getStates=function(){return j([],this.states.models,!0)},e.prototype.setStates=function(t,e){return this.states.reset(t.map((function(t){return new p(t)})),e)},e.prototype.getSelected=function(){return this.__getCommon()},e.prototype.addSelected=function(t){var e=this.add(t);this.em.getSelectedAll().forEach((function(t){t.getSelectors().add(e)}))},e.prototype.removeSelected=function(t){this.em.getSelectedAll().forEach((function(e){!t.get('protected')&&e&&e.getSelectors().remove(t)}))},e.prototype.getSelectedTargets=function(){return this.em.get('StyleManager').getSelectedAll()},e.prototype.setComponentFirst=function(t){this.getConfig().componentFirst=t,this.model.set({cFirst:t})},e.prototype.getComponentFirst=function(){return this.getConfig().componentFirst},e.prototype.escapeName=function(t){var e=this.getConfig().escapeName;return e?e(t):c.Z.escapeName(t)},e.prototype.render=function(t){this.em;var e=this.selectorTags,n=this.getConfig(),r=e&&e.el;return this.selected.reset(t),this.selectorTags=new x({el:r,collection:this.selected,module:this,config:n}),this.selectorTags.render().el},e.prototype.destroy=function(){var t=this.selectorTags;this.model.stopListening(),this.__update.cancel(),this.__destroy(),null==t||t.remove(),this.selectorTags=void 0},e.prototype.__getCommon=function(){return this.__getCommonSelectors(this.em.getSelectedAll())},e.prototype.__getCommonSelectors=function(t,e){void 0===e&&(e={});var n=t.map((function(t){return t.getSelectors&&t.getSelectors().getValid(e)})).filter(Boolean);return this.__common.apply(this,n)},e.prototype.__common=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.length?1===e.length?e[0]:2===e.length?e[0].filter((function(t){return e[1].indexOf(t)>=0})):e.slice(1).reduce((function(e,n){return t.__common(e,n)}),e[0]):[]},e}(o.Z)},5963:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r,i=n(9050),o=n(2316),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=1,l=2,c=function(t){function e(n,r){void 0===r&&(r={});var i=t.call(this,n,r)||this,o=r.config,a=void 0===o?{}:o,s=i.get('name'),l=i.get('label');s?l||i.set('label',s):i.set('name',l);var c=i.get('name'),u=a.escapeName,f=u?u(c):e.escapeName(c);return i.set('name',f),i.em=r.em,i}return a(e,t),e.prototype.defaults=function(){return{name:'',label:'',type:s,active:!0,private:!1,protected:!1,_undo:!0}},e.prototype.isId=function(){return this.get('type')===l},e.prototype.isClass=function(){return this.get('type')===s},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.escape,n=this.get('name'),r='';switch(this.get('type')){case s:r='.';break;case l:r='#'}return r+(e?e(n):n)},e.prototype.toString=function(){return this.getFullName()},e.prototype.getLabel=function(){return this.get('label')},e.prototype.setLabel=function(t){return this.set('label',t)},e.prototype.getActive=function(){return this.get('active')},e.prototype.setActive=function(t){return this.set('active',t)},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=this.em,n=o.Model.prototype.toJSON.call(this,[t]),r=(0,i.result)(this,'defaults');if(e&&e.getConfig().avoidDefaults){(0,i.forEach)(r,(function(t,e){n[e]===t&&delete n[e]})),n.label===n.name&&delete n.label;var a=(0,i.keys)(n).length;1===a&&n.name&&(n=n.name),2===a&&n.name&&n.type&&(n=this.getFullName())}return n},e.escapeName=function(t){return"".concat(t).trim().replace(/([^a-z0-9\w-\:]+)/gi,'-')},e.TYPE_CLASS=s,e.TYPE_ID=l,e}(o.Model);const u=c;c.prototype.idAttribute='name'},966:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r,i=n(9050),o=n(2316),a=n(5963),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t,e){return t.reduce((function(n,r,i){return n.concat(l(t.slice(i+1),"".concat(e).concat(r)))}),[e])},c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.modelId=function(t){return"".concat(t.name,"_").concat(t.type||a.Z.TYPE_CLASS)},e.prototype.getStyleable=function(){return(0,i.filter)(this.models,(function(t){return t.get('active')&&!t.get('private')}))},e.prototype.getValid=function(t){var e=(void 0===t?{}:t).noDisabled;return(0,i.filter)(this.models,(function(t){return!t.get('private')})).filter((function(t){return e?t.get('active'):1}))},e.prototype.getFullString=function(t,e){void 0===e&&(e={});var n=[];return(t||this).forEach((function(t){return n.push(t.getFullName(e))})),e.sort&&n.sort(),n.join('').trim()},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.combination,n=t.array,r=[],i=this.map((function(e){return e.getFullName(t)})).sort();return e?i.forEach((function(t,e){r=r.concat(l(i.slice(e+1),t))})):r=i,n?r:e?r.join(','):r.join('')},e}(o.Collection);const u=c;c.prototype.model=a.Z},7539:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(1163);function i(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=t.raw;return i.reduce((function(t,n,o){var a=e[o-1],s=i[o-1];return Array.isArray(a)?a=a.join(''):s&&'$'===s.slice(-1)?t=t.slice(0,-1):a=(0,r.escape)(a),t+a+n}))}},1163:(t,e,n)=>{"use strict";n.r(e),n.d(e,{appendStyles:()=>p,buildBase64UrlFromSvg:()=>U,camelCase:()=>b,capitalize:()=>I,createId:()=>z,deepMerge:()=>T,escape:()=>P,find:()=>_,getElRect:()=>j,getElement:()=>x,getGlobal:()=>l,getKeyChar:()=>D,getKeyCode:()=>R,getModel:()=>E,getPointerEvent:()=>A,getUiClass:()=>h,getUnitFromValue:()=>m,getViewEl:()=>B,hasDnd:()=>k,hasWin:()=>s,isCommentNode:()=>C,isComponent:()=>F,isDef:()=>a,isEmptyObj:()=>N,isEnterKey:()=>Z,isEscKey:()=>M,isObject:()=>L,isRule:()=>V,isTaggableNode:()=>S,isTextNode:()=>O,matches:()=>f,normalizeFloat:()=>w,off:()=>v,on:()=>g,setViewEl:()=>H,shallowDiff:()=>d,toLowerCase:()=>c,upFirst:()=>y});var r=n(9050),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)},o=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},a=function(t){return void 0!==t},s=function(){return'undefined'!=typeof window},l=function(){return'undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:n.g},c=function(t){return(t||'').toLowerCase()},u=s()?window.Element.prototype:{},f=u.matches||u.webkitMatchesSelector||u.mozMatchesSelector||u.msMatchesSelector,h=function(t,e){var n=t.getConfig(),r=n.stylePrefix;return[n.customUI&&"".concat(r,"cui"),e].filter((function(t){return t})).join(' ')},p=function(t,e){void 0===e&&(e={});var n=(0,r.isArray)(t)?o([],t,!0):[t];if(n.length){var i=n.shift();if(i&&(!e.unique||!document.querySelector("link[href=\"".concat(i,"\"]")))){var a=document.head,s=document.createElement('link');s.href=i,s.rel='stylesheet',e.prepand?a.insertBefore(s,a.firstChild):a.appendChild(s)}p(n)}},d=function(t,e){var n={},i=(0,r.keys)(e);for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],s=e[o];i.indexOf(o)>=0?a!==s&&(n[o]=s):n[o]=null}for(var o in e)e.hasOwnProperty(o)&&(0,r.isUndefined)(t[o])&&(n[o]=e[o]);return n},g=function(t,e,n,r){var i=e.split(/\s+/);t=t instanceof Array?t:[t];for(var o=function(e){t.forEach((function(t){return t&&t.addEventListener(i[e],n,r)}))},a=0;a<i.length;++a)o(a)},v=function(t,e,n,r){var i=e.split(/\s+/);t=t instanceof Array?t:[t];for(var o=function(e){t.forEach((function(t){return t&&t.removeEventListener(i[e],n,r)}))},a=0;a<i.length;++a)o(a)},m=function(t){return t.replace(parseFloat(t),'')},y=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},b=function(t){return t.replace(/-./g,(function(t){return t[1].toUpperCase()}))},w=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=0);var r=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var i=e.toString().split('.')[1];r=i?i.length:0}return r?parseFloat(t.toFixed(r)):t},k=function(t){return'draggable'in document.createElement('i')&&(t?t.get('Config').nativeDnD:1)},x=function(t){return(0,r.isElement)(t)||O(t)?t:t&&t.getEl?t.getEl():void 0},O=function(t){return t&&3===t.nodeType},C=function(t){return t&&8===t.nodeType},S=function(t){return t&&!O(t)&&!C(t)},_=function(t,e){var n=null;return t.some((function(r,i){return e(r,i,t)?(n=r,1):0})),n},P=function(t){return void 0===t&&(t=''),"".concat(t).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#039;').replace(/`/g,'&#96;')},T=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=i({},t[0]),r=1;r<t.length;r++){var o=i({},t[r]);for(var a in o){var s=n[a],l=o[a];L(s)&&L(l)?n[a]=T(s,l):n[a]=l}}return n},E=function(t,e){var n=t;return!e&&t&&t.__cashData?n=t.__cashData.model:(0,r.isElement)(t)&&(n=e(t).data('model')),n},j=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(O(t)){var r=document.createRange();r.selectNode(t),e=r.getBoundingClientRect(),r.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},A=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},R=function(t){return t.which||t.keyCode},D=function(t){return String.fromCharCode(R(t))},M=function(t){return 27===R(t)},Z=function(t){return 13===R(t)},L=function(t){return null!==t&&!Array.isArray(t)&&'object'==typeof t},N=function(t){return Object.keys(t).length<=0},I=function(t){return t&&t.charAt(0).toUpperCase()+t.substring(1)},F=function(t){return t&&t.toHTML},V=function(t){return t&&t.toCSS},B=function(t){return t.__gjsv},H=function(t,e){t.__gjsv=e},z=function(t){void 0===t&&(t=16);for(var e='',n='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',r=n.length,i=0;i<t;i++)e+=n.charAt(Math.floor(Math.random()*r));return e},U=function(t){if(t&&'<svg'===t.substr(0,4)){var e='';return s()?e=window.btoa(t):'undefined'!=typeof Buffer&&(e=Buffer.from(t,'utf8').toString('base64')),e?"data:image/svg+xml;base64,".concat(e):t}return t}},2828:(t,e,n)=>{var r={"./CanvasClear":7202,"./CanvasClear.js":7202,"./CanvasMove":327,"./CanvasMove.js":327,"./CommandAbstract":238,"./CommandAbstract.js":238,"./ComponentDelete":5820,"./ComponentDelete.js":5820,"./ComponentDrag":6694,"./ComponentDrag.js":6694,"./ComponentEnter":1947,"./ComponentEnter.js":1947,"./ComponentExit":3888,"./ComponentExit.js":3888,"./ComponentNext":5883,"./ComponentNext.js":5883,"./ComponentPrev":7508,"./ComponentPrev.js":7508,"./ComponentStyleClear":8769,"./ComponentStyleClear.js":8769,"./CopyComponent":2213,"./CopyComponent.js":2213,"./DeleteComponent":5049,"./DeleteComponent.js":5049,"./ExportTemplate":3775,"./ExportTemplate.js":3775,"./Fullscreen":58,"./Fullscreen.js":58,"./MoveComponent":8658,"./MoveComponent.js":8658,"./OpenAssets":9617,"./OpenAssets.js":9617,"./OpenBlocks":5821,"./OpenBlocks.js":5821,"./OpenLayers":3452,"./OpenLayers.js":3452,"./OpenStyleManager":2840,"./OpenStyleManager.js":2840,"./OpenTraitManager":8644,"./OpenTraitManager.js":8644,"./PasteComponent":560,"./PasteComponent.js":560,"./Preview":4944,"./Preview.js":4944,"./Resize":7538,"./Resize.js":7538,"./SelectComponent":2620,"./SelectComponent.js":2620,"./SelectPosition":8463,"./SelectPosition.js":8463,"./ShowOffset":7994,"./ShowOffset.js":7994,"./SwitchVisibility":8352,"./SwitchVisibility.js":8352};function i(t){var e=o(t);return n(e)}function o(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code='MODULE_NOT_FOUND',e}return r[t]}i.keys=function(){return Object.keys(r)},i.resolve=o,t.exports=i,i.id=2828},7061:(t,e,n)=>{var r=n(8698)["default"];function i(){"use strict";t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports["default"]=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof d?e:d,o=Object.create(i.prototype),a=new _(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=h(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p={};function d(){}function g(){}function v(){}var m={};u(m,s,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(P([])));b&&b!==n&&o.call(b,s)&&(m=b);var w=v.prototype=d.prototype=Object.create(m);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(i,a,s,l){var c=h(t[i],t,a);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==r(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(f).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function O(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=h(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function P(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:T}}function T(){return{value:void 0,done:!0}}return g.prototype=v,u(w,"constructor",v),u(v,"constructor",g),g.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},k(x.prototype),u(x.prototype,l,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(f(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(w),u(w,c,"Generator"),u(w,s,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=P,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=i,t.exports.__esModule=!0,t.exports["default"]=t.exports},8698:t=>{function e(n){return t.exports=e="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},t.exports.__esModule=!0,t.exports["default"]=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports["default"]=t.exports},4687:(t,e,n)=>{var r=n(7061)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},907:(t,e,n)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,{Z:()=>r})},7326:(t,e,n)=>{"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,{Z:()=>r})},5861:(t,e,n)=>{"use strict";function r(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function s(t){r(a,i,o,s,l,"next",t)}function l(t){r(a,i,o,s,l,"throw",t)}s(void 0)}))}}n.d(e,{Z:()=>i})},5671:(t,e,n)=>{"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{Z:()=>r})},3144:(t,e,n)=>{"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}n.d(e,{Z:()=>i})},4942:(t,e,n)=>{"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{Z:()=>r})},1752:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(1120);function i(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=(0,r.Z)(t)););return t}function o(){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=i(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},o.apply(this,arguments)}},1120:(t,e,n)=>{"use strict";function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}n.d(e,{Z:()=>r})},9340:(t,e,n)=>{"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}n.d(e,{Z:()=>i})},4925:(t,e,n)=>{"use strict";function r(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}n.d(e,{Z:()=>r})},2963:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(1002),i=n(7326);function o(t,e){if(e&&("object"===(0,r.Z)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(t)}},885:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(181);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw i}}return o}}(t,e)||(0,r.Z)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},168:(t,e,n)=>{"use strict";function r(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}n.d(e,{Z:()=>r})},2982:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(907);var i=n(181);function o(t){return function(t){if(Array.isArray(t))return(0,r.Z)(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,i.Z)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},1002:(t,e,n)=>{"use strict";function r(t){return r="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(t)}n.d(e,{Z:()=>r})},181:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(907);function i(t,e){if(t){if("string"==typeof t)return(0,r.Z)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.Z)(t,e):void 0}}},9050:(t,e,n)=>{"use strict";n.r(e),n.d(e,{VERSION:()=>i,after:()=>Ze,all:()=>en,allKeys:()=>vt,any:()=>nn,assign:()=>Zt,before:()=>Le,bind:()=>Oe,bindAll:()=>_e,chain:()=>be,chunk:()=>Fn,clone:()=>Ft,collect:()=>Ke,compact:()=>Tn,compose:()=>Me,constant:()=>J,contains:()=>rn,countBy:()=>yn,create:()=>It,debounce:()=>Ae,default:()=>Un,defaults:()=>Lt,defer:()=>Ee,delay:()=>Te,detect:()=>$e,difference:()=>jn,drop:()=>_n,each:()=>Ge,escape:()=>se,every:()=>en,extend:()=>Mt,extendOwn:()=>Zt,filter:()=>Qe,find:()=>$e,findIndex:()=>Ve,findKey:()=>Ie,findLastIndex:()=>Be,findWhere:()=>qe,first:()=>Sn,flatten:()=>En,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ge,functions:()=>Rt,get:()=>Ut,groupBy:()=>vn,has:()=>Wt,head:()=>Sn,identity:()=>$t,include:()=>rn,includes:()=>rn,indexBy:()=>mn,indexOf:()=>Ue,initial:()=>Cn,inject:()=>Xe,intersection:()=>Mn,invert:()=>At,invoke:()=>on,isArguments:()=>K,isArray:()=>$,isArrayBuffer:()=>N,isBoolean:()=>T,isDataView:()=>W,isDate:()=>D,isElement:()=>E,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>Z,isFinite:()=>Y,isFunction:()=>V,isMap:()=>St,isMatch:()=>ct,isNaN:()=>X,isNull:()=>_,isNumber:()=>R,isObject:()=>S,isRegExp:()=>M,isSet:()=>Pt,isString:()=>A,isSymbol:()=>L,isTypedArray:()=>it,isUndefined:()=>P,isWeakMap:()=>_t,isWeakSet:()=>Tt,iteratee:()=>Xt,keys:()=>st,last:()=>Pn,lastIndexOf:()=>We,map:()=>Ke,mapObject:()=>Qt,matcher:()=>qt,matches:()=>qt,max:()=>ln,memoize:()=>Pe,methods:()=>Rt,min:()=>cn,mixin:()=>Bn,negate:()=>De,noop:()=>te,now:()=>ie,object:()=>Nn,omit:()=>On,once:()=>Ne,pairs:()=>jt,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>an,property:()=>Gt,propertyOf:()=>ee,random:()=>re,range:()=>In,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>tn,rest:()=>_n,restArguments:()=>C,result:()=>ve,sample:()=>hn,select:()=>Qe,shuffle:()=>pn,size:()=>wn,some:()=>nn,sortBy:()=>dn,sortedIndex:()=>He,tail:()=>_n,take:()=>Sn,tap:()=>Vt,template:()=>ge,templateSettings:()=>ce,throttle:()=>je,times:()=>ne,toArray:()=>fn,toPath:()=>Bt,transpose:()=>Zn,unescape:()=>le,union:()=>Dn,uniq:()=>Rn,unique:()=>Rn,uniqueId:()=>ye,unzip:()=>Zn,values:()=>Et,where:()=>sn,without:()=>An,wrap:()=>Re,zip:()=>Ln});var r={};n.r(r),n.d(r,{VERSION:()=>i,after:()=>Ze,all:()=>en,allKeys:()=>vt,any:()=>nn,assign:()=>Zt,before:()=>Le,bind:()=>Oe,bindAll:()=>_e,chain:()=>be,chunk:()=>Fn,clone:()=>Ft,collect:()=>Ke,compact:()=>Tn,compose:()=>Me,constant:()=>J,contains:()=>rn,countBy:()=>yn,create:()=>It,debounce:()=>Ae,default:()=>Hn,defaults:()=>Lt,defer:()=>Ee,delay:()=>Te,detect:()=>$e,difference:()=>jn,drop:()=>_n,each:()=>Ge,escape:()=>se,every:()=>en,extend:()=>Mt,extendOwn:()=>Zt,filter:()=>Qe,find:()=>$e,findIndex:()=>Ve,findKey:()=>Ie,findLastIndex:()=>Be,findWhere:()=>qe,first:()=>Sn,flatten:()=>En,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ge,functions:()=>Rt,get:()=>Ut,groupBy:()=>vn,has:()=>Wt,head:()=>Sn,identity:()=>$t,include:()=>rn,includes:()=>rn,indexBy:()=>mn,indexOf:()=>Ue,initial:()=>Cn,inject:()=>Xe,intersection:()=>Mn,invert:()=>At,invoke:()=>on,isArguments:()=>K,isArray:()=>$,isArrayBuffer:()=>N,isBoolean:()=>T,isDataView:()=>W,isDate:()=>D,isElement:()=>E,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>Z,isFinite:()=>Y,isFunction:()=>V,isMap:()=>St,isMatch:()=>ct,isNaN:()=>X,isNull:()=>_,isNumber:()=>R,isObject:()=>S,isRegExp:()=>M,isSet:()=>Pt,isString:()=>A,isSymbol:()=>L,isTypedArray:()=>it,isUndefined:()=>P,isWeakMap:()=>_t,isWeakSet:()=>Tt,iteratee:()=>Xt,keys:()=>st,last:()=>Pn,lastIndexOf:()=>We,map:()=>Ke,mapObject:()=>Qt,matcher:()=>qt,matches:()=>qt,max:()=>ln,memoize:()=>Pe,methods:()=>Rt,min:()=>cn,mixin:()=>Bn,negate:()=>De,noop:()=>te,now:()=>ie,object:()=>Nn,omit:()=>On,once:()=>Ne,pairs:()=>jt,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>an,property:()=>Gt,propertyOf:()=>ee,random:()=>re,range:()=>In,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>tn,rest:()=>_n,restArguments:()=>C,result:()=>ve,sample:()=>hn,select:()=>Qe,shuffle:()=>pn,size:()=>wn,some:()=>nn,sortBy:()=>dn,sortedIndex:()=>He,tail:()=>_n,take:()=>Sn,tap:()=>Vt,template:()=>ge,templateSettings:()=>ce,throttle:()=>je,times:()=>ne,toArray:()=>fn,toPath:()=>Bt,transpose:()=>Zn,unescape:()=>le,union:()=>Dn,uniq:()=>Rn,unique:()=>Rn,uniqueId:()=>ye,unzip:()=>Zn,values:()=>Et,where:()=>sn,without:()=>An,wrap:()=>Re,zip:()=>Ln});var i='1.13.4',o='object'==typeof self&&self.self===self&&self||'object'==typeof global&&global.global===global&&global||Function('return this')()||{},a=Array.prototype,s=Object.prototype,l='undefined'!=typeof Symbol?Symbol.prototype:null,c=a.push,u=a.slice,f=s.toString,h=s.hasOwnProperty,p='undefined'!=typeof ArrayBuffer,d='undefined'!=typeof DataView,g=Array.isArray,v=Object.keys,m=Object.create,y=p&&ArrayBuffer.isView,b=isNaN,w=isFinite,k=!{toString:null}.propertyIsEnumerable('toString'),x=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'],O=Math.pow(2,53)-1;function C(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}}function S(t){var e=typeof t;return'function'===e||'object'===e&&!!t}function _(t){return null===t}function P(t){return void 0===t}function T(t){return!0===t||!1===t||'[object Boolean]'===f.call(t)}function E(t){return!(!t||1!==t.nodeType)}function j(t){var e='[object '+t+']';return function(t){return f.call(t)===e}}const A=j('String'),R=j('Number'),D=j('Date'),M=j('RegExp'),Z=j('Error'),L=j('Symbol'),N=j('ArrayBuffer');var I=j('Function'),F=o.document&&o.document.childNodes;1&&'object'!=typeof Int8Array&&'function'!=typeof F&&(I=function(t){return'function'==typeof t||!1});const V=I,B=j('Object');var H=d&&B(new DataView(new ArrayBuffer(8))),z='undefined'!=typeof Map&&B(new Map),U=j('DataView');const W=H?function(t){return null!=t&&V(t.getInt8)&&N(t.buffer)}:U,$=g||j('Array');function q(t,e){return null!=t&&h.call(t,e)}var G=j('Arguments');!function(){G(arguments)||(G=function(t){return q(t,'callee')})}();const K=G;function Y(t){return!L(t)&&w(t)&&!isNaN(parseFloat(t))}function X(t){return R(t)&&b(t)}function J(t){return function(){return t}}function Q(t){return function(e){var n=t(e);return'number'==typeof n&&n>=0&&n<=O}}function tt(t){return function(e){return null==e?void 0:e[t]}}const et=tt('byteLength'),nt=Q(et);var rt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const it=p?function(t){return y?y(t)&&!W(t):nt(t)&&rt.test(f.call(t))}:J(!1),ot=tt('length');function at(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return!0===e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=x.length,r=t.constructor,i=V(r)&&r.prototype||s,o='constructor';for(q(t,o)&&!e.contains(o)&&e.push(o);n--;)(o=x[n])in t&&t[o]!==i[o]&&!e.contains(o)&&e.push(o)}function st(t){if(!S(t))return[];if(v)return v(t);var e=[];for(var n in t)q(t,n)&&e.push(n);return k&&at(t,e),e}function lt(t){if(null==t)return!0;var e=ot(t);return'number'==typeof e&&($(t)||A(t)||K(t))?0===e:0===ot(st(t))}function ct(t,e){var n=st(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0}function ut(t){return t instanceof ut?t:this instanceof ut?void(this._wrapped=t):new ut(t)}function ft(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,et(t))}ut.VERSION=i,ut.prototype.value=function(){return this._wrapped},ut.prototype.valueOf=ut.prototype.toJSON=ut.prototype.value,ut.prototype.toString=function(){return String(this._wrapped)};var ht='[object DataView]';function pt(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return('function'===i||'object'===i||'object'==typeof e)&&dt(t,e,n,r)}function dt(t,e,n,r){t instanceof ut&&(t=t._wrapped),e instanceof ut&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;if(H&&'[object Object]'==i&&W(t)){if(!W(e))return!1;i=ht}switch(i){case'[object RegExp]':case'[object String]':return''+t==''+e;case'[object Number]':return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case'[object Date]':case'[object Boolean]':return+t==+e;case'[object Symbol]':return l.valueOf.call(t)===l.valueOf.call(e);case'[object ArrayBuffer]':case ht:return dt(ft(t),ft(e),n,r)}var o='[object Array]'===i;if(!o&&it(t)){if(et(t)!==et(e))return!1;if(t.buffer===e.buffer&&t.byteOffset===e.byteOffset)return!0;o=!0}if(!o){if('object'!=typeof t||'object'!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(V(a)&&a instanceof a&&V(s)&&s instanceof s)&&'constructor'in t&&'constructor'in e)return!1}r=r||[];for(var c=(n=n||[]).length;c--;)if(n[c]===t)return r[c]===e;if(n.push(t),r.push(e),o){if((c=t.length)!==e.length)return!1;for(;c--;)if(!pt(t[c],e[c],n,r))return!1}else{var u,h=st(t);if(c=h.length,st(e).length!==c)return!1;for(;c--;)if(!q(e,u=h[c])||!pt(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0}function gt(t,e){return pt(t,e)}function vt(t){if(!S(t))return[];var e=[];for(var n in t)e.push(n);return k&&at(t,e),e}function mt(t){var e=ot(t);return function(n){if(null==n)return!1;var r=vt(n);if(ot(r))return!1;for(var i=0;i<e;i++)if(!V(n[t[i]]))return!1;return t!==Ot||!V(n[yt])}}var yt='forEach',bt='has',wt=['clear','delete'],kt=['get',bt,'set'],xt=wt.concat(yt,kt),Ot=wt.concat(kt),Ct=['add'].concat(wt,yt,bt);const St=z?mt(xt):j('Map'),_t=z?mt(Ot):j('WeakMap'),Pt=z?mt(Ct):j('Set'),Tt=j('WeakSet');function Et(t){for(var e=st(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r}function jt(t){for(var e=st(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r}function At(t){for(var e={},n=st(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e}function Rt(t){var e=[];for(var n in t)V(t[n])&&e.push(n);return e.sort()}function Dt(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,l=0;l<s;l++){var c=a[l];e&&void 0!==n[c]||(n[c]=o[c])}return n}}const Mt=Dt(vt),Zt=Dt(st),Lt=Dt(vt,!0);function Nt(t){if(!S(t))return{};if(m)return m(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function It(t,e){var n=Nt(t);return e&&Zt(n,e),n}function Ft(t){return S(t)?$(t)?t.slice():Mt({},t):t}function Vt(t,e){return e(t),t}function Bt(t){return $(t)?t:[t]}function Ht(t){return ut.toPath(t)}function zt(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function Ut(t,e,n){var r=zt(t,Ht(e));return P(r)?n:r}function Wt(t,e){for(var n=(e=Ht(e)).length,r=0;r<n;r++){var i=e[r];if(!q(t,i))return!1;t=t[i]}return!!n}function $t(t){return t}function qt(t){return t=Zt({},t),function(e){return ct(e,t)}}function Gt(t){return t=Ht(t),function(e){return zt(e,t)}}function Kt(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,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}}function Yt(t,e,n){return null==t?$t:V(t)?Kt(t,e,n):S(t)&&!$(t)?qt(t):Gt(t)}function Xt(t,e){return Yt(t,e,1/0)}function Jt(t,e,n){return ut.iteratee!==Xt?ut.iteratee(t,e):Yt(t,e,n)}function Qt(t,e,n){e=Jt(e,n);for(var r=st(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o}function te(){}function ee(t){return null==t?te:function(e){return Ut(t,e)}}function ne(t,e,n){var r=Array(Math.max(0,t));e=Kt(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r}function re(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}ut.toPath=Bt,ut.iteratee=Xt;const ie=Date.now||function(){return(new Date).getTime()};function oe(t){var e=function(e){return t[e]},n='(?:'+st(t).join('|')+')',r=RegExp(n),i=RegExp(n,'g');return function(t){return t=null==t?'':''+t,r.test(t)?t.replace(i,e):t}}const ae={'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#x27;','`':'&#x60;'},se=oe(ae),le=oe(At(ae)),ce=ut.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ue=/(.)^/,fe={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'},he=/\\|'|\r|\n|\u2028|\u2029/g;function pe(t){return'\\'+fe[t]}var de=/^\s*(\w|\$)+\s*$/;function ge(t,e,n){!e&&n&&(e=n),e=Lt({},e,ut.templateSettings);var r=RegExp([(e.escape||ue).source,(e.interpolate||ue).source,(e.evaluate||ue).source].join('|')+'|$','g'),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(he,pe),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!de.test(s))throw new Error('variable is not a bare identifier: '+s)}else o='with(obj||{}){\n'+o+'}\n',s='obj';o="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+o+'return __p;\n';try{a=new Function(s,'_',o)}catch(t){throw t.source=o,t}var l=function(t){return a.call(this,t,ut)};return l.source='function('+s+'){\n'+o+'}',l}function ve(t,e,n){var r=(e=Ht(e)).length;if(!r)return V(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=V(o)?o.call(t):o}return t}var me=0;function ye(t){var e=++me+'';return t?t+e:e}function be(t){var e=ut(t);return e._chain=!0,e}function we(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=Nt(t.prototype),a=t.apply(o,i);return S(a)?a:o}var ke=C((function(t,e){var n=ke.placeholder,r=function(){for(var i=0,o=e.length,a=Array(o),s=0;s<o;s++)a[s]=e[s]===n?arguments[i++]:e[s];for(;i<arguments.length;)a.push(arguments[i++]);return we(t,r,this,this,a)};return r}));ke.placeholder=ut;const xe=ke,Oe=C((function(t,e,n){if(!V(t))throw new TypeError('Bind must be called on a function');var r=C((function(i){return we(t,r,e,this,n.concat(i))}));return r})),Ce=Q(ot);function Se(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var i=r.length,o=0,a=ot(t);o<a;o++){var s=t[o];if(Ce(s)&&($(s)||K(s)))if(e>1)Se(s,e-1,n,r),i=r.length;else for(var l=0,c=s.length;l<c;)r[i++]=s[l++];else n||(r[i++]=s)}return r}const _e=C((function(t,e){var n=(e=Se(e,!1,!1)).length;if(n<1)throw new Error('bindAll must be passed function names');for(;n--;){var r=e[n];t[r]=Oe(t[r],t)}return t}));function Pe(t,e){var n=function(r){var i=n.cache,o=''+(e?e.apply(this,arguments):r);return q(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n}const Te=C((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),Ee=xe(Te,ut,1);function je(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:ie(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=ie();s||!1!==n.leading||(s=c);var u=e-(c-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}function Ae(t,e,n){var r,i,o,a,s,l=function(){var c=ie()-i;e>c?r=setTimeout(l,e-c):(r=null,n||(a=t.apply(s,o)),r||(o=s=null))},c=C((function(c){return s=this,o=c,i=ie(),r||(r=setTimeout(l,e),n&&(a=t.apply(s,o))),a}));return c.cancel=function(){clearTimeout(r),r=o=s=null},c}function Re(t,e){return xe(e,t)}function De(t){return function(){return!t.apply(this,arguments)}}function Me(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function Ze(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Le(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const Ne=xe(Le,2);function Ie(t,e,n){e=Jt(e,n);for(var r,i=st(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r}function Fe(t){return function(e,n,r){n=Jt(n,r);for(var i=ot(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}const Ve=Fe(1),Be=Fe(-1);function He(t,e,n,r){for(var i=(n=Jt(n,r,1))(e),o=0,a=ot(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o}function ze(t,e,n){return function(r,i,o){var a=0,s=ot(r);if('number'==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(u.call(r,a,s),X))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o<s;o+=t)if(r[o]===i)return o;return-1}}const Ue=ze(1,Ve,He),We=ze(-1,Be);function $e(t,e,n){var r=(Ce(t)?Ve:Ie)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function qe(t,e){return $e(t,qt(e))}function Ge(t,e,n){var r,i;if(e=Kt(e,n),Ce(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=st(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t}function Ke(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&st(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o}function Ye(t){var e=function(e,n,r,i){var o=!Ce(e)&&st(e),a=(o||e).length,s=t>0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s<a;s+=t){var l=o?o[s]:s;r=n(r,e[l],l,e)}return r};return function(t,n,r,i){var o=arguments.length>=3;return e(t,Kt(n,i,4),r,o)}}const Xe=Ye(1),Je=Ye(-1);function Qe(t,e,n){var r=[];return e=Jt(e,n),Ge(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function tn(t,e,n){return Qe(t,De(Jt(e)),n)}function en(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&st(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0}function nn(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&st(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1}function rn(t,e,n,r){return Ce(t)||(t=Et(t)),('number'!=typeof n||r)&&(n=0),Ue(t,e,n)>=0}const on=C((function(t,e,n){var r,i;return V(e)?i=e:(e=Ht(e),r=e.slice(0,-1),e=e[e.length-1]),Ke(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=zt(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))}));function an(t,e){return Ke(t,Gt(e))}function sn(t,e){return Qe(t,qt(e))}function ln(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,l=(t=Ce(t)?t:Et(t)).length;s<l;s++)null!=(r=t[s])&&r>o&&(o=r);else e=Jt(e,n),Ge(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function cn(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,l=(t=Ce(t)?t:Et(t)).length;s<l;s++)null!=(r=t[s])&&r<o&&(o=r);else e=Jt(e,n),Ge(t,(function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)}));return o}var un=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function fn(t){return t?$(t)?u.call(t):A(t)?t.match(un):Ce(t)?Ke(t,$t):Et(t):[]}function hn(t,e,n){if(null==e||n)return Ce(t)||(t=Et(t)),t[re(t.length-1)];var r=fn(t),i=ot(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=re(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)}function pn(t){return hn(t,1/0)}function dn(t,e,n){var r=0;return e=Jt(e,n),an(Ke(t,(function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),'value')}function gn(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=Jt(r,i),Ge(n,(function(e,i){var a=r(e,i,n);t(o,e,a)})),o}}const vn=gn((function(t,e,n){q(t,n)?t[n].push(e):t[n]=[e]})),mn=gn((function(t,e,n){t[n]=e})),yn=gn((function(t,e,n){q(t,n)?t[n]++:t[n]=1})),bn=gn((function(t,e,n){t[n?0:1].push(e)}),!0);function wn(t){return null==t?0:Ce(t)?t.length:st(t).length}function kn(t,e,n){return e in n}const xn=C((function(t,e){var n={},r=e[0];if(null==t)return n;V(r)?(e.length>1&&(r=Kt(r,e[1])),e=vt(t)):(r=kn,e=Se(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],s=t[a];r(s,a,t)&&(n[a]=s)}return n})),On=C((function(t,e){var n,r=e[0];return V(r)?(r=De(r),e.length>1&&(n=e[1])):(e=Ke(Se(e,!1,!1),String),r=function(t,n){return!rn(e,n)}),xn(t,r,n)}));function Cn(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function Sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Cn(t,t.length-e)}function _n(t,e,n){return u.call(t,null==e||n?1:e)}function Pn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:_n(t,Math.max(0,t.length-e))}function Tn(t){return Qe(t,Boolean)}function En(t,e){return Se(t,e,!1)}const jn=C((function(t,e){return e=Se(e,!0,!0),Qe(t,(function(t){return!rn(e,t)}))})),An=C((function(t,e){return jn(t,e)}));function Rn(t,e,n,r){T(e)||(r=n,n=e,e=!1),null!=n&&(n=Jt(n,r));for(var i=[],o=[],a=0,s=ot(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&o===c||i.push(l),o=c):n?rn(o,c)||(o.push(c),i.push(l)):rn(i,l)||i.push(l)}return i}const Dn=C((function(t){return Rn(Se(t,!0,!0))}));function Mn(t){for(var e=[],n=arguments.length,r=0,i=ot(t);r<i;r++){var o=t[r];if(!rn(e,o)){var a;for(a=1;a<n&&rn(arguments[a],o);a++);a===n&&e.push(o)}}return e}function Zn(t){for(var e=t&&ln(t,ot).length||0,n=Array(e),r=0;r<e;r++)n[r]=an(t,r);return n}const Ln=C(Zn);function Nn(t,e){for(var n={},r=0,i=ot(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function In(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i}function Fn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(u.call(t,r,r+=e));return n}function Vn(t,e){return t._chain?ut(e).chain():e}function Bn(t){return Ge(Rt(t),(function(e){var n=ut[e]=t[e];ut.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),Vn(this,n.apply(ut,t))}})),ut}Ge(['pop','push','reverse','shift','sort','splice','unshift'],(function(t){var e=a[t];ut.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),'shift'!==t&&'splice'!==t||0!==n.length||delete n[0]),Vn(this,n)}})),Ge(['concat','join','slice'],(function(t){var e=a[t];ut.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Vn(this,t)}}));const Hn=ut;var zn=Bn(r);zn._=zn;const Un=zn}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t['default']:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if('object'==typeof globalThis)return globalThis;try{return this||new Function('return this')()}catch(t){if('object'==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>F});var t=n(4942),e=n(9050),i=n(2579),o=n(7539);const a={stylePrefix:'gjs-',components:'',style:'',fromElement:!1,projectData:null,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:'900px',width:'100%',log:['warning','error'],baseCss:'',protectedCss:'* { box-sizing: border-box; } body {margin: 0;}',canvasCss:'',defaultCommand:'select-comp',showToolbar:!0,showDevices:!0,devicePreviewMode:!1,mediaCondition:'max-width',tagVarStart:'{[ ',tagVarEnd:' ]}',keepEmptyTextNodes:!1,jsInHtml:!0,nativeDnD:!0,multipleSelection:!0,optsHtml:{},optsCss:{},avoidInlineStyle:!0,avoidDefaults:!0,clearStyles:!1,dragMode:0,listenToEl:[],cssIcons:'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',icons:{close:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',move:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/></svg>',plus:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>',caret:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7,10L12,15L17,10H7Z" /></svg>',delete:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>',copy:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" /></svg>',arrowUp:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z" /></svg>',chevron:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z" /></svg>',eye:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" /></svg>',eyeOff:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z" /></svg>'},el:'',i18n:{},undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:'Code',keepUnusedStyles:!1,multiFrames:!1,customUI:!1};var s=n(2316),l=n.n(s);var c,u=n(1163),f=void 0&&(void 0).__extends||(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(s.Model);const p=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getByComponent=function(t){var e=this;return this.filter((function(n){return e.getComponent(n)===t}))[0]},n.prototype.addComponent=function(t,n){var r=this,i=((0,e.isArray)(t)?t:[t]).filter((function(t){return!r.hasComponent(t)})).map((function(t){return new h({component:t})}))[0];return this.push(i,n)},n.prototype.getComponent=function(t){return t.get('component')},n.prototype.hasComponent=function(t){var e=this.getByComponent(t);return e&&this.contains(e)},n.prototype.lastComponent=function(){var t=this.last();return t&&this.getComponent(t)},n.prototype.allComponents=function(){var t=this;return this.map((function(e){return t.getComponent(e)})).filter((function(t){return t}))},n.prototype.removeComponent=function(t,n){var r=this,i=((0,e.isArray)(t)?t:[t]).map((function(t){return r.getByComponent(t)}));return this.remove(i,n)},n}(s.Collection);var d=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=void 0&&(void 0).__assign||function(){return g=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},g.apply(this,arguments)},v=void 0&&(void 0).__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},m=void 0&&(void 0).__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},y=void 0&&(void 0).__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},b=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};l().$=i["default"];var w=[n(6718),n(4836),n(9788),n(8202),n(4859),n(2004),n(4424),n(2326),n(3463),n(8588),n(7619),n(899),n(2012),n(1030),n(672),n(7948),n(6388),n(5819),n(7892),n(7287),n(289),n(6407)],k=[];!function(t){var n=t.$;if(n&&n.prototype&&'jQuery'!==n.prototype.constructor.name){var r=n.fn;r.hide=function(){return this.css('display','none')},r.show=function(){return this.css('display','block')},r.focus=function(){var t=this.get(0);return t&&t.focus(),this},r.bind=function(t,e){return this.on(t,e)},r.unbind=function(t,n){if((0,e.isObject)(t)){for(var r in t)t.hasOwnProperty(r)&&this.off(r,t[r]);return this}return this.off(t,n)},r.click=function(t){return t?this.on('click',t):this.trigger('click')},r.change=function(t){return t?this.on('change',t):this.trigger('change')},r.keydown=function(t){return t?this.on('keydown',t):this.trigger('keydown')},r.delegate=function(t,e,n,r){return r||(r=n),this.on(e,t,(function(t){t.data=n,r(t)}))},r.scrollLeft=function(){var t=this.get(0),e=(t=9==t.nodeType?t.defaultView:t)instanceof Window?t:null;return e?e.pageXOffset:t.scrollLeft||0},r.scrollTop=function(){var t=this.get(0),e=(t=9==t.nodeType?t.defaultView:t)instanceof Window?t:null;return e?e.pageYOffset:t.scrollTop||0};var i=n.prototype.offset;r.offset=function(t){var e,n;return t&&(e=t.top,n=t.left),void 0!==e&&this.css('top',"".concat(e,"px")),void 0!==n&&this.css('left',"".concat(n,"px")),i.call(this)},n.map=function(t,e){for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n};var o=Array.prototype.indexOf;n.inArray=function(t,e,n){return null==e?-1:o.call(e,t,n)},n.Event=function(t,e){if(!(this instanceof n.Event))return new n.Event(t,e);this.type=t,this.isDefaultPrevented=function(){return!1}}}}({Backbone:l(),$:l().$});var x={debug:console.log,info:console.info,warning:console.warn,error:console.error},O=function(t){function n(n){void 0===n&&(n={});var r=t.call(this)||this;r.__skip=!1,r.defaultRunning=!1,r.destroyed=!1,r._config=n;var i=r.config;r.set('Config',n),r.set('modules',[]),r.set('toLoad',[]),r.set('storables',[]),r.set('selected',new p),r.set('dmode',i.dragMode);var o=i.el,a=i.log,s=!0===a?(0,e.keys)(x):(0,e.isArray)(a)?a:[];return(0,e.bindAll)(r,'initBaseColorPicker'),o&&i.fromElement&&(i.components=o.innerHTML),r.attrsOrig=o?(0,e.toArray)(o.attributes).reduce((function(t,e){return t[e.nodeName]=e.nodeValue,t}),{}):'',i.components&&!i.pageManager&&(i.pageManager={pages:[{component:i.components}]}),w.forEach((function(t){return r.loadModule(t)})),k.forEach((function(t){return r.tsLoadModule(t)})),r.on('change:componentHovered',r.componentHovered,r),r.on('change:changesCount',r.updateChanges,r),r.on('change:readyLoad change:readyCanvas',r._checkReady,r),s.forEach((function(t){return r.listenLog(t)})),[{from:'change:selectedComponent',to:'component:toggled'}].forEach((function(t){var e=t.from,n=t.to;r.listenTo(r,e,(function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];r.trigger.apply(r,b([n],t,!1)),r.logWarning("The event '".concat(e,"' is deprecated, replace it with '").concat(n,"'"))}))})),r}return d(n,t),n.prototype.defaults=function(){return{editing:0,selected:0,clipboard:null,dmode:0,componentHovered:null,previousModel:null,changesCount:0,storables:[],modules:[],toLoad:[],opened:{},device:''}},Object.defineProperty(n.prototype,"storables",{get:function(){return this.get('storables')},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"modules",{get:function(){return this.get('modules')},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"toLoad",{get:function(){return this.get('toLoad')},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this.get('selected')},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shallow",{get:function(){return this.get('shallow')},enumerable:!1,configurable:!0}),n.prototype._checkReady=function(){this.get('readyLoad')&&this.get('readyCanvas')&&!this.get('ready')&&this.set('ready',!0)},n.prototype.getContainer=function(){return this.config.el},n.prototype.listenLog=function(t){this.listenTo(this,"log:".concat(t),x[t])},Object.defineProperty(n.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),n.prototype.getConfig=function(t){var n=this.config;return(0,e.isUndefined)(t)?n:n[t]},n.prototype.loadOnStart=function(){var t=this,e=this.config,r=e.projectData,i=e.headless,o=this.get('StorageManager');this.toLoad.forEach((function(t){return t.onLoad()}));var a=function(){t.modules.forEach((function(e){return e.postLoad&&e.postLoad(t)})),t.set('readyLoad',1)};i?(r&&this.loadData(r),a()):setTimeout((function(){return v(t,void 0,void 0,(function(){var t;return m(this,(function(e){switch(e.label){case 0:return r?(this.loadData(r),[3,5]):[3,1];case 1:if(!(null==o?void 0:o.canAutoload()))return[3,5];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.load()];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.logError(t),[3,5];case 5:return a(),[2]}}))}))}));var s=new n({noticeOnUnload:!1,storageManager:!1,undoManager:!1});['PageManager','Canvas'].forEach((function(t){return s.get(t).onLoad()})),this.set('shallow',s)},n.prototype.updateChanges=function(){var t=this,e=this.get('StorageManager'),n=this.getDirtyCount();this.updateItr&&clearTimeout(this.updateItr),this.updateItr=setTimeout((function(){return t.trigger('update')})),this.config.noticeOnUnload&&(window.onbeforeunload=n?function(){return!0}:null),e.isAutosave()&&n>=e.getStepsBeforeSave()&&this.store().catch((function(e){return t.logError(e)}))},n.prototype.loadModule=function(t){var n=this.config,r=new(t.default||t)(this),i=r.name.charAt(0).toLowerCase()+r.name.slice(1),o=(0,e.isUndefined)(n[i])?n[r.name]:n[i],a=!0===o?{}:o||{};return a.pStylePrefix=n.pStylePrefix||'',(0,e.isUndefined)(o)||o||(a._disable=1),r.storageKey&&r.store&&r.load&&this.storables.push(r),a.em=this,r.init(g({},a)),!r.private&&this.set(r.name,r),r.onLoad&&this.toLoad.push(r),this.modules.push(r),this},n.prototype.tsLoadModule=function(t){var e=new(t.default||t)(this);return e.storageKey&&e.store&&e.load&&this.storables.push(e),!e.private&&this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),this},n.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set('Editor',t)},n.prototype.getEditor=function(){return this.get('Editor')},n.prototype.handleUpdates=function(t,e,n){var r=this;void 0===n&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get('ready')||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout((function(){var t=r.getDirtyCount()||0,e=(n.unset,y(n,["unset"]));r.set('changesCount',t+1,e)}),0))},n.prototype.changesUp=function(t){this.handleUpdates(0,0,t)},n.prototype.componentHovered=function(t,e,n){var r=this.previous('componentHovered');r&&this.trigger('component:unhovered',r,n),e&&this.trigger('component:hovered',e,n)},n.prototype.getSelected=function(){return this.selected.lastComponent()},n.prototype.getSelectedAll=function(){return this.selected.allComponents()},n.prototype.setSelected=function(t,n){var r=this;void 0===n&&(n={});var o=n.event,a=o&&(o.ctrlKey||o.metaKey),s=(o||{}).shiftKey,l=((0,e.isArray)(t)?t:[t]).map((function(t){return(0,u.getModel)(t,i["default"])})),c=this.getSelectedAll(),f=this.getConfig().multipleSelection,h=(0,e.isArray)(t);h&&this.removeSelected(c.filter((function(t){return!(0,e.contains)(l,t)}))),l.forEach((function(t){var i=(0,u.getModel)(t,void 0);if(i&&(r.trigger('component:select:before',i,n),!i.get('selectable')||n.abort)){if(!n.useValid)return;for(var o=i.parent();o&&!o.get('selectable');)o=o.parent();i=o}if(a&&f)return r.toggleSelected(i);if(s&&f){r.clearSelection(r.get('Canvas').getWindow());var l,p,d=i.collection,g=i.index();if(r.getSelectedAll().forEach((function(t){var n=t.collection,r=t.index();n===d&&(r<g?l=(0,e.isUndefined)(l)?r:Math.max(l,r):r>g&&(p=(0,e.isUndefined)(p)?r:Math.min(p,r)))})),!(0,e.isUndefined)(l))for(;l!==g;)r.addSelected(d.at(l)),l++;if(!(0,e.isUndefined)(p))for(;p!==g;)r.addSelected(d.at(p)),p--;return r.addSelected(i)}!h&&r.removeSelected(c.filter((function(t){return t!==i}))),r.addSelected(i,n),i}))},n.prototype.addSelected=function(t,n){var r=this;void 0===n&&(n={});var o=(0,u.getModel)(t,i["default"]);((0,e.isArray)(o)?o:[o]).forEach((function(t){if(!t||t.get('selectable')){var e=r.selected;n.forceChange&&r.removeSelected(t,n),e.addComponent(t,n),t&&r.trigger('component:select',t,n)}}))},n.prototype.removeSelected=function(t,e){void 0===e&&(e={}),this.selected.removeComponent((0,u.getModel)(t,i["default"]),e)},n.prototype.toggleSelected=function(t,n){var r=this;void 0===n&&(n={});var o=(0,u.getModel)(t,i["default"]);((0,e.isArray)(o)?o:[o]).forEach((function(t){r.selected.hasComponent(t)?r.removeSelected(t,n):r.addSelected(t,n)}))},n.prototype.setHovered=function(t,e){if(void 0===e&&(e={}),!t)return this.set('componentHovered','');var n='component:hover',r=(0,u.getModel)(t,void 0);if(r){if(e.forceChange&&this.set('componentHovered',''),this.trigger("".concat(n,":before"),r,e),!r.get('hoverable')){if(!e.useValid||e.abort)return;for(var i=r&&r.parent();i&&!i.get('hoverable');)i=i.parent();r=i}e.abort||(this.set('componentHovered',r,e),this.trigger(n,r,e))}},n.prototype.getHovered=function(){return this.get('componentHovered')},n.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.get('DomComponents').setComponents(t,e)},n.prototype.getComponents=function(){var t=this.get('DomComponents'),e=this.get('CodeManager');if(t&&e){var n=t.getComponents();return e.getCode(n,'json')}},n.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.get('CssComposer');return n.clear(e),n.getAll().add(t,e),this},n.prototype.addStyle=function(t,n){void 0===n&&(n={});var r=this.getStyle().add(t,n);return(0,e.isArray)(r)?r:[r]},n.prototype.getStyle=function(){return this.get('CssComposer').getAll()},n.prototype.setState=function(t){return this.set('state',t),this},n.prototype.getState=function(){return this.get('state')||''},n.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,r=e.jsInHtml?this.getJs(t):'',i=t.component||this.get('DomComponents').getComponent(),o=i?this.get('CodeManager').getCode(i,'html',g(g({},n),t)):'';return o+=r?"<script>".concat(r,"<\/script>"):''},n.prototype.getCss=function(t){void 0===t&&(t={});var n=this.config,r=n.optsCss,i=t.avoidProtected,o=(0,e.isUndefined)(t.keepUnusedStyles)?n.keepUnusedStyles:t.keepUnusedStyles,a=this.get('CssComposer'),s=t.component||this.get('DomComponents').getComponent(),l=i?'':n.protectedCss,c=s&&this.get('CodeManager').getCode(s,'css',g(g({cssc:a,keepUnusedStyles:o},r),t));return s?t.json?c:l+c:''},n.prototype.getJs=function(t){void 0===t&&(t={});var e=t.component||this.get('DomComponents').getWrapper();return e?this.get('CodeManager').getCode(e,'js').trim():''},n.prototype.store=function(t){return v(this,void 0,void 0,(function(){var e;return m(this,(function(n){switch(n.label){case 0:return e=this.storeData(),[4,this.get('StorageManager').store(e,t)];case 1:return n.sent(),this.clearDirtyCount(),[2,e]}}))}))},n.prototype.load=function(t){return v(this,void 0,void 0,(function(){var e;return m(this,(function(n){switch(n.label){case 0:return[4,this.get('StorageManager').load(t)];case 1:return e=n.sent(),this.loadData(e),[2,e]}}))}))},n.prototype.storeData=function(){var t={},e=this.getEditing();return e&&e.trigger('sync:content',{noCount:!0}),this.storables.forEach((function(e){t=g(g({},t),e.store(1))})),JSON.parse(JSON.stringify(t))},n.prototype.loadData=function(t){return void 0===t&&(t={}),(0,u.isEmptyObj)(t)||(this.storables.forEach((function(t){return t.clear()})),this.storables.forEach((function(e){return e.load(t)}))),t},n.prototype.getDeviceModel=function(){var t=this.get('device');return this.get('DeviceManager').get(t)},n.prototype.runDefault=function(t){void 0===t&&(t={});var e=this.get('Commands').get(this.config.defaultCommand);e&&!this.defaultRunning&&(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=!0)},n.prototype.stopDefault=function(t){void 0===t&&(t={});var e=this.get('Commands').get(this.config.defaultCommand);e&&this.defaultRunning&&(e.stop(this,this,t),this.defaultRunning=!1)},n.prototype.refreshCanvas=function(t){void 0===t&&(t={}),this.set('canvasOffset',null),this.set('canvasOffset',this.get('Canvas').getOffset()),t.tools&&this.trigger('canvas:updateTools')},n.prototype.clearSelection=function(t){var e;null===(e=(t||window).getSelection())||void 0===e||e.removeAllRanges()},n.prototype.getCurrentMedia=function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,r=t.devicePreviewMode,i=e&&e.get('widthMedia');return e&&i&&!r?"(".concat(n,": ").concat(i,")"):''},n.prototype.getWrapper=function(){return this.get('DomComponents').getWrapper()},n.prototype.setCurrentFrame=function(t){return this.set('currentFrame',t)},n.prototype.getCurrentFrame=function(){return this.get('currentFrame')},n.prototype.getCurrentFrameModel=function(){return(this.getCurrentFrame()||{}).model},n.prototype.getIcon=function(t){return(this.config.icons||{})[t]||''},n.prototype.getDirtyCount=function(){return this.get('changesCount')},n.prototype.clearDirtyCount=function(){return this.set('changesCount',0)},n.prototype.getZoomDecimal=function(){return this.get('Canvas').getZoomDecimal()},n.prototype.getZoomMultiplier=function(){return this.get('Canvas').getZoomMultiplier()},n.prototype.setDragMode=function(t){return this.set('dmode',t)},n.prototype.t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.get('I18n');return null==n?void 0:n.t.apply(n,t)},n.prototype.inAbsoluteMode=function(){return'absolute'===this.get('dmode')},n.prototype.destroyAll=function(){var t=this,e=this.config,n=this.view,r=this.getEditor(),o=(e.grapesjs||{}).editors,a=void 0===o?[]:o,s=this.get('shallow');null==s||s.destroyAll(),this.stopListening(),this.stopDefault(),this.modules.slice().reverse().forEach((function(t){return t.destroy()})),n&&n.remove(),this.clear({silent:!0}),this.destroyed=!0,['_config','view','_previousAttributes','_events','_listeners'].forEach((function(e){return t[e]={}})),a.splice(a.indexOf(r),1),(0,u.hasWin)()&&(0,i["default"])(e.el).empty().attr(this.attrsOrig)},n.prototype.getEditing=function(){var t=this.get('editing');return t&&t.model||null},n.prototype.setEditing=function(t){return this.set('editing',t),this},n.prototype.isEditing=function(){return!!this.get('editing')},n.prototype.log=function(t,e){void 0===e&&(e={});var n=e.ns,r=e.level,i=void 0===r?'debug':r;if(this.trigger('log',t,e),i&&this.trigger("log:".concat(i),t,e),n){var o="log-".concat(n);this.trigger(o,t,e),i&&this.trigger("".concat(o,":").concat(i),t,e)}},n.prototype.logInfo=function(t,e){this.log(t,g(g({},e),{level:'info'}))},n.prototype.logWarning=function(t,e){this.log(t,g(g({},e),{level:'warning'}))},n.prototype.logError=function(t,e){this.log(t,g(g({},e),{level:'error'}))},n.prototype.initBaseColorPicker=function(t,e){void 0===e&&(e={});var n=this.config,r=n.colorPicker,o=void 0===r?{}:r,a=n.el,s=n.stylePrefix;return(0,i["default"])(t).spectrum(g(g({containerClassName:"".concat(s,"one-bg ").concat(s,"two-color"),appendTo:a||'body',maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:'Ok',cancelText:'⨯'},e),o))},n.prototype.skip=function(t){this.__skip=!0;var e=this.get('UndoManager');e?e.skip(t):t(),this.__skip=!1},n.prototype.data=function(t,n,r){var i='_gjs-data';if(t[i]||(t[i]={}),(0,e.isUndefined)(r))return t[i][n];t[i][n]=r},n}(s.Model);const C=O;var S=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=l().$;const P=function(t){function e(e){var n=t.call(this,{model:e})||this,r=e.attributes,i=r.Panels,o=r.UndoManager;return e.view=n,e.once('change:ready',(function(){i.active(),i.disableButtons(),o.clear(),setTimeout((function(){e.trigger('load',e.get('Editor')),e.clearDirtyCount()}))})),n}return S(e,t),e.prototype.render=function(){var t=this,e=this.$el,n=this.model,r=n.attributes,i=r.Panels,o=r.Canvas,a=n.config,s=n.modules,l=a.stylePrefix,c=_(a.el||"body ".concat(a.container));(0,u.appendStyles)(a.cssIcons,{unique:!0,prepand:!0}),e.empty(),a.width&&c.css('width',a.width),a.height&&c.css('height',a.height),e.append(o.render()),e.append(i.render());var f=n.get('shallow').get('Canvas').render();return f.style.display='none',e.append(f),e.attr('class',"".concat(l,"editor ").concat(l,"one-bg ").concat(l,"two-color")),c.addClass("".concat(l,"editor-cont")).empty().append(e),s.forEach((function(e){return e.postRender&&e.postRender(t)})),this},e}(s.View);var T=void 0&&(void 0).__assign||function(){return T=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},T.apply(this,arguments)},E=void 0&&(void 0).__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},j=void 0&&(void 0).__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},A=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};const R=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.modules=[],this.html=o.Z,this.config=T(T(T({},a),t),{pStylePrefix:a.stylePrefix}),this.em=new C(this.config),this.$=e.$,this.em.init(this),this.editor=this.em}return Object.defineProperty(t.prototype,"I18n",{get:function(){return this.em.get('I18n')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Utils",{get:function(){return this.em.get('Utils')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Config",{get:function(){return this.em.config},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Commands",{get:function(){return this.em.get('Commands')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Keymaps",{get:function(){return this.em.get('Keymaps')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Modal",{get:function(){return this.em.get('Modal')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Panels",{get:function(){return this.em.get('Panels')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Canvas",{get:function(){return this.em.get('Canvas')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Parser",{get:function(){return this.em.get('Parser')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CodeManager",{get:function(){return this.em.get('CodeManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"UndoManager",{get:function(){return this.em.get('UndoManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RichTextEditor",{get:function(){return this.em.get('RichTextEditor')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Pages",{get:function(){return this.em.get('PageManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Components",{get:function(){return this.em.get('DomComponents')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DomComponents",{get:function(){return this.em.get('DomComponents')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Layers",{get:function(){return this.em.get('LayerManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"LayerManager",{get:function(){return this.em.get('LayerManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Css",{get:function(){return this.em.get('CssComposer')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CssComposer",{get:function(){return this.em.get('CssComposer')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Storage",{get:function(){return this.em.get('StorageManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"StorageManager",{get:function(){return this.em.get('StorageManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Assets",{get:function(){return this.em.get('AssetManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"AssetManager",{get:function(){return this.em.get('AssetManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Blocks",{get:function(){return this.em.get('BlockManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BlockManager",{get:function(){return this.em.get('BlockManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Traits",{get:function(){return this.em.get('TraitManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TraitManager",{get:function(){return this.em.get('TraitManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Selectors",{get:function(){return this.em.get('SelectorManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SelectorManager",{get:function(){return this.em.get('SelectorManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Styles",{get:function(){return this.em.get('StyleManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"StyleManager",{get:function(){return this.em.get('StyleManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Devices",{get:function(){return this.em.get('DeviceManager')},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DeviceManager",{get:function(){return this.em.get('DeviceManager')},enumerable:!1,configurable:!0}),t.prototype.getConfig=function(t){var n=this.config;return(0,e.isUndefined)(t)?n:n[t]},t.prototype.getHtml=function(t){return this.em.getHtml(t)},t.prototype.getCss=function(t){return this.em.getCss(t)},t.prototype.getJs=function(t){return this.em.getJs(t)},t.prototype.getComponents=function(){return this.em.get('DomComponents').getComponents()},t.prototype.getWrapper=function(){return this.em.get('DomComponents').getWrapper()},t.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.em.setComponents(t,e),this},t.prototype.addComponents=function(t,e){return this.getWrapper().append(t,e)},t.prototype.getStyle=function(){return this.em.get('CssComposer').getAll()},t.prototype.setStyle=function(t,e){return void 0===e&&(e={}),this.em.setStyle(t,e),this},t.prototype.addStyle=function(t,e){return void 0===e&&(e={}),this.em.addStyle(t,e)},t.prototype.getSelected=function(){return this.em.getSelected()},t.prototype.getSelectedAll=function(){return this.em.getSelectedAll()},t.prototype.getSelectedToStyle=function(){var t=this.em.getSelected();if(t)return this.StyleManager.getModelToStyle(t)},t.prototype.select=function(t,e){return this.em.setSelected(t,e),this},t.prototype.selectAdd=function(t){return this.em.addSelected(t),this},t.prototype.selectRemove=function(t){return this.em.removeSelected(t),this},t.prototype.selectToggle=function(t){return this.em.toggleSelected(t),this},t.prototype.getEditing=function(){return this.em.getEditing()},t.prototype.setDevice=function(t){return this.em.set('device',t),this},t.prototype.getDevice=function(){return this.em.get('device')},t.prototype.runCommand=function(t,e){return void 0===e&&(e={}),this.em.get('Commands').run(t,e)},t.prototype.stopCommand=function(t,e){return void 0===e&&(e={}),this.em.get('Commands').stop(t,e)},t.prototype.store=function(t){return E(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this.em.store(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.load=function(t){return E(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this.em.load(t)];case 1:return[2,e.sent()]}}))}))},t.prototype.getProjectData=function(){return this.em.storeData()},t.prototype.loadProjectData=function(t){return this.em.loadData(t)},t.prototype.storeData=function(){return this.em.storeData()},t.prototype.loadData=function(t){return this.em.loadData(t)},t.prototype.getContainer=function(){return this.config.el},t.prototype.getDirtyCount=function(){return this.em.getDirtyCount()},t.prototype.clearDirtyCount=function(){return this.em.clearDirtyCount()},t.prototype.refresh=function(t){this.em.refreshCanvas(t)},t.prototype.setCustomRte=function(t){this.RichTextEditor.customRte=t},t.prototype.setCustomParserCss=function(t){return this.Parser.getConfig().parserCss=t,this},t.prototype.setDragMode=function(t){return this.em.setDragMode(t),this},t.prototype.log=function(t,e){return void 0===e&&(e={}),this.em.log(t,e),this},t.prototype.t=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.em).t.apply(t,e)},t.prototype.on=function(t,e){return this.em.on(t,e),this},t.prototype.once=function(t,e){return this.em.once(t,e),this},t.prototype.off=function(t,e){return this.em.off(t,e),this},t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.em.trigger.apply(this.em,A([t],e,!0)),this},t.prototype.destroy=function(){this.em&&(this.em.destroyAll(),this.editorView=void 0)},t.prototype.getEl=function(){var t;return null===(t=this.editorView)||void 0===t?void 0:t.el},t.prototype.getModel=function(){return this.em},t.prototype.render=function(){var t;return null===(t=this.editorView)||void 0===t||t.remove(),this.editorView=new P(this.em),this.editorView.render().el},t.prototype.onReady=function(t){this.em.get('ready')?t(this):this.em.on('load',t)},t}(),D={plugins:[]};function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?M(Object(r),!0).forEach((function(n){(0,t.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(){if((0,u.hasWin)()&&function(){for(var t,e=window.navigator.userAgent,n=[['edge',/Edge\/([0-9\._]+)/],['ie',/MSIE\s(7\.0)/],['ie',/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],['ie',/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]],r=0;r<n.length;r++){if(t=n[r][1].exec(e))break}return!!t}()){var t=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(e){return e||(e=''),t.apply(document.implementation,[e])}}}();var L=new function(t){var e=t||{};for(var n in D)n in e||(e[n]=D[n]);var r={};return{add:function(t,e){return r[t]?r[t]:(r[t]=e,e)},get:function(t){return r[t]},getAll:function(){return r}}},N=[],I={autorender:1,plugins:[],pluginsOpts:{}};const F={$:i["default"],editors:N,plugins:L,version:'0.20.1',init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t,r=n.headless,o=t.container;if(!o&&!r)throw new Error("'container' is required");(t=Z(Z(Z({},I),t),{},{grapesjs:this})).el=!r&&((0,e.isElement)(o)?o:document.querySelector(o));var a=new R(t,{$:i["default"]}),s=a.getModel();return t.plugins.forEach((function(n){var r=(0,e.isFunction)(n)?n:L.get(n),i=t.pluginsOpts[n]||{};if(!r){var o=(0,u.getGlobal)()[n];r=(null==o?void 0:o.default)||o}r?r(a,i):(0,e.isFunction)(n)?n(a,i):s.logWarning("Plugin ".concat(n," not found"),{context:'plugins',plugin:n})})),s.loadOnStart(),t.autorender&&!r&&a.render(),N.push(a),a}}})(),r=r["default"]})()));
//# sourceMappingURL=grapes.min.js.map

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0203 ]--