diff --git a/public/assets/scripts/grapesjs/grapes.min.js b/public/assets/scripts/grapesjs/grapes.min.js index a21bfb9..ff2d73b 100644 --- a/public/assets/scripts/grapesjs/grapes.min.js +++ b/public/assets/scripts/grapesjs/grapes.min.js @@ -1,3 +1,3 @@ -/*! grapesjs - 0.21.10 */ -!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={410:(t,e,n)=>{var o,r,i;1&&(r=[n(50),n(316)],void 0===(i='function'==typeof(o=function(t,e){var n=Array.prototype.slice;function o(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function r(t,e){return n.call(t,e)}function i(e,n){return null!=e&&(t.isArray(n)||(n=r(arguments,1)),t.all(n,(function(t){return t in e})))}var s=function(){var e=!1,n=-1;function o(){n++,e=!0,t.defer((function(){e=!1}))}return function(){return e||o(),n}}();function a(){this.registeredObjects=[],this.cidIndexes=[]}function l(e,n,o,r){for(var i,s=0,a=n.length;st.maximumStackLength&&(t.shift(),t.pointer--)}}}a.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 f={add:{undo:function(t,e,n,o){t.remove(n,o)},redo:function(t,e,n,o){o.index&&(o.at=o.index),t.add(n,o)},on:function(e,n,o){return{object:n,before:void 0,after:e,options:t.clone(o)}}},remove:{undo:function(t,e,n,o){"index"in o&&(o.at=o.index),t.add(e,o)},redo:function(t,e,n,o){t.remove(e,o)},on:function(e,n,o){return{object:n,before:e,after:void 0,options:t.clone(o)}}},change:{undo:function(e,n,o,r){t.isEmpty(n)?t.each(t.keys(o),e.unset,e):(e.set(n),r&&r.unsetData&&r.unsetData.before&&r.unsetData.before.length&&t.each(r.unsetData.before,e.unset,e))},redo:function(e,n,o,r){t.isEmpty(o)?t.each(t.keys(n),e.unset,e):(e.set(o),r&&r.unsetData&&r.unsetData.after&&r.unsetData.after.length&&t.each(r.unsetData.after,e.unset,e))},on:function(e,n){var o=e.changedAttributes(),r=t.keys(o),i=t.pick(e.previousAttributes(),r),s=t.keys(i),a=(n||(n={})).unsetData={after:[],before:[]};return r.length!=s.length&&(r.length>s.length?t.each(r,(function(t){t in i||a.before.push(t)}),this):t.each(s,(function(t){t in o||a.after.push(t)}))),{object:e,before:i,after:o,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 h(){}function g(e,n,o,r){if("object"==typeof n)return t.each(n,(function(t,n){2===e?g(e,t,o,r):g(e,n,t,o)}));switch(e){case 0:i(o,"undo","redo","on")&&t.all(t.pick(o,"undo","redo","on"),t.isFunction)&&(r[n]=o);break;case 1:r[n]&&t.isObject(o)&&(r[n]=t.extend({},r[n],o));break;case 2:delete r[n]}return this}h.prototype=f;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)}}),y=e.Collection.extend({model:v,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),m=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new y,this.objectRegistry=new a,this.undoTypes=new h,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)?o(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){d(this.stack,t,r(arguments,1),this.undoTypes)},register:function(){l("on",arguments,this._addToStack,this)},unregister:function(){l("off",arguments,this._addToStack,this)},unregisterAll:function(){o(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{var o,r;!function(i){var s='object'==typeof self&&self.self===self&&self||'object'==typeof n.g&&n.g.global===n.g&&n.g;if(1)o=[n(50),n(895),e],r=function(t,e,n){s.Backbone=function(t,e,n,o){var r=t.Backbone,i=Array.prototype.slice;e.VERSION='1.4.1',e.$=o,e.noConflict=function(){return t.Backbone=r,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s,a=e.Events={},l=/\s+/,c=function(t,e,o,r,i){var s,a=0;if(o&&'object'==typeof o){void 0!==r&&'context'in i&&void 0===i.context&&(i.context=r);for(s=n.keys(o);athis.length&&(r=this.length),r<0&&(r+=this.length+1);var i,s,a=[],l=[],c=[],u=[],p={},d=e.add,f=e.merge,h=e.remove,g=!1,v=this.comparator&&null==r&&!1!==e.sort,y=n.isString(this.comparator)?this.comparator:null;for(s=0;s7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=('/'+this.root+'/').replace(W,'/'),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 o=document.body,r=o.insertBefore(this.iframe,o.firstChild).contentWindow;r.document.open(),r.document.close(),r.location.hash='#'+this.fragment}var i=window.addEventListener||function(t,e){return attachEvent('on'+t,e)};if(this._usePushState?i('popstate',this.checkUrl,!1):this._useHashChange&&!this.iframe?i('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),B.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(!B.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 o=n+t;t=t.replace($,'');var r=this.decodeFragment(t);if(this.fragment!==r){if(this.fragment=r,this._usePushState)this.history[e.replace?'replaceState':'pushState']({},document.title,o);else{if(!this._wantsHashChange)return this.location.assign(o);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var o=t.href.replace(/(javascript:|#).*$/,'');t.replace(o+'#'+e)}else t.hash='#'+e}}),e.history=new B;var q=function(t,e){var o,r=this;return o=t&&n.has(t,'constructor')?t.constructor:function(){return r.apply(this,arguments)},n.extend(o,r,e),o.prototype=n.create(r.prototype,t),o.prototype.constructor=o,o.__super__=r.prototype,o};y.extend=m.extend=F.extend=k.extend=B.extend=q;var G=function(){throw new Error('A "url" property or function must be specified')},K=function(t,e){var n=e.error;e.error=function(o){n&&n.call(e.context,t,o,e),t.trigger('error',t,o,e)}};return e}(s,n,t,e)}.apply(e,o),void 0===r||(t.exports=r);else;}()},210:(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,o){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!o.lexical||")"!=o.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,o,r){var i=!1;return"html"==this.configuration&&(i=!!r.context&&e.test(r.context.tagName)),!i&&("tag"==t&&/>$/.test(n)&&r.context||/^-1&&a>-1&&a>s&&(t=t.substr(0,s)+t.substring(s+i.commentStart.length,a)+t.substr(a+i.commentEnd.length)),r.replaceRange(t,n,o)}}))})),t.defineExtension("autoIndentRange",(function(t,e){var n=this;this.operation((function(){for(var o=t.line;o<=e.line;o++)n.indentLine(o,"smart")}))})),t.defineExtension("autoFormatRange",(function(e,n){var o=this,r=o.getMode(),i=o.getRange(e,n).split("\n"),s=t.copyState(r,o.getTokenAt(e).state),a=o.getOption("tabSize"),l="",c=0,u=0===e.ch;function p(){l+="\n",u=!0,++c}for(var d=0;d2),y=/Android/.test(t),m=v||y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),b=v||/Mac/.test(e),_=/\bCrOS\b/.test(t),w=/win/i.test(e),x=d&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var C=b&&(c||d&&(null==x||x<12.11)),S=n||s&&a>=9;function O(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var T,k=function(t,e){var n=t.className,o=O(e).exec(n);if(o){var r=n.slice(o.index+o[0].length);t.className=n.slice(0,o.index)+(r?o[1]+r:"")}};function E(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function P(t,e){return E(t).appendChild(e)}function A(t,e,n,o){var r=document.createElement(t);if(n&&(r.className=n),o&&(r.style.cssText=o),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var i=0;i=e)return s+(e-i);s+=a-i,s+=n-s%n,i=a+1}}v?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(I=function(t){try{t.select()}catch(t){}});var B=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function U(t,e){for(var n=0;n=e)return o+Math.min(s,e-r);if(r+=i-o,o=i+1,(r+=n-r%n)>=e)return o}}var Z=[""];function X(t){for(;Z.length<=t;)Z.push(J(Z)+" ");return Z[t]}function J(t){return t[t.length-1]}function Q(t,e){for(var n=[],o=0;o"€"&&(t.toUpperCase()!=t.toLowerCase()||ot.test(t))}function it(t,e){return e?!!(e.source.indexOf("\\w")>-1&&rt(t))||e.test(t):rt(t)}function st(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var at=/[\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 lt(t){return t.charCodeAt(0)>=768&&at.test(t)}function ct(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var r=(e+n)/2,i=o<0?Math.ceil(r):Math.floor(r);if(i==e)return t(i)?e:n;t(i)?n=i:e=i+o}}function pt(t,e,n,o){if(!t)return o(e,n,"ltr",0);for(var r=!1,i=0;ie||e==n&&s.to==e)&&(o(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",i),r=!0)}r||o(e,n,"ltr")}var dt=null;function ft(t,e,n){var o;dt=null;for(var r=0;re)return r;i.to==e&&(i.from!=i.to&&"before"==n?o=r:dt=r),i.from==e&&(i.from!=i.to&&"before"!=n?o=r:dt=r)}return null!=o?o:dt}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 o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,i=/[LRr]/,s=/[Lb1n]/,a=/[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&&!o.test(t))return!1;for(var u=t.length,p=[],d=0;d-1&&(o[e]=r.slice(0,i).concat(r.slice(i+1)))}}}function _t(t,e){var n=mt(t,e);if(n.length)for(var o=Array.prototype.slice.call(arguments,2),r=0;r0}function St(t){t.prototype.on=function(t,e){yt(this,t,e)},t.prototype.off=function(t,e){bt(this,t,e)}}function Ot(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Tt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function kt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Et(t){Ot(t),Tt(t)}function Pt(t){return t.target||t.srcElement}function At(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 jt,Mt,Lt=function(){if(s&&a<9)return!1;var t=A('div');return"draggable"in t||"dragDrop"in t}();function Dt(t){if(null==jt){var e=A("span","​");P(t,A("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(jt=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=jt?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Nt(t){if(null!=Mt)return Mt;var e=P(t,document.createTextNode("AخA")),n=T(e,0,1).getBoundingClientRect(),o=T(e,1,2).getBoundingClientRect();return E(t),!(!n||n.left==n.right)&&(Mt=o.right-n.right<3)}var It,Ft=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],o=t.length;e<=o;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var i=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),s=i.indexOf("\r");-1!=s?(n.push(i.slice(0,s)),e+=s+1):(n.push(i),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Vt=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)},Rt="oncopy"in(It=A("div"))||(It.setAttribute("oncopy","return;"),"function"==typeof It.oncopy),Ht=null;function zt(t){if(null!=Ht)return Ht;var e=P(t,A("span","x")),n=e.getBoundingClientRect(),o=T(e,0,1).getBoundingClientRect();return Ht=Math.abs(n.left-o.left)>1}var Bt={},Ut={};function Wt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Bt[t]=e}function $t(t,e){Ut[t]=e}function qt(t){if("string"==typeof t&&Ut.hasOwnProperty(t))t=Ut[t];else if(t&&"string"==typeof t.name&&Ut.hasOwnProperty(t.name)){var e=Ut[t.name];"string"==typeof e&&(e={name:e}),(t=nt(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return qt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return qt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Gt(t,e){e=qt(e);var n=Bt[e.name];if(!n)return Gt(t,"text/plain");var o=n(t,e);if(Kt.hasOwnProperty(e.name)){var r=Kt[e.name];for(var i in r)r.hasOwnProperty(i)&&(o.hasOwnProperty(i)&&(o["_"+i]=o[i]),o[i]=r[i])}if(o.name=e.name,e.helperType&&(o.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)o[s]=e.modeProps[s];return o}var Kt={};function Yt(t,e){H(e,Kt.hasOwnProperty(t)?Kt[t]:Kt[t]={})}function Zt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var o in e){var r=e[o];r instanceof Array&&(r=r.concat([])),n[o]=r}return n}function Xt(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 Jt(t,e,n){return!t.startState||t.startState(e,n)}var Qt=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 te(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 o=0;;++o){var r=n.children[o],i=r.chunkSize();if(e=t.first&&en?le(n,te(t,n).text.length):ve(e,te(t,e.line).text.length)}function ve(t,e){var n=t.ch;return null==n||n>e?le(t.line,e):n<0?le(t.line,0):t}function ye(t,e){for(var n=[],o=0;o=this.string.length},Qt.prototype.sol=function(){return this.pos==this.lineStart},Qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qt.prototype.next=function(){if(this.pose},Qt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Qt.prototype.skipToEnd=function(){this.pos=this.string.length},Qt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Qt.prototype.backUp=function(t){this.pos-=t},Qt.prototype.column=function(){return this.lastColumnPos0?null:(o&&!1!==e&&(this.pos+=o[0].length),o)}var r=function(t){return n?t.toLowerCase():t};if(r(this.string.substr(this.pos,t.length))==r(t))return!1!==e&&(this.pos+=t.length),!0},Qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Qt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Qt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var me=function(t,e){this.state=t,this.lookAhead=e},be=function(t,e,n,o){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=o||0,this.baseTokens=null,this.baseTokenPos=1};function _e(t,e,n,o){var r=[t.state.modeGen],i={};Pe(t,e.text,t.doc.mode,n,(function(t,e){return r.push(t,e)}),i,o);for(var s=n.state,a=function(o){n.baseTokens=r;var a=t.state.overlays[o],l=1,c=0;n.state=!0,Pe(t,e.text,a.mode,n,(function(t,e){for(var n=l;ct&&r.splice(l,1,t,r[l+1],o),l+=2,c=Math.min(t,o)}if(e)if(a.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Zt(t.doc.mode,o.state),i=_e(t,e,o);r&&(o.state=r),e.stateAfter=o.save(!r),e.styles=i.styles,i.classes?e.styleClasses=i.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 xe(t,e,n){var o=t.doc,r=t.display;if(!o.mode.startState)return new be(o,!0,e);var i=Ae(t,e,n),s=i>o.first&&te(o,i-1).stateAfter,a=s?be.fromSaved(o,s,i):new be(o,Jt(o.mode),i);return o.iter(i,e,(function(n){Ce(t,n.text,a);var o=a.line;n.stateAfter=o==e-1||o%5==0||o>=r.viewFrom&&oe.start)return i}throw new Error("Mode "+t.name+" failed to advance stream.")}be.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},be.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}},be.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},be.fromSaved=function(t,e,n){return e instanceof me?new be(t,Zt(t.mode,e.state),n,e.lookAhead):new be(t,Zt(t.mode,e),n)},be.prototype.save=function(t){var e=!1!==t?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new me(e,this.maxLookAhead):e};var Te=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ke(t,e,n,o){var r,i,s=t.doc,a=s.mode,l=te(s,(e=ge(s,e)).line),c=xe(t,e.line,n),u=new Qt(l.text,t.options.tabSize,c);for(o&&(i=[]);(o||u.post.options.maxHighlightLength?(a=!1,s&&Ce(t,e,o,p.pos),p.pos=e.length,l=null):l=Ee(Oe(n,p,o.state,d),i),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;cs;--a){if(a<=i.first)return i.first;var l=te(i,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof me?c.lookAhead:0)<=i.modeFrontier))return a;var u=z(l.text,null,t.options.tabSize);(null==r||o>u)&&(r=a-1,o=u)}return r}function je(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;o--){var r=te(t,o).stateAfter;if(r&&(!(r instanceof me)||o+r.lookAhead=e:i.to>e);(o||(o=[])).push(new Ie(s,i.from,a?null:i.to))}}return o}function ze(t,e,n){var o;if(t)for(var r=0;r=e:i.to>e)||i.from==e&&"bookmark"==s.type&&(!n||i.marker.insertLeft)){var a=null==i.from||(s.inclusiveLeft?i.from<=e:i.from0&&a)for(var b=0;b0)){var u=[l,1],p=ce(c.from,a.from),d=ce(c.to,a.to);(p<0||!s.inclusiveLeft&&!p)&&u.push({from:c.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&u.push({from:a.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}function $e(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||Ye(n,i.marker)<0)&&(n=i.marker)}return n}function tn(t,e,n,o,r){var i=te(t,e),s=Le&&i.markedSpans;if(s)for(var a=0;a=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ce(c.to,n)>=0:ce(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ce(c.from,o)<=0:ce(c.from,o)<0)))return!0}}}function en(t){for(var e;e=Xe(t);)t=e.find(-1,!0).line;return t}function nn(t){for(var e;e=Je(t);)t=e.find(1,!0).line;return t}function on(t){for(var e,n;e=Je(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function rn(t,e){var n=te(t,e),o=en(n);return n==o?e:re(o)}function sn(t,e){if(e>t.lastLine())return e;var n,o=te(t,e);if(!an(t,o))return e;for(;n=Je(o);)o=n.find(1,!0).line;return re(o)+1}function an(t,e){var n=Le&&e.markedSpans;if(n)for(var o=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var dn=function(t,e,n){this.text=t,qe(this,e),this.height=n?n(this):1};function fn(t,e,n,o){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),$e(t),qe(t,n);var r=o?o(t):1;r!=t.height&&oe(t,r)}function hn(t){t.parent=null,$e(t)}dn.prototype.lineNo=function(){return re(this)},St(dn);var gn={},vn={};function yn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?vn:gn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function mn(t,e){var n=j("span",null,null,l?"padding-right: .1px":null),o={pre:j("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var i=r?e.rest[r-1]:e.line,s=void 0;o.pos=0,o.addToken=_n,Nt(t.display.measure)&&(s=gt(i,t.doc.direction))&&(o.addToken=xn(o.addToken,s)),o.map=[],Sn(i,o,we(t,i,e!=t.display.externalMeasured&&re(i))),i.styleClasses&&(i.styleClasses.bgClass&&(o.bgClass=N(i.styleClasses.bgClass,o.bgClass||"")),i.styleClasses.textClass&&(o.textClass=N(i.styleClasses.textClass,o.textClass||""))),0==o.map.length&&o.map.push(0,0,o.content.appendChild(Dt(t.display.measure))),0==r?(e.measure.map=o.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(o.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var a=o.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(o.content.className="cm-tab-wrap-hack")}return _t(t,"renderLine",t,e.line,o.pre),o.pre.className&&(o.textClass=N(o.pre.className,o.textClass||"")),o}function bn(t){var e=A("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function _n(t,e,n,o,r,i,l){if(e){var c,u=t.splitSpaces?wn(e,t.trailingSpace):e,p=t.cm.state.specialChars,d=!1;if(p.test(e)){c=document.createDocumentFragment();for(var f=0;1;){p.lastIndex=f;var h=p.exec(e),g=h?h.index-f:e.length-f;if(g){var v=document.createTextNode(u.slice(f,f+g));s&&a<9?c.appendChild(A("span",[v])):c.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!h)break;f+=g+1;var y=void 0;if("\t"==h[0]){var m=t.cm.options.tabSize,b=m-t.col%m;(y=c.appendChild(A("span",X(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),t.col+=b}else"\r"==h[0]||"\n"==h[0]?((y=c.appendChild(A("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),t.col+=1):((y=t.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),s&&a<9?c.appendChild(A("span",[y])):c.appendChild(y),t.col+=1);t.map.push(t.pos,t.pos+1,y),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),s&&a<9&&(d=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||o||r||d||i||l){var _=n||"";o&&(_+=o),r&&(_+=r);var w=A("span",[c],_,i);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&w.setAttribute(x,l[x]);return t.content.appendChild(w)}t.content.appendChild(c)}}function wn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,o="",r=0;rc&&p.from<=c);d++);if(p.to>=u)return t(n,o,r,i,s,a,l);t(n,o.slice(0,p.to-c),r,i,null,a,l),i=null,o=o.slice(p.to-c),c=p.to}}}function Cn(t,e,n,o){var r=!o&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!o&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function Sn(t,e,n){var o=t.markedSpans,r=t.text,i=0;if(o)for(var s,a,l,c,u,p,d,f=r.length,h=0,g=1,v="",y=0;;){if(y==h){l=c=u=a="",d=null,p=null,y=1/0;for(var m=[],b=void 0,_=0;_h||x.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&y>w.to&&(y=w.to,c=""),x.className&&(l+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&w.from==h&&(u+=" "+x.startStyle),x.endStyle&&w.to==y&&(b||(b=[])).push(x.endStyle,w.to),x.title&&((d||(d={})).title=x.title),x.attributes)for(var C in x.attributes)(d||(d={}))[C]=x.attributes[C];x.collapsed&&(!p||Ye(p.marker,x)<0)&&(p=w)}else w.from>h&&y>w.from&&(y=w.from)}if(b)for(var S=0;S=f)break;for(var T=Math.min(f,y);1;){if(v){var k=h+v.length;if(!p){var E=k>T?v.slice(0,T-h):v;e.addToken(e,E,s?s+l:l,u,h+E.length==y?c:"",a,d)}if(k>=T){v=v.slice(T-h),h=T;break}h=k,u=""}v=r.slice(i,i=n[g++]),s=yn(n[g++],e.cm.options)}}else for(var P=1;P2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}function eo(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var o=0;on)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}}function no(t,e){var n=re(e=en(e)),o=t.display.externalMeasured=new On(t.doc,e,n);o.lineN=n;var r=o.built=mn(t,o);return o.text=r.pre,P(t.display.lineMeasure,r.pre),o}function oo(t,e,n,o){return so(t,io(t,e),n,o)}function ro(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(r=(i=l-a)-1,e>=l&&(s="right")),null!=r){if(o=t[c+2],a==l&&n==(o.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)o=t[(c-=3)+2],s="left";if("right"==n&&r==l-a)for(;c=0&&(n=t[r]).left==n.right;r--);return n}function po(t,e,n,o){var r,i=co(e.map,n,o),l=i.node,c=i.start,u=i.end,p=i.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&<(e.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u0&&(p=o="right"),r=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==o?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!c&&(!r||!r.left&&!r.right)){var h=l.parentNode.getClientRects()[0];r=h?{left:h.left,right:h.left+Do(t.display),top:h.top,bottom:h.bottom}:lo}for(var g=r.top-e.rect.top,v=r.bottom-e.rect.top,y=(g+v)/2,m=e.view.measure.heights,b=0;b=o.text.length?(l=o.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return s("before"==c?l-1:l,"before"==c);function u(t,e,n){return s(n?t-1:t,1==a[e].level!=n)}var p=ft(a,l,c),d=dt,f=u(l,p,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function So(t,e){var n=0;e=ge(t.doc,e),t.options.lineWrapping||(n=Do(t.display)*e.ch);var o=te(t.doc,e.line),r=cn(o)+Kn(t.display);return{left:n,right:n,top:r,bottom:r+o.height}}function Oo(t,e,n,o,r){var i=le(t,e,n);return i.xRel=r,o&&(i.outside=o),i}function To(t,e,n){var o=t.doc;if((n+=t.display.viewOffset)<0)return Oo(o.first,0,null,-1,-1);var r=ie(o,n),i=o.first+o.size-1;if(r>i)return Oo(o.first+o.size-1,te(o,i).text.length,null,1,1);e<0&&(e=0);for(var s=te(o,r);;){var a=Ao(t,s,r,e,n),l=Qe(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==r)return c;s=te(o,r=c.line)}}function ko(t,e,n,o){o-=bo(e);var r=e.text.length,i=ut((function(e){return so(t,n,e-1).bottom<=o}),r,0);return{begin:i,end:r=ut((function(e){return so(t,n,e).top>o}),i,r)}}function Eo(t,e,n,o){return n||(n=io(t,e)),ko(t,e,n,_o(t,e,so(t,n,o),"line").top)}function Po(t,e,n,o){return!(t.bottom<=n)&&(t.top>n||(o?t.left:t.right)>e)}function Ao(t,e,n,o,r){r-=cn(e);var i=io(t,e),s=bo(e),a=0,l=e.text.length,c=!0,u=gt(e,t.doc.direction);if(u){var p=(t.options.lineWrapping?Mo:jo)(t,e,n,i,u,o,r);a=(c=1!=p.level)?p.from:p.to-1,l=c?p.to:p.from-1}var d,f,h=null,g=null,v=ut((function(e){var n=so(t,i,e);return n.top+=s,n.bottom+=s,!!Po(n,o,r,!1)&&(n.top<=r&&n.left<=o&&(h=e,g=n),!0)}),a,l),y=!1;if(g){var m=o-g.left=_.bottom?1:0}return Oo(n,v=ct(e.text,v,1),f,y,o-d)}function jo(t,e,n,o,r,i,s){var a=ut((function(a){var l=r[a],c=1!=l.level;return Po(Co(t,le(n,c?l.to:l.from,c?"before":"after"),"line",e,o),i,s,!0)}),0,r.length-1),l=r[a];if(a>0){var c=1!=l.level,u=Co(t,le(n,c?l.from:l.to,c?"after":"before"),"line",e,o);Po(u,i,s,!0)&&u.top>s&&(l=r[a-1])}return l}function Mo(t,e,n,o,r,i,s){var a=ko(t,e,o,s),l=a.begin,c=a.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,p=null,d=0;d=c||f.to<=l)){var h=so(t,o,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=hg)&&(u=f,p=g)}}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Lo(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ao){ao=A("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ao.appendChild(document.createTextNode("x")),ao.appendChild(A("br"));ao.appendChild(document.createTextNode("x"))}P(t.measure,ao);var n=ao.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),E(t.measure),n||1}function Do(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=A("span","xxxxxxxxxx"),n=A("pre",[e],"CodeMirror-line-like");P(t.measure,n);var o=e.getBoundingClientRect(),r=(o.right-o.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function No(t){for(var e=t.display,n={},o={},r=e.gutters.clientLeft,i=e.gutters.firstChild,s=0;i;i=i.nextSibling,++s){var a=t.display.gutterSpecs[s].className;n[a]=i.offsetLeft+i.clientLeft+r,o[a]=i.clientWidth}return{fixedPos:Io(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:o,wrapperWidth:e.wrapper.clientWidth}}function Io(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Fo(t){var e=Lo(t.display),n=t.options.lineWrapping,o=n&&Math.max(5,t.display.scroller.clientWidth/Do(t.display)-3);return function(r){if(an(t.doc,r))return 0;var i=0;if(r.widgets)for(var s=0;s0&&(l=te(t.doc,c.line).text).length==c.ch){var u=z(l,l.length,t.options.tabSize)-l.length;c=le(c.line,Math.max(0,Math.round((i-Zn(t.display).left)/Do(t.display))-u))}return c}function Ho(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,o=0;oe)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)Le&&rn(t.doc,e)r.viewFrom?Uo(t):(r.viewFrom+=o,r.viewTo+=o);else if(e<=r.viewFrom&&n>=r.viewTo)Uo(t);else if(e<=r.viewFrom){var i=Wo(t,n,n+o,1);i?(r.view=r.view.slice(i.index),r.viewFrom=i.lineN,r.viewTo+=o):Uo(t)}else if(n>=r.viewTo){var s=Wo(t,e,e,-1);s?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):Uo(t)}else{var a=Wo(t,e,e,-1),l=Wo(t,n,n+o,1);a&&l?(r.view=r.view.slice(0,a.index).concat(Tn(t,a.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=o):Uo(t)}var c=r.externalMeasured;c&&(n=r.lineN&&e=o.viewTo)){var i=o.view[Ho(t,e)];if(null!=i.node){var s=i.changes||(i.changes=[]);-1==U(s,n)&&s.push(n)}}}function Uo(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Wo(t,e,n,o){var r,i=Ho(t,e),s=t.display.view;if(!Le||n==t.doc.first+t.doc.size)return{index:i,lineN:n};for(var a=t.display.viewFrom,l=0;l0){if(i==s.length-1)return null;r=a+s[i].size-e,i++}else r=a-e;e+=r,n+=r}for(;rn(t.doc,n)!=n;){if(i==(o<0?0:s.length-1))return null;n+=o*s[i-(o<0?1:0)].size,i+=o}return{index:i,lineN:n}}function $o(t,e,n){var o=t.display;0==o.view.length||e>=o.viewTo||n<=o.viewFrom?(o.view=Tn(t,e,n),o.viewFrom=e):(o.viewFrom>e?o.view=Tn(t,e,o.viewFrom).concat(o.view):o.viewFromn&&(o.view=o.view.slice(0,Ho(t,n)))),o.viewTo=n}function qo(t){for(var e=t.display.view,n=0,o=0;o=t.display.viewTo||l.to().line0?s:t.defaultCharWidth())+"px"}if(o.other){var a=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=o.other.left+"px",a.style.top=o.other.top+"px",a.style.height=.85*(o.other.bottom-o.other.top)+"px"}}function Zo(t,e){return t.top-e.top||t.left-e.left}function Xo(t,e,n){var o=t.display,r=t.doc,i=document.createDocumentFragment(),s=Zn(t.display),a=s.left,l=Math.max(o.sizerWidth,Jn(t)-o.sizer.offsetLeft)-s.right,c="ltr"==r.direction;function u(t,e,n,o){e<0&&(e=0),e=Math.round(e),o=Math.round(o),i.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(o-e)+"px"))}function p(e,n,o){var i,s,p=te(r,e),d=p.text.length;function f(n,o){return xo(t,le(e,n),"div",p,o)}function h(e,n,o){var r=Eo(t,p,null,e),i="ltr"==n==("after"==o)?"left":"right";return f("after"==o?r.begin:r.end-(/\s/.test(p.text.charAt(r.end-1))?2:1),i)[i]}var g=gt(p,r.direction);return pt(g,n||0,null==o?d:o,(function(t,e,r,p){var v="ltr"==r,y=f(t,v?"left":"right"),m=f(e-1,v?"right":"left"),b=null==n&&0==t,_=null==o&&e==d,w=0==p,x=!g||p==g.length-1;if(m.top-y.top<=3){var C=(c?_:b)&&x,S=(c?b:_)&&w?a:(v?y:m).left,O=C?l:(v?m:y).right;u(S,y.top,O-S,y.bottom)}else{var T,k,E,P;v?(T=c&&b&&w?a:y.left,k=c?l:h(t,r,"before"),E=c?a:h(e,r,"after"),P=c&&_&&x?l:m.right):(T=c?h(t,r,"before"):a,k=!c&&b&&w?l:y.right,E=!c&&_&&x?a:m.left,P=c?h(e,r,"after"):l),u(T,y.top,k-T,y.bottom),y.bottom0?e.blinker=setInterval((function(){t.hasFocus()||nr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Qo(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||er(t))}function tr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&nr(t))}),100)}function er(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(_t(t,"focus",t,e),t.state.focused=!0,D(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()),Jo(t))}function nr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(_t(t,"blur",t,e),t.state.focused=!1,k(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function or(t){for(var e=t.display,n=e.lineDiv.offsetTop,o=Math.max(0,e.scroller.getBoundingClientRect().top),r=e.lineDiv.getBoundingClientRect().top,i=0,l=0;l.005||g<-.005)&&(rt.display.sizerWidth){var y=Math.ceil(d/Do(t.display));y>t.display.maxLineLength&&(t.display.maxLineLength=y,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(e.scroller.scrollTop+=i)}function rr(t){if(t.widgets)for(var e=0;e=s&&(i=ie(e,cn(te(e,l))-t.wrapper.clientHeight),s=l)}return{from:i,to:Math.max(s,i+1)}}function sr(t,e){if(!wt(t,"scrollCursorIntoView")){var n=t.display,o=n.sizer.getBoundingClientRect(),r=null,i=n.wrapper.ownerDocument;if(e.top+o.top<0?r=!0:e.bottom+o.top>(i.defaultView.innerHeight||i.documentElement.clientHeight)&&(r=!1),null!=r&&!g){var s=A("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Kn(t.display))+"px;\n height: "+(e.bottom-e.top+Xn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(s),s.scrollIntoView(r),t.display.lineSpace.removeChild(s)}}}function ar(t,e,n,o){var r;null==o&&(o=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?le(e.line,e.ch+1,"before"):e,e=e.ch?le(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var i=0;i<5;i++){var s=!1,a=Co(t,e),l=n&&n!=e?Co(t,n):a,c=cr(t,r={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-o,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+o}),u=t.doc.scrollTop,p=t.doc.scrollLeft;if(null!=c.scrollTop&&(vr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(s=!0)),null!=c.scrollLeft&&(mr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-p)>1&&(s=!0)),!s)break}return r}function lr(t,e){var n=cr(t,e);null!=n.scrollTop&&vr(t,n.scrollTop),null!=n.scrollLeft&&mr(t,n.scrollLeft)}function cr(t,e){var n=t.display,o=Lo(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,i=Qn(t),s={};e.bottom-e.top>i&&(e.bottom=e.top+i);var a=t.doc.height+Yn(n),l=e.topa-o;if(e.topr+i){var u=Math.min(e.top,(c?a:e.bottom)-i);u!=r&&(s.scrollTop=u)}var p=t.options.fixedGutter?0:n.gutters.offsetWidth,d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-p,f=Jn(t)-n.gutters.offsetWidth,h=e.right-e.left>f;return h&&(e.right=e.left+f),e.left<10?s.scrollLeft=0:e.leftf+d-3&&(s.scrollLeft=e.right+(h?0:10)-f),s}function ur(t,e){null!=e&&(hr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function pr(t){hr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function dr(t,e,n){null==e&&null==n||hr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function fr(t,e){hr(t),t.curOp.scrollToPos=e}function hr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,gr(t,So(t,e.from),So(t,e.to),e.margin))}function gr(t,e,n,o){var r=cr(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-o,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+o});dr(t,r.scrollLeft,r.scrollTop)}function vr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Gr(t,{top:e}),yr(t,e,!0),n&&Gr(t),Rr(t,100))}function yr(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 mr(t,e,n,o){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)&&!o||(t.doc.scrollLeft=e,Xr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function br(t){var e=t.display,n=e.gutters.offsetWidth,o=Math.round(t.doc.height+Yn(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:o,scrollHeight:o+Xn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var _r=function(t,e,n){this.cm=n;var o=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");o.tabIndex=r.tabIndex=-1,t(o),t(r),yt(o,"scroll",(function(){o.clientHeight&&e(o.scrollTop,"vertical")})),yt(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};_r.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,o=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?o+"px":"0";var r=t.viewHeight-(e?o:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"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?o+"px":"0",this.horiz.style.left=t.barLeft+"px";var i=t.viewWidth-t.barLeft-(n?o:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?o:0,bottom:e?o:0}},_r.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},_r.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},_r.prototype.zeroWidthHack=function(){var t=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new B,this.disableVert=new B},_r.prototype.enableZeroWidthBar=function(t,e,n){function o(){var r=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=t?t.style.visibility="hidden":e.set(1e3,o)}t.style.visibility="",e.set(1e3,o)},_r.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var wr=function(){};function xr(t,e){e||(e=br(t));var n=t.display.barWidth,o=t.display.barHeight;Cr(t,e);for(var r=0;r<4&&n!=t.display.barWidth||o!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&or(t),Cr(t,br(t)),n=t.display.barWidth,o=t.display.barHeight}function Cr(t,e){var n=t.display,o=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=o.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=o.bottom)+"px",n.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=o.bottom+"px",n.scrollbarFiller.style.width=o.right+"px"):n.scrollbarFiller.style.display="",o.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=o.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};var Sr={native:_r,null:wr};function Or(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&k(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Sr[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),yt(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?mr(t,e):vr(t,e)}),t),t.display.scrollbars.addClass&&D(t.display.wrapper,t.display.scrollbars.addClass)}var Tr=0;function kr(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:++Tr,markArrays:null},En(t.curOp)}function Er(t){var e=t.curOp;e&&An(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new zr(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function jr(t){t.updatedDisplay=t.mustUpdate&&$r(t.cm,t.update)}function Mr(t){var e=t.cm,n=e.display;t.updatedDisplay&&or(e),t.barMeasure=br(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=oo(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+Xn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Jn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Lr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,o=xe(t,e.highlightFrontier),r=[];e.iter(o.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(i){if(o.line>=t.display.viewFrom){var s=i.styles,a=i.text.length>t.options.maxHighlightLength?Zt(e.mode,o.state):null,l=_e(t,i,o,!0);a&&(o.state=a),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var p=!s||s.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!p&&dn)return Rr(t,t.options.workDelay),!0})),e.highlightFrontier=o.line,e.modeFrontier=Math.max(e.modeFrontier,o.line),r.length&&Nr(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==qo(t))return!1;Jr(t)&&(Uo(t),e.dims=No(t));var r=o.first+o.size,i=Math.max(e.visible.from-t.options.viewportMargin,o.first),s=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),Le&&(i=rn(t.doc,i),s=sn(t.doc,s));var a=i!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;$o(t,i,s),n.viewOffset=cn(te(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=qo(t);if(!a&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Ur(t);return l>4&&(n.lineDiv.style.display="none"),Kr(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Wr(c),E(n.cursorDiv),E(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Rr(t,400)),n.updateLineNumbers=null,!0}function qr(t,e){for(var n=e.viewport,o=!0;;o=!1){if(o&&t.options.lineWrapping&&e.oldDisplayWidth!=Jn(t))o&&(e.visible=ir(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Yn(t.display)-Qn(t),n.top)}),e.visible=ir(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!$r(t,e))break;or(t);var r=br(t);Go(t),xr(t,r),Zr(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Gr(t,e){var n=new zr(t,e);if($r(t,n)){or(t),qr(t,n);var o=br(t);Go(t),xr(t,o),Zr(t,o),n.finish()}}function Kr(t,e,n){var o=t.display,r=t.options.lineNumbers,i=o.lineDiv,s=i.firstChild;function a(e){var n=e.nextSibling;return l&&b&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=o.view,u=o.viewFrom,p=0;p-1&&(f=!1),Dn(t,d,u,n)),f&&(E(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(ae(t.options,u)))),s=d.node.nextSibling}else{var h=Bn(t,d,u,n);i.insertBefore(h,s)}u+=d.size}for(;s;)s=a(s)}function Yr(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",Mn(t,"gutterChanged",t)}function Zr(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+Xn(t)+"px"}function Xr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var o=Io(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,i=o+"px",s=0;s=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute('translate','no'),s&&a<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&m||(i.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(i.wrapper):t(i.wrapper)),i.viewFrom=i.viewTo=e.first,i.reportedViewFrom=i.reportedViewTo=e.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Qr(r.gutters,r.lineNumbers),ti(i),o.init(i)}zr.prototype.signal=function(t,e){Ct(t,e)&&this.events.push(arguments)},zr.prototype.finish=function(){for(var t=0;tc.clientWidth,h=c.scrollHeight>c.clientHeight;if(r&&f||i&&h){if(i&&b&&l)t:for(var g=e.target,v=a.view;g!=c;g=g.parentNode)for(var y=0;y=0&&ce(t,o.to())<=0)return n}return-1};var ci=function(t,e){this.anchor=t,this.head=e};function ui(t,e,n){var o=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return ce(t.from(),e.from())})),n=U(e,r);for(var i=1;i0:l>=0){var c=fe(a.from(),s.from()),u=de(a.to(),s.to()),p=a.empty()?s.from()==s.head:a.from()==a.head;i<=n&&--n,e.splice(--i,2,new ci(p?u:c,p?c:u))}}return new li(e,n)}function pi(t,e){return new li([new ci(t,e||t)],0)}function di(t){return t.text?le(t.from.line+t.text.length-1,J(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function fi(t,e){if(ce(t,e.from)<0)return t;if(ce(t,e.to)<=0)return di(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,o=t.ch;return t.line==e.to.line&&(o+=di(e).ch-e.to.ch),le(n,o)}function hi(t,e){for(var n=[],o=0;o1&&t.remove(a.line+1,h-1),t.insert(a.line+1,y)}Mn(t,"change",t,e)}function wi(t,e,n){function o(t,r,i){if(t.linked)for(var s=0;s1&&!t.done[t.done.length-2].ranges?(t.done.pop(),J(t.done)):void 0}function Pi(t,e,n,o){var r=t.history;r.undone.length=0;var i,s,a=+new Date;if((r.lastOp==o||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(i=Ei(r,r.lastOp==o)))s=J(i.changes),0==ce(e.from,e.to)&&0==ce(e.from,s.to)?s.to=di(e):i.changes.push(Ti(t,e));else{var l=J(r.done);for(l&&l.ranges||Mi(t.sel,r.done),i={changes:[Ti(t,e)],generation:r.generation},r.done.push(i);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=o,r.lastOrigin=r.lastSelOrigin=e.origin,s||_t(t,"historyAdded")}function Ai(t,e,n,o){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==o.ranges.length&&n.somethingSelected()==o.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function ji(t,e,n,o){var r=t.history,i=o&&o.origin;n==r.lastSelOp||i&&r.lastSelOrigin==i&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==i||Ai(t,i,J(r.done),e))?r.done[r.done.length-1]=e:Mi(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=i,r.lastSelOp=n,o&&!1!==o.clearRedo&&ki(r.undone)}function Mi(t,e){var n=J(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Li(t,e,n,o){var r=e["spans_"+t.id],i=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,o),(function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[i]=n.markedSpans),++i}))}function Di(t){if(!t)return null;for(var e,n=0;n-1&&(J(a)[p]=c[p],delete c[p])}}}return o}function Vi(t,e,n,o){if(o){var r=t.anchor;if(n){var i=ce(e,r)<0;i!=ce(n,r)<0?(r=e,e=n):i!=ce(e,n)<0&&(e=n)}return new ci(r,e)}return new ci(n||e,e)}function Ri(t,e,n,o,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),$i(t,new li([Vi(t.sel.primary(),e,n,r)],0),o)}function Hi(t,e,n){for(var o=[],r=t.cm&&(t.cm.display.shift||t.extend),i=0;i=e.ch:a.to>e.ch))){if(r&&(_t(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var p=l.find(o<0?1:-1),d=void 0;if((o<0?u:c)&&(p=Ji(t,p,-o,p&&p.line==e.line?i:null)),p&&p.line==e.line&&(d=ce(p,n))&&(o<0?d<0:d>0))return Zi(t,p,e,o,r)}var f=l.find(o<0?-1:1);return(o<0?c:u)&&(f=Ji(t,f,o,f.line==e.line?i:null)),f?Zi(t,f,e,o,r):null}}return e}function Xi(t,e,n,o,r){var i=o||1,s=Zi(t,e,n,i,r)||!r&&Zi(t,e,n,i,!0)||Zi(t,e,n,-i,r)||!r&&Zi(t,e,n,-i,!0);return s||(t.cantEdit=!0,le(t.first,0))}function Ji(t,e,n,o){return n<0&&0==e.ch?e.line>t.first?ge(t,le(e.line-1)):null:n>0&&e.ch==(o||te(t,e.line)).text.length?e.line=0;--r)ns(t,{from:o[r].from,to:o[r].to,text:r?[""]:e.text,origin:e.origin});else ns(t,e)}}function ns(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ce(e.from,e.to)){var n=hi(t,e);Pi(t,e,n,t.cm?t.cm.curOp.id:NaN),is(t,e,n,Be(t,e));var o=[];wi(t,(function(t,n){n||-1!=U(o,t.history)||(us(t.history,e),o.push(t.history)),is(t,e,null,Be(t,e))}))}}function os(t,e,n){var o=t.cm&&t.cm.state.suppressEdits;if(!o||n){for(var r,i=t.history,s=t.sel,a="undo"==e?i.done:i.undone,l="undo"==e?i.undone:i.done,c=0;c=0;--f){var h=d(f);if(h)return h.v}}}}function rs(t,e){if(0!=e&&(t.first+=e,t.sel=new li(Q(t.sel.ranges,(function(t){return new ci(le(t.anchor.line+e,t.anchor.ch),le(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){zo(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,o=n.viewFrom;ot.lastLine())){if(e.from.linei&&(e={from:e.from,to:le(i,te(t,i).text.length),text:[e.text[0]],origin:e.origin}),e.removed=ee(t,e.from,e.to),n||(n=hi(t,e)),t.cm?ss(t.cm,e,o):_i(t,e,o),qi(t,n,q),t.cantEdit&&Xi(t,le(t.firstLine(),0))&&(t.cantEdit=!1)}}function ss(t,e,n){var o=t.doc,r=t.display,i=e.from,s=e.to,a=!1,l=i.line;t.options.lineWrapping||(l=re(en(te(o,i.line))),o.iter(l,s.line+1,(function(t){if(t==r.maxLine)return a=!0,!0}))),o.sel.contains(e.from,e.to)>-1&&xt(t),_i(o,e,n,Fo(t)),t.options.lineWrapping||(o.iter(l,i.line+e.text.length,(function(t){var e=un(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,a=!1)})),a&&(t.curOp.updateMaxLine=!0)),je(o,i.line),Rr(t,400);var c=e.text.length-(s.line-i.line)-1;e.full?zo(t):i.line!=s.line||1!=e.text.length||bi(t.doc,e)?zo(t,i.line,s.line+1,c):Bo(t,i.line,"text");var u=Ct(t,"changes"),p=Ct(t,"change");if(p||u){var d={from:i,to:s,text:e.text,removed:e.removed,origin:e.origin};p&&Mn(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}function as(t,e,n,o,r){var i;o||(o=n),ce(o,n)<0&&(n=(i=[o,n])[0],o=i[1]),"string"==typeof e&&(e=t.splitLines(e)),es(t,{from:n,to:o,text:e,origin:r})}function ls(t,e,n,o){n1||!(this.children[0]instanceof ds))){var a=[];this.collapse(a),this.children=[new ds(a)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var s=r.lines.length%25+25,a=s;a10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var o=0;o0||0==s&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=j("span",[i.replacedWith],"CodeMirror-widget"),o.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),o.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(tn(t,e.line,e,n,i)||e.line!=n.line&&tn(t,n.line,e,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ne()}i.addToHistory&&Pi(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(o){c&&i.collapsed&&!c.options.lineWrapping&&en(o)==c.display.maxLine&&(a=!0),i.collapsed&&l!=e.line&&oe(o,0),Re(o,new Ie(i,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),i.collapsed&&t.iter(e.line,n.line+1,(function(e){an(t,e)&&oe(e,0)})),i.clearOnEnter&&yt(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(De(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),i.collapsed&&(i.id=++ys,i.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),i.collapsed)zo(c,e.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=e.line;u<=n.line;u++)Bo(c,u,"text");i.atomic&&Ki(c.doc),Mn(c,"markerAdded",c,i)}return i}ms.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&kr(t),Ct(this,"clear")){var n=this.find();n&&Mn(this,"clear",n.from,n.to)}for(var o=null,r=null,i=0;it.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=o&&t&&this.collapsed&&zo(t,o,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Ki(t.doc)),t&&Mn(t,"markerCleared",t,this,o,r),e&&Er(t),this.parent&&this.parent.clear()}},ms.prototype.find=function(t,e){var n,o;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)es(this,o[l]);a?Wi(this,a):this.cm&&pr(this.cm)})),undo:Vr((function(){os(this,"undo")})),redo:Vr((function(){os(this,"redo")})),undoSelection:Vr((function(){os(this,"undo",!0)})),redoSelection:Vr((function(){os(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,o=0;o=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=ge(this,t),e=ge(this,e);var o=[],r=t.line;return this.iter(t.line,e.line+1,(function(i){var s=i.markedSpans;if(s)for(var a=0;a=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||o.push(l.marker.parent||l.marker)}++r})),o},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var o=0;ot)return e=t,!0;t-=i,++n})),ge(this,le(n,e))},indexFromPos:function(t){var e=(t=ge(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var p=t.dataTransfer.getData("Text");if(p){var d;if(e.state.draggingText&&!e.state.draggingText.copy&&(d=e.listSelections()),qi(e.doc,pi(n,n)),d)for(var f=0;f=0;e--)as(t.doc,"",o[e].from,o[e].to,"+delete");pr(t)}))}function Zs(t,e,n){var o=ct(t.text,e+n,n);return o<0||o>t.text.length?null:o}function Xs(t,e,n){var o=Zs(t,e.ch,n);return null==o?null:new le(e.line,o,n<0?"after":"before")}function Js(t,e,n,o,r){if(t){"rtl"==e.doc.direction&&(r=-r);var i=gt(n,e.doc.direction);if(i){var s,a=r<0?J(i):i[0],l=r<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var c=io(e,n);s=r<0?n.text.length-1:0;var u=so(e,c,s).top;s=ut((function(t){return so(e,c,t).top==u}),r<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Zs(n,s,1))}else s=r<0?a.to:a.from;return new le(o,s,l)}}return new le(o,r<0?n.text.length:0,r<0?"before":"after")}function Qs(t,e,n,o){var r=gt(e,t.doc.direction);if(!r)return Xs(e,n,o);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=ft(r,n.ch,n.sticky),s=r[i];if("ltr"==t.doc.direction&&s.level%2==0&&(o>0?s.to>n.ch:s.from=s.from&&d>=u.begin)){var f=p?"before":"after";return new le(n.line,d,f)}}var h=function(t,e,o){for(var i=function(t,e){return e?new le(n.line,l(t,1),"before"):new le(n.line,t,"after")};t>=0&&t0==(1!=s.level),c=a?o.begin:l(o.end,-1);if(s.from<=c&&c0?u.end:l(u.begin,-1);return null==v||o>0&&v==e.text.length||!(g=h(o>0?0:r.length-1,o,c(v)))?null:g}zs.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"},zs.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"},zs.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"},zs.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"]},zs["default"]=b?zs.macDefault:zs.pcDefault;var ta={selectAll:Qi,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),q)},killLine:function(t){return Ys(t,(function(e){if(e.empty()){var n=te(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new le(r.line,r.ch+1),t.replaceRange(i.charAt(r.ch-1)+i.charAt(r.ch-2),le(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var s=te(t.doc,r.line-1).text;s&&(r=new le(r.line,1),t.replaceRange(i.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),le(r.line-1,s.length-1),r,"+transpose"))}n.push(new ci(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return Nr(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 o=0;o-1&&(ce((r=a.ranges[r]).from(),e)<0||e.xRel>0)&&(ce(r.to(),e)>0||e.xRel<0)?Oa(t,o,e,i):ka(t,o,e,i)}function Oa(t,e,n,o){var r=t.display,i=!1,c=Ir(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:tr(t)),bt(r.wrapper.ownerDocument,"mouseup",c),bt(r.wrapper.ownerDocument,"mousemove",u),bt(r.scroller,"dragstart",p),bt(r.scroller,"drop",c),i||(Ot(e),o.addNew||Ri(t.doc,n,null,null,o.extend),l&&!f||s&&9==a?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(t){i=i||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},p=function(){return i=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!o.moveOnDrag,yt(r.wrapper.ownerDocument,"mouseup",c),yt(r.wrapper.ownerDocument,"mousemove",u),yt(r.scroller,"dragstart",p),yt(r.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}function Ta(t,e,n){if("char"==n)return new ci(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ci(le(e.line,0),ge(t.doc,le(e.line+1,0)));var o=n(t,e);return new ci(o.from,o.to)}function ka(t,e,n,o){s&&tr(t);var r=t.display,i=t.doc;Ot(e);var a,l,c=i.sel,u=c.ranges;if(o.addNew&&!o.extend?(l=i.sel.contains(n),a=l>-1?u[l]:new ci(n,n)):(a=i.sel.primary(),l=i.sel.primIndex),"rectangle"==o.unit)o.addNew||(a=new ci(n,n)),n=Ro(t,e,!0,!0),l=-1;else{var p=Ta(t,n,o.unit);a=o.extend?Vi(a,p.anchor,p.head,o.extend):p}o.addNew?-1==l?(l=u.length,$i(i,ui(t,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==o.unit&&!o.extend?($i(i,ui(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):zi(i,l,a,G):(l=0,$i(i,new li([a],0),G),c=i.sel);var d=n;function f(e){if(0!=ce(d,e))if(d=e,"rectangle"==o.unit){for(var r=[],s=t.options.tabSize,u=z(te(i,n.line).text,n.ch,s),p=z(te(i,e.line).text,e.ch,s),f=Math.min(u,p),h=Math.max(u,p),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var y=te(i,g).text,m=Y(y,f,s);f==h?r.push(new ci(le(g,m),le(g,m))):y.length>m&&r.push(new ci(le(g,m),le(g,Y(y,h,s))))}r.length||r.push(new ci(n,n)),$i(i,ui(t,c.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,_=a,w=Ta(t,e,o.unit),x=_.anchor;ce(w.anchor,x)>0?(b=w.head,x=fe(_.from(),w.anchor)):(b=w.anchor,x=de(_.to(),w.head));var C=c.ranges.slice(0);C[l]=Ea(t,new ci(ge(i,x),b)),$i(i,ui(t,C,l),G)}}var h=r.wrapper.getBoundingClientRect(),g=0;function v(e){var n=++g,s=Ro(t,e,!0,"rectangle"==o.unit);if(s)if(0!=ce(s,d)){t.curOp.focus=L(F(t)),f(s);var a=ir(r,i);(s.line>=a.to||s.lineh.bottom?20:0;l&&setTimeout(Ir(t,(function(){g==n&&(r.scroller.scrollTop+=l,v(e))})),50)}}function y(e){t.state.selectingText=!1,g=1/0,e&&(Ot(e),r.input.focus()),bt(r.wrapper.ownerDocument,"mousemove",m),bt(r.wrapper.ownerDocument,"mouseup",b),i.history.lastSelOrigin=null}var m=Ir(t,(function(t){0!==t.buttons&&At(t)?v(t):y(t)})),b=Ir(t,y);t.state.selectingText=b,yt(r.wrapper.ownerDocument,"mousemove",m),yt(r.wrapper.ownerDocument,"mouseup",b)}function Ea(t,e){var n=e.anchor,o=e.head,r=te(t.doc,n.line);if(0==ce(n,o)&&n.sticky==o.sticky)return e;var i=gt(r);if(!i)return e;var s=ft(i,n.ch,n.sticky),a=i[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,c=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==i.length)return e;if(o.line!=n.line)l=(o.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ft(i,o.ch,o.sticky),p=u-s||(o.ch-n.ch)*(1==a.level?-1:1);l=u==c-1||u==c?p<0:p>0}var d=i[c+(l?-1:0)],f=l==(1==d.level),h=f?d.from:d.to,g=f?"after":"before";return n.ch==h&&n.sticky==g?e:new ci(new le(n.line,h,g),o)}function Pa(t,e,n,o){var r,i;if(e.touches)r=e.touches[0].clientX,i=e.touches[0].clientY;else try{r=e.clientX,i=e.clientY}catch(t){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;o&&Ot(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(i>a.bottom||!Ct(t,n))return kt(e);i-=a.top-s.viewOffset;for(var l=0;l=r)return _t(t,n,t,ie(t.doc,i),t.display.gutterSpecs[l].className,e),kt(e)}}function Aa(t,e){return Pa(t,e,"gutterClick",!0)}function ja(t,e){Gn(t.display,e)||Ma(t,e)||wt(t,e,"contextmenu")||S||t.display.input.onContextMenu(e)}function Ma(t,e){return!!Ct(t,"gutterContextMenu")&&Pa(t,e,"gutterContextMenu",!1)}function La(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vo(t)}ba.prototype.compare=function(t,e,n){return this.time+ma>t&&0==ce(e,this.pos)&&n==this.button};var Da={toString:function(){return"CodeMirror.Init"}},Na={},Ia={};function Fa(t){var e=t.optionHandlers;function n(n,o,r,i){t.defaults[n]=o,r&&(e[n]=i?function(t,e,n){n!=Da&&r(t,e,n)}:r)}t.defineOption=n,t.Init=Da,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,yi(t)}),!0),n("indentUnit",2,yi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){mi(t),vo(t),zo(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],o=t.doc.first;t.doc.iter((function(t){for(var r=0;;){var i=t.text.indexOf(e,r);if(-1==i)break;r=i+e.length,n.push(le(o,i))}o++}));for(var r=n.length-1;r>=0;r--)as(t.doc,e,n[r],le(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Da&&t.refresh()})),n("specialCharPlaceholder",bn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("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",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){La(t),ei(t)}),!0),n("keyMap","default",(function(t,e,n){var o=Ks(e),r=n!=Da&&Ks(n);r&&r.detach&&r.detach(t,o),o.attach&&o.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ra,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Qr(e,t.options.lineNumbers),ei(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Io(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return xr(t)}),!0),n("scrollbarStyle","native",(function(t){Or(t),xr(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=Qr(t.options.gutters,e),ei(t)}),!0),n("firstLineNumber",1,ei,!0),n("lineNumberFormatter",(function(t){return t}),ei,!0),n("showCursorWhenSelecting",!1,Go,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(nr(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,Va),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Go,!0),n("singleCursorHeightPerLine",!0,Go,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mi,!0),n("addModeClass",!1,mi,!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,mi,!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 Va(t,e,n){if(!e!=!(n&&n!=Da)){var o=t.display.dragFunctions,r=e?yt:bt;r(t.display.scroller,"dragstart",o.start),r(t.display.scroller,"dragenter",o.enter),r(t.display.scroller,"dragover",o.over),r(t.display.scroller,"dragleave",o.leave),r(t.display.scroller,"drop",o.drop)}}function Ra(t){t.options.lineWrapping?(D(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(k(t.display.wrapper,"CodeMirror-wrap"),pn(t)),Vo(t),zo(t),vo(t),setTimeout((function(){return xr(t)}),100)}function Ha(t,e){var n=this;if(!(this instanceof Ha))return new Ha(t,e);this.options=e=e?H(e):{},H(Na,e,!1);var o=e.value;"string"==typeof o?o=new Ts(o,e.mode,null,e.lineSeparator,e.direction):e.mode&&(o.modeOption=e.mode),this.doc=o;var r=new Ha.inputStyles[e.inputStyle](this),i=this.display=new ni(t,o,r,e);for(var c in i.wrapper.CodeMirror=this,La(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Or(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 B,keySeq:null,specialChars:null},e.autofocus&&!m&&i.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),za(this),Ds(),kr(this),this.curOp.forceUpdate=!0,xi(this,o),e.autofocus&&!m||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&er(n)}),20):nr(this),Ia)Ia.hasOwnProperty(c)&&Ia[c](this,e[c],Da);Jr(this),e.finishInit&&e.finishInit(this);for(var u=0;u20*20}yt(e.scroller,"touchstart",(function(r){if(!wt(t,r)&&!i(r)&&!Aa(t,r)){e.input.ensurePolled(),clearTimeout(n);var s=+new Date;e.activeTouch={start:s,moved:!1,prev:s-o.end<=300?o:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}})),yt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),yt(e.scroller,"touchend",(function(n){var o=e.activeTouch;if(o&&!Gn(e,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var i,s=t.coordsChar(e.activeTouch,"page");i=!o.prev||l(o,o.prev)?new ci(s,s):!o.prev.prev||l(o,o.prev.prev)?t.findWordAt(s):new ci(le(s.line,0),ge(t.doc,le(s.line+1,0))),t.setSelection(i.anchor,i.head),t.focus(),Ot(n)}r()})),yt(e.scroller,"touchcancel",r),yt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(vr(t,e.scroller.scrollTop),mr(t,e.scroller.scrollLeft,!0),_t(t,"scroll",t))})),yt(e.scroller,"mousewheel",(function(e){return ai(t,e)})),yt(e.scroller,"DOMMouseScroll",(function(e){return ai(t,e)})),yt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){wt(t,e)||Et(e)},over:function(e){wt(t,e)||(As(t,e),Et(e))},start:function(e){return Ps(t,e)},drop:Ir(t,Es),leave:function(e){wt(t,e)||js(t)}};var c=e.input.getField();yt(c,"keyup",(function(e){return ha.call(t,e)})),yt(c,"keydown",Ir(t,da)),yt(c,"keypress",Ir(t,ga)),yt(c,"focus",(function(e){return er(t,e)})),yt(c,"blur",(function(e){return nr(t,e)}))}Ha.defaults=Na,Ha.optionHandlers=Ia;var Ba=[];function Ua(t,e,n,o){var r,i=t.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?r=xe(t,e).state:n="prev");var s=t.options.tabSize,a=te(i,e),l=z(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(o||/\S/.test(a.text)){if("smart"==n&&((c=i.mode.indent(r,a.text.slice(u.length),a.text))==$||c>150)){if(!o)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>i.first?z(te(i,e-1).text,null,s):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var p="",d=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/s);f;--f)d+=s,p+="\t";if(ds,l=Ft(e),c=null;if(a&&o.ranges.length>1)if(Wa&&Wa.text.join("\n")==e){if(o.ranges.length%Wa.text.length==0){c=[];for(var u=0;u=0;d--){var f=o.ranges[d],h=f.from(),g=f.to();f.empty()&&(n&&n>0?h=le(h.line,h.ch-n):t.state.overwrite&&!a?g=le(g.line,Math.min(te(i,g.line).text.length,g.ch+J(l).length)):a&&Wa&&Wa.lineWise&&Wa.text.join("\n")==l.join("\n")&&(h=g=le(h.line,0)));var v={from:h,to:g,text:c?c[d%c.length]:l,origin:r||(a?"paste":t.state.cutIncoming>s?"cut":"+input")};es(t.doc,v),Mn(t,"inputRead",t,v)}e&&!a&&Ka(t,e),pr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=p),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ga(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||!e.hasFocus()||Nr(e,(function(){return qa(e,n,0,null,"paste")})),!0}function Ka(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,o=n.ranges.length-1;o>=0;o--){var r=n.ranges[o];if(!(r.head.ch>100||o&&n.ranges[o-1].head.line==r.head.line)){var i=t.getModeAt(r.head),s=!1;if(i.electricChars){for(var a=0;a-1){s=Ua(t,r.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(te(t.doc,r.head.line).text.slice(0,r.head.ch))&&(s=Ua(t,r.head.line,"smart"));s&&Mn(t,"electricInput",t,r.head.line)}}}function Ya(t){for(var e=[],n=[],o=0;on&&(Ua(this,r.head.line,t,!0),n=r.head.line,o==this.doc.sel.primIndex&&pr(this));else{var i=r.from(),s=r.to(),a=Math.max(n,i.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l0&&zi(this.doc,o,new ci(i,c[o].to()),q)}}})),getTokenAt:function(t,e){return ke(this,t,e)},getLineTokens:function(t,e){return ke(this,le(t),e,!0)},getTokenTypeAt:function(t){t=ge(this.doc,t);var e,n=we(this,te(this.doc,t.line)),o=0,r=(n.length-1)/2,i=t.ch;if(0==i)e=n[2];else for(;;){var s=o+r>>1;if((s?n[2*s-1]:0)>=i)r=s;else{if(!(n[2*s+1]i&&(t=i,r=!0),o=te(this.doc,t)}else o=t;return _o(this,o,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-cn(o):0)},defaultTextHeight:function(){return Lo(this.display)},defaultCharWidth:function(){return Do(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,o,r){var i=this.display,s=(t=Co(this,ge(this.doc,t))).bottom,a=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),i.sizer.appendChild(e),"over"==o)s=t.top;else if("above"==o||"near"==o){var l=Math.max(i.wrapper.clientHeight,this.doc.height),c=Math.max(i.sizer.clientWidth,i.lineSpace.clientWidth);('above'==o||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?s=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(s=t.bottom),a+e.offsetWidth>c&&(a=c-e.offsetWidth)}e.style.top=s+"px",e.style.left=e.style.right="","right"==r?(a=i.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?a=0:"middle"==r&&(a=(i.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),n&&lr(this,{left:a,top:s,right:a+e.offsetWidth,bottom:s+e.offsetHeight})},triggerOnKeyDown:Fr(da),triggerOnKeyPress:Fr(ga),triggerOnKeyUp:ha,triggerOnMouseDown:Fr(wa),execCommand:function(t){if(ta.hasOwnProperty(t))return ta[t].call(null,this)},triggerElectric:Fr((function(t){Ka(this,t)})),findPosH:function(t,e,n,o){var r=1;e<0&&(r=-1,e=-e);for(var i=ge(this.doc,t),s=0;s0&&s(e.charAt(n-1));)--n;for(;o.5||this.options.lineWrapping)&&Vo(this),_t(this,"refresh",this)})),swapDoc:Fr((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),xi(this,t),vo(this),this.display.input.reset(),dr(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Mn(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}},St(t),t.registerHelper=function(e,o,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][o]=r},t.registerGlobalHelper=function(e,o,r,i){t.registerHelper(e,o,i),n[e]._global.push({pred:r,val:i})}}function Qa(t,e,n,o,r){var i=e,s=n,a=te(t,e.line),l=r&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new le(n,e.ch,e.sticky),a=te(t,n))}function u(i){var s;if("codepoint"==o){var u=a.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))s=null;else{var p=n>0?u>=55296&&u<56320:u>=56320&&u<57343;s=new le(e.line,Math.max(0,Math.min(a.text.length,e.ch+n*(p?2:1))),-n)}}else s=r?Qs(t.cm,a,e,n):Xs(a,e,n);if(null==s){if(i||!c())return!1;e=Js(r,t.cm,a,e.line,l)}else e=s;return!0}if("char"==o||"codepoint"==o)u();else if("column"==o)u(!0);else if("word"==o||"group"==o)for(var p=null,d="group"==o,f=t.cm&&t.cm.getHelper(e,"wordChars"),h=!0;!(n<0)||u(!h);h=!1){var g=a.text.charAt(e.ch)||"\n",v=it(g,f)?"w":d&&"\n"==g?"n":!d||/\s/.test(g)?null:"p";if(!d||h||v||(v="s"),p&&p!=v){n<0&&(n=1,u(),e.sticky="after");break}if(v&&(p=v),n>0&&!u(!h))break}var y=Xi(t,e,i,s,!0);return ue(i,y)&&(y.hitSide=!0),y}function tl(t,e,n,o){var r,i,s=t.doc,a=e.left;if("page"==o){var l=Math.min(t.display.wrapper.clientHeight,V(t).innerHeight||s(t).documentElement.clientHeight),c=Math.max(l-.5*Lo(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==o&&(r=n>0?e.bottom+3:e.top-3);for(;(i=To(t,a,r)).outside;){if(n<0?r<=0:r>=s.height){i.hitSide=!0;break}r+=5*n}return i}var el=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new B,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function nl(t,e){var n=ro(t,e.line);if(!n||n.hidden)return null;var o=te(t.doc,e.line),r=eo(n,o,e.line),i=gt(o,t.doc.direction),s="left";i&&(s=ft(i,e.ch)%2?"right":"left");var a=co(r.map,e.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function ol(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function rl(t,e){return e&&(t.bad=!0),t}function il(t,e,n,o,r){var i="",s=!1,a=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){s&&(i+=a,l&&(i+=a),s=l=!1)}function p(t){t&&(u(),i+=t)}function d(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void p(n);var i,f=e.getAttribute("cm-marker");if(f){var h=t.findMarks(le(o,0),le(r+1,0),c(+f));return void(h.length&&(i=h[0].find(0))&&p(ee(t.doc,i.from,i.to).join(a)))}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.display.viewTo||i.line=e.display.viewFrom&&nl(e,r)||{node:l[0].measure.map[2],offset:0},u=i.lineo.firstLine()&&(s=le(s.line-1,te(o.doc,s.line-1).length)),a.ch==te(o.doc,a.line).text.length&&a.liner.viewTo-1)return!1;s.line==r.viewFrom||0==(t=Ho(o,s.line))?(e=re(r.view[0].line),n=r.view[0].node):(e=re(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=Ho(o,a.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=re(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var p=o.doc.splitLines(il(o,n,c,e,l)),d=ee(o.doc,le(e,0),le(l,te(o.doc,l).text.length));p.length>1&&d.length>1;)if(J(p)==J(d))p.pop(),d.pop(),l--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),e++}for(var f=0,h=0,g=p[0],v=d[0],y=Math.min(g.length,v.length);fs.ch&&m.charCodeAt(m.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;p[p.length-1]=m.slice(0,m.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(f).replace(/\u200b+$/,"");var w=le(e,f),x=le(l,d.length?J(d).length-h:0);return p.length>1||p[0]||ce(w,x)?(as(o.doc,p,w,x,"+input"),!0):void 0},el.prototype.ensurePolled=function(){this.forceCompositionEnd()},el.prototype.reset=function(){this.forceCompositionEnd()},el.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},el.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))},el.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Nr(this.cm,(function(){return zo(t.cm)}))},el.prototype.setUneditable=function(t){t.contentEditable="false"},el.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Ir(this.cm,qa)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},el.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},el.prototype.onContextMenu=function(){},el.prototype.resetPosition=function(){},el.prototype.needsContentAttribute=!0;var ll=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new B,this.hasSelection=!1,this.composing=null,this.resetting=!1};function cl(t,e){if((e=e?H(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=L(t.ownerDocument);e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function o(){t.value=a.getValue()}var r;if(t.form&&(yt(t.form,"submit",o),!e.leaveSubmitMethodAlone)){var i=t.form;r=i.submit;try{var s=i.submit=function(){o(),i.submit=r,i.submit(),i.submit=s}}catch(t){}}e.finishInit=function(n){n.save=o,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,o(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(bt(t.form,"submit",o),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var a=Ha((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return a}function ul(t){t.off=bt,t.on=yt,t.wheelEventPixels=si,t.Doc=Ts,t.splitLines=Ft,t.countColumn=z,t.findColumn=Y,t.isWordChar=rt,t.Pass=$,t.signal=_t,t.Line=dn,t.changeEnd=di,t.scrollbarModel=Sr,t.Pos=le,t.cmpPos=ce,t.modes=Bt,t.mimeModes=Ut,t.resolveMode=qt,t.getMode=Gt,t.modeExtensions=Kt,t.extendMode=Yt,t.copyState=Zt,t.startState=Jt,t.innerMode=Xt,t.commands=ta,t.keyMap=zs,t.keyName=Gs,t.isModifierKey=$s,t.lookupKey=Ws,t.normalizeKeyMap=Us,t.StringStream=Qt,t.SharedTextMarker=_s,t.TextMarker=ms,t.LineWidget=hs,t.e_preventDefault=Ot,t.e_stopPropagation=Tt,t.e_stop=Et,t.addClass=D,t.contains=M,t.rmClass=k,t.keyNames=Fs}ll.prototype.init=function(t){var e=this,n=this,o=this.cm;this.createField(t);var r=this.textarea;function i(t){if(!wt(o,t)){if(o.somethingSelected())$a({lineWise:!1,text:o.getSelections()});else{if(!o.options.lineWiseCopyCut)return;var e=Ya(o);$a({lineWise:!0,text:e.text}),"cut"==t.type?o.setSelections(e.ranges,null,q):(n.prevInput="",r.value=e.text.join("\n"),I(r))}"cut"==t.type&&(o.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),v&&(r.style.width="0px"),yt(r,"input",(function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),yt(r,"paste",(function(t){wt(o,t)||Ga(t,o)||(o.state.pasteIncoming=+new Date,n.fastPoll())})),yt(r,"cut",i),yt(r,"copy",i),yt(t.scroller,"paste",(function(e){if(!Gn(t,e)&&!wt(o,e)){if(!r.dispatchEvent)return o.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=e.clipboardData,r.dispatchEvent(i)}})),yt(t.lineSpace,"selectstart",(function(e){Gn(t,e)||Ot(e)})),yt(r,"compositionstart",(function(){var t=o.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:o.markText(t,o.getCursor("to"),{className:"CodeMirror-composing"})}})),yt(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ll.prototype.createField=function(t){this.wrapper=Xa(),this.textarea=this.wrapper.firstChild;var e=this.cm.options;Za(this.textarea,e.spellcheck,e.autocorrect,e.autocapitalize)},ll.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute('aria-label',t):this.textarea.removeAttribute('aria-label')},ll.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,o=Ko(t);if(t.options.moveInputWithCursor){var r=Co(t,n.sel.primary().head,"div"),i=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();o.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+s.top-i.top)),o.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+s.left-i.left))}return o},ll.prototype.showSelection=function(t){var e=this.cm.display;P(e.cursorDiv,t.cursors),P(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},ll.prototype.reset=function(t){if(!(this.contextMenuPending||this.composing&&t)){var e=this.cm;if(this.resetting=!0,e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null));this.resetting=!1}},ll.prototype.getField=function(){return this.textarea},ll.prototype.supportsTouch=function(){return!1},ll.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||L(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(t){}},ll.prototype.blur=function(){this.textarea.blur()},ll.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ll.prototype.receivedFocus=function(){this.slowPoll()},ll.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},ll.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)},ll.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,o=this.prevInput;if(this.contextMenuPending||this.resetting||!e.state.focused||Vt(n)&&!o&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==o&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===r||b&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||o||(o="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(o.length,r.length);l1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ll.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ll.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},ll.prototype.onContextMenu=function(t){var e=this,n=e.cm,o=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var i=Ro(n,t),c=o.scroller.scrollTop;if(i&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&Ir(n,$i)(n.doc,pi(i),q);var u,p=r.style.cssText,f=e.wrapper.style.cssText,h=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-h.top-5)+"px; left: "+(t.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=r.ownerDocument.defaultView.scrollY),o.input.focus(),l&&r.ownerDocument.defaultView.scrollTo(null,u),o.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=y,o.selForContextMenu=n.doc.sel,clearTimeout(o.detectingSelectAll),s&&a>=9&&v(),S){Et(t);var g=function(){bt(window,"mouseup",g),setTimeout(y,20)};yt(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=r.selectionStart){var t=n.somethingSelected(),i="​"+(t?r.value:"");r.value="⇚",r.value=i,e.prevInput=t?"":"​",r.selectionStart=1,r.selectionEnd=i.length,o.selForContextMenu=n.doc.sel}}function y(){if(e.contextMenuPending==y&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,r.style.cssText=p,s&&a<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=c),null!=r.selectionStart)){(!s||s&&a<9)&&v();var t=0,i=function(){o.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==e.prevInput?Ir(n,Qi)(n):t++<10?o.detectingSelectAll=setTimeout(i,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(i,200)}}},ll.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},ll.prototype.setUneditable=function(){},ll.prototype.needsContentAttribute=!1,Fa(Ha),Ja(Ha);var pl="iter insert remove copy getEditor constructor".split(" ");for(var dl in Ts.prototype)Ts.prototype.hasOwnProperty(dl)&&U(pl,dl)<0&&(Ha.prototype[dl]=function(t){return function(){return t.apply(this.doc,arguments)}}(Ts.prototype[dl]));return St(Ts),Ha.inputStyles={textarea:ll,contenteditable:el},Ha.defineMode=function(t){Ha.defaults.mode||"null"==t||(Ha.defaults.mode=t),Wt.apply(this,arguments)},Ha.defineMIME=$t,Ha.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ha.defineMIME("text/plain","null"),Ha.defineExtension=function(t,e){Ha.prototype[t]=e},Ha.defineDocExtension=function(t,e){Ts.prototype[t]=e},Ha.fromTextArea=cl,ul(Ha),Ha.version="5.65.15",Ha}())},629:(t,e,n)=>{1&&function(t){"use strict";function e(t){for(var e={},n=0;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=O),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 S(t){return function(e,n){for(var o,r=!1;null!=(o=e.next());){if(o==t&&!r){")"==t&&e.backUp(1);break}r=!r&&"\\"==o}return(o==t||!r&&")"!=t)&&(n.tokenize=null),x("string","string")}}function O(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=S(")"),x(null,"(")}function T(t,e,n){this.type=t,this.indent=e,this.prev=n}function k(t,e,n,o){return t.context=new T(n,e.indentation()+(!1===o?0:s),t.context),n}function E(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function P(t,e,n){return M[n.context.type](t,e,n)}function A(t,e,n,o){for(var r=o||1;r>0;r--)n.context=n.context.prev;return P(t,e,n)}function j(t){var e=t.current().toLowerCase();i=y.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var M={top:function(t,e,n){if("{"==t)return k(n,e,"block");if("}"==t&&n.context.prev)return E(n);if(_&&/@component/i.test(t))return k(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return k(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return k(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 k(n,e,"at");if("hash"==t)i="builtin";else if("word"==t)i="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return k(n,e,"interpolation");if(":"==t)return"pseudo";if(m&&"("==t)return k(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var o=e.current().toLowerCase();return d.hasOwnProperty(o)?(i="property","maybeprop"):f.hasOwnProperty(o)?(i=w?"string-2":"property","maybeprop"):m?(i=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==t?"block":m||"hash"!=t&&"qualifier"!=t?M.top(t,e,n):(i="error","block")},maybeprop:function(t,e,n){return":"==t?k(n,e,"prop"):P(t,e,n)},prop:function(t,e,n){if(";"==t)return E(n);if("{"==t&&m)return k(n,e,"propBlock");if("}"==t||"{"==t)return A(t,e,n);if("("==t)return k(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)j(e);else if("interpolation"==t)return k(n,e,"interpolation")}else i+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?E(n):"word"==t?(i="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?A(t,e,n):")"==t?E(n):"("==t?k(n,e,"parens"):"interpolation"==t?k(n,e,"interpolation"):("word"==t&&j(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(i="variable-3",n.context.type):P(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(i="tag",n.context.type):M.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return k(n,e,"atBlock_parens");if("}"==t||";"==t)return A(t,e,n);if("{"==t)return E(n)&&k(n,e,m?"block":"top");if("interpolation"==t)return k(n,e,"interpolation");if("word"==t){var o=e.current().toLowerCase();i="only"==o||"not"==o||"and"==o||"or"==o?"keyword":c.hasOwnProperty(o)?"attribute":u.hasOwnProperty(o)?"property":p.hasOwnProperty(o)?"keyword":d.hasOwnProperty(o)?"property":f.hasOwnProperty(o)?w?"string-2":"property":y.hasOwnProperty(o)?"atom":v.hasOwnProperty(o)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?A(t,e,n):"{"==t?E(n)&&k(n,e,m?"block":"top",!1):("word"==t&&(i="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?E(n):"{"==t||"}"==t?A(t,e,n,2):M.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?k(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):P(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,E(n)):"word"==t?(i="@font-face"==n.stateArg&&!h.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?(i="variable","keyframes"):"{"==t?k(n,e,"top"):P(t,e,n)},at:function(t,e,n){return";"==t?E(n):"{"==t||"}"==t?A(t,e,n):("word"==t?i="tag":"hash"==t&&(i="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?E(n):"{"==t||";"==t?A(t,e,n):("word"==t?i="variable":"variable"!=t&&"("!=t&&")"!=t&&(i="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:o?"block":"top",stateArg:null,context:new T(o?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||C)(t,e);return n&&"object"==typeof n&&(r=n[1],n=n[0]),i=n,"comment"!=r&&(e.state=M[e.state](r,t,e)),i},indent:function(t,e){var n=t.context,o=e&&e.charAt(0),r=n.indent;return"prop"!=n.type||"}"!=o&&")"!=o||(n=n.prev),n.prev&&("}"!=o||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=o||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=o||"at"!=n.type&&"atBlock"!=n.type)||(r=Math.max(0,n.indent-s)):r=(n=n.prev).indent),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],o=e(n),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(r),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],a=e(s),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"],p=e(u),d=["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"],f=e(d),h=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"],y=e(v),m=["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(m),_=n.concat(r).concat(s).concat(l).concat(u).concat(d).concat(v).concat(m);function w(t,e){for(var n,o=!1;null!=(n=t.next());){if(o&&"/"==n){e.tokenize=null;break}o="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",_),t.defineMIME("text/css",{documentTypes:o,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=w,w(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:y,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=w,w(t,e)):["operator","operator"]},":":function(t){return!!t.match(/^\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:y,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=w,w(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:o,mediaTypes:i,mediaFeatures:a,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=w,w(t,e))}},name:"css",helperType:"gss"})}(n(631))},531:(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 o=t.current(),r=o.search(e);return r>-1?t.backUp(o.length-r):o.match(/<\/?$/)&&(t.backUp(o.length),t.match(e,!1)||t.match(o)),n}var o={};function r(t){var e=o[t];return e||(o[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function i(t,e){var n=t.match(r(e));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function s(t,e){return new RegExp((e?"^":"")+"","i")}function a(t,e){for(var n in t)for(var o=e[n]||(e[n]=[]),r=t[n],i=r.length-1;i>=0;i--)o.unshift(r[i])}function l(t,e){for(var n=0;n=0;d--)c.script.unshift(["type",p[d].matches,p[d].mode]);function f(e,r){var a,u=i.token(e,r.htmlState),p=/\btag\b/.test(u);if(p&&!/[<>\s\/]/.test(e.current())&&(a=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(a))r.inTag=a+" ";else if(r.inTag&&p&&/>$/.test(e.current())){var d=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null;var h=">"==e.current()&&l(c[d[1]],d[2]),g=t.getMode(o,h),v=s(d[1],!0),y=s(d[1],!1);r.token=function(t,e){return t.match(v,!1)?(e.token=f,e.localState=e.localMode=null,null):n(t,y,e.localMode.token(t,e.localState))},r.localMode=g,r.localState=t.startState(g,i.indent(r.htmlState,"",""))}else r.inTag&&(r.inTag+=e.current(),e.eol()&&(r.inTag+=" "));return u}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:t.startState(i)}},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(i,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,o){return!e.localMode||/^\s*<\//.test(n)?i.indent(e.htmlState,n,o):e.localMode.indent?e.localMode.indent(e.localState,n,o):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||i}}}}),"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(631),n(589),n(876),n(629))},876:(t,e,n)=>{1&&function(t){"use strict";t.defineMode("javascript",(function(e,n){var o,r,i=e.indentUnit,s=n.statementIndent,a=n.jsonld,l=n.json||a,c=!1!==n.trackScope,u=n.typescript,p=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),o=t("keyword c"),r=t("keyword d"),i=t("operator"),s={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:r,break:r,continue:r,new:t("new"),delete:o,void:o,throw:o,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:i,typeof:i,instanceof:i,true:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:t("this"),class:t("class"),super:t("atom"),yield:o,export:t("export"),import:t("import"),extends:o,await:o}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t){for(var e,n=!1,o=!1;null!=(e=t.next());){if(!n){if("/"==e&&!o)return;"["==e?o=!0:o&&"]"==e&&(o=!1)}n=!n&&"\\"==e}}function v(t,e,n){return o=t,r=n,e}function y(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=m(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")):re(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=_,_(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),v("meta","meta");if("#"==n&&t.eatWhile(p))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(f.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(p.test(n)){t.eatWhile(p);var o=t.current();if("."!=e.lastType){if(d.propertyIsEnumerable(o)){var r=d[o];return v(r.type,r.style,o)}if("async"==o&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",o)}return v("variable","variable",o)}}function m(t){return function(e,n){var o,r=!1;if(a&&"@"==e.peek()&&e.match(h))return n.tokenize=y,v("jsonld-keyword","meta");for(;null!=(o=e.next())&&(o!=t||r);)r=!r&&"\\"==o;return r||(n.tokenize=y),v("string","string")}}function b(t,e){for(var n,o=!1;n=t.next();){if("/"==n&&o){e.tokenize=y;break}o="*"==n}return v("comment","comment")}function _(t,e){for(var n,o=!1;null!=(n=t.next());){if(!o&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=y;break}o=!o&&"\\"==n}return v("quasi","string-2",t.current())}var w="([{}])";function x(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var o=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));o&&(n=o.index)}for(var r=0,i=!1,s=n-1;s>=0;--s){var a=t.string.charAt(s),l=w.indexOf(a);if(l>=0&&l<3){if(!r){++s;break}if(0==--r){"("==a&&(i=!0);break}}else if(l>=3&&l<6)++r;else if(p.test(a))i=!0;else if(/["'\/`]/.test(a))for(;;--s){if(0==s)return;if(t.string.charAt(s-1)==a&&"\\"!=t.string.charAt(s-2)){s--;break}}else if(i&&!r){++s;break}}i&&!r&&(e.fatArrowAt=s)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function S(t,e,n,o,r,i){this.indented=t,this.column=e,this.type=n,this.prev=r,this.info=i,null!=o&&(this.align=o)}function O(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var o=t.context;o;o=o.prev)for(n=o.vars;n;n=n.next)if(n.name==e)return!0}function T(t,e,n,o,r){var i=t.cc;for(k.state=t,k.stream=r,k.marked=null,k.cc=i,k.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);1;)if((i.length?i.pop():l?$:U)(n,o)){for(;i.length&&i[i.length-1].lex;)i.pop()();return k.marked?k.marked:"variable"==n&&O(t,o)?"variable-2":e}}var k={state:null,column:null,marked:null,cc:null};function E(){for(var t=arguments.length-1;t>=0;t--)k.cc.push(arguments[t])}function P(){return E.apply(null,arguments),!0}function A(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function j(t){var e=k.state;if(k.marked="def",c){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var o=M(t,e.context);if(null!=o)return void(e.context=o)}else if(!A(t,e.localVars))return void(e.localVars=new N(t,e.localVars));n.globalVars&&!A(t,e.globalVars)&&(e.globalVars=new N(t,e.globalVars))}}function M(t,e){if(e){if(e.block){var n=M(t,e.prev);return n?n==e.prev?e:new D(n,e.vars,!0):null}return A(t,e.vars)?e:new D(e.prev,new N(t,e.vars),!1)}return null}function L(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function D(t,e,n){this.prev=t,this.vars=e,this.block=n}function N(t,e){this.name=t,this.next=e}var I=new N("this",new N("arguments",null));function F(){k.state.context=new D(k.state.context,k.state.localVars,!1),k.state.localVars=I}function V(){k.state.context=new D(k.state.context,k.state.localVars,!0),k.state.localVars=null}function R(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function H(t,e){var n=function(){var n=k.state,o=n.indented;if("stat"==n.lexical.type)o=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)o=r.indented;n.lexical=new S(o,k.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function z(){var t=k.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function B(t){function e(n){return n==t?P():";"==t||"}"==n||")"==n||"]"==n?E():P(e)}return e}function U(t,e){return"var"==t?P(H("vardef",e),Et,B(";"),z):"keyword a"==t?P(H("form"),G,U,z):"keyword b"==t?P(H("form"),U,z):"keyword d"==t?k.stream.match(/^\s*$/,!1)?P():P(H("stat"),Y,B(";"),z):"debugger"==t?P(B(";")):"{"==t?P(H("}"),V,dt,z,R):";"==t?P():"if"==t?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==z&&k.state.cc.pop()(),P(H("form"),G,U,z,Dt)):"function"==t?P(Vt):"for"==t?P(H("form"),V,Nt,U,R,z):"class"==t||u&&"interface"==e?(k.marked="keyword",P(H("form","class"==t?t:e),Ut,z)):"variable"==t?u&&"declare"==e?(k.marked="keyword",P(U)):u&&("module"==e||"enum"==e||"type"==e)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==e?P(ee):"type"==e?P(Ht,B("operator"),yt,B(";")):P(H("form"),Pt,B("{"),H("}"),dt,z,z)):u&&"namespace"==e?(k.marked="keyword",P(H("form"),$,U,z)):u&&"abstract"==e?(k.marked="keyword",P(U)):P(H("stat"),it):"switch"==t?P(H("form"),G,B("{"),H("}","switch"),V,dt,z,z,R):"case"==t?P($,B(":")):"default"==t?P(B(":")):"catch"==t?P(H("form"),F,W,U,z,R):"export"==t?P(H("stat"),Gt,z):"import"==t?P(H("stat"),Yt,z):"async"==t?P(U):"@"==e?P($,U):E(H("stat"),$,B(";"),z)}function W(t){if("("==t)return P(zt,B(")"))}function $(t,e){return K(t,e,!1)}function q(t,e){return K(t,e,!0)}function G(t){return"("!=t?E():P(H(")"),Y,B(")"),z)}function K(t,e,n){if(k.state.fatArrowAt==k.stream.start){var o=n?et:tt;if("("==t)return P(F,H(")"),ut(zt,")"),z,B("=>"),o,R);if("variable"==t)return E(F,Pt,B("=>"),o,R)}var r=n?X:Z;return C.hasOwnProperty(t)?P(r):"function"==t?P(Vt,r):"class"==t||u&&"interface"==e?(k.marked="keyword",P(H("form"),Bt,z)):"keyword c"==t||"async"==t?P(n?q:$):"("==t?P(H(")"),Y,B(")"),z,r):"operator"==t||"spread"==t?P(n?q:$):"["==t?P(H("]"),te,z,r):"{"==t?pt(at,"}",null,r):"quasi"==t?E(J,r):"new"==t?P(nt(n)):P()}function Y(t){return t.match(/[;\}\)\],]/)?E():E($)}function Z(t,e){return","==t?P(Y):X(t,e,!1)}function X(t,e,n){var o=0==n?Z:X,r=0==n?$:q;return"=>"==t?P(F,n?et:tt,R):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?P(o):u&&"<"==e&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?P(H(">"),ut(yt,">"),z,o):"?"==e?P($,B(":"),r):P(r):"quasi"==t?E(J,o):";"!=t?"("==t?pt(q,")","call",o):"."==t?P(st,o):"["==t?P(H("]"),Y,B("]"),z,o):u&&"as"==e?(k.marked="keyword",P(yt,o)):"regexp"==t?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),P(r)):void 0:void 0}function J(t,e){return"quasi"!=t?E():"${"!=e.slice(e.length-2)?P(J):P(Y,Q)}function Q(t){if("}"==t)return k.marked="string-2",k.state.tokenize=_,P(J)}function tt(t){return x(k.stream,k.state),E("{"==t?U:$)}function et(t){return x(k.stream,k.state),E("{"==t?U:q)}function nt(t){return function(e){return"."==e?P(t?rt:ot):"variable"==e&&u?P(Ot,t?X:Z):E(t?q:$)}}function ot(t,e){if("target"==e)return k.marked="keyword",P(Z)}function rt(t,e){if("target"==e)return k.marked="keyword",P(X)}function it(t){return":"==t?P(z,U):E(Z,B(";"),z)}function st(t){if("variable"==t)return k.marked="property",P()}function at(t,e){return"async"==t?(k.marked="property",P(at)):"variable"==t||"keyword"==k.style?(k.marked="property","get"==e||"set"==e?P(lt):(u&&k.state.fatArrowAt==k.stream.start&&(n=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+n[0].length),P(ct))):"number"==t||"string"==t?(k.marked=a?"property":k.style+" property",P(ct)):"jsonld-keyword"==t?P(ct):u&&L(e)?(k.marked="keyword",P(at)):"["==t?P($,ft,B("]"),ct):"spread"==t?P(q,ct):"*"==e?(k.marked="keyword",P(at)):":"==t?E(ct):void 0;var n}function lt(t){return"variable"!=t?E(ct):(k.marked="property",P(Vt))}function ct(t){return":"==t?P(q):"("==t?E(Vt):void 0}function ut(t,e,n){function o(r,i){if(n?n.indexOf(r)>-1:","==r){var s=k.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),P((function(n,o){return n==e||o==e?E():E(t)}),o)}return r==e||i==e?P():n&&n.indexOf(";")>-1?E(t):P(B(e))}return function(n,r){return n==e||r==e?P():E(t,o)}}function pt(t,e,n){for(var o=3;o"),yt):"quasi"==t?E(wt,St):void 0}function mt(t){if("=>"==t)return P(yt)}function bt(t){return t.match(/[\}\)\]]/)?P():","==t||";"==t?P(bt):E(_t,bt)}function _t(t,e){return"variable"==t||"keyword"==k.style?(k.marked="property",P(_t)):"?"==e||"number"==t||"string"==t?P(_t):":"==t?P(yt):"["==t?P(B("variable"),ht,B("]"),_t):"("==t?E(Rt,_t):t.match(/[;\}\)\],]/)?void 0:P()}function wt(t,e){return"quasi"!=t?E():"${"!=e.slice(e.length-2)?P(wt):P(yt,xt)}function xt(t){if("}"==t)return k.marked="string-2",k.state.tokenize=_,P(wt)}function Ct(t,e){return"variable"==t&&k.stream.match(/^\s*[?:]/,!1)||"?"==e?P(Ct):":"==t?P(yt):"spread"==t?P(Ct):E(yt)}function St(t,e){return"<"==e?P(H(">"),ut(yt,">"),z,St):"|"==e||"."==t||"&"==e?P(yt):"["==t?P(yt,B("]"),St):"extends"==e||"implements"==e?(k.marked="keyword",P(yt)):"?"==e?P(yt,B(":"),yt):void 0}function Ot(t,e){if("<"==e)return P(H(">"),ut(yt,">"),z,St)}function Tt(){return E(yt,kt)}function kt(t,e){if("="==e)return P(yt)}function Et(t,e){return"enum"==e?(k.marked="keyword",P(ee)):E(Pt,ft,Mt,Lt)}function Pt(t,e){return u&&L(e)?(k.marked="keyword",P(Pt)):"variable"==t?(j(e),P()):"spread"==t?P(Pt):"["==t?pt(jt,"]"):"{"==t?pt(At,"}"):void 0}function At(t,e){return"variable"!=t||k.stream.match(/^\s*:/,!1)?("variable"==t&&(k.marked="property"),"spread"==t?P(Pt):"}"==t?E():"["==t?P($,B(']'),B(':'),At):P(B(":"),Pt,Mt)):(j(e),P(Mt))}function jt(){return E(Pt,Mt)}function Mt(t,e){if("="==e)return P(q)}function Lt(t){if(","==t)return P(Et)}function Dt(t,e){if("keyword b"==t&&"else"==e)return P(H("form","else"),U,z)}function Nt(t,e){return"await"==e?P(Nt):"("==t?P(H(")"),It,z):void 0}function It(t){return"var"==t?P(Et,Ft):"variable"==t?P(Ft):E(Ft)}function Ft(t,e){return")"==t?P():";"==t?P(Ft):"in"==e||"of"==e?(k.marked="keyword",P($,Ft)):E($,Ft)}function Vt(t,e){return"*"==e?(k.marked="keyword",P(Vt)):"variable"==t?(j(e),P(Vt)):"("==t?P(F,H(")"),ut(zt,")"),z,gt,U,R):u&&"<"==e?P(H(">"),ut(Tt,">"),z,Vt):void 0}function Rt(t,e){return"*"==e?(k.marked="keyword",P(Rt)):"variable"==t?(j(e),P(Rt)):"("==t?P(F,H(")"),ut(zt,")"),z,gt,R):u&&"<"==e?P(H(">"),ut(Tt,">"),z,Rt):void 0}function Ht(t,e){return"keyword"==t||"variable"==t?(k.marked="type",P(Ht)):"<"==e?P(H(">"),ut(Tt,">"),z):void 0}function zt(t,e){return"@"==e&&P($,zt),"spread"==t?P(zt):u&&L(e)?(k.marked="keyword",P(zt)):u&&"this"==t?P(ft,Mt):E(Pt,ft,Mt)}function Bt(t,e){return"variable"==t?Ut(t,e):Wt(t,e)}function Ut(t,e){if("variable"==t)return j(e),P(Wt)}function Wt(t,e){return"<"==e?P(H(">"),ut(Tt,">"),z,Wt):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(k.marked="keyword"),P(u?yt:$,Wt)):"{"==t?P(H("}"),$t,z):void 0}function $t(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&L(e))&&k.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",P($t)):"variable"==t||"keyword"==k.style?(k.marked="property",P(qt,$t)):"number"==t||"string"==t?P(qt,$t):"["==t?P($,ft,B("]"),qt,$t):"*"==e?(k.marked="keyword",P($t)):u&&"("==t?E(Rt,$t):";"==t||","==t?P($t):"}"==t?P():"@"==e?P($,$t):void 0}function qt(t,e){if("!"==e)return P(qt);if("?"==e)return P(qt);if(":"==t)return P(yt,Mt);if("="==e)return P(q);var n=k.state.lexical.prev;return E(n&&"interface"==n.info?Rt:Vt)}function Gt(t,e){return"*"==e?(k.marked="keyword",P(Qt,B(";"))):"default"==e?(k.marked="keyword",P($,B(";"))):"{"==t?P(ut(Kt,"}"),Qt,B(";")):E(U)}function Kt(t,e){return"as"==e?(k.marked="keyword",P(B("variable"))):"variable"==t?E(q,Kt):void 0}function Yt(t){return"string"==t?P():"("==t?E($):"."==t?E(Z):E(Zt,Xt,Qt)}function Zt(t,e){return"{"==t?pt(Zt,"}"):("variable"==t&&j(e),"*"==e&&(k.marked="keyword"),P(Jt))}function Xt(t){if(","==t)return P(Zt,Xt)}function Jt(t,e){if("as"==e)return k.marked="keyword",P(Zt)}function Qt(t,e){if("from"==e)return k.marked="keyword",P($)}function te(t){return"]"==t?P():E(ut(q,"]"))}function ee(){return E(H("form"),Pt,B("{"),H("}"),ut(ne,"}"),z,z)}function ne(){return E(Pt,Mt)}function oe(t,e){return"operator"==t.lastType||","==t.lastType||f.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function re(t,e,n){return e.tokenize==y&&/^(?: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 F.lex=V.lex=!0,R.lex=!0,z.lex=!0,{startState:function(t){var e={tokenize:y,lastType:"sof",cc:[],lexical:new S((t||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&new D(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"==o?n:(e.lastType="operator"!=o||"++"!=r&&"--"!=r?o:"incdec",T(e,n,o,r,t))},indent:function(e,o){if(e.tokenize==b||e.tokenize==_)return t.Pass;if(e.tokenize!=y)return 0;var r,a=o&&o.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(o))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==z)l=l.prev;else if(u!=Dt&&u!=R)break}for(;("stat"==l.type||"form"==l.type)&&("}"==a||(r=e.cc[e.cc.length-1])&&(r==Z||r==X)&&!/^[,\.=+\-*:?[\(]/.test(o));)l=l.prev;s&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var p=l.type,d=a==p;return"vardef"==p?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==p&&"{"==a?l.indented:"form"==p?l.indented+i:"stat"==p?l.indented+(oe(e,o)?s||i:0):"switch"!=l.info||d||0==n.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:i):l.indented+(/^(?:case|default)\b/.test(o)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l,expressionAllowed:re,skipExpression:function(e){T(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(631))},589:(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(o,r){var i,s,a=o.indentUnit,l={},c=r.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in r)l[u]=r[u];function p(t,e){function n(n){return e.tokenize=n,n(t,e)}var o=t.next();return"<"==o?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(h("atom","]]>")):null:t.match("--")?n(h("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=h("meta","?>"),"meta"):(i=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"tag bracket"):"&"==o?(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 d(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=p,i=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return i="equals",null;if("<"==n){e.tokenize=p,e.state=_,e.tagName=e.tagStart=null;var o=e.tokenize(t,e);return o?o+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=f(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=d;break}return"string"};return e.isInAttribute=!0,e}function h(t,e){return function(n,o){for(;!n.eol();){if(n.match(e)){o.tokenize=p;break}n.next()}return t}}function g(t){return function(e,n){for(var o;null!=(o=e.next());){if("<"==o)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==o){if(1==t){n.tokenize=p;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function v(t){return t&&t.toLowerCase()}function y(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 m(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;m(t)}}function _(t,e,n){return"openTag"==t?(n.tagStart=e.column(),w):"closeTag"==t?x:_}function w(t,e,n){return"word"==t?(n.tagName=e.current(),s="tag",O):l.allowMissingTagName&&"endTag"==t?(s="tag bracket",O(t,e,n)):(s="error",w)}function x(t,e,n){if("word"==t){var o=e.current();return n.context&&n.context.tagName!=o&&l.implicitlyClosed.hasOwnProperty(v(n.context.tagName))&&m(n),n.context&&n.context.tagName==o||!1===l.matchClosing?(s="tag",C):(s="tag error",S)}return l.allowMissingTagName&&"endTag"==t?(s="tag bracket",C(t,e,n)):(s="error",S)}function C(t,e,n){return"endTag"!=t?(s="error",C):(m(n),_)}function S(t,e,n){return s="error",C(t,e,n)}function O(t,e,n){if("word"==t)return s="attribute",T;if("endTag"==t||"selfcloseTag"==t){var o=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(v(o))?b(n,o):(b(n,o),n.context=new y(n,o,r==n.indented)),_}return s="error",O}function T(t,e,n){return"equals"==t?k:(l.allowMissing||(s="error"),O(t,e,n))}function k(t,e,n){return"string"==t?E:"word"==t&&l.allowUnquoted?(s="string",O):(s="error",O(t,e,n))}function E(t,e,n){return"string"==t?E:O(t,e,n)}return p.isInText=!0,{startState:function(t){var e={tokenize:p,state:_,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;i=null;var n=e.tokenize(t,e);return(n||i)&&"comment"!=n&&(s=null,e.state=e.state(i||n,t,e),s&&(n="error"==s?n+" error":s)),n},indent:function(e,n,o){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(r&&r.noIndent)return t.Pass;if(e.tokenize!=d&&e.tokenize!=p)return o?o.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==k&&(t.state=O)},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(631))},642:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var o,r=n(346),i=void 0&&(void 0).__extends||(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(e,n,o){var r=t.call(this,n,o)||this;return r._module=e,r}return i(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}(r.Hn)},675:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a,q:()=>r});var o,r,i=n(642),s=void 0&&(void 0).__extends||(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t["Select"]="select",t["Hover"]="hover",t["Spacing"]="spacing",t["Target"]="target",t["Resize"]="resize"}(r||(r={}));const a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.defaults=function(){return{id:'',type:''}},Object.defineProperty(e.prototype,"type",{get:function(){return this.get('type')||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"component",{get:function(){var t;return this.get('component')||(null===(t=this.get('componentView'))||void 0===t?void 0:t.model)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"componentView",{get:function(){var t;return this.get('componentView')||(null===(t=this.get('component'))||void 0===t?void 0:t.getView())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"el",{get:function(){var t;return null===(t=this.componentView)||void 0===t?void 0:t.el},enumerable:!1,configurable:!0}),e.prototype.getBoxRect=function(t){var e=this.el,n=this.em.Canvas.getCanvasView(),o=this.get('boxRect');return o||(e&&n?n.getElBoxRect(e,t):{x:0,y:0,width:0,height:0})},e.prototype.getStyle=function(t){void 0===t&&(t={});var e=t.boxRect||this.getBoxRect(t),n=e.width,o=e.height,r=e.x,i=e.y;return{width:"".concat(n,"px"),height:"".concat(o,"px"),top:'0',left:'0',position:'absolute',translate:"".concat(r,"px ").concat(i,"px")}},e.prototype.isType=function(t){return this.type===t},e}(i.Z)},713:(t,e,n)=>{"use strict";var o;n.d(e,{Z:()=>r}),function(t){t["run"]="command:run",t["_run"]="run",t["runCommand"]="command:run:",t["_runCommand"]="run:",t["runBeforeCommand"]="command:run:before:",t["abort"]="command:abort:",t["_abort"]="abort:",t["stop"]="command:stop",t["_stop"]="stop",t["stopCommand"]="command:stop:",t["_stopCommand"]="stop:",t["stopBeforeCommand"]="command:stop:before:"}(o||(o={}));const r=o},858:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){t.Components.clear(),t.Css.clear()}}},884:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});var o=n(50),r=n(668),i=n(491);const s={run:function(t){(0,o.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.sN)(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,o=this.em,i=this.dragger,s=t?'add':'remove';this.getCanvas().classList[s]("".concat(this.ppfx,"is__grabbing")),i||(i=new r.Z({getPosition:function(){return{x:n.get('x'),y:n.get('y')}},setPosition:function(t){var e=t.x,o=t.y;n.set({x:e,y:o})},onStart:function(t,e){o.trigger('canvas:move:start',e)},onDrag:function(t,e){o.trigger('canvas:move',e)},onEnd:function(t,e){o.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',o=t?'on':'off',r={on:i.on,off:i.S1},s=this.getCanvas(),a=["".concat(e,"is__grab")];!t&&a.push("".concat(e,"is__grabbing")),a.forEach((function(t){return s.classList[n](t)})),r[o](document,'keyup',this.onKeyUp),r[o](s,'mousedown',this.enableDragger),r[o](document,'mouseup',this.disableDragger)}}},790:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l,defineCommand:()=>a});var o,r=n(346),i=n(713),s=void 0&&(void 0).__extends||(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function a(t){return t}const l=function(t){function e(e){var n=t.call(this,0)||this;n.config=e||{},n.em=n.config.em||{};var o=n.config.stylePrefix;return n.pfx=o,n.ppfx=n.config.pStylePrefix,n.hoverClass="".concat(o,"hover"),n.badgeClass="".concat(o,"badge"),n.plhClass="".concat(o,"placeholder"),n.freezClass="".concat(n.ppfx,"freezed"),n.canvas=n.em.Canvas,n.init(n.config),n}return s(e,t),e.prototype.onFrameScroll=function(t){},e.prototype.getCanvas=function(){return this.canvas.getElement()},e.prototype.getCanvasBody=function(){return this.canvas.getBody()},e.prototype.getCanvasTools=function(){return this.canvas.getToolsEl()},e.prototype.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},e.prototype.init=function(t){},e.prototype.callRun=function(t,e){void 0===e&&(e={});var n=this.id;if(t.trigger("".concat(i.Z.runBeforeCommand).concat(n),{options:e}),t.trigger("".concat(i.Z._runCommand).concat(n,":before"),e),e.abort)return t.trigger("".concat(i.Z.abort).concat(n),{options:e}),void t.trigger("".concat(i.Z._abort).concat(n),e);var o=e.sender||t,r=this.run(t,o,e),s={id:n,result:r,options:e};return t.trigger("".concat(i.Z.runCommand).concat(n),s),t.trigger(i.Z.run,s),t.trigger("".concat(i.Z._runCommand).concat(n),r,e),t.trigger(i.Z._run,n,r,e),r},e.prototype.callStop=function(t,e){void 0===e&&(e={});var n=this.id,o=e.sender||t;t.trigger("".concat(i.Z.stopBeforeCommand).concat(n),{options:e}),t.trigger("".concat(i.Z._stopCommand).concat(n,":before"),e);var r=this.stop(t,o,e),s={id:n,result:r,options:e};return t.trigger("".concat(i.Z.stopCommand).concat(n),s),t.trigger(i.Z.stop,s),t.trigger("".concat(i.Z._stopCommand).concat(n),r,e),t.trigger(i.Z._stop,n,r,e),r},e.prototype.stopCommand=function(t){this.em.Commands.stop(this.id,t)},e.prototype.run=function(t,e,n){},e.prototype.stop=function(t,e,n){},e}(r.Hn)},180:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(50),r=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r{"use strict";n.r(e),n.d(e,{default:()=>a});var o=n(50),r=n(668),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n ");(e=document.createElement('div')).className="".concat(a,"guides"),l.className="".concat(a,"guide-info ").concat(a,"guide-info__x"),c.className="".concat(a,"guide-info ").concat(a,"guide-info__y"),l.innerHTML=u,c.innerHTML=u,e.appendChild(l),e.appendChild(c),r.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=l,this.elGuideInfoY=c,this.elGuideInfoContentX=l.querySelector(".".concat(a,"guide-info__content")),this.elGuideInfoContentY=c.querySelector(".".concat(a,"guide-info__content")),i.on('canvas:update frame:scroll',(0,o.debounce)((function(){var e;t.updateGuides(),s.debug&&(null===(e=t.guides)||void 0===e||e.forEach((function(e){return t.renderGuide(e)})))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),r=n.parentNode,i=void 0===r?{}:r;return(0,o.each)(i.children,(function(o){return e=e.concat(n!==o?t.getElementGuides(o):[])})),e.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,r=this;(t||this.guides).forEach((function(t){var i=t.origin,s=e===i?n:r.getElementPos(i);e=i,n=s,(0,o.each)(r.getGuidePosUpdate(t,s),(function(e,n){return t[n]=e})),t.originRect=s}))},getGuidePosUpdate:function(t,e){var n={},o=e.top,r=e.height,i=e.left,s=e.width;switch(t.type){case't':n.y=o;break;case'b':n.y=o+r;break;case'l':n.x=i;break;case'r':n.x=i+s;break;case'x':n.x=i+s/2;break;case'y':n.y=o+r/2}return n},renderGuide:function(t){void 0===t&&(t={});var e=t.guide||document.createElement('div'),n='px',o=t.active?2:1,r=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?'green':'red',";"),e.children.length||((r=document.createElement('div')).style='position: absolute; color: red; padding: 5px; top: 0; left: 0;',e.appendChild(r)),t.y?(e.style.width='100%',e.style.height="".concat(o).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(o).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,o=this.getElementPos(t),r=o.top,s=o.height,a=o.left,l=o.width,c=[{type:'t',y:r},{type:'b',y:r+s},{type:'l',x:a},{type:'r',x:a+l},{type:'x',x:a+l/2},{type:'y',y:r+s/2}].map((function(r){return i(i({},r),{origin:t,originRect:o,guide:n.debug&&e.renderGuide(r)})}));return c.forEach((function(t){var n;return null===(n=e.guides)||void 0===n?void 0:n.push(t)})),c},getTranslate:function(t,e){void 0===e&&(e='x');var n=0;return(t||'').split(' ').forEach((function(t){var o=t.trim(),r="translate".concat(e.toUpperCase(),"(");0===o.indexOf(r)&&(n=parseFloat(o.replace(r,'')))})),n},setTranslate:function(t,e,n){var o="translate".concat(e.toUpperCase(),"("),r="".concat(o).concat(n,")"),i=(t||'').split(' ').map((function(t){return 0===t.trim().indexOf(o)&&(t=r),t})).join(' ');return i.indexOf(o)<0&&(i+=" ".concat(r)),i},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),o=n.left,r=n.top,i=n.transform,s=0,a=0;return e?(s=this.getTranslate(i),a=this.getTranslate(i,'y')):(s=parseFloat(o||0),a=parseFloat(r||0)),{x:s,y:a}},setPosition:function(t){var e=t.x,n=t.y,r=t.end,i=t.position,s=t.width,a=t.height,l=this,c=l.target,u=l.isTran,p=l.em,d='px',f=!r,h="".concat(parseInt(e,10)).concat(d),g="".concat(parseInt(n,10)).concat(d),v={};if(u){var y=c.getStyle()['transform']||'';y=this.setTranslate(y,'x',h),v={transform:y=this.setTranslate(y,'y',g),__p:f},c.addStyle(v,{avoidStore:!r})}else{var m={position:i,width:s,height:a},b={left:h,top:g,__p:f};(0,o.keys)(m).forEach((function(t){var e=m[t];e&&(b[t]=e)})),v=b,c.addStyle(v,{avoidStore:!r})}null==p||p.Styles.__emitCmpStyleUpdate(v,{components:p.getSelected()})},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this,n=e.target,o=e.editor,r=e.isTran,i=e.opts,s=i.center,a=i.onStart,l=o.Canvas,c=n.getStyle(),u='absolute',p=[u,'relative'];if(a&&a(this._getDragData()),!r&&c.position!==u){var d=l.offset(n.getEl()),f=d.left,h=d.top,g=d.width,v=d.height,y=n.parent(),m=void 0;do{var b=y.getStyle();m=p.indexOf(b.position)>=0?y:null,y=y.parent()}while(y&&!m);if(s){var _=l.getMouseRelativeCanvas(t);f=_.x,h=_.y}else if(m){var w=l.offset(m.getEl());f-=w.left,h-=w.top}this.setPosition({x:f,y:h,width:"".concat(g,"px"),height:"".concat(v,"px"),position:u})}},onDrag:function(){for(var t=this,e=[],n=0;n0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(m){var b=m.originRect,_=b.left,w=b.width,x=b.top,C=b.height,S=b.rect,O=u?_{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.components(),o=n&&n.filter((function(t){return t.get('selectable')}))[0];o&&e.push(o)})),e.length&&t.select(e)}}}},368:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t,e,n){if(void 0===n&&(n={}),t.Canvas.hasFocus()||n.force){var o=[];t.getSelectedAll().forEach((function(t){for(var e=t.parent();e&&!e.get('selectable');)e=e.parent();e&&o.push(e)})),o.length&&t.select(o)}}}},243:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var o,r=n.components().length,i=0,s=0;do{i++,o=(s=t.index()+i)<=r?n.getChildAt(s):null}while(o&&!o.get('selectable'));e.push(o||t)}})),e.length&&t.select(e)}}}},400:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var o,r=0,i=0;do{r++,o=(i=t.index()-r)>=0?n.getChildAt(i):null}while(o&&!o.get('selectable'));e.push(o||t)}})),e.length&&t.select(e)}}}},910:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(50);const r={run:function(t,e,n){void 0===n&&(n={});var r=n.target,i=[];if(!r.get('styles'))return i;var s=r.get('type'),a=t.Pages.getAllWrappers();if(!(0,o.flatten)(a.map((function(t){return t.findType(s)}))).length){var l=t.CssComposer.getAll();i=l.filter((function(t){return t.get('group')==="cmp:".concat(s)})),l.remove(i)}return i}}},744:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(491);const r={run:function(t,e,n){var r=this;void 0===n&&(n={}),e&&e.set&&e.set('active',0);var i=t.getConfig(),s=t.Modal,a=i.stylePrefix;if(this.cm=t.CodeManager||null,!this.editors){var l=this.buildEditor('htmlmixed','hopscotch','HTML'),c=this.buildEditor('css','hopscotch','CSS');this.htmlEditor=l.model,this.cssEditor=c.model;var u=(0,o.ut)('div',{class:"".concat(a,"export-dl")});u.appendChild(l.el),u.appendChild(c.el),this.editors=u}s.open({title:i.textViewCode,content:this.editors}).getModel().once('change:open',(function(){return t.stopCommand("".concat(r.id))})),this.htmlEditor.setContent(t.getHtml(n.optsHtml)),this.cssEditor.setContent(t.getCss(n.optsCss))},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var o=this.em.CodeManager,r=o.createViewer({label:n,codeName:t,theme:e});return{model:r,el:new o.EditorView({model:r,config:o.getConfig()}).render().el}}}},975:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(50);const r={isEnabled:function(){var t=document;return!!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement)},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(),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){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(t||'',"fullscreenchange"),this.fsChanged))},run:function(t,e,n){void 0===n&&(n={}),this.sender=e;var r=n.target,i=(0,o.isElement)(r)?r:document.querySelector(r),s=this.enable(i||t.getContainer());this.fsChanged=this.fsChanged.bind(this,s),document.addEventListener(s+'fullscreenchange',this.fsChanged)},stop:function(t,e){e&&e.set&&e.set('active',!1),this.disable()}}},191:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var o=n(50),r=n(895),i=n(491),s=n(407),a=n(189);const l=(0,o.extend)({},a["default"],s["default"],{init:function(t){s["default"].init.apply(this,arguments),(0,o.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=[],e=0;e{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(50),r=n(491);const i={open:function(t){var e=this,n=this,r=n.editor,i=n.title,s=n.config,a=n.am,l=s.custom;if((0,o.isFunction)(l.open))return l.open(a.__customData());r.Modal.open({title:i,content:t}).onceClose((function(){return r.stopCommand(e.id)}))},close:function(){var t=this.config.custom;if((0,o.isFunction)(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e,n){void 0===n&&(n={});var o=t.AssetManager,i=o.getConfig(),s=n.types,a=void 0===s?[]:s,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t('assetManager.modalTitle')||'',this.editor=t,this.config=i,this.am=o,o.setTarget(n.target),o.onClick(n.onClick),o.onDblClick(n.onDblClick),o.onSelect(n.onSelect),o.__behaviour({select:c,types:a,options:n}),i.custom)this.rendered=this.rendered||(0,r.ut)('div'),this.rendered.className="".concat(i.stylePrefix,"custom-wrp"),o.__behaviour({container:this.rendered}),o.__trgCustom();else{if(!this.rendered||a){var u=o.getAll().filter((function(t){return t}));a&&a.length&&(u=u.filter((function(t){return-1!==a.indexOf(t.get('type'))}))),o.render(u),this.rendered=o.getContainer()}if(l){var p=this.rendered.querySelector("input#".concat(i.stylePrefix,"uploadFile"));p&&p.setAttribute('accept',l)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},117:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(50),r=n(491);const i={open:function(){var t=this,e=t.container,n=t.editor,r=t.bm,i=t.config,s=i.custom,a=i.appendTo;if((0,o.isFunction)(s.open))return s.open(r.__customData());if(this.firstRender&&!a){var l='views-container',c=n.Panels;(c.getPanel(l)||c.addPanel({id:l})).set('appendContent',e).trigger('change:appendContent'),s||e.appendChild(r.render())}e&&(e.style.display='block')},close:function(){var t=this.container,e=this.config.custom;if((0,o.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,r.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()}}},614:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){var e=t.LayerManager,n=t.Panels,o=e.getConfig();if(!o.appendTo){if(!this.layers){var r='views-container',i=document.createElement('div'),s=n.getPanel(r)||n.addPanel({id:r});o.custom?e.__trgCustom({container:i}):i.appendChild(e.render()),s.set('appendContent',i).trigger('change:appendContent'),this.layers=i}this.layers.style.display='block'}},stop:function(){var t=this.layers;t&&(t.style.display='none')}}},801:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(895);const r={run:function(t,e){if(this.sender=e,!this.$cnt){var n=t.getConfig(),r=t.Panels,i=t.DeviceManager,s=t.SelectorManager,a=t.StyleManager,l='change:appendContent',c=(0,o["default"])('
'),u=(0,o["default"])('
'),p=(0,o["default"])('
'),d=(0,o["default"])('
');if(this.$cnt=c,this.$cntInner=u,u.append(p),u.append(d),c.append(u),i&&n.showDevices){var f=r.addPanel({id:'devices-c'}),h=i.render();f.set('appendContent',h).trigger(l)}var g=s.getConfig();g.custom?s.__trgCustom({container:p.get(0)}):g.appendTo||p.append(s.render([])),this.sm=a;var v=a.getConfig(),y=v.stylePrefix;this.$header=(0,o["default"])("
").concat(t.t('styleManager.empty'),"
")),c.append(this.$header),v.custom?a.__trgCustom({container:d.get(0)}):v.appendTo||d.append(a.render());var m='views-container';(r.getPanel(m)||r.addPanel({id:m})).set('appendContent',c).trigger(l);var b=t.getModel();this.listenTo(b,a.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this,e=t.sender,n=t.sm,o=t.$cntInner,r=t.$header;e&&e.get&&!e.get('active')||!n||(n.getSelected()?(null==o||o.show(),null==r||r.hide()):(null==o||o.hide(),null==r||r.show()))},stop:function(){var t,e;null===(t=this.$cntInner)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},395:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(895);const r={run:function(t,e){this.sender=e;var n,r=t.getModel(),i=t.Config.stylePrefix,s=t.TraitManager,a=s.getConfig();if(!a.appendTo){if(!this.$cn){this.$cn=(0,o["default"])('
'),this.$cn2=(0,o["default"])('
'),this.$cn.append(this.$cn2),this.$header=(0,o["default"])('
').append("
").concat(r.t('traitManager.empty'),"
")),this.$cn.append(this.$header),a.custom?s.__trgCustom({container:this.$cn2.get(0)}):(this.$cn2.append("
").concat(r.t('traitManager.label'),"
")),this.$cn2.append(s.render()));var l=t.Panels;null==(n=l.getPanel('views-container')?l.getPanel('views-container'):l.addPanel({id:'views-container'}))||n.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()}}},98:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(50);const r={run:function(t,e,n){void 0===n&&(n={});var r=t.getModel(),s=r.get('clipboard'),a=t.getSelected();(null==s?void 0:s.length)&&a&&(t.getSelectedAll().forEach((function(e){var a,l,c,u,p=(null===(l=null===(a=e.delegate)||void 0===a?void 0:a.copy)||void 0===l?void 0:l.call(a,e))||e,d=p.collection;if(d){var f={at:p.index()+1,action:n.action||'paste-component'};u=(0,o.contains)(s,p)&&p.get('copyable')?d.add(p.clone(),f):i(t,s,p.parent(),f)}else{var h=null===(c=r.Pages.getSelected())||void 0===c?void 0:c.getMainComponent();f={at:(null==h?void 0:h.components().length)||0,action:n.action||'paste-component'};u=i(t,s,h,f)}(u=(0,o.isArray)(u)?u:[u]).forEach((function(e){return t.trigger('component:paste',e)}))})),a.emitUpdate())}};function i(t,e,n,o){var r=e.filter((function(t){return t.get('copyable')})).filter((function(e){return t.Components.canMove(n,e).result}));return n.components().add(r.map((function(t){return t.clone()})),o)}},129:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});var o=n(50),r=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r{"use strict";n.r(e),n.d(e,{default:()=>r});var o=void 0&&(void 0).__assign||function(){return o=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{"use strict";n.r(e),n.d(e,{default:()=>S});var o,r=n(50),i=n(346),s=void 0&&(void 0).__extends||(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.defaults=function(){return{command:'',attributes:{}}},e}(i.Hn);var l=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e}(i.FE);const u=c;c.prototype.model=a;var p=n(330),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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),f=void 0&&(void 0).__assign||function(){return f=Object.assign||function(t){for(var e,n=1,o=arguments.length;n").concat(l,"
"):'',"\n
").concat(r.getName(),"
");i.innerHTML=p?p(r):d}var f='px';s.display='block';var h=o.getTargetToElementFixed(t,i,{pos:e}).top,g=n.leftOff<0?-n.leftOff:0;s.top=h+f,s.left=g+f}else s.display='none'},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=''},initResize:function(t){var e=this.em,n=this.canvas,o=e.Editor,i=!(0,r.isElement)(t)&&(0,b.o5)(t)?t:e.getSelected(),s=null==i?void 0:i.get('resizable'),a=w.q.Resize,l=n.hasCustomSpot(a);if(n.removeSpots({type:a}),i&&s){n.addSpot({type:a,component:i});var c,u=(0,r.isElement)(t)?t:i.getEl(),p=(0,_.isObject)(s)?s:{},d=p.onStart,f=void 0===d?function(){}:d,h=p.onMove,g=void 0===h?function(){}:h,v=p.onEnd,y=void 0===v?function(){}:v,S=p.updateTarget,O=void 0===S?function(){}:S,T=C(p,["onStart","onMove","onEnd","updateTarget"]);if(l||!u||this.activeResizer)return;var k=e.config.stylePrefix||'',E="".concat(k,"resizing"),P=this,A={component:i,el:u},j=function(t,e,n){var o=n.docs;o&&o.forEach((function(e){var n=e.body,o=n.className||'';n.className=('add'==t?"".concat(o," ").concat(E):o.replace(E,'')).trim()}))},M=x({onStart:function(t,r){f(t,r);var s=r.el,a=r.config,l=r.resizer,u=a.keyHeight,p=a.keyWidth,d=a.currentUnit,h=a.keepAutoHeight,g=a.keepAutoWidth;j('add',0,r),c=e.Styles.getModelToStyle(i),n.toggleFramesEvents(!1);var v=getComputedStyle(s),y=c.getStyle(),b=y[p];a.autoWidth=g&&'auto'===b,isNaN(parseFloat(b))&&(b=v[p]);var w=y[u];a.autoHeight=h&&'auto'===w,isNaN(parseFloat(w))&&(w=v[u]),l.startDim.w=parseFloat(b),l.startDim.h=parseFloat(w),m=!1,d&&(a.unitHeight=(0,_.getUnitFromValue)(w),a.unitWidth=(0,_.getUnitFromValue)(b)),P.activeResizer=!0,o.trigger('component:resize',x(x({},A),{type:'start'}))},onMove:function(t){g(t),o.trigger('component:resize',x(x({},A),{type:'move'}))},onEnd:function(t,e){y(t,e),j('remove',0,e),o.trigger('component:resize',x(x({},A),{type:'end'})),n.toggleFramesEvents(!0),m=!0,P.activeResizer=!1},updateTarget:function(t,o,r){if(O(t,o,r),c){var s=r.store,a=r.selectedHandler,l=r.config,u=l.keyHeight,p=l.keyWidth,d=l.autoHeight,f=l.autoWidth,h=l.unitWidth,g=l.unitHeight,v=['tc','bc'].indexOf(a)>=0,y=['cl','cr'].indexOf(a)>=0,m={};if(!v){var b=n.getBody().offsetWidth,_=o.w{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(895);const r={startSelectPosition:function(t,e,n){var o=this;void 0===n&&(n={}),this.isPointed=!1;var r=this.em.Utils,i=t.ownerDocument.body;r&&!this.sorter&&(this.sorter=new r.Sorter({container:i,placer:this.canvas.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,direction:'a',document:e,wmargin:1,nested:1,em:this.em,canvasRelative:1,scale:function(){return o.em.getZoomDecimal()}})),n.onStart&&(this.sorter.onStart=n.onStart),t&&this.sorter.startSort(t,{container:i})},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?(0,o["default"])(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?(0,o["default"])(this.cDim[this.posIndex][5]).parent():(0,o["default"])(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 o=t||0,r=e||'before',i=n.length,s=0!==i&&'after'==r&&o==i;return 0!==i&&(!s&&!n[o][4]||n[o-1]&&!n[o-1][4]||s&&!n[o-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css('cursor',''),this.$wrapper.unbind()}}},804:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var o=n(50),r=n(675),i=n(895),s=n(491),a=void 0&&(void 0).__assign||function(){return a=Object.assign||function(t){for(var e,n=1,o=arguments.length;n")).get(0),j=(0,i["default"])("
")).get(0),M=v+P+'-el',L="".concat(v+E+'-el'," ").concat(v+E),D="".concat(M," ").concat(v+P);b=(0,i["default"])("
")).get(0),_=(0,i["default"])("
")).get(0),w=(0,i["default"])("
")).get(0),x=(0,i["default"])("
")).get(0),C=(0,i["default"])("
")).get(0),S=(0,i["default"])("
")).get(0),O=(0,i["default"])("
")).get(0),T=(0,i["default"])("
")).get(0),this['marginT'+u]=b,this['marginB'+u]=_,this['marginL'+u]=w,this['marginR'+u]=x,this['padT'+u]=C,this['padB'+u]=S,this['padL'+u]=O,this['padR'+u]=T,A.appendChild(b),A.appendChild(_),A.appendChild(w),A.appendChild(x),j.appendChild(C),j.appendChild(S),j.appendChild(O),j.appendChild(T),m.appendChild(A),m.appendChild(j),this[y]='1'}var N='px',I=parseFloat(g.marginLeft.replace(N,''))*d,F=parseFloat(g.marginRight.replace(N,''))*d,V=parseFloat(g.marginTop.replace(N,''))*d,R=parseFloat(g.marginBottom.replace(N,''))*d,H=b.style,z=_.style,B=w.style,U=x.style,W=C.style,$=S.style,q=O.style,G=T.style,K=parseFloat(h.left),Y=parseFloat(g.width)*d+N;H.height=V+N,H.width=Y,H.top=h.top-V+N,H.left=K+N,z.height=R+N,z.width=Y,z.top=h.top+h.height+N,z.left=K+N;var Z=h.height+V+R+N,X=h.top-V+N;B.height=Z,B.width=I+N,B.top=X,B.left=K-I+N,U.height=Z,U.width=F+N,U.top=X,U.left=K+h.width+N;var J=parseFloat(g.paddingTop)*d;W.height=J+N;var Q=parseFloat(g.paddingBottom)*d;$.height=Q+N;var tt=h.height-Q-J+N,et=h.top+J+N;q.height=tt,q.width=parseFloat(g.paddingLeft)*d+N,q.top=et;var nt=parseFloat(g.paddingRight)*d;G.height=tt,G.width=nt+N,G.top=et}}else t.stopCommand("".concat(this.id),n)},stop:function(t,e,n){void 0===n&&(n={});var o=(n||{}).state||'',r=this.getOffsetMethod(o),i=n.view;this.canvas[r](i).style.opacity=0}}},434:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(50),r=n(163);const i={init:function(){(0,o.bindAll)(this,'_onFramesChange')},run:function(t){this.toggleVis(t,!0)},stop:function(t){this.toggleVis(t,!1)},toggleVis:function(t,e){if(void 0===e&&(e=!0),!t.Commands.isActive('preview')){var n=t.Canvas,o=e?'on':'off';n.getModel()[o]('change:frames',this._onFramesChange),this.handleFrames(n.getFrames(),e)}},handleFrames:function(t,e){var n=this;t.forEach((function(t){var o;(null===(o=t.view)||void 0===o?void 0:o.loaded)&&n._upFrame(t,e),t.__ol||(t.on('loaded',(function(){return n._upFrame(t)})),t.__ol=!0)}))},_onFramesChange:function(t,e){this.handleFrames(e)},_upFrame:function(t,e){var n,o=this,i=o.ppfx,s=o.em,a=o.id,l=((0,r.isDef)(e)?e:s.Commands.isActive(a))?'add':'remove',c="".concat(i,"dashed");null===(n=t.view)||void 0===n||n.getBody().classList[l](c)}}},346:(t,e,n)=>{"use strict";n.d(e,{FE:()=>u,G7:()=>p,Hn:()=>c,pH:()=>d,vA:()=>r});var o,r,i=n(316),s=n.n(i),a=void 0&&(void 0).__extends||(o=function(t,e){return o=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])},o(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}o(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,o=arguments.length;n{"use strict";n.d(e,{Z:()=>l});var o,r=n(50),i=n(346),s=void 0&&(void 0).__extends||(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e,n,o){void 0===e&&(e={}),void 0===o&&(o=!1);var r=t.call(this,e)||this;return r.itemsView='',r.itemType='type',r.reuseView=!1,r.config=n||e.config||{},o&&r.listenTo(r.collection,'add',r.addTo),r.items=[],r}return s(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){var e=this.config,n=this.ns,o=e.em,r="".concat(n?"[".concat(n,"]: "):'',"'").concat(t,"' type not found");o&&o.logWarning(r)},e.prototype.add=function(t,e){var n,o=this,i=o.config,s=o.reuseView,a=o.items,l=this.itemsView||{},c=e||null,u=this.itemView,p=t.get(this.itemType);l[p]?u=l[p]:!p||l[p]||(0,r.includes)(['button','checkbox','color','date','datetime-local','email','file','hidden','image','month','number','password','radio','range','reset','search','submit','tel','text','time','url','week'],p)||this.itemViewNotFound(p),n=t.view&&s?t.view:new u({model:t,config:i},i),a&&a.push(n);var d=n.render().el;c?c.appendChild(d):this.$el.append(d)},e.prototype.render=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},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(e){void 0===e&&(e={});var n=this.items;return this.onRemoveBefore(n,e),this.clearItems(),t.prototype.remove.call(this),this.onRemove(n,e),this},e.prototype.clearItems=function(){this.items},e}(i.G7);const l=a;a.prototype.itemView=''},668:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var o=n(50),r=n(491),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=e&&t<=e+o||t<=e&&t>=e-o},t.prototype.setGuideLock=function(t,e){var n=(0,o.isUndefined)(t.x)?'Y':'X',r="trg".concat(n);return null!==e?(t.active=!0,t.lock=e,this[r]=t):(delete t.active,delete t.lock,delete this[r]),t},t.prototype.stop=function(t,e){void 0===e&&(e={});var n=this.delta,r=!!e.cancel,i=r?0:n.x,s=r?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,s,!0);var a=this.opts.onEnd;(0,o.isFunction)(a)&&a(t,this,{cancelled:r})},t.prototype.keyHandle=function(t){(0,r.kl)(t)&&this.stop(t,{cancel:!0})},t.prototype.move=function(t,e,n){var r=this.el,i=this.opts,s=this.startPosition;if(s){var a=i.setPosition,l=s.x+t,c=s.y+e;this.position={x:l,y:c,end:n},(0,o.isFunction)(a)&&a(this.position),r&&(r.style.left="".concat(l,"px"),r.style.top="".concat(c,"px"))}},t.prototype.getContainerEl=function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()},t.prototype.getWindowEl=function(){return this.getContainerEl().map((function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow}))},t.prototype.getDocumentEl=function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs.length){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs},t.prototype.getPointerPos=function(t){var e=this.opts.getPointerPosition,n=(0,r.VB)(t);return e?e(t):{x:n.clientX,y:n.clientY}},t.prototype.getStartPosition=function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return(0,o.isFunction)(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n},t.prototype.getScrollInfo=function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}},t.prototype.detectAxisLock=function(t,e){var n=t,o=e,r=Math.abs(n),i=Math.abs(o);return o>=r||o<=-r?'x':n>i||n<-i?'y':void 0},t}()},895:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>vt});var o='undefined'!=typeof document?document:null,r='undefined'!=typeof window?window:null,i=Array.prototype,s=i.filter,a=i.indexOf,l=i.map,c=i.push,u=i.reverse,p=i.slice,d=i.splice,f=/^#[\w-]*$/,h=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function y(t,e){return void 0===e&&(e=o),h.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function m(t,e){if(void 0===e&&(e=o),t){if(t.__cash)return t;var n=t;if(E(t)){if(e.__cash&&(e=e[0]),!(n=f.test(t)?e.getElementById(t.slice(1)):g.test(t)?ft(t):y(t,e)))return}else if(k(t))return this.ready(t);(n.nodeType||n===r)&&(n=[n]),this.length=n.length;for(var i=0,s=this.length;i=0})):n.value=r}))},_.clone=function(){return this.map((function(t,e){return e.cloneNode(!0)}))},_.detach=function(){return this.each((function(t,e){e.parentNode&&e.parentNode.removeChild(e)}))};var ut,pt=/^\s*<(\w+)[^>]*>/,dt=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function ft(t){if(function(){if(!ut){var t=o.createElement('table'),e=o.createElement('tr');ut={'*':o.createElement('div'),tr:o.createElement('tbody'),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!E(t))return[];if(dt.test(t))return[o.createElement(RegExp.$1)];var e=pt.test(t)&&RegExp.$1,n=ut[e]||ut['*'];return n.innerHTML=t,b(n.childNodes).detach().get()}function ht(t,e,n){if(void 0!==e){var o=E(e);!o&&e.length?S(e,(function(e){return ht(t,e,n)})):S(t,o?function(t){t.insertAdjacentHTML(n?'afterbegin':'beforeend',e)}:function(t,o){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,o?e.cloneNode(!0):e,n)})}}b.parseHTML=ft,_.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},_.append=function(){var t=this;return S(arguments,(function(e){ht(t,e)})),this},_.appendTo=function(t){return ht(b(t),this),this},_.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}))},_.insertAfter=function(t){var e=this;return b(t).each((function(t,n){var o=n.parentNode;e.each((function(e,r){o.insertBefore(t?r.cloneNode(!0):r,n.nextSibling)}))})),this},_.after=function(){var t=this;return S(u.apply(arguments),(function(e){u.apply(b(e).slice()).insertAfter(t)})),this},_.insertBefore=function(t){var e=this;return b(t).each((function(t,n){var o=n.parentNode;e.each((function(e,r){o.insertBefore(t?r.cloneNode(!0):r,n)}))})),this},_.before=function(){var t=this;return S(arguments,(function(e){b(e).insertBefore(t)})),this},_.prepend=function(){var t=this;return S(arguments,(function(e){ht(t,e,!0)})),this},_.prependTo=function(t){return ht(b(t),u.apply(this.slice()),!0),this},_.remove=function(){return this.detach().off()},_.replaceWith=function(t){var e=this;return this.each((function(n,o){var r=o.parentNode;if(r){var i=n?b(t).clone():b(t);if(!i[0])return e.remove(),!1;r.replaceChild(i[0],o),b(i[0]).after(i.slice(1))}}))},_.replaceAll=function(t){return b(t).replaceWith(this),this},_.text=function(t){return void 0===t?this[0]?this[0].textContent:'':this.each((function(e,n){n.textContent=t}))};var gt=o&&o.documentElement;_.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+r.pageYOffset-gt.clientTop,left:e.left+r.pageXOffset-gt.clientLeft}}},_.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},_.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},_.children=function(t){var e=[];return this.each((function(t,n){c.apply(e,n.children)})),e=b(D(e)),t?e.filter((function(e,n){return T(n,t)})):e},_.contents=function(){var t=[];return this.each((function(e,n){c.apply(t,'IFRAME'===n.tagName?[n.contentDocument]:n.childNodes)})),b(t.length&&D(t))},_.find=function(t){for(var e=[],n=0,o=this.length;n{"use strict";n.d(e,{$Q:()=>g,BM:()=>w,FW:()=>d,G1:()=>a,GX:()=>S,L_:()=>c,Mx:()=>l,R3:()=>v,S1:()=>M,SJ:()=>_,Ut:()=>C,VB:()=>k,Vb:()=>A,cx:()=>u,dL:()=>h,kl:()=>E,o5:()=>x,on:()=>j,pn:()=>f,r$:()=>P,rw:()=>m,sE:()=>p,sN:()=>T,t3:()=>b,ut:()=>y});var o=n(50),r=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r=i?t.appendChild(e):t.insertBefore(e,r[s])},v=function(t,e){return g(t,e)},y=function(t,e,n){void 0===e&&(e={});var r=document.createElement(t);return e&&(0,o.each)(e,(function(t,e){return r.setAttribute(e,t)})),n&&((0,o.isString)(n)?r.innerHTML=n:r.appendChild(n)),r},m=function(t){return document.createTextNode(t)},b=function(t,e){var n,o=t.type;try{n=new window[e](o,t)}catch(t){(n=document.createEvent(e)).initEvent(o,!0,!0)}return n._parentEvent=t,0===o.indexOf('key')&&(n.keyCodeVal=t.keyCode,['keyCode','which'].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})}))),n},_=function(t,e){void 0===e&&(e=[]),(Array.isArray(e)?e:[e]).forEach((function(e){var n=e[i]||'div',r=e[s]||{},a=document.createElement(n);(0,o.each)(r,(function(t,e){a.setAttribute(e,t)})),t.appendChild(a)}))},w=function(t){return(null==t?void 0:t.nodeType)===Node.TEXT_NODE},x=function(t){return t&&!w(t)&&!function(t){return(null==t?void 0:t.nodeType)===Node.COMMENT_NODE}(t)},C=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(w(t)){var o=document.createRange();o.selectNode(t),e=o.getBoundingClientRect(),o.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},S=function(t){var e=(null==t?void 0:t.ownerDocument)||document,n=e.documentElement,o=e.defaultView||window;return{x:(o.pageXOffset||n.scrollLeft||0)-(n.clientLeft||0),y:(o.pageYOffset||n.scrollTop||0)-(n.clientTop||0)}},O=function(t){return t.which||t.keyCode},T=function(t){return String.fromCharCode(O(t))},k=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},E=function(t){return 27===O(t)},P=function(t){return 13===O(t)},A=function(t){return function(t){return t.ctrlKey}(t)||t.metaKey},j=function(t,e,n,r){var i=e.split(/\s+/),s=(0,o.isArray)(t)?t:[t];i.forEach((function(t){s.forEach((function(e){return null==e?void 0:e.addEventListener(t,n,r)}))}))},M=function(t,e,n,r){var i=e.split(/\s+/),s=(0,o.isArray)(t)?t:[t];i.forEach((function(t){s.forEach((function(e){return null==e?void 0:e.removeEventListener(t,n,r)}))}))}},163:(t,e,n)=>{"use strict";n.r(e),n.d(e,{appendStyles:()=>m,buildBase64UrlFromSvg:()=>z,camelCase:()=>x,capitalize:()=>L,createId:()=>H,deepMerge:()=>P,escape:()=>k,escapeNodeContent:()=>E,find:()=>T,getComponentModel:()=>V,getComponentView:()=>F,getElement:()=>O,getGlobal:()=>f,getModel:()=>A,getUiClass:()=>y,getUnitFromValue:()=>_,getViewEl:()=>N,hasDnd:()=>S,hasWin:()=>d,isBultInMethod:()=>l,isComponent:()=>I,isDef:()=>p,isEmptyObj:()=>M,isObject:()=>j,isRule:()=>D,matches:()=>v,normalizeFloat:()=>C,normalizeKey:()=>c,setViewEl:()=>R,shallowDiff:()=>b,toLowerCase:()=>h,upFirst:()=>w,wait:()=>u});var o=n(50),r=n(491),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0?s!==a&&(n[i]=a):n[i]=null}for(var i in e)e.hasOwnProperty(i)&&(0,o.isUndefined)(t[i])&&(n[i]=e[i]);return n},_=function(t){return t.replace(parseFloat(t),'')},w=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},x=function(t){return t.replace(/-./g,(function(t){return t[1].toUpperCase()}))},C=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=0);var o=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var r=e.toString().split('.')[1];o=r?r.length:0}return o?parseFloat(t.toFixed(o)):t},S=function(t){return'draggable'in document.createElement('i')&&(!t||t.config.nativeDnD)},O=function(t){return(0,o.isElement)(t)||(0,r.BM)(t)?t:t&&t.getEl?t.getEl():void 0},T=function(t,e){var n=null;return t.some((function(o,r){return e(o,r,t)?(n=o,1):0})),n},k=function(t){return void 0===t&&(t=''),"".concat(t).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/`/g,'`')},E=function(t){return void 0===t&&(t=''),"".concat(t).replace(/&/g,'&').replace(//g,'>')},P=function(){for(var t=[],e=0;e{var o={"./CanvasClear":858,"./CanvasClear.ts":858,"./CanvasMove":884,"./CanvasMove.ts":884,"./CommandAbstract":790,"./CommandAbstract.ts":790,"./ComponentDelete":180,"./ComponentDelete.ts":180,"./ComponentDrag":544,"./ComponentDrag.ts":544,"./ComponentEnter":236,"./ComponentEnter.ts":236,"./ComponentExit":368,"./ComponentExit.ts":368,"./ComponentNext":243,"./ComponentNext.ts":243,"./ComponentPrev":400,"./ComponentPrev.ts":400,"./ComponentStyleClear":910,"./ComponentStyleClear.ts":910,"./CopyComponent":744,"./CopyComponent.ts":744,"./ExportTemplate":457,"./ExportTemplate.ts":457,"./Fullscreen":975,"./Fullscreen.ts":975,"./MoveComponent":191,"./MoveComponent.ts":191,"./OpenAssets":912,"./OpenAssets.ts":912,"./OpenBlocks":117,"./OpenBlocks.ts":117,"./OpenLayers":614,"./OpenLayers.ts":614,"./OpenStyleManager":801,"./OpenStyleManager.ts":801,"./OpenTraitManager":395,"./OpenTraitManager.ts":395,"./PasteComponent":98,"./PasteComponent.ts":98,"./Preview":129,"./Preview.ts":129,"./Resize":116,"./Resize.ts":116,"./SelectComponent":407,"./SelectComponent.ts":407,"./SelectPosition":189,"./SelectPosition.ts":189,"./ShowOffset":804,"./ShowOffset.ts":804,"./SwitchVisibility":434,"./SwitchVisibility.ts":434};function r(t){var e=i(t);return n(e)}function i(t){if(!n.o(o,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code='MODULE_NOT_FOUND',e}return o[t]}r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=828},50:(t,e,n)=>{"use strict";n.r(e),n.d(e,{VERSION:()=>r,after:()=>Ne,all:()=>en,allKeys:()=>vt,any:()=>nn,assign:()=>Nt,before:()=>Ie,bind:()=>Ce,bindAll:()=>Te,chain:()=>be,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ye,compact:()=>En,compose:()=>De,constant:()=>J,contains:()=>on,countBy:()=>mn,create:()=>Vt,debounce:()=>je,default:()=>Wn,defaults:()=>It,defer:()=>Pe,delay:()=>Ee,detect:()=>qe,difference:()=>An,drop:()=>Tn,each:()=>Ke,escape:()=>ae,every:()=>en,extend:()=>Dt,extendOwn:()=>Nt,filter:()=>Qe,find:()=>qe,findIndex:()=>He,findKey:()=>Ve,findLastIndex:()=>ze,findWhere:()=>Ge,first:()=>On,flatten:()=>Pn,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ke,functions:()=>Mt,get:()=>Wt,groupBy:()=>vn,has:()=>$t,head:()=>On,identity:()=>qt,include:()=>on,includes:()=>on,indexBy:()=>yn,indexOf:()=>We,initial:()=>Sn,inject:()=>Xe,intersection:()=>Dn,invert:()=>jt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>F,isBoolean:()=>E,isDataView:()=>$,isDate:()=>L,isElement:()=>P,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>N,isFinite:()=>Z,isFunction:()=>H,isMap:()=>Ot,isMatch:()=>ct,isNaN:()=>X,isNull:()=>T,isNumber:()=>M,isObject:()=>O,isRegExp:()=>D,isSet:()=>kt,isString:()=>j,isSymbol:()=>I,isTypedArray:()=>rt,isUndefined:()=>k,isWeakMap:()=>Tt,isWeakSet:()=>Et,iteratee:()=>Xt,keys:()=>at,last:()=>kn,lastIndexOf:()=>$e,map:()=>Ye,mapObject:()=>Qt,matcher:()=>Gt,matches:()=>Gt,max:()=>ln,memoize:()=>ke,methods:()=>Mt,min:()=>cn,mixin:()=>zn,negate:()=>Le,noop:()=>te,now:()=>re,object:()=>Fn,omit:()=>Cn,once:()=>Fe,pairs:()=>At,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>sn,property:()=>Kt,propertyOf:()=>ee,random:()=>oe,range:()=>Vn,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>tn,rest:()=>Tn,restArguments:()=>S,result:()=>ve,sample:()=>dn,select:()=>Qe,shuffle:()=>fn,size:()=>_n,some:()=>nn,sortBy:()=>hn,sortedIndex:()=>Be,tail:()=>Tn,take:()=>On,tap:()=>Ht,template:()=>ge,templateSettings:()=>ce,throttle:()=>Ae,times:()=>ne,toArray:()=>pn,toPath:()=>zt,transpose:()=>Nn,unescape:()=>le,union:()=>Ln,uniq:()=>Mn,unique:()=>Mn,uniqueId:()=>me,unzip:()=>Nn,values:()=>Pt,where:()=>an,without:()=>jn,wrap:()=>Me,zip:()=>In});var o={};n.r(o),n.d(o,{VERSION:()=>r,after:()=>Ne,all:()=>en,allKeys:()=>vt,any:()=>nn,assign:()=>Nt,before:()=>Ie,bind:()=>Ce,bindAll:()=>Te,chain:()=>be,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ye,compact:()=>En,compose:()=>De,constant:()=>J,contains:()=>on,countBy:()=>mn,create:()=>Vt,debounce:()=>je,default:()=>Bn,defaults:()=>It,defer:()=>Pe,delay:()=>Ee,detect:()=>qe,difference:()=>An,drop:()=>Tn,each:()=>Ke,escape:()=>ae,every:()=>en,extend:()=>Dt,extendOwn:()=>Nt,filter:()=>Qe,find:()=>qe,findIndex:()=>He,findKey:()=>Ve,findLastIndex:()=>ze,findWhere:()=>Ge,first:()=>On,flatten:()=>Pn,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ke,functions:()=>Mt,get:()=>Wt,groupBy:()=>vn,has:()=>$t,head:()=>On,identity:()=>qt,include:()=>on,includes:()=>on,indexBy:()=>yn,indexOf:()=>We,initial:()=>Sn,inject:()=>Xe,intersection:()=>Dn,invert:()=>jt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>F,isBoolean:()=>E,isDataView:()=>$,isDate:()=>L,isElement:()=>P,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>N,isFinite:()=>Z,isFunction:()=>H,isMap:()=>Ot,isMatch:()=>ct,isNaN:()=>X,isNull:()=>T,isNumber:()=>M,isObject:()=>O,isRegExp:()=>D,isSet:()=>kt,isString:()=>j,isSymbol:()=>I,isTypedArray:()=>rt,isUndefined:()=>k,isWeakMap:()=>Tt,isWeakSet:()=>Et,iteratee:()=>Xt,keys:()=>at,last:()=>kn,lastIndexOf:()=>$e,map:()=>Ye,mapObject:()=>Qt,matcher:()=>Gt,matches:()=>Gt,max:()=>ln,memoize:()=>ke,methods:()=>Mt,min:()=>cn,mixin:()=>zn,negate:()=>Le,noop:()=>te,now:()=>re,object:()=>Fn,omit:()=>Cn,once:()=>Fe,pairs:()=>At,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>sn,property:()=>Kt,propertyOf:()=>ee,random:()=>oe,range:()=>Vn,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>tn,rest:()=>Tn,restArguments:()=>S,result:()=>ve,sample:()=>dn,select:()=>Qe,shuffle:()=>fn,size:()=>_n,some:()=>nn,sortBy:()=>hn,sortedIndex:()=>Be,tail:()=>Tn,take:()=>On,tap:()=>Ht,template:()=>ge,templateSettings:()=>ce,throttle:()=>Ae,times:()=>ne,toArray:()=>pn,toPath:()=>zt,transpose:()=>Nn,unescape:()=>le,union:()=>Ln,uniq:()=>Mn,unique:()=>Mn,uniqueId:()=>me,unzip:()=>Nn,values:()=>Pt,where:()=>an,without:()=>jn,wrap:()=>Me,zip:()=>In});var r='1.13.6',i='object'==typeof self&&self.self===self&&self||'object'==typeof global&&global.global===global&&global||Function('return this')()||{},s=Array.prototype,a=Object.prototype,l='undefined'!=typeof Symbol?Symbol.prototype:null,c=s.push,u=s.slice,p=a.toString,d=a.hasOwnProperty,f='undefined'!=typeof ArrayBuffer,h='undefined'!=typeof DataView,g=Array.isArray,v=Object.keys,y=Object.create,m=f&&ArrayBuffer.isView,b=isNaN,_=isFinite,w=!{toString:null}.propertyIsEnumerable('toString'),x=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'],C=Math.pow(2,53)-1;function S(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),o=Array(n),r=0;r=0&&n<=C}}function tt(t){return function(e){return null==e?void 0:e[t]}}const et=tt('byteLength'),nt=Q(et);var ot=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const rt=f?function(t){return m?m(t)&&!$(t):nt(t)&&ot.test(p.call(t))}:J(!1),it=tt('length');function st(t,e){e=function(t){for(var e={},n=t.length,o=0;o':'>','"':'"',"'":''','`':'`'},ae=ie(se),le=ie(jt(se)),ce=ut.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ue=/(.)^/,pe={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'},de=/\\|'|\r|\n|\u2028|\u2029/g;function fe(t){return'\\'+pe[t]}var he=/^\s*(\w|\$)+\s*$/;function ge(t,e,n){!e&&n&&(e=n),e=It({},e,ut.templateSettings);var o=RegExp([(e.escape||ue).source,(e.interpolate||ue).source,(e.evaluate||ue).source].join('|')+'|$','g'),r=0,i="__p+='";t.replace(o,(function(e,n,o,s,a){return i+=t.slice(r,a).replace(de,fe),r=a+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":o?i+="'+\n((__t=("+o+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),e})),i+="';\n";var s,a=e.variable;if(a){if(!he.test(a))throw new Error('variable is not a bare identifier: '+a)}else i='with(obj||{}){\n'+i+'}\n',a='obj';i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+'return __p;\n';try{s=new Function(a,'_',i)}catch(t){throw t.source=i,t}var l=function(t){return s.call(this,t,ut)};return l.source='function('+a+'){\n'+i+'}',l}function ve(t,e,n){var o=(e=Bt(e)).length;if(!o)return H(n)?n.call(t):n;for(var r=0;r1)Oe(a,e-1,n,o),r=o.length;else for(var l=0,c=a.length;le?(o&&(clearTimeout(o),o=null),a=c,s=t.apply(r,i),o||(r=i=null)):o||!1===n.trailing||(o=setTimeout(l,u)),s};return c.cancel=function(){clearTimeout(o),a=0,o=r=i=null},c}function je(t,e,n){var o,r,i,s,a,l=function(){var c=re()-r;e>c?o=setTimeout(l,e-c):(o=null,n||(s=t.apply(a,i)),o||(i=a=null))},c=S((function(c){return a=this,i=c,r=re(),o||(o=setTimeout(l,e),n&&(s=t.apply(a,i))),s}));return c.cancel=function(){clearTimeout(o),o=i=a=null},c}function Me(t,e){return xe(e,t)}function Le(t){return function(){return!t.apply(this,arguments)}}function De(){var t=arguments,e=t.length-1;return function(){for(var n=e,o=t[e].apply(this,arguments);n--;)o=t[n].call(this,o);return o}}function Ne(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Ie(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const Fe=xe(Ie,2);function Ve(t,e,n){e=Jt(e,n);for(var o,r=at(t),i=0,s=r.length;i0?0:r-1;i>=0&&i0?s=i>=0?i:Math.max(i+a,s):a=i>=0?Math.min(i+1,a):i+a+1;else if(n&&i&&a)return o[i=n(o,r)]===r?i:-1;if(r!=r)return(i=e(u.call(o,s,a),X))>=0?i+s:-1;for(i=t>0?s:a-1;i>=0&&i=3;return function(e,n,o,r){var i=!Se(e)&&at(e),s=(i||e).length,a=t>0?0:s-1;for(r||(o=e[i?i[a]:a],a+=t);a>=0&&a=0}const rn=S((function(t,e,n){var o,r;return H(e)?r=e:(e=Bt(e),o=e.slice(0,-1),e=e[e.length-1]),Ye(t,(function(t){var i=r;if(!i){if(o&&o.length&&(t=Ut(t,o)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)}))}));function sn(t,e){return Ye(t,Kt(e))}function an(t,e){return Qe(t,Gt(e))}function ln(t,e,n){var o,r,i=-1/0,s=-1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var a=0,l=(t=Se(t)?t:Pt(t)).length;ai&&(i=o);else e=Jt(e,n),Ke(t,(function(t,n,o){((r=e(t,n,o))>s||r===-1/0&&i===-1/0)&&(i=t,s=r)}));return i}function cn(t,e,n){var o,r,i=1/0,s=1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var a=0,l=(t=Se(t)?t:Pt(t)).length;ao||void 0===n)return 1;if(n1&&(o=Yt(o,e[1])),e=vt(t)):(o=wn,e=Oe(e,!1,!1),t=Object(t));for(var r=0,i=e.length;r1&&(n=e[1])):(e=Ye(Oe(e,!1,!1),String),o=function(t,n){return!on(e,n)}),xn(t,o,n)}));function Sn(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function On(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Sn(t,t.length-e)}function Tn(t,e,n){return u.call(t,null==e||n?1:e)}function kn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:Tn(t,Math.max(0,t.length-e))}function En(t){return Qe(t,Boolean)}function Pn(t,e){return Oe(t,e,!1)}const An=S((function(t,e){return e=Oe(e,!0,!0),Qe(t,(function(t){return!on(e,t)}))})),jn=S((function(t,e){return An(t,e)}));function Mn(t,e,n,o){E(e)||(o=n,n=e,e=!1),null!=n&&(n=Jt(n,o));for(var r=[],i=[],s=0,a=it(t);s{var e=t&&t.__esModule?()=>t['default']:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},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 o={};return(()=>{"use strict";n.d(o,{default:()=>lg});var t=n(50),e=n(163);function r(t){for(var n=[],o=1;o',move:'',plus:'',caret:'',delete:'',copy:'',arrowUp:'',chevron:'',eye:'',eyeOff:''},i18n:{},undoManager:{},assetManager:{},canvas:{},layerManager:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:'Code',keepUnusedStyles:!1,customUI:!1};var s=n(316),a=n.n(s),l=n(895);var c,u=n(346),p=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)}),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e}(u.Hn);const f=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return p(n,e),n.prototype.getByComponent=function(t){var e=this;return this.filter((function(n){return e.getComponent(n)===t}))[0]},n.prototype.addComponent=function(e,n){var o=this,r=((0,t.isArray)(e)?e:[e]).filter((function(t){return!o.hasComponent(t)})).map((function(t){return new d({component:t})}))[0];return this.push(r,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):void 0},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(e,n){var o=this,r=((0,t.isArray)(e)?e:[e]).map((function(t){return o.getByComponent(t)}));return this.remove(r,n)},n}(u.FE);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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),g=void 0&&(void 0).__assign||function(){return g=Object.assign||function(t){for(var e,n=1,o=arguments.length;n',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]'],allowExternalDrop:!0};var w=n(642);const x={default:'',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 C=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return C(e,t),e.prototype.defaults=function(){return{name:'',width:null,height:'',widthMedia:null,priority:null}},e.prototype.initialize=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)}))},e.prototype.checkUnit=function(t){var e=this.get(t)||'';(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))},e.prototype.getName=function(){return this.get('name')||this.get('id')},e.prototype.getWidthMedia=function(){return this.get('widthMedia')||''},e}(u.Hn);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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e}(u.FE);const k=T;T.prototype.model=S;var E=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),P=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},A=function(t){function e(e){var n=t.call(this,e)||this;return n.config=e.config||{},n.em=n.config.em,n.ppfx=n.config.pStylePrefix||'',n.listenTo(n.em,'change:device',n.updateSelect),n}return E(e,t),e.prototype.template=function(t){var e=t.ppfx,n=t.label;return r(M||(M=P(["\n
","
\n
\n \n \n \n
\n
\n
\n
\n \n "],["\n
","
\n
\n \n \n \n
\n
\n
\n
\n \n "])),e,n,e,e,e,e,e,e,e)},e.prototype.events=function(){return{change:'updateDevice','click [data-add-trasp]':'startAdd'}},e.prototype.startAdd=function(){},e.prototype.updateDevice=function(){var t=this.em;if(t){var e=this.devicesEl;t.set('device',e?e.val():'')}},e.prototype.updateSelect=function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel();e.val(n?n.get('id'):'')}},e.prototype.getOptions=function(){var t=this.collection,e=this.em,n='';return t.forEach((function(t){var o=t.attributes,r=o.name,i=o.id,s=e&&e.t&&e.t("deviceManager.devices.".concat(i))||r;n+="")})),n},e.prototype.render=function(){var t=this,e=t.em,n=t.ppfx,o=t.$el,r=t.el,i=e&&e.t&&e.t('deviceManager.device');return o.html(this.template({ppfx:n,label:i})),this.devicesEl=o.find(".".concat(n,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(e.get('device')),r.className="".concat(n,"devices-c"),this},e}(u.G7);const j=A;var M,L=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),D=void 0&&(void 0).__assign||function(){return D=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0&&this.head.splice(r,1)},o.prototype.addLink=function(t){var e='link';!this.getHeadByAttr('href',t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:'stylesheet'}})},o.prototype.removeLink=function(t){this.removeHeadByAttr('href',t,'link')},o.prototype.addScript=function(t){var e='script';!this.getHeadByAttr('src',t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},o.prototype.removeScript=function(t){this.removeHeadByAttr('src',t,'script')},o.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},o.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger('frame:updated',J({frame:this},t))},o.prototype.hasAutoHeight=function(){return!('auto'!==this.attributes.height&&!this.config.infiniteCanvas)},o.prototype.toJSON=function(e){void 0===e&&(e={});var n=w.Z.prototype.toJSON.call(this,e),o=(0,t.result)(this,'defaults');return e.fromUndo&&delete n.component,delete n.styles,delete n.changesCount,n[tt]&&delete n.width,n[et]&&delete n.height,n.refFrame&&(n.refFrame=n.refFrame.id,delete n.component),(0,t.forEach)(n,(function(t,e){0===e.indexOf('_')&&delete n[e]})),(0,t.forEach)(o,(function(t,e){n[e]===t&&delete n[e]})),(0,t.forEach)(['attributes','head'],(function(e){(0,t.isEmpty)(n[e])&&delete n[e]})),n},o}(w.Z);const rt=ot;var it=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const st=function(e){function n(n,o){void 0===o&&(o=[]);var r=e.call(this,n,o,rt)||this;return r.loadedItems=0,r.itemsToLoad=0,(0,t.bindAll)(r,'itemLoaded'),r.on('add',r.onAdd),r.on('reset',r.onReset),r.on('remove',r.onRemove),r.forEach((function(t){return r.onAdd(t)})),r}return it(n,e),n.prototype.onAdd=function(t){this.module.framesById[t.id]=t},n.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map((function(t){return n.onRemove(t)}))},n.prototype.onRemove=function(t){t.onRemove(),delete this.module.framesById[t.id]},n.prototype.initRefs=function(){this.forEach((function(t){return t.initRefs()}))},n.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger('loaded:all'),this.listenToLoadItems(!1))},n.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},n.prototype.listenToLoadItems=function(t){var e=this;this.forEach((function(n){return n[t?'on':'off']('loaded',e.itemLoaded)}))},n}(Z);var at=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),lt=function(t){function e(e){var n=this,o=e.em,r=e.config,i=r.scripts,s=r.styles;return(n=t.call(this,e,{scripts:i,styles:s})||this).set('frames',new st(e)),n.on('change:zoom',n.onZoomChange),n.on('change:x change:y',n.onCoordsChange),n.on('change:pointer change:pointerScreen',n.onPointerChange),n.listenTo(o,"change:device ".concat(V),n.updateDevice),n.listenTo(o,G.select,n._pageUpdated),n}return at(e,t),e.prototype.defaults=function(){return{frame:'',frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[],pointer:u.pH,pointerScreen:u.pH}},Object.defineProperty(e.prototype,"frames",{get:function(){return this.get('frames')},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this.em.Pages._initPage();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(),o=t.frame||e.getCurrentFrameModel();if(o&&n){var r=n.attributes,i=r.width,s=r.height;o.set({width:i,height:s},{noUndo:1})}},e.prototype.onZoomChange=function(){var t=this.em,e=this.module;this.get('zoom')<1&&this.set('zoom',1),t.trigger(e.events.zoom)},e.prototype.onCoordsChange=function(){var t=this.em,e=this.module;t.trigger(e.events.coords)},e.prototype.onPointerChange=function(){var t=this.em,e=this.module;t.trigger(e.events.pointer)},e.prototype.getPointerCoords=function(t){void 0===t&&(t=u.vA.World);var e=this.attributes,n=e.pointer,o=e.pointerScreen;return t===u.vA.World?n:o},e}(w.Z);const ct=lt;var ut=n(675),pt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),dt=function(e){function n(n,o){void 0===o&&(o=[]);var r=e.call(this,n,o,ut.Z)||this;r.on('add',r.onAdd),r.on('change',r.onChange),r.on('remove',r.onRemove);var i=r.em;r.refreshDbn=(0,t.debounce)((function(){return r.refresh()}),0);return r.listenTo(i,'component:resize styleable:change component:input component:update frame:updated undo redo',(function(){return r.refreshDbn()})),r}return pt(n,e),Object.defineProperty(n.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"events",{get:function(){return this.module.events},enumerable:!1,configurable:!0}),n.prototype.refresh=function(){var t=this.em,e=this.events;t.trigger(e.spot)},n.prototype.onAdd=function(t){this.__trgEvent(this.events.spotAdd,{spot:t})},n.prototype.onChange=function(t){this.__trgEvent(this.events.spotUpdate,{spot:t})},n.prototype.onRemove=function(t){this.__trgEvent(this.events.spotRemove,{spot:t})},n.prototype.__trgEvent=function(t,e){this.module.em.trigger(t,e),this.refreshDbn()},n}(Z);const ft=dt;var ht;!function(t){t["dragEnter"]="canvas:dragenter",t["dragOver"]="canvas:dragover",t["dragEnd"]="canvas:dragend",t["dragData"]="canvas:dragdata",t["drop"]="canvas:drop",t["spot"]="canvas:spot",t["spotAdd"]="canvas:spot:add",t["spotUpdate"]="canvas:spot:update",t["spotRemove"]="canvas:spot:remove",t["coords"]="canvas:coords",t["zoom"]="canvas:zoom",t["pointer"]="canvas:pointer",t["refresh"]="canvas:refresh",t["frameLoad"]="canvas:frame:load",t["frameLoadHead"]="canvas:frame:load:head",t["frameLoadBody"]="canvas:frame:load:body"}(ht||(ht={}));const gt=ht;var vt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vt(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}(u.G7);const mt=yt;var bt=n(491),_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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const wt=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n=!1);var o=t.call(this,e)||this;return o.itemsView='',o.itemType='type',o.reuseView=!1,o.viewCollection=[],n&&o.listenTo(o.collection,'add',o.addTo),o}return _t(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){},e.prototype.add=function(t,e){var n,o=this.reuseView,r=this.viewCollection,i=e||null,s=t.get(this.itemType);n=t.view&&o?t.view:this.renderView(t,s),r.push(n);var a=n.render().el;i?i.appendChild(a):this.$el.append(a)},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(),u.G7.prototype.remove.apply(this,t),this.onRemove(e,t),this},e.prototype.clearItems=function(){this.viewCollection},e}(mt);var xt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Ct=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{};var o=n.model;return n.listenTo(o,'change',n.render),n.listenTo(o,'destroy remove',n.remove),n.listenTo(o.get('selectors'),'change',n.render),n}return xt(e,t),e.prototype.tagName=function(){return'style'},e.prototype.render=function(){var t=this.model,e=this.el,n=t.get('important');return e.innerHTML=t.toCSS({important:n}),this},e}(u.G7);var St=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Ot=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return St(e,t),e.prototype._createElement=function(){return document.createTextNode('')},e.prototype.render=function(){var t=this.model,e=t.get('important');return this.el.textContent=t.getDeclaration({important:e}),this},e}(Ct);var Tt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),kt=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):'')},Et=function(e){function n(n){var o=e.call(this,n)||this;(0,t.bindAll)(o,'sortRules');var r=n.config||{};o.atRules={},o.config=r,o.em=r.em,o.pfx=r.stylePrefix||'',o.className=o.pfx+'rules';var i=o.collection;return o.listenTo(i,'add',o.addTo),o.listenTo(i,'reset',o.render),o}return Tt(n,e),n.prototype.addTo=function(t){this.addToCollection(t)},n.prototype.addToCollection=function(t,e){if(this.renderStarted){var n,o,r=e||null,i={model:t,config:this.config};if('keyframes'===t.get('atRuleType')){var s=t.getAtRule(),a=this.atRules[s];if(!a){var l=document.createElement('style');a=document.createTextNode(''),l.appendChild(document.createTextNode("".concat(s,"{"))),l.appendChild(a),l.appendChild(document.createTextNode('}')),this.atRules[s]=a,n=l}o=new Ot(i),a.appendData(o.render().el.textContent)}else n=(o=new Ct(i)).render().el;var c=this.className,u=t.get('mediaText'),p=kt(c),d=p;if(u&&(d=kt(c,this.getMediaWidth(u))),n){var f=r||this.el,h=void 0;try{h=f.querySelector("#".concat(d))}catch(t){}h||(h=f.querySelector("#".concat(p))),null==h||h.appendChild(n)}return n}},n.prototype.getMediaWidth=function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),'').replace(')','')},n.prototype.sortRules=function(t,e){var n=-1!==(this.em.getConfig().mediaCondition||'').indexOf('min-width');return n?(n?t:e)-(n?e:t):0},n.prototype.render=function(){var t=this;this.renderStarted=!0,this.atRules={};var e=this,n=e.em,o=e.$el,r=e.collection,i=this.className,s=document.createDocumentFragment();o.empty();var a=n.Devices.getAll().pluck('priority').sort(this.sortRules);return a.every((function(t){return t}))&&a.unshift(0),a.forEach((function(t){return s.appendChild((0,bt.ut)('div',{id:kt(i,t)}))})),r.each((function(e){return t.addToCollection(e,s)})),o.append(s),o.attr('class',i),this},n}(u.G7);const Pt=Et;var At=void 0&&(void 0).__assign||function(){return At=Object.assign||function(t){for(var e,n=1,o=arguments.length;n';if(n.stopDefault(),n.inAbsoluteMode()){var u=n.Components.getWrapper(),p=u.append({})[0],d=n.Commands.run('core:component-drag',{event:t,guidesInfo:1,center:1,target:p,onEnd:function(t,n,i){var s;if(!i.cancelled){s=u.append(c)[0];var a=o.getOffset(),l=p.getStyle(),d=l.top,f=l.left,h=l.position,g=(0,bt.GX)(t.target),v=parseInt("".concat(parseFloat(f)+g.x-a.left),10),y=parseInt("".concat(parseFloat(d)+g.y-a.top),10);s.addStyle({left:v+'px',top:y+'px',position:h})}e.handleDragEnd(s,r),p.remove()}});s=function(e){return d.stop(t,{cancel:e})},a=function(t){return c=t}}else{var f=new l.Sorter(At({em:n,wmargin:1,nested:1,canvasRelative:1,direction:'a',container:this.el,placer:o.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:'gjs-',onEndMove:function(t){return e.handleDragEnd(t,r)},document:this.el.ownerDocument},this.sortOpts||{}));f.setDropContent(c),f.startSort(),this.sorter=f,s=function(t){t&&(f.moved=!1),f.endMove()},a=function(t){return f.setDropContent(t)}}this.dragStop=s,this.dragContent=a,n.trigger('canvas:dragenter',r,c)}},e.prototype.handleDragEnd=function(t,e){var n=this.em;this.over=!1,t&&(n.set('dragResult',t),n.trigger('canvas:drop',e,t)),n.runDefault({preserveSelected:1})},e.prototype.handleDragOver=function(t){t.preventDefault(),this.em.trigger('canvas:dragover',t)},e.prototype.handleDrop=function(t){t.preventDefault();var e=this.dragContent,n=t.dataTransfer,o=this.getContentByData(n).content;t.target.style.border='',o&&e&&e(o),this.endDrop(!o,t)},e.prototype.getContentByData=function(e){var n=this.em,o=e&&e.types,r=e&&e.files||[],i=n.get('dragContent'),s=e&&e.getData('text');if(r.length){s=[];for(var a=0;a=0)s=e&&e.getData('text/html').replace(/<\/?meta[^>]*>/g,'');else if((0,t.indexOf)(o,'text/uri-list')>=0)s={type:'link',attributes:{href:s},content:s};else if((0,t.indexOf)(o,'text/json')>=0){var u=e&&e.getData('text/json');u&&(s=JSON.parse(u))}else 1===o.length&&'text/plain'===o[0]&&(s="
".concat(s,"
"));var p={content:s};return n.trigger('canvas:dragdata',e,p),p},e}();const Mt=jt;var Lt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dt=void 0&&(void 0).__assign||function(){return Dt=Object.assign||function(t){for(var e,n=1,o=arguments.length;na&&(l+=i-a),!(0,t.isUndefined)(e)&&l!==r&&l>0&&l0){var l=n.shift(),u=(0,bt.ut)('script',Dt({type:'text/javascript'},(0,t.isString)(l)?{src:l}:l));null===(r=o.contentDocument)||void 0===r||r.head.appendChild(u),u.hasAttribute('nomodule')&&'noModule'in HTMLScriptElement.prototype?c(n):u.onerror=u.onload=c.bind(null,n)}else null==i||i.trigger(gt.frameLoadHead,a),e.renderBody(),null==i||i.trigger(gt.frameLoadBody,a),null==i||i.trigger(s,a)};o.onload=function(){var t=e.config.frameContent;if(t){var n=e.getDoc();n.open(),n.write(t),n.close()}a.window=e.getWindow(),null==i||i.trigger("".concat(s,":before"),a),null==i||i.trigger(gt.frameLoad,a),c(Nt([],l.get('scripts'),!0))}},o.prototype.renderStyles=function(e){void 0===e&&(e={});var n=this.getHead(),o=this.getCanvasModel(),r=function(e){return e.map((function(e){return{tag:'link',attributes:Dt({rel:'stylesheet'},(0,t.isString)(e)?{href:e}:e)}}))},i=r(e.prev||o.previous('styles')),s=r(o.get('styles')),a=[],l=[],c=function(t,e,n){t.forEach((function(t){var o=t.attributes.href;!e.some((function(t){return t.attributes.href===o}))&&n.push(t)}))};c(s,i,l),c(i,s,a),a.forEach((function(t){var e,o=n.querySelector("link[href=\"".concat(t.attributes.href,"\"]"));null===(e=null==o?void 0:o.parentNode)||void 0===e||e.removeChild(o)})),(0,bt.SJ)(n,l)},o.prototype.renderBody=function(){var t,n,o=this,r=this,i=r.config,s=r.em,a=r.model,l=r.ppfx,c=this.getDoc(),u=this.getBody(),p=this.getWindow(),d=a.hasAutoHeight(),f=s.config;p._isEditor=!0,this.renderStyles({prev:[]});(0,bt.R3)(u,""));var h=a.root,g=s.Components.getType('wrapper').view;this.wrapper=new g({model:h,config:Dt(Dt({},h.config),{em:s,frameView:this})}).render(),(0,bt.R3)(u,null===(t=this.wrapper)||void 0===t?void 0:t.el),(0,bt.R3)(u,new Pt({collection:a.getStyles(),config:Dt(Dt({},s.Css.getConfig()),{frameView:this})}).render().el),(0,bt.R3)(u,this.getJsContainer()),(0,bt.on)(u,'click',(function(t){var e;return t&&'A'==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()})),(0,bt.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',opts:{passive:!i.infiniteCanvas}}].forEach((function(t){return t.event.split(' ').forEach((function(e){c.addEventListener(e,(function(e){return o.el.dispatchEvent((0,bt.t3)(e,t.class))}),t.opts)}))})),this._toggleEffects(!0),(0,e.hasDnd)(s)&&(this.droppable=new Mt(s,null===(n=this.wrapper)||void 0===n?void 0:n.el)),this.loaded=!0,a.trigger('loaded')},o.prototype._toggleEffects=function(t){var e=t?bt.on:bt.S1,n=this.getWindow();n&&e(n,"".concat(bt.G1," resize"),this._emitUpdate)},o.prototype._emitUpdate=function(){this.model._emitUpdated()},o}(mt);const Ft=It;var Vt=n(668),Rt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ht=void 0&&(void 0).__assign||function(){return Ht=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n ").concat(i.get('name')||'',"\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n ")).append(e.el);var l=(0,bt.ut)('div',{class:"".concat(o,"tools"),style:'pointer-events:none; display: none'},"\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n "));this.elTools=l;var c=null==r?void 0:r.toolsWrapper;return c&&c.appendChild(l),a&&a({el:s,elTop:s.querySelector('[data-frame-top]'),elRight:s.querySelector('[data-frame-right]'),elBottom:s.querySelector('[data-frame-bottom]'),elLeft:s.querySelector('[data-frame-left]'),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},n}(mt);const Bt=zt;var Ut=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Wt=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,!0)||this;return o.listenTo(o.collection,'reset',o.render),o.canvasView=n.canvasView,o._module=n.module,o}return Ut(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach((function(t){return t.remove(e)}))},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.clearItems=function(){(this.viewCollection||[]).forEach((function(t){return t.remove()})),this.viewCollection=[]},e.prototype.renderView=function(t,e){return new Bt(t,this.canvasView)},e}(wt);const $t=Wt;var qt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Gt=void 0&&(void 0).__assign||function(){return Gt=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n \n
\n \n ")},o.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},o.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,o=t.config,r=t.em,i=n.frames;r.set('readyCanvas',0),i.once('loaded:all',(function(){return r.set('readyCanvas',1)})),null==e||e.remove(),this.frames=new $t({collection:i},Gt(Gt({},o),{canvasView:this}))},o.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var o=e.scroll,r=this.em.getCurrentFrame();o&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t.frameView===r&&t.scrollIntoView(o)})))},o.prototype.remove=function(){for(var t,e=[],n=0;n=O?O/2-C/2:-w)+w)*P,y:(-v.y+T/2-S/2+x)*P};if(m){var M=a.getZoomMultiplier(),L=(T*M-T)/2;j.y=(-v.y+x)*P-L/M}a.setCoords(j.x,j.y)},o.prototype.isElInViewport=function(t){var n=(0,e.getElement)(t),o=(0,bt.Ut)(n),r=this.getFrameOffset(n),i=o.top,s=o.left;return i>=0&&s>=0&&i<=r.height&&s<=r.width},o.prototype.offset=function(t,e){void 0===e&&(e={});var n=e.noScroll,o=(0,bt.Ut)(t),r=n?{x:0,y:0}:(0,bt.GX)(t);return{top:o.top+r.y,left:o.left+r.x,width:o.width,height:o.height}},o.prototype.getRectToScreen=function(t){var e,n,o,r,i=this.module.getZoomDecimal(),s=this.module.getCoords(),a=this.getViewportDelta();return{x:(null!==(e=t.x)&&void 0!==e?e:0)*i+s.x+a.x||0,y:(null!==(n=t.y)&&void 0!==n?n:0)*i+s.y+a.y||0,width:(null!==(o=t.width)&&void 0!==o?o:0)*i,height:(null!==(r=t.height)&&void 0!==r?r:0)*i}},o.prototype.getElBoxRect=function(t,n){var o,r,i;void 0===n&&(n={});var s=this.module,a=(0,bt.Ut)(t),l=a.width,c=a.height,u=a.left,p=a.top,d=null===(o=(0,e.getComponentView)(t))||void 0===o?void 0:o.frameView,f=null==d?void 0:d.getBoxRect(),h=s.getZoomMultiplier(),g=null!==(r=null==f?void 0:f.x)&&void 0!==r?r:0,v=null!==(i=null==f?void 0:f.y)&&void 0!==i?i:0,y=this.el,m=(0,bt.GX)(),b={x:u+g+(y.scrollLeft+m.x)*h,y:p+v+(y.scrollTop+m.y)*h,width:l,height:c};return n.local&&(b.x=u,b.y=p),n.toScreen?this.getRectToScreen(b):b},o.prototype.getViewportRect=function(t){void 0===t&&(t={});var e=this.getCanvasOffset(),n=e.top,o=e.left,r=e.width,i=e.height,s=this.module;if(t.toWorld){var a=s.getZoomMultiplier(),l=s.getCoords(),c=this.getViewportDelta();return{x:(-l.x-c.x||0)*a,y:(-l.y-c.y||0)*a,width:r*a,height:i*a}}return{x:o,y:n,width:r,height:i}},o.prototype.getViewportDelta=function(t){void 0===t&&(t={});var e=this.module.getZoomMultiplier(),n=this.getCanvasOffset(),o=n.width,r=n.height;return{x:(o*e-o)/2/e,y:(r*e-r)/2/e}},o.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},o.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,o=null==t?void 0:t.ownerDocument.defaultView,r=o?o.frameElement:n;this.frmOff=this.offset(r||n)}return this.frmOff},o.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},o.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.module.getZoomDecimal(),o=this.getFrameOffset(t),r=this.el,i=this.getCanvasOffset(),s=this.offset(t,e),a=e.avoidFrameOffset?0:o.top,l=e.avoidFrameOffset?0:o.left,c=e.avoidFrameZoom?s.top:s.top*n,u=e.avoidFrameZoom?s.left:s.left*n;return{top:e.avoidFrameOffset?c:c+a-i.top+r.scrollTop,left:e.avoidFrameOffset?u:u+l-i.left+r.scrollLeft,height:e.avoidFrameZoom?s.height:s.height*n,width:e.avoidFrameZoom?s.width:s.width*n,zoom:n,rect:s}},o.prototype.getElementOffsets=function(t){if(!t||(0,bt.BM)(t))return{};var e={},n=window.getComputedStyle(t),o=this.module.getZoomDecimal();return['marginTop','marginRight','marginBottom','marginLeft','paddingTop','paddingRight','paddingBottom','paddingLeft','borderTopWidth','borderRightWidth','borderBottomWidth','borderLeftWidth'].forEach((function(t){e[t]=parseFloat(n[t])*o})),e},o.prototype.getPosition=function(t){var e;void 0===t&&(t={});var n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(!n)return{top:0,left:0,width:0,height:0};var o=n.body,r=this.module.getZoomDecimal(),i=this.getFrameOffset(),s=this.getCanvasOffset(),a=t.noScroll;return{top:i.top+(a?0:o.scrollTop)*r-s.top,left:i.left+(a?0:o.scrollLeft)*r-s.left,width:s.width,height:s.height}},o.prototype.updateScript=function(t){var e=t.model,n=e.getId();if(!t.scriptContainer){t.scriptContainer=(0,bt.ut)('div',{'data-id':n});var o=this.getJsContainer();null==o||o.appendChild(t.scriptContainer)}t.el.id=n,t.scriptContainer.innerHTML='';var r=document.createElement('script'),i=e.getScriptString(),s=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(s,".bind(item))(").concat(a,")\n }, 1);"),setTimeout((function(){var e=t.scriptContainer;null==e||e.appendChild(r)}),0)},o.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return null==e?void 0:e.getJsContainer()},o.prototype.getFrameView=function(t){return(null==t?void 0:t.frameView)||this.em.getCurrentFrame()},o.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,o=t.em,r=t.framesArea,i=e.frames;i.listenToLoad(),n.render();var s=i.at(0),a=null==s?void 0:s.view;o.setCurrentFrame(a),null==r||r.appendChild(n.el),this.frame=a,this.updateFramesArea()}},o.prototype.renderFrames=function(){this._renderFrames()},o.prototype.render=function(){var t=this,n=t.el,o=t.$el,r=t.ppfx,i=t.config,s=t.em;o.html(this.template());var a=o.find('[data-frames]');this.framesArea=a.get(0);var l=o.find('[data-tools]');return this.toolsWrapper=l.get(0),l.append("\n
\n
\n
\n
\n
\n
\n ").concat(i.extHl?"
"):'',"\n
\n
\n
\n
\n
\n
\n
\n ")),this.toolsEl=n.querySelector("#".concat(r,"tools")),this.hlEl=n.querySelector(".".concat(r,"highlighter")),this.badgeEl=n.querySelector(".".concat(r,"badge")),this.placerEl=n.querySelector(".".concat(r,"placeholder")),this.ghostEl=n.querySelector(".".concat(r,"ghost")),this.toolbarEl=n.querySelector(".".concat(r,"toolbar")),this.resizerEl=n.querySelector(".".concat(r,"resizer")),this.offsetEl=n.querySelector(".".concat(r,"offset-v")),this.fixedOffsetEl=n.querySelector(".".concat(r,"offset-fixed-v")),this.toolsGlobEl=n.querySelector(".".concat(r,"tools-gl")),this.spotsEl=n.querySelector('[data-spots]'),this.cvStyle=n.querySelector('[data-canvas-style]'),this.el.className=(0,e.getUiClass)(s,this.className),this.ready=!0,this._renderFrames(),this},o}(mt);const Yt=Kt;var Zt=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Xt=void 0&&(void 0).__assign||function(){return Xt=Object.assign||function(t){for(var e,n=1,o=arguments.length;ni.top+i.height?i.top+i.height:f,left:d,elementTop:i.top,elementLeft:i.left,elementWidth:i.width,elementHeight:i.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:r.top,canvasLeft:r.left,canvasWidth:r.width,canvasHeight:r.height};return c&&this.em&&this.em.trigger(c,h),h}},o.prototype.canvasRectOffset=function(t,e,n){var o=this;void 0===n&&(n={});var r=function(t,e,r){void 0===e&&(e=1);var i=o.em.getZoomDecimal(),s=e?'top':'left',a=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(a):{},c=l.offsetTop,u=void 0===c?0:c,p=l.offsetLeft,d=void 0===p?0:p,f=a.body||{},h=f.scrollTop,g=void 0===h?0:h,v=f.scrollLeft,y=e?g:void 0===v?0:v,m=e?u:d;return r[s]-(y-m)*i};return{top:r(t,1,e),left:r(t,0,e)}},o.prototype.getTargetToElementFixed=function(e,n,o){void 0===o&&(o={});var r=o.pos||this.getElementPos(e,{noScroll:!0}),i=o.canvasOff||this.canvasRectOffset(e,r),s=n.offsetHeight||0,a=n.offsetWidth||0,l=r.left+r.width,c=this.getCanvasView(),u=c.getPosition(),p=c.getFrameOffset(e),d=o.event,f=-s,h=(0,t.isUndefined)(o.left)?r.width-a:o.left;if(h=r.left<-h?-r.left:h,h=l>u.width?h-(l-u.width):h,i.top=0;){var o=e.indexOf('/*'),r=e.indexOf('*/')+2;e=e.replace(e.slice(o,r),'')}for(var i=e.split(';'),s=0,a=i.length;s'!=="".concat(l.outerHTML).slice(-2)||(h.void=!0);var k=h.components;if(!h.type&&k){for(var E=n.textTypes,P=void 0===E?[]:E,A=n.textTags,j=void 0===A?[]:A,M=1,L=0,D=0;D".concat(e,""),l=r.parseFromString(a,i);if(s){var c=l.head,u=l.body,p=c.querySelectorAll('script');(0,t.each)(p,(function(t){return u.appendChild(t)}));var d=[];(0,t.each)(c.children,(function(t){return d.push(t)})),(0,t.each)(d,(function(t,e){return u.insertBefore(t,u.children[e])})),o=u}else o=l.firstChild;return o}(d,u),h=f.querySelectorAll('script'),g=h.length;if(!((0,t.isUndefined)(a.allowScripts)?u.allowScripts:a.allowScripts))for(;g--;)h[g].parentNode.removeChild(h[g]);if(u.allowUnsafeAttr&&u.allowUnsafeAttrValue||this.__sanitizeNode(f,u),r){for(var v=f.querySelectorAll('style'),y=v.length,m='';y--;)m=v[y].innerHTML+m,v[y].parentNode.removeChild(v[y]);m&&(l.css=r.parse(m))}null==e||e.trigger("".concat(se,":root"),{input:d,root:f});var b=this.parseNode(f,c),_=1!==b.length||c.returnArray?b:b[0];return l.html=_,null==e||e.trigger(se,{input:d,output:l}),l},__sanitizeNode:function(e,n){var o=this,r=e.attributes||[],i=e.childNodes||[],s=[];(0,t.each)(r,(function(t){var e=t.nodeName||'',o=t.nodeValue||'';!n.allowUnsafeAttr&&e.startsWith('on')&&s.push(e),!n.allowUnsafeAttrValue&&o.startsWith('javascript:')&&s.push(e)})),s.map((function(t){return e.removeAttribute(t)})),(0,t.each)(i,(function(t){return o.__sanitizeNode(t,n)}))}}};var le=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ce=void 0&&(void 0).__assign||function(){return ce=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0:r;if('__'===e.substring(0,2))return"continue";var s=o[e];((0,t.isArray)(s)?s:[s]).forEach((function(t){var o="".concat(t).concat(i?' !important':'');o&&n.push("".concat(e,":").concat(o,";"))}))};for(var s in o)i(s);return n.join('')},o.prototype.getSelectors=function(){return this.get('selectors')||this.get('classes')},o.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},o}(u.Hn);const fe=de;var he=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ge=void 0&&(void 0).__assign||function(){return ge=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&g.reset(h,o)}else d.components=h}return d}))},_e=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return he(n,e),n.prototype.initialize=function(t,e){void 0===e&&(e={}),this.opt=e,this.listenTo(this,'add',this.onAdd),this.listenTo(this,'remove',this.removeChildren),this.listenTo(this,'reset',this.resetChildren);var n=e.em,o=e.config;this.config=o,this.em=n,this.domc=e.domc||(null==n?void 0:n.Components)},n.prototype.resetChildren=function(t,e){var n=this;void 0===e&&(e={});var o=this,r=e.previousModels||[],i=r.filter((function(e){return!t.get(e.cid)})),s=me(t),a=me(r).filter((function(t){return s.indexOf(t)>=0}));e.keepIds=(e.keepIds||[]).concat(a),i.forEach((function(t){return n.removeChildren(t,o,e)})),t.each((function(t){return n.onAdd(t)}))},n.prototype.resetFromString=function(t,e){var n,o;void 0===t&&(t=''),void 0===e&&(e={}),e.keepIds=me(this);var r=this,i=r.domc,s=r.em,a=r.parent,l=null==s?void 0:s.Css,c=(null==i?void 0:i.allById())||{},u=this.parseString(t,e),p=be(u,c,e),d=e.visitedCmps,f=void 0===d?{}:d;Object.keys(f).forEach((function(t){var e=f[t];if(e.length){var n=(null==l?void 0:l.getRules("#".concat(t)))||[];n.length&&e.forEach((function(t){n.forEach((function(e){var n=e.clone();n.set('selectors',["#".concat(t.attributes.id)]),l.getAll().add(n)}))}))}})),this.reset(p,e),null==s||s.trigger('component:content',a,e,t),null===(o=(n=a).__checkInnerChilds)||void 0===o||o.call(n)},n.prototype.removeChildren=function(t,e,n){var o=this;if(void 0===n&&(n={}),t){var r=this.domc,i=this.em,s=n.temporary||n.fromUndo;if(t.prevColl=this,!s){var a=t.getId(),l=i.Selectors.getAll(),c=i.Css.getAll(),u=(n.keepIds||[]).indexOf(a)<0;delete(r?r.allById():{})[a];var p=u?c.remove(c.filter((function(t){return t.getSelectors().getFullString()==="#".concat(a)})),n):[];l.remove(p.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(i.Commands.run('core:component-style-clear',{target:t}),t.removed(),t.trigger('removed'),i.trigger('component:remove',t)),t.components().forEach((function(t){return o.removeChildren(t,e,n)}))}var d=t.components();i.stopListening(d),i.stopListening(t),i.stopListening(t.get('classes')),t.__postRemove()}},n.prototype.model=function(t,e){var n,o=e.collection.opt,r=o.em,i=r.Components.componentTypes;e.em=r,e.config=o.config,e.componentTypes=i,e.domc=o.domc;for(var s=0;s=0&&this.set('void',!0),n.em=i,this.opt=n,this.em=i,this.frame=n.frame,this.config=n.config||{},this.set('attributes',Qe(Qe({},(0,t.result)(this,'defaults').attributes||{}),this.get('attributes')||{})),this.ccid=o.createId(this,n),this.initClasses(),this.initComponents(),this.initTraits(),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(un,this.__propToParent),this.set('status',''),this.views=[],['classes','traits','components'].forEach((function(t){var e="add remove ".concat('components'!==t?'change':'');r.listenTo(r.get(t),e.trim(),(function(){for(var e=[],n=0;n=0}))},o.prototype.__getSymbToUp=function(t){var e=this;void 0===t&&(t={});var n=[],o=t.changed;if(t.fromInstance||t.noPropagate||t.fromUndo||o&&this.__isSymbOvrd(o))return n;var r=this.__getSymbols()||[],i=this.__getSymbol();return n=(i?en([i],i.__getSymbols()||[],!0):r).filter((function(t){return t!==e})).filter((function(t){return!(o&&t.__isSymbOvrd(o))}))},o.prototype.__getSymbTop=function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e},o.prototype.__upSymbProps=function(n,o){var r=this;void 0===o&&(o={});var i=this.changedAttributes()||{},s=i.attributes||{};if(delete i.status,delete i.open,delete i[sn],delete i[an],delete i[ln],delete i.attributes,delete s.id,(0,e.isEmptyObj)(s)||(i.attributes=s),!(0,e.isEmptyObj)(i)){var a=this.__getSymbToUp(o);(0,t.keys)(i).map((function(t){r.__isSymbOvrd(t)&&delete i[t]})),this.__logSymbol('props',a,{opts:o,changed:i}),a.forEach((function(e){var n=Qe({},i);(0,t.keys)(n).map((function(t){e.__isSymbOvrd(t)&&delete n[t]})),e.set(n,Qe({fromInstance:r},o))}))}},o.prototype.__upSymbCls=function(t,e,n){var o=this;void 0===n&&(n={});var r=this.__getSymbToUp(n);this.__logSymbol('classes',r,{opts:n}),r.forEach((function(t){t.set('classes',o.get('classes'),{fromInstance:o})})),this.__changesUp(n)},o.prototype.__upSymbComps=function(t,e,n){var o=this,r=n||e||{},i={fromInstance:r.fromInstance,fromUndo:r.fromUndo},s=t.opt.temporary;if(n)if(n.add){var a=[],l=!!this.__getSymbols();if((y=this.__getSymbToUp(Qe(Qe({},i),{changed:'components:add'}))).length){var c=t.__getSymbol();a=(c?c.__getSymbols():t.__getSymbols())||[],(a=en([],a,!0)).push(c||t)}!s&&this.__logSymbol('add',y,{opts:n,addedInstances:a.map((function(t){return t.cid})),added:t.cid}),y.forEach((function(e){var r=e.__getSymbTop(),i=a.filter((function(t){var e=t.__getSymbTop({prev:1});return r&&e&&e===r}))[0]||t.clone({symbol:!0,symbolInv:l});e.append(i,Qe({fromInstance:o},n))}))}else{var u=t.__getSymbol();if(u&&!n.temporary&&u.set(sn,u.__getSymbols().filter((function(e){return e!==t}))),!t.__isSymbolTop()){var p='components:remove',d=n.index,f=t.parent(),h=Qe({fromInstance:t},n),g=t.__isSymbolNested(),v=function(t){var e=t.parent();e&&!e.__isSymbOvrd(p)&&t.remove(h)};y=(null==f?void 0:f.__isSymbOvrd(p))?[]:t.__getSymbToUp(i);g&&(y=null==f?void 0:f.__getSymbToUp(Qe(Qe({},i),{changed:p})),v=function(t){var e=t.components().at(d);e&&e.remove(Qe({fromInstance:f},h))}),!s&&this.__logSymbol('remove',y,{opts:n,removed:t.cid,isSymbNested:g}),y.forEach(v)}}else{var y=this.__getSymbToUp(Qe(Qe({},i),{changed:'components:reset'})),m=t.models;this.__logSymbol('reset',y,{components:m}),y.forEach((function(t){var n=m.map((function(t){return t.clone({symbol:!0})}));t.components().reset(n,Qe({fromInstance:o},e))}))}this.__changesUp(r)},o.prototype.initClasses=function(e,n,o){void 0===o&&(o={});var r=this.get('attributes')||{},i=r.class,s=tn(r,["class"]),a=[this,'change:classes',this.initClasses],l=this.get('classes')||i||[],c=(0,t.isString)(l)?l.split(' '):l;this.stopListening.apply(this,a);var u=this.normalizeClasses(c),p=new Ae([]);return this.set('classes',p,o),p.add(u),p.on('add remove reset',this.__upSymbCls),i&&u.length&&this.set('attributes',s),this.listenTo.apply(this,a),this},o.prototype.initComponents=function(){var e=[this,'change:components',this.initComponents];this.stopListening.apply(this,e);var n=new we([],this.opt);n.parent=this;var o=this.get('components'),r=!this.opt.avoidChildren;return this.set('components',n),r&&o&&n.add((0,t.isFunction)(o)?o(this):o,this.opt),n.on('add remove reset',this.__upSymbComps),this.listenTo.apply(this,e),this},o.prototype.initTraits=function(t){var e=this.em,n='change:traits';this.off(n,this.initTraits),this.__loadTraits();var o=Qe({},this.get('attributes')),r=this.traits;return r.each((function(t){if(!t.changeProp){var e=t.getName(),n=t.getInitValue();e&&n&&(o[e]=n)}})),r.length&&this.set('attributes',o),this.on(n,this.initTraits),t&&e&&e.trigger('component:toggled'),this},o.prototype.initScriptProps=function(){if(!this.opt.temporary){var t='script-props',e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],o=this.get(t)||[],r=n.map((function(t){return"change:".concat(t)})).join(' '),i=o.map((function(t){return"change:".concat(t)})).join(' ');r&&this.off(r,this.__scriptPropsChange),i&&this.on(i,this.__scriptPropsChange),this.on.apply(this,e)}},o.prototype.__scriptPropsChange=function(t,e,n){void 0===n&&(n={}),n.avoidStore||this.trigger('rerender')},o.prototype.append=function(e,n){void 0===n&&(n={});var o=((0,t.isArray)(e)?en([],e,!0):[e]).map((function(e){return(0,t.isString)(e)||e.collection&&e.collection.remove(e,{temporary:!0}),e})),r=this.components().add(o,n);return(0,t.isArray)(r)?r:[r]},o.prototype.components=function(e,n){void 0===n&&(n={});var o=this.get('components');return(0,t.isUndefined)(e)?o:(o.reset(void 0,n),e?this.append(e,n):[])},o.prototype.getChildAt=function(t){return this.components().at(t||0)||void 0},o.prototype.getLastChild=function(){var t=this.components();return t.at(t.length-1)||null},o.prototype.empty=function(t){return void 0===t&&(t={}),this.components().reset(void 0,t),this},o.prototype.parent=function(t){void 0===t&&(t={});var e=this.collection||t.prev&&this.prevColl;return e?e.parent:void 0},o.prototype.parents=function(){var t=this.parent();return t?[t].concat(t.parents()):[]},o.prototype.scriptUpdated=function(){this.set('scriptUpdated',1)},o.prototype.initToolbar=function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||'';if(!e.get('toolbar')&&t){var o=[];e.collection&&o.push({label:t.getIcon('arrowUp'),command:function(t){return t.runCommand('core:component-exit',{force:1})}}),e.get('draggable')&&o.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon('move'),command:'tlb-move'}),e.get('copyable')&&o.push({label:t.getIcon('copy'),command:'tlb-clone'}),e.get('removable')&&o.push({label:t.getIcon('delete'),command:'tlb-delete'}),e.set('toolbar',o)}},o.prototype.__loadTraits=function(e,n){void 0===n&&(n={});var o=e||this.traits;if(!(o instanceof Xe)){o=(0,t.isFunction)(o)?o(this):o;var r=new Xe([],this.opt);r.setTarget(this),o.length&&(o.forEach((function(t){return t.attributes&&delete t.attributes.value})),r.add(o)),this.set({traits:r},n)}return this},o.prototype.getTraits=function(){return this.__loadTraits(),en([],this.traits.models,!0)},o.prototype.setTraits=function(e){var n=(0,t.isArray)(e)?e:[e];return this.set({traits:n}),this.getTraits()},o.prototype.getTrait=function(t){return this.getTraits().filter((function(e){return e.get('id')===t||e.get('name')===t}))[0]||null},o.prototype.updateTrait=function(t,e){var n,o=this.getTrait(t);return o&&o.set(e),null===(n=this.em)||void 0===n||n.trigger('component:toggled'),this},o.prototype.getTraitIndex=function(t){var e=this.getTrait(t);return e?this.traits.indexOf(e):-1},o.prototype.removeTrait=function(e){var n,o=this,r=((0,t.isArray)(e)?e:[e]).map((function(t){return o.getTrait(t)})),i=this.traits,s=r.length?i.remove(r):[];return null===(n=this.em)||void 0===n||n.trigger('component:toggled'),(0,t.isArray)(s)?s:[s]},o.prototype.addTrait=function(e,n){var o;void 0===n&&(n={}),this.__loadTraits();var r=this.traits.add(e,n);return null===(o=this.em)||void 0===o||o.trigger('component:toggled'),(0,t.isArray)(r)?r:[r]},o.prototype.normalizeClasses=function(t){var e=[],n=this.em,o=null==n?void 0:n.Selectors;return o?t.models?en([],t.models,!0):(t.forEach((function(t){return e.push(o.add(t))})),e):[]},o.prototype.clone=function(t){void 0===t&&(t={});var e=this.em,n=Qe({},this.attributes),o=Qe({},this.opt),r=this.getId(),i=null==e?void 0:e.Css;n.attributes=Qe({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=!0),this.get('components').each((function(e,o){n.components[o]=e.clone(Qe(Qe({},t),{_inner:1}))})),this.get('traits').each((function(t,e){n.traits[e]=t.clone()})),this.get('classes').each((function(t,e){n.classes[e]=t.get('name')})),n.status='',o.collection=null;var s=new this.constructor(n,o),a="#".concat(s.getId());(i?i.getRules("#".concat(r)):[]).forEach((function(t){var e=t.clone();e.set('selectors',[a]),i.getAll().add(e)})),s.set(sn,0);var l=this.__getSymbol(),c=this.__getSymbols();t.symbol||!l&&!c?l?(l.set(sn,en(en([],l.__getSymbols(),!0),[s],!1)),s.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(sn,en(en([],c,!0),[s],!1)),s.set(an,this),s.__initSymb()):t.symbolInv?(this.set(sn,[s]),s.set(an,this),[this,s].map((function(t){return t.__initSymb()}))):(s.set(sn,[this]),[this,s].map((function(t){return t.__initSymb()})),this.set(an,s))):(s.set(an,0),s.set(sn,0));var u='component:clone';return e&&e.trigger(u,s),this.trigger(u,s),s},o.prototype.getName=function(t){void 0===t&&(t={});var n=this.em,o=this.attributes,r=o.type,i=o.tagName,s=o.name,a=r||i,l=r?'':i,c='domComponents.names.',u=s&&(null==n?void 0:n.t("".concat(c).concat(s))),p=l&&(null==n?void 0:n.t("".concat(c).concat(l))),d=n&&(n.t("".concat(c).concat(r))||n.t("".concat(c).concat(i))),f=this.get('custom-name');return(t.noCustom?'':f)||u||s||p||(0,e.capitalize)(l)||d||(0,e.capitalize)(a)},o.prototype.getIcon=function(){var t=this.get('icon');return t?t+' ':''},o.prototype.toHTML=function(n){void 0===n&&(n={});var o=this,r=[],i=n.tag||o.get('tagName'),s=o.get('void'),a=n.attributes,l=this.getAttrToHTML();if(delete n.tag,a&&((0,t.isFunction)(a)?l=a(o,l)||{}:(0,e.isObject)(a)&&(l=a)),n.withProps){var c=this.toJSON();(0,t.forEach)(c,(function(n,o){'_'!==o[0]&&['classes','attributes','components'].indexOf(o)<0&&(l["data-gjs-".concat(o)]=(0,t.isArray)(n)||(0,e.isObject)(n)?JSON.stringify(n):(0,t.isBoolean)(n)?"".concat(n):n)}))}for(var u in l){var p=l[u];if(!(0,t.isUndefined)(p)&&null!==p)if((0,t.isBoolean)(p))p&&r.push(u);else{var d='';if(n.altQuoteAttr&&(0,t.isString)(p)&&p.indexOf('"')>=0)d="'".concat(p.replace(/'/g,'''),"'");else{var f=(0,t.isString)(p)?p.replace(/"/g,'"'):p;d="\"".concat(f,"\"")}r.push("".concat(u,"=").concat(d))}}var h=r.length?" ".concat(r.join(' ')):'',g=o.getInnerHTML(n),v="<".concat(i).concat(h).concat(s?'/':'',">").concat(g);return!s&&(v+="")),v},o.prototype.getInnerHTML=function(t){return this.__innerHTML(t)},o.prototype.__innerHTML=function(t){void 0===t&&(t={});var e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(''):this.content},o.prototype.getAttrToHTML=function(){var t=this.getAttributes();return on(this.em)&&delete t.style,t},o.prototype.toJSON=function(e){void 0===e&&(e={});var n=s.Model.prototype.toJSON.call(this,e);if(n.attributes=this.getAttributes(),delete n.attributes.class,delete n.toolbar,delete n.traits,delete n.status,delete n.open,delete n._undoexc,delete n.delegate,!e.fromUndo){var o=n[an],r=n[sn];r&&(0,t.isArray)(r)&&(n[sn]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),o&&!(0,t.isString)(o)&&(n[an]=o.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(n),n},o.prototype.getChangedProps=function(e){var n=e||s.Model.prototype.toJSON.apply(this),o=(0,t.result)(this,'defaults');return(0,t.forEach)(o,(function(t,e){-1===['type'].indexOf(e)&&n[e]===t&&delete n[e]})),(0,t.isEmpty)(n.type)&&delete n.type,(0,t.forEach)(['attributes','style'],(function(e){(0,t.isEmpty)(o[e])&&(0,t.isEmpty)(n[e])&&delete n[e]})),(0,t.forEach)(['classes','components'],(function(e){(!n[e]||(0,t.isEmpty)(o[e])&&!n[e].length)&&delete n[e]})),n},o.prototype.getId=function(){return(this.get('attributes')||{}).id||this.ccid||this.cid},o.prototype.setId=function(t,e){var n=Qe({},this.get('attributes'));return n.id=t,this.set('attributes',n,e),this},o.prototype.getEl=function(t){var e=this.getView(t);return e&&e.el},o.prototype.getView=function(t){var e=this,n=e.view,o=e.views,r=e.em,i=t||(null==r?void 0:r.getCurrentFrameModel());return i&&(n=o.filter((function(t){return t.frameView===i.view}))[0]),n},o.prototype.getCurrentView=function(){var t=this.em.getCurrentFrame(),e=null==t?void 0:t.model;return this.getView(e)},o.prototype.__getScriptProps=function(){var t=this.props();return(this.get('script-props')||[]).reduce((function(e,n){return e[n]=t[n],e}),{})},o.prototype.getScriptString=function(e){var n=this,o=e||this.get('script')||'';if(!o)return o;if(this.get('script-props'))o=o.toString().trim();else{if((0,t.isFunction)(o)){var r=o.toString().trim();o=(r=r.slice(r.indexOf('{')+1,r.lastIndexOf('}'))).trim()}var i=this.em.getConfig(),s=nn(i.tagVarStart||'{[ '),a=nn(i.tagVarEnd||' ]}'),l=new RegExp("".concat(s,"([\\w\\d-]*)").concat(a),'g');o=o.replace(l,(function(e,o){n.scriptUpdated();var r=n.attributes[o]||'';return(0,t.isArray)(r)||'object'==typeof r?JSON.stringify(r):r}))}return o},o.prototype.emitUpdate=function(t){for(var e,n=[],o=1;o=0&&this.__propSelfToParent({component:this,changed:(e={},e[t]=s,e),options:n[2]||n[1]||{}})},o.prototype.onAll=function(e){return(0,t.isFunction)(e)&&(e(this),this.components().forEach((function(t){return t.onAll(e)}))),this},o.prototype.forEachChild=function(e){(0,t.isFunction)(e)&&this.components().forEach((function(t){e(t),t.forEachChild(e)}))},o.prototype.remove=function(t){var e=this;void 0===t&&(t={});var n=this.em,o=this.collection,r=function(){o&&o.remove(e,Qe(Qe({},t),{action:'remove-component'})),o||(e.components('',t),e.components().removeChildren(e,void 0,t))},i=Qe({},t);return[this,n].map((function(t){return t.trigger('component:remove:before',e,r,i)})),!i.abort&&r(),this},o.prototype.move=function(t,e){if(void 0===e&&(e={}),t){var n=e.at,o=this.index(),r=t===this.parent();r&&(o===n||o===n-1)||(r&&n&&n>o&&(e.at=n-1),this.remove({temporary:1}),t.append(this,e),this.emitUpdate())}return this},o.prototype.isInstanceOf=function(t){var e,n,o=null===(n=null===(e=this.em)||void 0===e?void 0:e.Components.getType(t))||void 0===n?void 0:n.model;return!!o&&this instanceof o},o.prototype.isChildOf=function(e){for(var n=(0,t.isString)(e),o=this.parent();o;){if(n){if(o.isInstanceOf(e))return!0}else if(o===e)return!0;o=o.parent()}return!1},o.prototype.resetId=function(t){void 0===t&&(t={});var e=this.em,n=this.getId();if(!n)return this;var r=o.createId(this);this.setId(r);var i=null==e?void 0:e.Css.getIdRule(n),s=null==i?void 0:i.get('selectors').at(0);return null==s||s.set('name',r),this},o.prototype._getStyleRule=function(t){var e=(void 0===t?{}:t).id,n=this.em,o=e||this.getId();return null==n?void 0:n.Css.getIdRule(o)},o.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return null==e?void 0:e.get('selectors').at(0)},o.prototype._idUpdated=function(t,e,n){if(void 0===n&&(n={}),!n.idUpdate){var r=this.ccid,i=(this.get('attributes')||{}).id,s=(this.previous('attributes')||{}).id||r,a=o.getList(this);if(a[i]||!i&&s)return this.setId(s,{idUpdate:!0});delete a[s],a[i]=this,this.ccid=i;var l=this._getStyleSelector({id:s});l&&l.set({name:i,label:i})}},o.getDefaults=function(){return(0,t.result)(this.prototype,'defaults')},o.isComponent=function(t){return{tagName:(0,e.toLowerCase)(t.tagName)}},o.ensureInList=function(t){var e=o.getList(t),n=t.getId(),r=e[n];if(r){if(r!==t){var i=o.getIncrementId(n,e);t.setId(i),e[i]=t}}else e[n]=t;t.components().forEach((function(t){return o.ensureInList(t)}))},o.createId=function(t,e){void 0===e&&(e={});var n,r=o.getList(t),i=e.idMap,s=void 0===i?{}:i,a=t.get('attributes').id;return a?(n=o.getIncrementId(a,r,e),t.setId(n),a!==n&&(s[a]=n)):n=o.getNewId(r),r[n]=t,n},o.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=o.getNewId(t);return r},o.getIncrementId=function(t,e,n){void 0===n&&(n={});var o=n.keepIds,r=1,i=t;if((void 0===o?[]:o).indexOf(t)<0)for(;e[i];)r++,i="".concat(t,"-").concat(r);return i},o.getList=function(t){var e=t.opt,n=void 0===e?{}:e,o=n.domc,r=n.em,i=o||(null==r?void 0:r.Components);return i?i.componentsById:{}},o.checkId=function(e,n,r,i){void 0===n&&(n=[]),void 0===r&&(r={}),void 0===i&&(i={});var s=(0,t.isArray)(e)?e:[e],a=i.keepIds,l=void 0===a?[]:a,c=i.idMap,u=void 0===c?{}:c;s.forEach((function(e){e.attributes;var s=e.attributes,a=void 0===s?{}:s,c=e.components,p=a.id;if(p&&r[p]&&l.indexOf(p)<0){var d=o.getIncrementId(p,r);u[p]=d,a.id=d,(0,t.isArray)(n)&&n.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(p)&&(e[n]="#".concat(d))}))}))}c&&o.checkId(c,n,r,i)}))},o}(fe);const dn=pn;var fn=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),hn=void 0&&(void 0).__assign||function(){return hn=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n "),fallback:"\n \n "),file:''})},enumerable:!1,configurable:!0}),o.prototype.initialize=function(o,r){n.prototype.initialize.call(this,o,r);var i=this.get('attributes').src;i&&(0,e.buildBase64UrlFromSvg)((0,t.result)(this,'defaults').src)!==i&&this.set('src',i,{silent:!0})},o.prototype.initToolbar=function(){n.prototype.initToolbar.call(this);var t=this.em;if(t){var e='image-editor';if(t.Commands.has(e)){for(var o=!1,r=this.get('toolbar'),i=0;i=0)&&delete r.editable}))}return r},o}(Mn);const zn=Hn;var Bn=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Un=void 0&&(void 0).__assign||function(){return Un=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0},n}(dn);var go=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vo=void 0&&(void 0).__assign||function(){return vo=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0&&l0&&u=0&&p0&&c<=a)},o.prototype.scrollIntoView=function(t){var e;if(void 0===t&&(t={}),!this.isInViewport()||t.force){var n=this.el;if('smooth'!==t.behavior){var o=this.getOffsetRect();null===(e=n.ownerDocument.defaultView)||void 0===e||e.scrollTo(0,o.top)}else n.scrollIntoView($o({behavior:'smooth',block:'nearest'},t))}},o.prototype.reset=function(){var t=this.el;this.el='',this._ensureElement(),this._setData(),(0,bt.dL)(t,this.el),this.render()},o.prototype._setData=function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},o.prototype._createElement=function(t){return this.createDoc.createElement(t)},o.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new Uo({collection:this.model.get('components'),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),o=0,r=n.length;o0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]-1;return Rr(Rr({},i),!u||p?{reason:Fr.TargetReject}:{result:!0})},o.prototype.allById=function(){return this.componentsById},o.prototype.getById=function(t){return this.componentsById[t]||null},o.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{}}))},o}(b);const Br=zr;const Ur={stylePrefix:'css-',rules:[]};var Wr=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),$r=Number.MAX_VALUE,qr=function(n){function o(){var e=n.call(this)||this;return(0,t.bindAll)(e,'sortRules'),e.compCls=[],e.ids=[],e}return Wr(o,n),o.prototype.buildFromModel=function(t,e){var n=this;void 0===e&&(e={});var o='',r=this.em,i=r&&r.getConfig().avoidInlineStyle,s=t.styleToString(),a=t.classes;return this.ids.push("#".concat(t.getId())),a.forEach((function(t){return n.compCls.push(t.getFullName())})),!i&&s&&(o="#".concat(t.getId(),"{").concat(s,"}")),t.components().forEach((function(t){return o+=n.buildFromModel(t,e)})),o},o.prototype.build=function(n,o){var r=this;void 0===o&&(o={});var i=o.json,s=o.em,a=o.cssc||(null==s?void 0:s.Css);this.em=s,this.compCls=[],this.ids=[],this.model=n;var l=[],c=n?this.buildFromModel(n,o):'',u=(0,t.isUndefined)(o.clearStyles)&&s?s.getConfig().clearStyles:o.clearStyles;if(a){var p=o.rules||a.getAll(),d={},f=[];o.onlyMatched&&n&&(0,e.hasWin)()&&(p=this.matchedRules(n,p)),p.forEach((function(t){var e=t.getAtRule();if(e){var n=d[e];n?n.push(t):d[e]=[t]}else{var s=r.buildFromRule(t,f,o);i?l.push(s):c+=s}})),this.sortMediaObject(d).forEach((function(t){var e='',n=t.key;t.value.forEach((function(t){var s=r.buildFromRule(t,f,o);t.get('singleAtRule')?c+="".concat(n,"{").concat(s,"}"):e+=s,i&&l.push(s)})),e&&(c+="".concat(n,"{").concat(e,"}"))})),s&&u&&p.remove&&p.remove(f)}return i?l.filter((function(t){return t})):c},o.prototype.buildFromRule=function(t,e,n){var o,r=this;void 0===n&&(n={});var i,s='',a=this.model,l=t.selectorsToString({skipAdd:1}),c=t.get('selectorsAdd'),u=t.get('singleAtRule');if(null===(o=t.get('selectors'))||void 0===o||o.forEach((function(t){var e=t.getFullName();(r.compCls.indexOf(e)>=0||r.ids.indexOf(e)>=0||n.keepUnusedStyles)&&(i=1)})),l&&i||c||u||!a){var p=t.getDeclaration({body:1});p&&(n.json?s=t:s+=p)}else e.push(t);return s},o.prototype.matchedRules=function(t,e){var n=this,o=t.getEl(),r=[];return e.forEach((function(t){try{t.selectorsToString().split(',').some((function(t){return null==o?void 0:o.matches(n.__cleanSelector(t))}))&&r.push(t)}catch(t){}})),t.components().forEach((function(t){r=r.concat(n.matchedRules(t,e))})),r=r.filter((function(t,e){return r.indexOf(t)===e}))},o.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):$r},o.prototype.sortMediaObject=function(e){var n=this;void 0===e&&(e={});var o=[];return(0,t.each)(e,(function(t,e){return o.push({key:e,value:t})})),o.sort((function(t,e){var o=[t.key,e.key].every((function(t){return-1!==t.indexOf('min-width')})),r=o?t.key:e.key,i=o?e.key:t.key;return n.getQueryLength(r)-n.getQueryLength(i)}))},o.prototype.sortRules=function(t,e){var n=function(t){return t.get('mediaText')||''},o=[n(t),n(e)].every((function(t){return-1!==t.indexOf('min-width')})),r=n(o?t:e),i=n(o?e:t);return this.getQueryLength(r)-this.getQueryLength(i)},o.prototype.__cleanSelector=function(t){return t.split(' ').map((function(t){return t.split(':')[0]})).join(' ')},o}(u.Hn);const Gr=qr;var Kr=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Yr=void 0&&(void 0).__assign||function(){return Yr=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0}))},o.prototype.setIdRule=function(e,n,o){void 0===n&&(n={}),void 0===o&&(o={});var r=o.addOpts,i=void 0===r?{}:r,s=o.mediaText,a=o.state||'',l=(0,t.isUndefined)(s)?this.em.getCurrentMedia():s,c=this.em.Selectors.add({name:e,type:Te.TYPE_ID},i),u=this.add(c,a,l,{},i);return u.setStyle(n,ri(ri({},o),i)),u},o.prototype.getIdRule=function(e,n){void 0===n&&(n={});var o=n.mediaText,r=n.state||'',i=(0,t.isUndefined)(o)?this.em.getCurrentMedia():o,s=this.em.Selectors.get(e,Te.TYPE_ID);return s&&this.get(s,r,i)},o.prototype.setClassRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=n.state||'',r=n.mediaText||this.em.getCurrentMedia(),i=this.em.Selectors.add({name:t,type:Te.TYPE_CLASS}),s=this.add(i,o,r);return s.setStyle(e,n),s},o.prototype.getClassRule=function(t,e){void 0===e&&(e={});var n=e.state||'',o=e.mediaText||this.em.getCurrentMedia(),r=this.em.Selectors.get(t,Te.TYPE_CLASS);return r&&this.get(r,n,o)},o.prototype.remove=function(e,n){var o=(0,t.isString)(e)?this.getRules(e):e,r=this.getAll().remove(o,n);return(0,t.isArray)(r)?r:[r]},o.prototype.clear=function(t){return void 0===t&&(t={}),this.getAll().reset([],t),this},o.prototype.getComponentRules=function(e,n){void 0===n&&(n={});var o=n.state,r=n.mediaText;n.current&&(o=this.em.get('state')||'',r=this.em.getCurrentMedia());var i=e.getId();return this.getAll().filter((function(e){return!(!(0,t.isUndefined)(o)&&e.get('state')!==o)&&(!(!(0,t.isUndefined)(r)&&e.get('mediaText')!==r)&&e.getSelectorsString()==="#".concat(i))}))},o.prototype.render=function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new Pt({collection:this.rules,config:this.config}),this.rulesView.render().el},o.prototype.checkId=function(e,n){void 0===n&&(n={});var o=n.idMap,r=void 0===o?{}:o,i=[];return Object.keys(r).length?((Array.isArray(e)?e:[e]).forEach((function(e){var n=e.selectors;if(n&&1==n.length){var o=n[0];if((0,t.isString)(o)){if('#'===o[0]){var s=o.substring(1),a=r[s];s&&a&&(n[0]="#".concat(a),i.push(e))}}else if(o.name&&o.type===Te.TYPE_ID){(a=r[o.name])&&(o.name=a,i.push(e))}}})),i):i},o.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove()},o}(b);const ai=si;const li={appendTo:'',blocks:[],appendOnClick:!1,custom:!1};var ci=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const ui=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return ci(n,e),n.prototype.defaults=function(){return{label:'',content:'',media:'',category:'',activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},Object.defineProperty(n.prototype,"category",{get:function(){var t=this.get('category');return t instanceof Le?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),n.prototype.getId=function(){return this.id},n.prototype.getLabel=function(){return this.get('label')},n.prototype.getMedia=function(){return this.get('media')},n.prototype.getContent=function(){return this.get('content')},n.prototype.getCategoryLabel=function(){var e=this.get('category');return(0,t.isFunction)(null==e?void 0:e.get)?e.get('label'):(null==e?void 0:e.label)?null==e?void 0:e.label:e},n}(u.Hn);var pi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),di=function(t){function e(e,n){var o=t.call(this,e)||this;return o.em=n.em,o.on('add',o.handleAdd),o}return pi(e,t),e.prototype.getCategories=function(){return this.em.Blocks.getCategories()},e.prototype.handleAdd=function(t){this.initCategory(t)},e}(Fe);const fi=di;var hi;di.prototype.model=ui,function(t){t["add"]="block:add",t["remove"]="block:remove",t["removeBefore"]="block:remove:before",t["update"]="block:update",t["dragStart"]="block:drag:start",t["drag"]="block:drag",t["dragEnd"]="block:drag:stop",t["custom"]="block:custom",t["all"]="block"}(hi||(hi={}));var gi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vi=function(n){function o(t,e){void 0===e&&(e={});var o=n.call(this,t)||this,r=o.model;return o.em=e.em,o.config=e,o.endDrag=o.endDrag.bind(o),o.ppfx=e.pStylePrefix||'',o.listenTo(r,'destroy remove',o.remove),o.listenTo(r,'change',o.render),o}return gi(o,n),o.prototype.events=function(){return{click:'handleClick',mousedown:'startDrag',dragstart:'handleDragStart',drag:'handleDrag',dragend:'handleDragEnd'}},o.prototype.__getModule=function(){return this.em.Blocks},o.prototype.handleClick=function(e){var n=this,o=n.config,r=n.model,i=n.em,s=r.get('onClick')||o.appendOnClick;if(i.trigger('block:click',r,e),s){if((0,t.isFunction)(s))return s(r,null==i?void 0:i.getEditor(),{event:e});var a,l,c=o.getSorter(),u=r.get('content'),p=i.getSelected();if(c.setDropContent(u),p)if(c.validTarget(p.getEl(),u).valid)a=p;else{var d=p.parent();d&&c.validTarget(d.getEl(),u).valid&&(a=d,l=d.components().indexOf(p)+1)}if(!a){var f=i.getWrapper();c.validTarget(f.getEl(),u).valid&&(a=f)}var h=a&&a.append(u,{at:l})[0];h&&i.setSelected(h,{scroll:1})}},o.prototype.startDrag=function(t){var e=this,n=e.config,o=e.em,r=e.model,i=r.get('disable');if(0===t.button&&n.getSorter&&!this.el.draggable&&!i){o.refreshCanvas();var s=n.getSorter();s.__currentBlock=r,s.setDragHelper(this.el,t),s.setDropContent(this.model.get('content')),s.startSort(this.el),(0,bt.on)(document,'mouseup',this.endDrag)}},o.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},o.prototype.handleDrag=function(t){this.__getModule().__drag(t)},o.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},o.prototype.endDrag=function(){(0,bt.S1)(document,'mouseup',this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},o.prototype.render=function(){var t,n=this,o=n.em,r=n.el,i=n.$el,s=n.ppfx,a=n.model,l=a.get('disable'),c=a.get('attributes')||{},u=c.class||'',p="".concat(s,"block"),d=o&&o.t("blockManager.labels.".concat(a.id))||a.get('label'),f=a.get('render'),h=a.get('media'),g=l?"".concat(p,"--disable"):"".concat(s,"four-color-h");i.attr(c),r.className="".concat(u," ").concat(p," ").concat(s,"one-bg ").concat(g).trim(),r.innerHTML="\n ".concat(h?"
").concat(h,"
"):'',"\n
").concat(d,"
\n "),r.title=c.title||(null===(t=r.textContent)||void 0===t?void 0:t.trim()),r.setAttribute('draggable',"".concat(!(!(0,e.hasDnd)(o)||l)));var v=f&&f({el:r,model:a,className:p,prefix:s});return v&&(r.innerHTML=v),this},o}(u.G7);const yi=vi;var mi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),bi=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},_i=function(t){function e(e,n,o){var r=t.call(this,e)||this;r.config=n;var i=n.pStylePrefix||'';return r.em=n.em,r.catName=o,r.pfx=i,r.caretR='fa fa-caret-right',r.caretD='fa fa-caret-down',r.iconClass="".concat(i,"caret-icon"),r.activeClass="".concat(i,"open"),r.className="".concat(i).concat(o,"-category"),r.listenTo(r.model,'change:open',r.updateVisibility),r.model.view=r,r}return mi(e,t),e.prototype.events=function(){return{'click [data-title]':'toggle'}},e.prototype.template=function(t){var e=t.pfx,n=t.label,o=t.catName;return r(xi||(xi=bi(["\n
\n \n ","\n
\n
\n "],["\n
\n \n ","\n
\n
\n "])),e,e,n,e,o)},e.prototype.attributes=function(){return this.model.get('attributes')||{}},e.prototype.updateVisibility=function(){this.model.get('open')?this.open():this.close()},e.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getTypeEl().style.display=''},e.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getTypeEl().style.display='none'},e.prototype.toggle=function(){var t=this.model;t.set('open',!t.get('open'))},e.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},e.prototype.getTypeEl=function(){return this.typeEl||(this.typeEl=this.el.querySelector(".".concat(this.pfx).concat(this.catName,"s-c"))),this.typeEl},e.prototype.append=function(t){this.getTypeEl().appendChild(t)},e.prototype.render=function(){var t=this,e=t.em,n=t.el,o=t.$el,r=t.model,i=t.pfx,s=t.catName,a=e.t("".concat(s,"Manager.categories.").concat(r.id))||r.get('label');return n.innerHTML=this.template({pfx:i,label:a,catName:s}),o.addClass(this.className),o.css({order:r.get('order')}),this.updateVisibility(),this},e}(u.G7);const wi=_i;var xi,Ci=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Si=void 0&&(void 0).__assign||function(){return Si=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n
\n
\n "),this.collection.each((function(e){return t.add(e,n)})),this.append(n);var o="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(o),this.rendered=!0,this},n}(u.G7);const Ti=Oi;var ki=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ei=void 0&&(void 0).__assign||function(){return Ei=Object.assign||function(t){for(var e,n=1,o=arguments.length;n',iconSync:'',iconTagOn:'',iconTagOff:'',iconTagRemove:'',componentFirst:!1,custom:!1};var Mi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Li=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Mi(e,t),e.prototype.defaults=function(){return{name:'',label:''}},e.prototype.getName=function(){return this.get('name')},e.prototype.getLabel=function(){return this.get('label')||this.getName()},e}(u.Hn);const Di=Li;Li.prototype.idAttribute='name';var Ni=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ii=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Fi='contentEditable',Vi=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.config||{};return n.config=o,n.module=e.module,n.coll=e.coll||null,n.pfx=o.stylePrefix||'',n.ppfx=o.pStylePrefix||'',n.em=o.em,n.listenTo(n.model,'change:active',n.updateStatus),n}return Ni(e,t),e.prototype.template=function(){var t=this,e=t.pfx,n=t.model,o=t.config,i=n.get('label')||'';return r(Hi||(Hi=Ii(["\n \n ","\n $"," \n "],["\n \n ","\n $"," \n "])),e,e,e,i,e,e,o.iconTagRemove)},e.prototype.events=function(){return{'click [data-tag-remove]':'removeTag','click [data-tag-status]':'changeStatus','dblclick [data-tag-name]':'startEditTag','focusout [data-tag-name]':'endEditTag'}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector('[data-tag-name]')),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[Fi]='true',e.focus(),null==t||t.setEditing(!0)},e.prototype.endEditTag=function(){var t=this.model,e=this.em,n=this.getInputEl(),o=n.textContent||'',r=null==e?void 0:e.Selectors;n[Fi]='false',null==e||e.setEditing(!1),r&&r.rename(t,o)!==t&&(n.innerText=t.getLabel())},e.prototype.changeStatus=function(){var t=this.model;t.set('active',!t.getActive())},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,o=t.config,r=o.iconTagOn,i=o.iconTagOff,s=n.find('[data-tag-status]');e.get('active')?(s.html(r),n.removeClass('opac50')):(s.html(i),n.addClass('opac50'))},e.prototype.render=function(){var t=this,e=t.pfx,n=t.ppfx,o=t.$el,r=t.model,i="".concat(e,"tag"),s=["".concat(i," ").concat(n,"three-bg")];return r.get('protected')&&s.push("".concat(i,"-protected")),o.html(this.template()),o.attr('class',s.join(' ')),this.updateStatus(),this},e}(u.G7);const Ri=Vi;var Hi,zi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Bi=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Ui=function(e){function n(n){void 0===n&&(n={});var o=e.call(this,n)||this;o.config=n.config||{},o.pfx=o.config.stylePrefix||'',o.ppfx=o.config.pStylePrefix||'',o.className=o.pfx+'tags',o.stateInputId=o.pfx+'states',o.stateInputC=o.pfx+'input-c',o.states=o.config.states||[];var r=o.config.em,i=o.collection;o.target=r;var s=r.Selectors;o.module=s,o.em=r,o.componentChanged=(0,t.debounce)(o.componentChanged.bind(o),0),o.checkSync=(0,t.debounce)(o.checkSync.bind(o),0);return o.listenTo(r,'component:toggled component:update:classes',o.componentChanged),o.listenTo(r,'styleManager:update',o.componentChanged),o.listenTo(r,'component:update:classes change:state',o.__handleStateChange),o.listenTo(r,'styleable:change change:device',o.checkSync),o.listenTo(i,'add',o.addNew),o.listenTo(i,'reset',o.renderClasses),o.listenTo(i,'remove',o.tagRemoved),o.listenTo(s.getAll(),s.events.state,(0,t.debounce)((function(){return o.renderStates()}),0)),o.delegateEvents(),o}return zi(n,e),n.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,o=t.iconSync,i=t.iconAdd,s=t.pfx,a=t.ppfx;return r($i||($i=Bi(["
\n
","
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $"," \n $"," \n
\n
\n
",":
\n
\n
"],["
\n
","
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $"," \n $"," \n
\n
\n
",":
\n
\n
"])),s,s,s,s,n,s,s,s,a,a,a,s,a,a,s,a,s,s,s,s,s,i,s,s,o,s,s,e,s)},n.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'}},n.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),o=e.Css,r=this.getCommonSelectors({opts:{noDisabled:1}}),i=e.get('state'),s=e.getCurrentMedia(),a=[],l=o.get(r,i,s)||o.add(r,i,s);this.getTargets().forEach((function(e){var n=o.getIdRule(e.getId(),{state:i,mediaText:s});t=n.getStyle(),n.setStyle({}),a.push(n)})),t&&l.addStyle(t),e.trigger('component:toggled'),e.trigger('component:sync-style',{component:n,selectors:r,mediaText:s,rule:l,ruleComponents:a,state:i})},n.prototype.tagRemoved=function(t){this.updateStateVis()},n.prototype.addNew=function(t){this.addToClasses(t)},n.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()},n.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('')},n.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()},n.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},n.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},n.prototype.updateSelection=function(e){var n=e||this.getTargets(),o=[];return(n=(0,t.isArray)(n)?n:[n])&&n.length&&(o=this.getCommonSelectors({targets:n}),this.checkSync({validSelectors:o})),this.collection.reset(o),this.updateStateVis(n),this.module.__trgCustom(),o},n.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,o=e.opts,r=void 0===o?{}:o,i=n||this.getTargets();return this.module.__getCommonSelectors(i,r)},n.prototype._commonSelectors=function(){for(var t,e=[],n=0;n",""],["",""])),i,e);else{var u=null==e?void 0:e.getSelectors();if(!u)return'';var p=u.getStyleable(),d=a.get('state'),f=e.getId?r(Gi||(Gi=Bi(["","\n #",""],["","\n #",""])),i,e.getName(),i,e.getId()):'';n=(n=this.collection.getFullString(p))?r(Ki||(Ki=Bi(["",""],["",""])),i,n):e.get('selectorsAdd')||f,n=c&&f?f:n,n+=d?r(Yi||(Yi=Bi([":",""],[":",""])),i,d):'',n=l?l({result:n,state:d,target:e}):n}return n&&"").concat(n,"")},n.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set('state',n)},n.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},n.prototype.addToClasses=function(t,e){var n=e,o=this.getClasses(),r=new Ri({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(r):o.append(r),r},n.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)},n.prototype.getClasses=function(){return this.$el.find('[data-selectors]')},n.prototype.getStates=function(){if(!this.$states){var t=this.$el.find('[data-states]');this.$states=t[0]&&t}return this.$states},n.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find('#'+this.stateInputC)),this.$statesC},n.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t('selectorManager.emptyState'),o=t.getStates().map((function(t){var n=e.t("selectorManager.states.".concat(t.id))||t.getLabel()||t.id;return"")})).join(''),r=this.getStates();r&&r.html("").concat(o)),this.checkStates()},n.prototype.render=function(){var t=this,e=t.em,n=t.pfx,o=t.ppfx,r=t.config,i=t.$el,s=t.el,a=r.render,l={iconSync:r.iconSync,iconAdd:r.iconAdd,labelHead:e.t('selectorManager.label'),labelInfo:e.t('selectorManager.selected'),ppfx:o,pfx:n,el:s};i.html(this.template(l));var c=a&&a(l);return c&&c!==s&&i.empty().append(c),this.$input=i.find('[data-input]'),this.$addBtn=i.find('[data-add]'),this.$classes=i.find('#'+n+'tags-c'),this.$btnSyncEl=i.find('[data-sync-style]'),this.$input.hide(),this.renderStates(),this.renderClasses(),i.attr('class',"".concat(this.className," ").concat(o,"one-bg ").concat(o,"two-color")),this},n}(u.G7);const Wi=Ui;var $i,qi,Gi,Ki,Yi,Zi=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Xi=void 0&&(void 0).__assign||function(){return Xi=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0})):e.slice(1).reduce((function(e,n){return t.__common(e,n)}),e[0]):[]},o.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},o}(b);const ps=us;const ds={textTags:['br','b','i','u','a','ul','ol'],textTypes:['text','textnode','comment'],parserCss:void 0,parserHtml:void 0,optionsHtml:{htmlType:'text/html',allowScripts:!1,allowUnsafeAttr:!1,allowUnsafeAttrValue:!1,keepEmptyTextNodes:!1}};var fs,hs=5,gs=6,vs=7,ys=11,ms=12,bs=13,_s=14,ws=15,xs=((fs={})[4]='media',fs[hs]='font-face',fs[gs]='page',fs[vs]='keyframes',fs[ys]='counter-style',fs[ms]='supports',fs[bs]='document',fs[_s]='font-feature-values',fs[ws]='viewport',fs),Cs=(0,t.keys)(xs),Ss=[hs,gs,ys,ws],Os=Cs.filter((function(t){return Ss.indexOf(Number(t))<0})).map((function(t){return xs[t]})).concat(['container','layer']),Ts=Ss.map((function(t){return xs[t]})),ks=function(t){void 0===t&&(t='');for(var e=[],n=[],o=t.split(','),r=0,i=o.length;r=0&&(o.singleAtRule=!0),l&&(o.atRuleType=l),c&&(o.selectorsAdd=c),u&&(o.mediaText=u),a&&(t[r-1]=s[0],o.state=a,s.splice(s.length-1,1)),o.selectors=t,o.style=e,o},js=function(t){var e=t.cssText,n=void 0===e?'':e;return Os.find((function(t){return 0===n.indexOf("@".concat(t))}))},Ms=function(t){for(var e=[],n=t.cssRules||[],o=0,r=n.length;o=0;if(p)a=!0,l=xs[s],c=Ps(i);else if(Cs.indexOf("".concat(s))>=0||!s&&js(i)){var d=Ms(i),f=xs[s]||js(i);c=Ps(i);for(var h=0,g=d.length;h0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]").concat(n,"")},o.prototype.templateInput=function(t){var e=this.clsField;return"
")},o.prototype.getClbOpts=function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},o.prototype.removeView=function(){this.remove(),this.removed()},o.prototype.init=function(){},o.prototype.removed=function(){},o.prototype.onRender=function(t){},o.prototype.onUpdate=function(t){},o.prototype.onEvent=function(t){},o.prototype.onChange=function(e){var n=this.getInputElem();n&&!(0,t.isUndefined)(n.value)&&this.model.set('value',n.value),this.onEvent(wa(wa({},this.getClbOpts()),{event:e}))},o.prototype.getValueForTarget=function(){return this.model.get('value')},o.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.value=t)},o.prototype.onValueChange=function(t,e,n){if(void 0===n&&(n={}),n.fromTarget)this.setInputValue(t.get('value')),this.postUpdate();else{var o=this.getValueForTarget();t.setTargetValue(o,n)}},o.prototype.renderLabel=function(){var t=this.$el,e=this.target,n=this.getLabel(),o=this.templateLabel(e);this.createLabel&&(o=this.createLabel({label:n,component:e,trait:this})||''),t.find('[data-label]').append(o)},o.prototype.getLabel=function(){var t=this.em,n=this.model.attributes,o=n.label,r=n.name;return t.t("traitManager.traits.labels.".concat(r))||(0,e.capitalize)(o||r).replace(/-/g,' ')},o.prototype.getComponent=function(){return this.target},o.prototype.getInputEl=function(){if(!this.$input){var e=this.em,n=this.model,o=n,r=n.attributes.name,i=o.get('placeholder')||o.get('default')||'',s=o.get('type')||'text',a=o.get('min'),c=o.get('max'),u=this.getModelValue(),p=(0,l["default"])("")),d=e.t("traitManager.traits.attributes.".concat(r))||{};p.attr(wa({placeholder:i},d)),(0,t.isUndefined)(u)||(o.set({value:u},{silent:!0}),p.prop('value',u)),a&&p.prop('min',a),c&&p.prop('max',c),this.$input=p}return this.$input.get(0)},o.prototype.getInputElem=function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()},o.prototype.getModelValue=function(){return this.model.getValue()},o.prototype.getElInput=function(){return this.elInput},o.prototype.renderField=function(){var e=this,n=e.$el,o=e.appendInput,r=e.model,i=n.find('[data-input]'),s=i[i.length-1],a=r.el;a||(a=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,t.isString)(a)?(s.innerHTML=a,this.elInput=s.firstChild):(o?s.appendChild(a):s.insertBefore(a,s.firstChild),this.elInput=a),r.el=this.elInput},o.prototype.hasLabel=function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t},o.prototype.rerender=function(){delete this.model.el,this.render()},o.prototype.postUpdate=function(){this.onUpdate(this.getClbOpts())},o.prototype.render=function(){var e=this,n=e.$el,o=e.pfx,r=e.ppfx,i=e.model.attributes,s=i.type,a=i.id,l=this.hasLabel&&this.hasLabel(),c="".concat(o,"trait");delete this.$input;var u="
\n ").concat(l?"
"):'',"\n
\n ").concat(this.templateInput?(0,t.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:'',"\n
\n
");return n.empty().append(u),l&&this.renderLabel(),this.renderField(),this.el.className="".concat(c,"__wrp ").concat(c,"__wrp-").concat(a),this.postUpdate(),this.onRender(this.getClbOpts()),this},o}(u.G7);const Ca=xa;xa.prototype.eventCapture=['change'];var Sa=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Oa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sa(e,t),e.prototype.templateInput=function(){return''},e.prototype.onChange=function(){this.handleClick()},e.prototype.handleClick=function(){this.model.runCommand()},e.prototype.renderLabel=function(){this.model.get('label')&&Ca.prototype.renderLabel.apply(this)},e.prototype.getInputEl=function(){var t=this.model,e=this.ppfx,n=t.props(),o=n.labelButton,r=n.text,i=n.full,s=o||r,a="".concat(e,"btn");return"")},e}(Ca);const Ta=Oa;Oa.prototype.eventCapture=['click button'];var ka=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Ea=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.appendInput=!1,t}return ka(n,e),n.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return"")},n.prototype.onChange=function(){this.model.set('value',this.getInputElem().checked)},n.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},n.prototype.getInputEl=function(){for(var e=[],n=0;n")},e.prototype.inputClass=function(){return"".concat(this.ppfx,"field")},e.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},e.prototype.elementUpdated=function(){this.model.trigger('el:change')},e.prototype.setValue=function(t,e){var n=this.model,o=t||n.get('defaults'),r=this.getInputEl();r&&(r.value=o)},e.prototype.handleModelChange=function(t,e,n){this.setValue(e,n)},e.prototype.handleChange=function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},e.prototype.__onInputChange=function(t){this.model.set({value:t},{fromInput:1})},e.prototype.getInputEl=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=(0,l["default"])(""))}return this.inputEl.get(0)},e.prototype.render=function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this},e}(u.G7);const ja=Aa;Aa.prototype.events={change:'handleChange'};var Ma=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),La=void 0&&(void 0).__assign||function(){return La=Object.assign||function(t){for(var e,n=1,o=arguments.length;n","
","
",''].join(''),l=function(){var t='';if(i)for(var e=1;e<=6;e++)t+="
";return["
","
","
","
","",'
','
',"
","
","
","
","
","
","
","
",'
','
','
',"
",'
',"
","
",t,'
','
',"
",'
',"
","",'
',"
","
","","",'
','
','
'].join('')}(),c='spectrum.id';t.fn.spectrum=function(e,n){if('string'==typeof e){var o=this,i=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=r[t(this).data(c)];if(n){var s=n[e];if(!s)throw new Error("Spectrum: no such method: '"+e+"'");'get'==e?o=n.get():'container'==e?o=n.container:'option'==e?o=n.option.apply(n,i):'destroy'==e?(n.destroy(),t(this).removeData(c)):s.apply(n,i)}})),o}return this.spectrum('destroy').each((function(){var n=T(this,t.extend({},e,t(this).data()));t(this).data(c,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=A,t.fn.spectrum.defaults=o,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t("")[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&&!j()&&e.spectrum({preferredFormat:'hex6'})};var u=/^[\s,#]+/,p=/\s+$/,d=0,f=Math,h=f.round,g=f.min,v=f.max,y=f.random,m=function(t,e){if(e=e||{},(t=t||'')instanceof m)return t;if(!(this instanceof m))return new m(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,o=!1,r=!1;'string'==typeof t&&(t=function(t){t=t.replace(u,'').replace(p,'').toLowerCase();var e,n=!1;if(x[t])t=x[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:et(e[1]),r:J(e[2]),g:J(e[3]),b:J(e[4]),format:n?'name':'hex8'};if(e=S.hex6.exec(t))return{r:J(e[1]),g:J(e[2]),b:J(e[3]),format:n?'name':'hex'};if(e=S.hex3.exec(t))return{r:J(e[1]+''+e[1]),g:J(e[2]+''+e[2]),b:J(e[3]+''+e[3]),format:n?'name':'hex'};return!1}(t));'object'==typeof t&&(t.hasOwnProperty('r')&&t.hasOwnProperty('g')&&t.hasOwnProperty('b')?(i=t.r,s=t.g,a=t.b,e={r:255*Z(i,255),g:255*Z(s,255),b:255*Z(a,255)},o=!0,r='%'===String(t.r).substr(-1)?'prgb':'rgb'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('v')?(t.s=tt(t.s),t.v=tt(t.v),e=function(t,e,n){t=6*Z(t,360),e=Z(e,100),n=Z(n,100);var o=f.floor(t),r=t-o,i=n*(1-e),s=n*(1-r*e),a=n*(1-(1-r)*e),l=o%6,c=[n,s,i,i,a,n][l],u=[a,n,n,s,i,i][l],p=[i,i,a,n,n,s][l];return{r:255*c,g:255*u,b:255*p}}(t.h,t.s,t.v),o=!0,r='hsv'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('l')&&(t.s=tt(t.s),t.l=tt(t.l),e=function(t,e,n){var o,r,i;function s(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=Z(t,360),e=Z(e,100),n=Z(n,100),0===e)o=r=i=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;o=s(l,a,t+1/3),r=s(l,a,t),i=s(l,a,t-1/3)}return{r:255*o,g:255*r,b:255*i}}(t.h,t.s,t.l),o=!0,r='hsl'),t.hasOwnProperty('a')&&(n=t.a));var i,s,a;return n=Y(n),{ok:o,format:t.format||r,r:g(255,v(e.r,0)),g:g(255,v(e.g,0)),b:g(255,v(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=h(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=h(this._r)),this._g<1&&(this._g=h(this._g)),this._b<1&&(this._b=h(this._b)),this._ok=n.ok,this._tc_id=d++};m.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=h(100*this._a)/100,this},toHsv:function(){var t=L(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=L(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),o=h(100*t.v);return 1==this._a?'hsv('+e+', '+n+'%, '+o+'%)':'hsva('+e+', '+n+'%, '+o+'%, '+this._roundA+')'},toHsl:function(){var t=M(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=M(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),o=h(100*t.l);return 1==this._a?'hsl('+e+', '+n+'%, '+o+'%)':'hsla('+e+', '+n+'%, '+o+'%, '+this._roundA+')'},toHex:function(t){return D(this._r,this._g,this._b,t)},toHexString:function(t){return'#'+this.toHex(t)},toHex8:function(){return N(this._r,this._g,this._b,this._a)},toHex8String:function(){return'#'+this.toHex8()},toRgb:function(){return{r:h(this._r),g:h(this._g),b:h(this._b),a:this._a}},toRgbString:function(){return 1==this._a?'rgb('+h(this._r)+', '+h(this._g)+', '+h(this._b)+')':'rgba('+h(this._r)+', '+h(this._g)+', '+h(this._b)+', '+this._roundA+')'},toPercentageRgb:function(){return{r:h(100*Z(this._r,255))+'%',g:h(100*Z(this._g,255))+'%',b:h(100*Z(this._b,255))+'%',a:this._a}},toPercentageRgbString:function(){return 1==this._a?'rgb('+h(100*Z(this._r,255))+'%, '+h(100*Z(this._g,255))+'%, '+h(100*Z(this._b,255))+'%)':'rgba('+h(100*Z(this._r,255))+'%, '+h(100*Z(this._g,255))+'%, '+h(100*Z(this._b,255))+'%, '+this._roundA+')'},toName:function(){return 0===this._a?'transparent':!(this._a<1)&&(C[D(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e='#'+N(this._r,this._g,this._b,this._a),n=e,o=this._gradientType?'GradientType = 1, ':'';t&&(n=m(t).toHex8String());return'progid:DXImageTransform.Microsoft.gradient('+o+'startColorstr='+e+',endColorstr='+n+')'},toString:function(t){var e=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0;return e||!o||'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(R,arguments)},brighten:function(){return this._applyModification(H,arguments)},darken:function(){return this._applyModification(z,arguments)},desaturate:function(){return this._applyModification(I,arguments)},saturate:function(){return this._applyModification(F,arguments)},greyscale:function(){return this._applyModification(V,arguments)},spin:function(){return this._applyModification(B,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)}},m.fromRatio=function(t,e){if('object'==typeof t){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]='a'===o?t[o]:tt(t[o]));t=n}return m(t,e)},m.equals=function(t,e){return!(!t||!e)&&m(t).toRgbString()==m(e).toRgbString()},m.random=function(){return m.fromRatio({r:y(),g:y(),b:y()})},m.mix=function(t,e,n){n=0===n?0:n||50;var o,r=m(t).toRgb(),i=m(e).toRgb(),s=n/100,a=2*s-1,l=i.a-r.a,c=1-(o=((o=a*l==-1?a:(a+l)/(1+a*l))+1)/2),u={r:i.r*o+r.r*c,g:i.g*o+r.g*c,b:i.b*o+r.b*c,a:i.a*s+r.a*(1-s)};return m(u)},m.readability=function(t,e){var n=m(t),o=m(e),r=n.toRgb(),i=o.toRgb(),s=n.getBrightness(),a=o.getBrightness(),l=Math.max(r.r,i.r)-Math.min(r.r,i.r)+Math.max(r.g,i.g)-Math.min(r.g,i.g)+Math.max(r.b,i.b)-Math.min(r.b,i.b);return{brightness:Math.abs(s-a),color:l}},m.isReadable=function(t,e){var n=m.readability(t,e);return n.brightness>125&&n.color>500},m.mostReadable=function(t,e){for(var n=null,o=0,r=!1,i=0;i125&&s.color>500,l=3*(s.brightness/125)+s.color/500;(a&&!r||a&&r&&l>o||!a&&!r&&l>o)&&(r=a,o=l,n=m(e[i]))}return n};var b,_,w,x=m.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=m.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(x),S=(_='[\\s|\\(]+('+(b='(?:'+'[-\\+]?\\d*\\.\\d+%?'+')|(?:'+'[-\\+]?\\d+%?'+')')+')[,|\\s]+('+b+')[,|\\s]+('+b+')\\s*\\)?',w='[\\s|\\(]+('+b+')[,|\\s]+('+b+')[,|\\s]+('+b+')[,|\\s]+('+b+')\\s*\\)?',{rgb:new RegExp('rgb'+_),rgba:new RegExp('rgba'+w),hsl:new RegExp('hsl'+_),hsla:new RegExp('hsla'+w),hsv:new RegExp('hsv'+_),hsva:new RegExp('hsva'+w),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=m,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}function O(e,n,o,r){for(var i=[],a=0;a')}else{i.push(t('
').append(t('').attr('title',r.noColorSelectedText)).html())}}return"
"+i.join('')+'
'}function T(e,c){var u,p,d,f,h=function(e,n){var r=t.extend({},o,e);return r.callbacks={move:P(r.move,n),change:P(r.change,n),show:P(r.show,n),hide:P(r.hide,n),beforeShow:P(r.beforeShow,n)},r}(c,e),g=h.flat,v=h.showSelectionPalette,y=h.localStorageKey,b=h.theme,_=h.callbacks,w=(u=$t,p=10,function(){var t=this,e=arguments,n=function(){f=null,u.apply(t,e)};d&&clearTimeout(f),!d&&f||(f=setTimeout(n,p))}),x=!1,C=!1,S=!0,T=0,k=0,M=0,L=0,D=0,N=0,I=0,F=0,V=0,R=0,H=1,z=[],B=[],U={},W=h.selectionPalette.slice(0),$=h.maxSelectionSize,q='sp-dragging',G=null,K=e.ownerDocument,Y=(K.body,t(e)),Z=!1,X=t(l,K).addClass(b),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'),ot=X.find('.sp-alpha-inner'),rt=X.find('.sp-alpha'),it=X.find('.sp-alpha-handle'),st=X.find('.sp-input'),at=X.find('.sp-palette'),lt=X.find('.sp-initial'),ct=X.find('.sp-cancel'),ut=X.find('.sp-clear'),pt=X.find('.sp-choose'),dt=X.find('.sp-palette-toggle'),ft=Y.is('input'),ht=ft&&'color'===Y.attr('type')&&j(),gt=ft&&!g,vt=gt?t(a).addClass(b).addClass(h.className).addClass(h.replacerClassName):t([]),yt=gt?vt:Y,mt=vt.find('.sp-preview-inner'),bt=h.color||ft&&Y.val(),_t=!1,wt=h.preferredFormat,xt=!h.showButtons||h.clickoutFiresChange,Ct=!bt,St=h.allowEmpty&&!ht;function Ot(){if(h.showPaletteOnly&&(h.showPalette=!0),dt.text(h.showPaletteOnly?h.togglePaletteMoreText:h.togglePaletteLessText),h.palette){z=h.palette.slice(0),B=t.isArray(z[0])?z:[z],U={};for(var e=0;e1&&(delete window.localStorage[y],t.each(e,(function(t,e){kt(e)})))}catch(t){}try{W=window.localStorage[y].split(';')}catch(t){}}}function kt(e){if(v){var n=m(e).toRgbString();if(!U[n]&&-1===t.inArray(n,W))for(W.push(n);W.length>$;)W.shift();if(y&&window.localStorage)try{window.localStorage[y]=W.join(';')}catch(t){}}}function Et(){var e=Ht(),n=t.map(B,(function(t,n){return O(t,e,'sp-palette-row sp-palette-row-'+n,h)}));Tt(),W&&n.push(O(function(){var t=[];if(h.showPalette)for(var e=0;ewindow.innerWidth-window.scrollX&&i.right-s>0&&(l.left-=s-l.width);i.bottom+aMath.abs(e-r);G=i?'x':'y'}}else G=null;var s=!G||'y'===G;(!G||'x'===G)&&(V=parseFloat(t/T)),s&&(R=parseFloat((k-e)/k)),Ct=!1,h.showAlpha||(H=1),zt()}),At,jt),bt?(Rt(bt),Bt(),wt=h.preferredFormat||m(bt).getFormat(),kt(bt)):Bt(),g&&Dt();var o=i?'mousedown.spectrum':'click.spectrum touchstart.spectrum';at.delegate('.sp-thumb-el',o,n),lt.delegate('.sp-thumb-el:nth-child(1)',o,{ignore:!0},n)}();var Gt={show:Dt,hide:Ft,toggle:Lt,reflow:$t,option:function(e,o){return e===n?t.extend({},h):o===n?h[e]:(h[e]=o,'preferredFormat'===e&&(wt=h.preferredFormat),void Ot())},enable:function(){Z=!1,Y.attr('disabled',!1),yt.removeClass('sp-disabled')},disable:qt,offset:function(t){h.offset=t,$t()},set:function(t){Rt(t),Wt()},get:Ht,destroy:function(){Y.show(),yt.unbind('click.spectrum touchstart.spectrum'),X.remove(),vt.remove(),r[Gt.id]=null},container:X};return Gt.id=r.push(Gt)-1,Gt}function k(){}function E(t){t.stopPropagation()}function P(t,e){var n=Array.prototype.slice,o=n.call(arguments,2);return function(){return t.apply(e,o.concat(n.call(arguments)))}}function A(e,n,o,r){n=n||function(){},o=o||function(){},r=r||function(){};var s=document,a=!1,l={},c=0,u=0,p='ontouchstart'in window,d={};function f(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function h(t){if(a){if(i&&s.documentMode<9&&!t.button)return g();var o=t&&t.touches&&t.touches[0],r=o&&o.pageX||t.pageX,d=o&&o.pageY||t.pageY,h=Math.max(0,Math.min(r-l.left,u)),v=Math.max(0,Math.min(d-l.top,c));p&&f(t),n.apply(e,[h,v,t])}}function g(){a&&(t(s).unbind(d),t(s.body).removeClass('sp-dragging'),setTimeout((function(){r.apply(e,arguments)}),0)),a=!1}d['selectstart']=f,d['dragstart']=f,d['touchmove mousemove']=h,d['touchend mouseup']=g,t(e).bind('touchstart mousedown',(function(n){(n.which?3==n.which:2==n.button)||a||!1!==o.apply(e,arguments)&&(a=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(s).bind(d),t(s.body).addClass('sp-dragging'),h(n),f(n))}))}function j(){return t.fn.spectrum.inputTypeColorSupport()}function M(t,e,n){t=Z(t,255),e=Z(e,255),n=Z(n,255);var o,r,i=v(t,e,n),s=g(t,e,n),a=(i+s)/2;if(i==s)o=r=0;else{var l=i-s;switch(r=a>.5?l/(2-i-s):l/(i+s),i){case t:o=(e-n)/l+(e>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(m(o));return i}function K(t,e){e=e||6;for(var n=m(t).toHsv(),o=n.h,r=n.s,i=n.v,s=[],a=1/e;e--;)s.push(m({h:o,s:r,v:i})),i=(i+a)%1;return s}function Y(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Z(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=g(e,v(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),f.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function X(t){return g(1,v(0,t))}function J(t){return parseInt(t,16)}function Q(t){return 1==t.length?'0'+t:''+t}function tt(t){return t<=1&&(t=100*t+'%'),t}function et(t){return J(t)/255}}(l["default"]);var Da=function(t){var e='name'===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,'')},Na=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ma(n,e),n.prototype.template=function(){var t=this.ppfx;return"\n
\n
\n
\n
\n
\n
\n ")},n.prototype.inputClass=function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},n.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},n.prototype.remove=function(){return e.prototype.remove.call(this),this.colorEl.spectrum('destroy'),this},n.prototype.handleChange=function(e){e.stopPropagation();var n=e.target.value;(0,t.isUndefined)(n)||this.__onInputChange(n)},n.prototype.__onInputChange=function(t){var e=this.model,n=this.opts.onChange,o=t,r=this.getColorEl();if(r){r.spectrum('set',o);var i=r.spectrum('get'),s=o&&Da(i);s&&(o=s)}n?n(o):e.set({value:o},{fromInput:1})},n.prototype.setValue=function(e,n){void 0===n&&(n={});var o=this.model,r=(0,t.isUndefined)(n.def)?o.get('defaults'):n.def,i=(0,t.isUndefined)(e)?(0,t.isUndefined)(r)?'':r:e,s=this.getInputEl(),a=this.getColorEl(),l='none'!=i?i:'';s.value=i,a.get(0).style.backgroundColor=l,(n.fromTarget||n.fromInput&&!n.avoidStore)&&(a.spectrum('set',l),this.noneColor='none'==i,this.movedColor=l)},n.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var e=this,n=e.em,o=e.model,r=e.opts,i=this.ppfx,s=r.onChange,a=(0,l["default"])("
")),c=a.get(0).style,u=n&&n.getConfig&&n.getConfig().colorPicker||{};this.movedColor='';var p,d=!1;this.$el.find('[data-colorp-c]').append(a);var f=function(t,e){void 0===e&&(e=!0),s?s(t,!e):(e&&o.setValueFromInput(0,!1),o.setValueFromInput(t,e))};a.spectrum(La(La(La({color:o.getValue()||!1,containerClassName:"".concat(i,"one-bg ").concat(i,"two-color ").concat(i,"editor-sp"),maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:'Ok',cancelText:'⨯',palette:[]},u),o.get('colorPicker')||{}),{move:function(e){var n=Da(e);t.movedColor=n,c.backgroundColor=n,f(n,!1)},change:function(e){d=!0;var n=Da(e);c.backgroundColor=n,f(n),t.noneColor=!1},show:function(e){d=!1,t.movedColor='',p=s?o.getValue({noDefault:!0}):Da(e)},hide:function(){d||!p&&!s||(t.noneColor&&(p=''),c.backgroundColor=p,a.spectrum('set',p),f(p,!1))}})),n&&n.on&&this.listenTo(n,'component:selected',(function(){t.movedColor&&f(t.movedColor),d=!0,t.movedColor='',a.spectrum('hide')})),this.colorEl=a}return this.colorEl},n.prototype.render=function(){return ja.prototype.render.call(this),this.getColorEl(),this},n}(ja);const Ia=Na;var Fa=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Va=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fa(e,t),e.prototype.templateInput=function(){return''},e.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new Ia({model:t,target:this.config.em,contClass:this.ppfx+'field-color',ppfx:this.ppfx}).render();n.setValue(e,{fromTarget:1}),this.input=n.el}return this.input},e}(Ca);var Ra=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ha=function(e){function n(n){void 0===n&&(n={});var o=e.call(this,n)||this;return(0,t.bindAll)(o,'moveIncrement','upIncrement'),o.doc=document,o.listenTo(o.model,'change:unit',o.handleModelChange),o}return Ra(n,e),n.prototype.template=function(){var t=this.ppfx;return"\n \n \n
\n
\n
\n
\n ")},n.prototype.inputClass=function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},n.prototype.setValue=function(t,e){var n=e||{},o=this.validateInputValue(t,{deepCheck:1}),r={value:o.value,unit:''};(o.unit||o.force)&&(r.unit=o.unit),this.model.set(r,n),n.silent&&this.handleModelChange()},n.prototype.handleChange=function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},n.prototype.handleUnitChange=function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set('unit',e),this.elementUpdated()},n.prototype.handleKeyDown=function(t){'ArrowUp'===t.key&&(t.preventDefault(),this.upArrowClick()),'ArrowDown'===t.key&&(t.preventDefault(),this.downArrowClick())},n.prototype.elementUpdated=function(){this.model.trigger('el:change')},n.prototype.handleModelChange=function(){var t=this.model;this.getInputEl().value=t.get('value');var e=this.getUnitEl();e&&(e.value=t.get('unit')||'')},n.prototype.getUnitEl=function(){if(!this.unitEl){var t=this.model,e=t.get('units')||[];if(e.length){var n=[''];e.forEach((function(e){var o=e==t.get('unit')?'selected':'';n.push(""))}));var o=document.createElement('div');o.innerHTML=""),this.unitEl=o.firstChild}}return this.unitEl},n.prototype.upArrowClick=function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n+e)),this.elementUpdated()},n.prototype.downArrowClick=function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n-e)),this.elementUpdated()},n.prototype.downIncrement=function(t){t.preventDefault(),this.moved=!1;var e=this.model.get('value')||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,bt.on)(this.doc,'mousemove',this.moveIncrement),(0,bt.on)(this.doc,'mouseup',this.upIncrement)},n.prototype.moveIncrement=function(t){this.moved=!0;var e=this.model,n=e.get('step'),o=this.current,r=this.normalizeValue(o.val+(o.y-t.pageY)*n),i=this.validateInputValue(r),s=i.value,a=i.unit;return this.prValue=s,e.set({value:s,unit:a},{avoidStore:1}),!1},n.prototype.upIncrement=function(){var t=this.model,e=t.get('step');if((0,bt.S1)(this.doc,'mouseup',this.upIncrement),(0,bt.S1)(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()}},n.prototype.normalizeValue=function(t,e){void 0===e&&(e=0);var n=this.model.get('step'),o=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var r=n.toString().split('.')[1];o=r?r.length:0}return o?parseFloat(t.toFixed(o)):t},n.prototype.validateInputValue=function(e,n){void 0===n&&(n={});var o=0,r=n||{},i=this.model,s='',a=(0,t.isUndefined)(e)?s:e,l=n.units||i.get('units')||[],c=i.get('unit')||l.length&&l[0]||'',u=(0,t.isUndefined)(n.max)?i.get('max'):n.max,p=(0,t.isUndefined)(n.min)?i.get('min'):n.min,d=!!i.get('limitlessMax'),f=!!i.get('limitlessMin');if(r.deepCheck){var h=i.get('fixedValues')||[];if(''===a&&(c=''),a){var g=new RegExp('^'+h.join('|'),'g');if(h.length&&g.test(a))a=a.match(g)[0],c='',o=1;else{var v=a+'';a+='',a=parseFloat(a.replace(',','.')),a=isNaN(a)?s:a;var y=v.replace(a,'');(0,t.indexOf)(l,y)>=0&&(c=y)}}}return d||(0,t.isUndefined)(u)||''===u||(a=a>u?u:a),f||(0,t.isUndefined)(p)||''===p||(a=a\n
\n
\n
\n
\n
")},n.prototype.getInputEl=function(){if(!this.$input){var e=this.model,n=this.em,o=e.get('name'),r=e.get('options')||[],i=[],s='',this.$input=(0,l["default"])(s);var a=e.getTargetValue(),c=i.indexOf(a)>=0?a:e.get('default');!(0,t.isUndefined)(c)&&this.$input.val(c)}return this.$input.get(0)},n}(Ca);var Ga=n(330),Ka=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ya='data-categories',Za='data-no-categories',Xa=function(t){function e(e,n){var o=t.call(this,e)||this;o.reuseView=!0,o.renderedCategories=new Map,o.itemsView=n;var r=e.config||{};o.config=r;var i=e.editor;o.em=i;var s=r.pStylePrefix||'';return o.ppfx=s,o.pfx=s+r.stylePrefix||'',o.className="".concat(o.pfx,"traits"),o.traitContClass="".concat(s,"traits-c"),o.classNoCat="".concat(s,"traits-empty-c"),o.catsClass="".concat(s,"trait-categories"),o.collection=new Xe([],{em:i}),o.listenTo(i,'component:toggled',o.updatedCollection),o.updatedCollection(),o}return Ka(e,t),e.prototype.updatedCollection=function(){var t=this.ppfx,e=this.em,n=e.getSelected();this.el.className="".concat(this.traitContClass,"s ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=(null==n?void 0:n.traits)||new Xe([],{em:e}),this.render()},e.prototype.add=function(t,e){var n=this.config,o=this.renderedCategories,r=this.itemView,i=t.get(this.itemType);this.itemsView&&this.itemsView[i]&&(r=this.itemsView[i]);var s=new r({config:n,model:t,attributes:t.get('attributes')}).render().el,a=t.parent.initCategory(t);if(a){var l=a.getId(),c=this.getCategoriesEl(),u=o.get(l);return!u&&c&&(u=new wi({model:a},n,'trait').render(),o.set(l,u),c.appendChild(u.el)),void(null==u||u.append(s))}e?e.appendChild(s):this.append(s)},e.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector("[".concat(Ya,"]"))),this.catsEl},e.prototype.getTraitsEl=function(){return this.traitsEl||(this.traitsEl=this.el.querySelector("[".concat(Za,"]"))),this.traitsEl},e.prototype.append=function(t){var e=this.getTraitsEl();null==e||e.appendChild(t)},e.prototype.render=function(){var t=this,e=this,n=e.el,o=e.ppfx,r=e.catsClass,i=e.traitContClass,s=e.classNoCat,a=document.createDocumentFragment();delete this.catsEl,delete this.traitsEl,this.renderedCategories=new Map,n.innerHTML="\n
\n
\n "),this.collection.forEach((function(e){return t.add(e,a)})),this.append(a);var l="".concat(i,"s ").concat(o,"one-bg ").concat(o,"two-color");return this.$el.addClass(l),this.rendered=!0,this},e}(Ga.Z);const Ja=Xa;Xa.prototype.itemView=Ca;var Qa=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),tl=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r\n
\n ").concat(c?"\n ").concat(x,"\n ").concat(C,"\n "):'',"\n
\n
\n
\n ").concat(S,"\n ").concat(m?"").concat(m,""):'',"\n ").concat(y,"\n
\n
\n
\n
\n
\n
").concat(u||'',"
\n
").concat(w||'',"
\n
\n \n
\n ")},Object.defineProperty(n.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),n.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,o=e.components();this.listenTo(o,'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',o),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},n.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},n.prototype.getVisibilityEl=function(){return this.getItemContainer().find('[data-toggle-visible]')},n.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,o=t.module,r="".concat(e,"layer-hidden"),i=!o.isVisible(n)?'addClass':'removeClass';this.$el[i](r),this.getVisibilityEl()[i]("".concat(e,"layer-off"))},n.prototype.toggleVisibility=function(t){null==t||t.stopImmediatePropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},n.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this,n=e.em,o=e.$el,r=e.clsNoEdit,i=e.clsEdit,s=this.getInputName();s[wl]='true',s.focus(),document.execCommand('selectAll',!1),n.setEditing(!0),o.find(".".concat(this.inputNameCls)).removeClass(r).addClass(i)},n.prototype.handleEditKey=function(t){t.stopPropagation(),((0,bt.kl)(t)||(0,bt.r$)(t))&&this.handleEditEnd(t)},n.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this,n=e.em,o=e.$el,r=e.clsNoEdit,i=e.clsEdit,s=this.getInputName(),a=s.textContent;s.scrollLeft=0,s[wl]='false',this.setName(a,{component:this.model,propName:'custom-name'}),n.setEditing(!1),o.find(".".concat(this.inputNameCls)).addClass(r).removeClass(i),this.updateName()},n.prototype.setName=function(t,e){var n=e.propName;this.model.set(n,t)},n.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},n.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,o=t.pfx,r='open',i="".concat(o,"layer-open"),s=this.getCaret();this.module.isOpen(n)?(e.addClass(r),s.addClass(i)):(e.removeClass(r),s.removeClass(i))},n.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))},n.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},n.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},n.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},n.prototype.startSort=function(t){var e,n,o;t.stopPropagation();var r=this,i=r.em,s=r.sorter,a=r.model;if((!t.button||0===t.button)&&s){var l=(null===(n=null===(e=a.delegate)||void 0===e?void 0:e.move)||void 0===n?void 0:n.call(e,a))||a;s.onStart=gl(i),s.onMoveClb=vl(i),s.onEndMove=yl(i,[l]);var c=(null===(o=l.viewLayer)||void 0===o?void 0:o.el)||t.target;s.startSort(c)}},n.prototype.updateStatus=function(){Go.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:!0}])},n.prototype.getItemContainer=function(){return this.$el.children('[data-toggle-select]')},n.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,o=t.module,r=o.getComponents(e).length,i=this.getItemContainer(),s=i.find(".".concat(this.clsTitle)),a=i.find('[data-count]');s[r?'removeClass':'addClass'](n),a.html("".concat(r||'')),!r&&o.setOpen(e,!1)},n.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.getItemContainer().find(".".concat(this.clsCaret))),this.caret},n.prototype.setRoot=function(e){var n,o=(0,t.isString)(e)?null===(n=this.em.getWrapper())||void 0===n?void 0:n.find(e)[0]:e;o&&(this.stopListening(),this.model=o,this.initComponent(),this._rendered&&this.render())},n.prototype.updateLayerable=function(){(this.parentView||this).render()},n.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},n.prototype.remove=function(){for(var t=[],e=0;e\n ").concat(this.getPreview(),"\n \n
\n ").concat(this.getInfo(),"\n
\n
\n ⨯\n
\n ")},n.prototype.updateTarget=function(e){e&&e.set&&(e.set('attributes',(0,t.clone)(e.get('attributes'))),e.set('src',this.model.get('src')))},n.prototype.getPreview=function(){return''},n.prototype.getInfo=function(){return''},n.prototype.render=function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this},n}(u.G7);const $l=Wl;var ql=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Gl=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Kl=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return ql(n,e),n.prototype.getPreview=function(){var t=this,e=t.pfx,n=t.ppfx,o=t.model.get('src');return r(Zl||(Zl=Gl(["\n
\n
\n "],["\n
\n
\n "])),e,o,e,n)},n.prototype.getInfo=function(){var t=this.pfx,e=this.model,n=e.get('name'),o=e.get('width'),i=e.get('height'),s=e.get('unitDim'),a=o&&i?"".concat(o,"x").concat(i).concat(s):'';return n=n||e.getFilename(),r(Xl||(Xl=Gl(["\n
","
\n
","
\n "],["\n
","
\n
","
\n "])),t,n,t,a)},n.prototype.init=function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},n.prototype.onClick=function(){var e=this.model,n=this.pfx,o=this.__getBhv().select,r=this.config.onClick,i=this.collection;i.trigger('deselectAll'),this.$el.addClass(n+'highlight'),(0,t.isFunction)(o)?o(e,!1):(0,t.isFunction)(r)?r(e):this.updateTarget(i.target)},n.prototype.onDblClick=function(){var e=this.em,n=this.model,o=this.__getBhv().select,r=this.config.onDblClick,i=this.collection,s=i.target,a=i.onSelect;(0,t.isFunction)(o)?o(n,!0):(0,t.isFunction)(r)?r(n):(this.updateTarget(s),null==e||e.Modal.close()),(0,t.isFunction)(a)&&a(n)},n.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},n}($l);const Yl=Kl;var Zl,Xl;Kl.prototype.events={'click [data-toggle=asset-remove]':'onRemove',click:'onClick',dblclick:'onDblClick'};var Jl=void 0&&(void 0).__assign||function(){return Jl=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n \n
\n \n
\n \n ")),"\n
\n
\n ").concat(r,"\n
\n
\n
\n
\n ")},e.prototype.handleSubmit=function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),o=this.config.handleAdd;if(n){e.value='';var r=this.getAssetsEl();r&&(r.scrollTop=0),o?o.bind(this)(n):this.options.globalCollection.add(n,{at:0})}},e.prototype.getAssetsEl=function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},e.prototype.getAddInput=function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},e.prototype.removedAsset=function(t){this.collection.length||this.toggleNoAssets()},e.prototype.addToAsset=function(t){1==this.collection.length&&this.toggleNoAssets(!0),this.addAsset(t)},e.prototype.addAsset=function(t,e){void 0===e&&(e=null);var n=e,o=this.collection,r=this.config,i=new t.typeView({model:t,collection:o,config:r}).render().el;if(n)n.appendChild(i);else{var s=this.getAssetsEl();s&&s.insertBefore(i,s.firstChild)}return i},e.prototype.toggleNoAssets=function(t){void 0===t&&(t=!1);var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},e.prototype.deselectAll=function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))},e.prototype.renderAssets=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)},e.prototype.render=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},e}(u.G7);const lc=ac;ac.prototype.events={submit:'handleSubmit'};var cc=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),uc=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},pc=function(t){function e(n){void 0===n&&(n={});var o=t.call(this,n)||this;o.options=n;var r=n.config||{};o.module=n.module,o.config=r,o.em=o.config.em,o.pfx=r.stylePrefix||'',o.ppfx=r.pStylePrefix||'',o.target=o.options.globalCollection||{},o.uploadId=o.pfx+'uploadFile',o.disabled=void 0!==r.disableUpload?r.disableUpload:!r.upload&&!r.embedAsBase64,o.multiUpload=void 0===r.multiUpload||r.multiUpload;var i=r.uploadFile;return i?o.uploadFile=i.bind(o):!r.upload&&r.embedAsBase64&&(o.uploadFile=e.embedAsBase64),o.delegateEvents(),o}return cc(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.title,o=t.uploadId,i=t.disabled,s=t.multiUpload;return r(fc||(fc=uc(["\n
\n
","
\n \n
\n \n "],["\n
\n
","
\n \n
\n \n "])),e,n,o,i?'disabled':'',s?'multiple':'')},e.prototype.events=function(){return{'change [data-input]':'uploadFile'}},e.prototype.onUploadStart=function(){var t=this.module;null==t||t.__propEv(t.events.uploadStart)},e.prototype.onUploadEnd=function(t){var e=this.$el,n=this.module;null==n||n.__propEv(n.events.uploadEnd,t);var o=e.find('input');o&&o.val('')},e.prototype.onUploadError=function(t){var e=this.module;console.error(t),this.onUploadEnd(t),null==e||e.__propEv(e.events.uploadError,t)},e.prototype.onUploadResponse=function(t,e){var n,o=this,r=o.module,i=o.config,s=o.target;try{n='string'==typeof t?JSON.parse(t):t}catch(e){n=t}null==r||r.__propEv(r.events.uploadResponse,n),i.autoAdd&&s&&s.add(n.data,{at:0}),this.onUploadEnd(t),null==e||e(n)},e.prototype.uploadFile=function(t,e){var n=this,o=t.dataTransfer?t.dataTransfer.files:t.target.files,r=this.config,i=r.beforeUpload;if(!1!==(i&&i(o))){var s=new FormData,a=r.params,l=r.customFetch,c=r.fetchOptions;for(var u in a)s.append(u,a[u]);if(this.multiUpload)for(var p=0;p").concat(o.dropzoneContent,"")),p(),'draggable'in i&&[i,a].forEach((function(t){t.ondragover=d,t.ondragleave=f,t.ondrop=h}))},e.prototype.render=function(){var t=this,e=t.$el,n=t.pfx,o=t.em;return e.html(this.template({title:o&&o.t('assetManager.uploadTitle'),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:n})),this.initDrop(),e.attr('class',n+'file-uploader'),this},e.embedAsBase64=function(t,e){var n=this,o=t.dataTransfer?t.dataTransfer.files:t.target.files,r={data:[]};if(FileReader){for(var i=[],s=/^(.+)\/(.+)$/,a=function(t){var e=new Promise((function(e,n){var o=new FileReader;o.addEventListener('load',(function(r){var i,a=t.name,l=s.exec(t.type);if('image'===(i=l?l[1]:t.type)){var c={src:o.result,name:a,type:i,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(i?{src:o.result,name:a,type:i}:o.result)})),o.addEventListener('error',(function(t){n(t)})),o.addEventListener('abort',(function(t){n('Aborted')})),o.readAsDataURL(t)}));i.push(e)},l=0,c=o;l0&&(i=e.split('.').reduce((function(e,n){if(!(0,t.isUndefined)(e))return e[n]}),r)),i}},o.prototype._debug=function(t,e){void 0===e&&(e={});var n=this.em,o=this.config;(e.debug||o.debug)&&n&&n.logWarning(t)},o.prototype.destroy=function(){},o}(m);const Vc=Fc;var Rc=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Hc=void 0&&(void 0).__assign||function(){return Hc=Object.assign||function(t){for(var e,n=1,o=arguments.length;na+u-e||il+c-e)return 1},o.prototype.getCurrentPos=function(){var t=this.eventMove;return{x:(null==t?void 0:t.pageX)||0,y:(null==t?void 0:t.pageY)||0}},o.prototype.getDim=function(t){var e,n,o,r,i=this.em,s=this.canvasRelative,a=null==i?void 0:i.Canvas,l=a?a.getElementOffsets(t):{};if(s&&i){var c=a.getElementPos(t,{noScroll:1});e=c.top,n=c.left,o=c.height,r=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,o=t.offsetHeight,r=t.offsetWidth}return{top:e,left:n,height:o,width:r,offsets:l}},o.prototype.getChildrenDim=function(n){var o=this,r=[];if(!n)return r;var i=this.getTargetModel(n);if(i&&i.view&&!this.ignoreViewChildren){var s=i.getCurrentView?i.getCurrentView():i.view;n=s.getChildrenContainer()}return(0,t.each)(n.children,(function(t,i){var s=t,a=(0,e.getModel)(s,l["default"]),c=a&&a.index?a.index():i;if((0,bt.BM)(s)||o.matches(s,o.itemSel)){var u,p=o.getDim(s),d=o.direction;u='v'==d||'h'!=d&&o.isInFlow(s,n),p.dir=u,p.el=s,p.indexEl=c,r.push(p)}})),r},o.prototype.nearBorders=function(t,e,n){var o=!1,r=this.borderOffset,i=e||0,s=n||0,a=t.top,l=t.left,c=t.height,u=t.width;return(a+r>s||s>a+c-r||l+r>i||i>l+u-r)&&(o=!0),o},o.prototype.findPosition=function(t,e,n){for(var o,r={index:0,indexEl:0,method:'before'},i=0,s=0,a=0,l=0,c=0,u=0,p=0,d=t.length;ps||a&&c>=a||i&&h+vx&&(_.at=f-1))}i&&(w?(delete _.at,s=v.getView().insertComponent(i,_)):s=g.add(i,_)),delete this.dropContent,delete this.prevTarget}else if(a){var S=h.dropInfo||(null==v?void 0:v.get('droppable')),O=h.dragInfo||(null==y?void 0:y.get('draggable'));!g&&d.push('Target collection not found'),!b&&S&&d.push("Target is not droppable, accepts [".concat(S,"]")),!m&&O&&d.push("Component not draggable, acceptable by [".concat(O,"]")),a.logWarning('Invalid target position',{errors:d,model:y,context:'sorter',target:v})}return null==a||a.trigger('sorter:drag:end',{targetCollection:g,modelToDrop:i,warns:d,validResult:h,dst:n,srcEl:p}),s},o.prototype.rollback=function(t){(0,bt.S1)(this.getDocuments(),'keydown',this.rollback),27==(t.which||t.keyCode)&&(this.moved=!1,this.endMove())},o}(u.G7);const Wc=Uc;var $c=void 0&&(void 0).__assign||function(){return $c=Object.assign||function(t){for(var e,n=1,o=arguments.length;nb?v.h=Math.round(v.w/b):v.w=Math.round(v.h*b)}for(var _ in~y.indexOf('l')&&(v.l+=i.w-v.w),~y.indexOf('t')&&(v.t+=i.h-v.h),v){var w=_;v[w]=parseInt("".concat(v[w]),10)}return v}},n}();const Gc=qc;var Kc=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Yc=void 0&&(void 0).__assign||function(){return Yc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0&&ru.splice(o,1),93!=n&&224!=n||(n=91),n in Qc)for(e in Qc[n]=!1,eu)eu[e]==n&&(pu[e]=!1)}function uu(){for(Xc in Qc)Qc[Xc]=!1;for(Xc in eu)pu[Xc]=!1}function pu(t,e,n){var o,r;o=fu(t),void 0===n&&(n=e,e='all');for(var i=0;i1&&(r=hu(t),t=[t[t.length-1]]),t=t[0],(t=ou(t))in Jc||(Jc[t]=[]),Jc[t].push({shortcut:o[i],scope:e,method:n,key:o[i],mods:r})}for(Xc in eu)pu[Xc]=!1;function du(){return tu||'all'}function fu(t){var e;return''==(e=(t=t.replace(/\s/g,'')).split(','))[e.length-1]&&(e[e.length-2]+=','),e}function hu(t){for(var e=t.slice(0,t.length-1),n=0;n1&&(a=hu(o)),t=o[o.length-1],t=ou(t),void 0===e&&(e=du()),!Jc[t])return;for(r=0;r0,Qc)(!Qc[o]&&iu(n.mods,+o)>-1||Qc[o]&&-1==iu(n.mods,+o))&&(i=!1);(0!=n.mods.length||Qc[16]||Qc[18]||Qc[17]||Qc[91])&&!i||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)})),gu(t.document,'keyup',cu),gu(t,'focus',uu)};const vu=pu;const yu={defaults:{'core:undo':{keys:'⌘+z, ctrl+z',handler:'core:undo',opts:{prevent:!0}},'core:redo':{keys:'⌘+shift+z, ctrl+shift+z',handler:'core:redo',opts:{prevent:!0}},'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:!0}}}};var mu=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),bu=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r\n
\n
").concat(r,"
\n
\n
\n
\n
").concat(o,"
\n
\n
\n \n
")},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(),o=this.model.get('content');e.length&&n.append(e),t.empty().append(o)},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,o=e.$el,r=e.el,i=[].slice.call(r.attributes).map((function(t){return t.name}));o.removeAttr(i.join(' ')),o.attr(Tu(Tu({},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}(mt);const Eu=ku;var Pu=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Au=function(e){function n(n){var o=e.call(this,n,'Modal',xu)||this;return o.model=new Su(o),o.model.on('change:open',(function(t,e){n.trigger("modal:".concat(e?'open':'close'))})),o.model.on('change',(0,t.debounce)((function(){var e=o._evData(),r=o.config.custom;(0,t.isFunction)(r)&&r(e),n.trigger('modal',e)}),0)),o}return Pu(n,e),n.prototype._evData=function(){var e=this,n=this.getTitle(),o=this.getContent(),r=this.model.attributes;return{open:r.open,attributes:r.attributes,title:(0,t.isString)(n)?(0,bt.rw)(n):n,content:(0,t.isString)(o)?(0,bt.rw)(o):o.get?o.get(0):o,close:function(){e.close()}}},n.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},n.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},n.prototype.close=function(){return this.model.close(),this},n.prototype.onceClose=function(t){return this.em.once('modal:close',t),this},n.prototype.onceOpen=function(t){return this.em.once('modal:open',t),this},n.prototype.isOpen=function(){return!!this.model.get('open')},n.prototype.setTitle=function(t){return this.model.set('title',t),this},n.prototype.getTitle=function(){return this.model.get('title')},n.prototype.setContent=function(t){return this.model.set('content',' '),this.model.set('content',t),this},n.prototype.getContent=function(){return this.model.get('content')},n.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},n.prototype.getModel=function(){return this.model},n.prototype.render=function(){var t;if(!this.config.custom){var e=Eu.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}},n.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},n}(m);const ju=Au;var Mu='sw-visibility',Lu='export-template',Du='open-sm',Nu='open-tm',Iu='open-layers',Fu='open-blocks',Vu='fullscreen',Ru='preview';const Hu={stylePrefix:'pn-',defaults:[{id:'commands',buttons:[{}]},{id:'options',buttons:[{active:!0,id:Mu,className:'fa fa-square-o',command:'core:component-outline',context:Mu,attributes:{title:'View components'}},{id:Ru,className:'fa fa-eye',command:Ru,context:Ru,attributes:{title:'Preview'}},{id:Vu,className:'fa fa-arrows-alt',command:Vu,context:Vu,attributes:{title:'Fullscreen'}},{id:Lu,className:'fa fa-code',command:Lu,attributes:{title:'View code'}}]},{id:'views',buttons:[{id:Du,className:'fa fa-paint-brush',command:Du,active:!0,togglable:!1,attributes:{title:'Open Style Manager'}},{id:Nu,className:'fa fa-cog',command:Nu,togglable:!1,attributes:{title:'Settings'}},{id:Iu,className:'fa fa-bars',command:Iu,togglable:!1,attributes:{title:'Open Layer Manager'}},{id:Fu,className:'fa fa-th-large',command:Fu,togglable:!1,attributes:{title:'Open Blocks'}}]}]};var zu=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Bu=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.get('buttons').length&&o.set('buttons',new $u(o.module,o.get('buttons'))),o}return zu(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}(w.Z);var Uu=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Wu=function(t){function e(e,n){return t.call(this,e,n,Bu)||this}return Uu(e,t),e.prototype.deactivateAllExceptOne=function(t,e){this.forEach((function(n,o){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,o){n!==t&&(n.set('disable',!0),e&&n.get('buttons').length&&n.get('buttons').disableAllButtonsExceptOne(t,e))}))},e}(Z);const $u=Wu;Wu.prototype.model=Bu;var qu=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();const Gu=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=o.get('buttons')||[];return o.buttons=new $u(e,r),o}return qu(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}(w.Z);var Ku=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Yu=function(t){function e(e,n){return t.call(this,e,n,Gu)||this}return Ku(e,t),e}(Z);const Zu=Yu;Yu.prototype.model=Gu;var Xu=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ju=void 0&&(void 0).__assign||function(){return Ju=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
","
\n
\n \n "],["\n
\n
","
\n
\n
\n "])),e,e,n,e,o,e)},e.prototype.initialize=function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},e.prototype.render=function(){var t,e,n=this,o=n.model,r=n.pfx,i=n.$el,s=o.toJSON(),a=o.get('input')||(null===(e=(t=o).getElement)||void 0===e?void 0:e.call(t));return s.pfx=r,i.html(this.template(s)),i.attr('class',"".concat(r,"editor-c")),i.find("#".concat(r,"code")).append(a),this},e}(u.G7);const jp=Ap;var Mp,Lp=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dp=void 0&&(void 0).__assign||function(){return Dp=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0})))return!1;if((0,t.isBoolean)(n))return!0;if((0,t.isArray)(n)&&$p(e).some((function(t){return n.indexOf(t)>=0})))return!0}return!1},on:function(e,n,o){var i=this;!this.beforeCache&&(this.beforeCache=e.previousAttributes());var s=o||n||{};if(s.noUndo&&setTimeout((function(){i.beforeCache=null})),!Wp(s)){var a=e.toJSON({fromUndo:r}),l={object:e,before:this.beforeCache,after:a};if(this.beforeCache=null,!(0,t.isEmpty)(a))return l}}}),o.um.changeUndoType('add',{on:function(t,e,n){if(void 0===n&&(n={}),!Wp(n)&&o.isRegistered(e))return{object:e,before:void 0,after:t,options:Bp(Bp({},n),{fromUndo:r})}}}),o.um.changeUndoType('remove',{on:function(t,e,n){if(void 0===n&&(n={}),!Wp(n)&&o.isRegistered(e))return{object:e,before:t,after:void 0,options:Bp(Bp({},n),{fromUndo:r})}}}),o.um.changeUndoType('reset',{undo:function(t,e){t.reset(e,{fromUndo:r})},redo:function(t,e,n){t.reset(n,{fromUndo:r})},on:function(t,e){if(void 0===e&&(e={}),!Wp(e)&&o.isRegistered(t))return{object:t,before:e.previousModels,after:Up([],t.models,!0),options:Bp(Bp({},e),{fromUndo:r})}}}),o.um.on('undo redo',(function(){n.getSelectedAll().map((function(t){return t.trigger('rerender:layer')}))})),['undo','redo'].forEach((function(t){return o.um.on(t,(function(){return n.trigger(t)}))})),o}return zp(n,e),n.prototype.postLoad=function(){var t=this.config,e=this.em;t.trackSelection&&e&&this.add(e.get('selected'))},n.prototype.add=function(t){return this.um.register(t),this},n.prototype.remove=function(t){return this.um.unregister(t),this},n.prototype.removeAll=function(){return this.um.unregisterAll(),this},n.prototype.start=function(){return this.um.startTracking(),this},n.prototype.stop=function(){return this.um.stopTracking(),this},n.prototype.undo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.undo(t),this},n.prototype.undoAll=function(){return this.um.undoAll(),this},n.prototype.redo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.redo(t),this},n.prototype.redoAll=function(){return this.um.redoAll(),this},n.prototype.hasUndo=function(){return!!this.um.isAvailable('undo')},n.prototype.hasRedo=function(){return!!this.um.isAvailable('redo')},n.prototype.isRegistered=function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},n.prototype.getStack=function(){return this.um.stack},n.prototype.getStackGroup=function(){var t=[],e=[];return this.getStack().forEach((function(n){var o=n.get('magicFusionIndex');e.indexOf(o)<0&&(e.push(o),t.push(n))})),t},n.prototype.skip=function(t){var e=!!this.um.isTracking();e&&this.stop(),t(),e&&this.start()},n.prototype.getGroupedStack=function(){var e={},n=this.getStack();return n.forEach((function(t,n){var o=t.get('magicFusionIndex'),r=function(t,e){var n=t.attributes,o=n.type,r=n.after,i=n.before,s=n.object,a=n.options;return{index:e,type:o,after:r,before:i,object:s,options:void 0===a?{}:a}}(t,n);e[o]?e[o].push(r):e[o]=[r]})),Object.keys(e).map((function(n){var o=e[n];return{index:o[o.length-1].index,actions:o,labels:(0,t.unique)(o.reduce((function(t,e){var n,o=null===(n=e.options)||void 0===n?void 0:n.action;return o&&t.push(o),t}),[]))}}))},n.prototype.goToGroup=function(e){var n=this;if(e){var o=this.getPointer(),r=e.index-o;(0,t.times)(Math.abs(r),(function(){n[r<0?'undo':'redo'](!1)}))}},n.prototype.getPointer=function(){return this.getStack().pointer},n.prototype.clear=function(){return this.um.clear(),this},n.prototype.getInstance=function(){return this.um},n.prototype.destroy=function(){this.clear().removeAll()},n}(m);const Gp=qp;const Kp={stylePrefix:'rte-',adjustToolbar:!0,actions:['bold','italic','underline','strikethrough','link','wrap'],custom:!1};var Yp,Zp=void 0&&(void 0).__assign||function(){return Zp=Object.assign||function(t){for(var e,n=1,o=arguments.length;nB',attributes:{title:'Bold'},result:function(t){return t.exec('bold')}},italic:{name:'italic',icon:'I',attributes:{title:'Italic'},result:function(t){return t.exec('italic')}},underline:{name:'underline',icon:'U',attributes:{title:'Underline'},result:function(t){return t.exec('underline')}},strikethrough:{name:'strikethrough',icon:'S',attributes:{title:'Strike-through'},result:function(t){return t.exec('strikeThrough')}},link:{icon:"\n \n ",name:'link',attributes:{style:'font-size:1.4rem;padding:0 4px 2px;',title:'Link'},state:function(t){return t&&t.selection()&&ed(t)?Jp:Qp},result:function(t){ed(t)?t.exec('unlink'):t.insertHTML("").concat(t.selection(),""),{select:!0})}},wrap:{name:'wrap',icon:"\n \n ",attributes:{title:'Wrap for style'},state:function(t){return(null==t?void 0:t.selection())&&ed(t,'SPAN')?td:Qp},result:function(t){!ed(t,'SPAN')&&t.insertHTML("").concat(t.selection(),""),{select:!0})}}},rd=function(){function n(e,n,o){var r=this;if(void 0===o&&(o={}),this.em=e,this.settings=o,n[Xp])return n[Xp];n[Xp]=this,this.setEl(n),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var i=(o.actions||[]).map((function(e){var n=e;return(0,t.isString)(e)?n=Zp({},od[e]):od[e.name]&&(n=Zp(Zp({},od[e.name]),e)),n})),s=i.length?i:Object.keys(od).map((function(t){return od[t]}));o.classes=Zp({actionbar:'actionbar',button:'action',active:'active',disabled:'disabled',inactive:'inactive'},o.classes);var a=o.classes,l=o.actionbar;if(this.actionbar=l,this.classes=a,this.actions=s,!l){if(!this.isCustom(o.module)){var c=o.actionbarContainer;(l=document.createElement('div')).className=a.actionbar,null==c||c.appendChild(l),this.actionbar=l}s.forEach((function(t){return r.addAction(t)}))}return o.styleWithCSS&&this.exec('styleWithCSS'),this}return n.prototype.isCustom=function(t){var e=t||this.em.RichTextEditor;return!(!(null==e?void 0:e.config.custom)&&!(null==e?void 0:e.customRte))},n.prototype.destroy=function(){},n.prototype.setEl=function(t){this.el=t,this.doc=t.ownerDocument},n.prototype.updateActiveActions=function(){var t=this,e=this.getActions();e.forEach((function(e){var n=e.update,o=e.btn,r=t.classes,i=r.active,s=r.inactive,a=r.disabled,l=e.state,c=e.name,u=t.doc,p=Yp.INACTIVE;if(o&&(o.className=o.className.replace(i,'').trim(),o.className=o.className.replace(s,'').trim(),o.className=o.className.replace(a,'').trim()),l){var d=l(t,u);if(p=d,o)switch(d){case Jp:o.className+=" ".concat(i);break;case Qp:o.className+=" ".concat(s);break;case td:o.className+=" ".concat(a)}}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(o&&(o.className+=" ".concat(i)),p=Yp.ACTIVE);e.currentState=p,null==n||n(t,e)})),e.length&&this.em.RichTextEditor.__dbdTrgCustom()},n.prototype.enable=function(t){return this.enabled?this:this.__toggleEffects(!0,t)},n.prototype.disable=function(){return this.__toggleEffects(!1)},n.prototype.__toggleEffects=function(t,e){void 0===t&&(t=!1),void 0===e&&(e={});var n=t?bt.on:bt.S1,o=this.el,r=this.doc,i=this.actionbarEl();if(i&&(i.style.display=t?'':'none'),o.contentEditable="".concat(!!t),n(o,'mouseup keyup',this.updateActiveActions),n(r,'keydown',this.__onKeydown),n(r,'paste',this.__onPaste),this.enabled=t,t){var s=e.event;if(this.syncActions(),this.updateActiveActions(),s){var a=null;if(r.caretRangeFromPoint){var l=(0,bt.VB)(s);a=r.caretRangeFromPoint(l.clientX,l.clientY)}else s.rangeParent&&(a=r.createRange()).setStart(s.rangeParent,s.rangeOffset);var c=r.getSelection();null==c||c.removeAllRanges(),a&&(null==c||c.addRange(a))}o.focus()}return this},n.prototype.__onKeydown=function(t){var e=this.em,n=e.RichTextEditor.getConfig().onKeydown;if(n)return n({ev:t,rte:this,editor:e.getEditor()});var o=this.doc;'Enter'!==t.key||['insertOrderedList','insertUnorderedList'].some((function(t){return o.queryCommandState(t)}))||(o.execCommand('insertLineBreak'),t.preventDefault())},n.prototype.__onPaste=function(t){var e=this.em,n=e.RichTextEditor.getConfig().onPaste;if(n)return n({ev:t,rte:this,editor:e.getEditor()});var o=t.clipboardData,r=o.getData('text'),i=o.getData('text/html');if(r&&!i){t.preventDefault();var s=r.replace(/(?:\r\n|\r|\n)/g,'
');this.doc.execCommand('insertHTML',!1,s)}},n.prototype.syncActions=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',o=e.btn;o&&(o["on".concat(n)]=function(){e.result(t,e),t.updateActiveActions()})}}))},n.prototype.addAction=function(t,e){void 0===e&&(e={});var n=e.sync,o=this.actionbarEl();if(o){var r=t.icon,i=t.attributes,s=void 0===i?{}:i,a=document.createElement('span');for(var l in a.className=this.classes.button,t.btn=a,s)a.setAttribute(l,s[l]);'string'==typeof r?a.innerHTML=r:a.appendChild(r),o.appendChild(a)}n&&(this.actions.push(t),this.syncActions())},n.prototype.getActions=function(){return this.actions},n.prototype.selection=function(){return this.doc.getSelection()},n.prototype.exec=function(t,e){this.doc.execCommand(t,!1,e)},n.prototype.actionbarEl=function(){return this.actionbar},n.prototype.insertHTML=function(n,o){var r=(void 0===o?{}:o).select,i=this,s=i.em,a=i.doc,l=i.el,c=a.getSelection();if(c&&c.rangeCount){var u=(0,e.getComponentModel)(l)||s.getSelected(),p=a.createElement('div'),d=c.getRangeAt(0);d.deleteContents(),(0,t.isString)(n)?p.innerHTML=n:n&&p.appendChild(n),Array.prototype.slice.call(p.childNodes).forEach((function(t){d.insertNode(t)})),c.removeAllRanges(),c.addRange(d),l.focus(),r&&u&&(u.once('rte:disable',(function(){var t=u.find("[".concat(nd,"]"))[0];t&&(s.setSelected(t),t.removeAttributes(nd))})),u.trigger('disable'))}},n}();const id=rd;var sd=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ad=void 0&&(void 0).__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(r,i){function s(t){try{l(o.next(t))}catch(t){i(t)}}function a(t){try{l(o["throw"](t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))},ld=void 0&&(void 0).__generator||function(t,e){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,o&&(r=2&a[0]?o["return"]:a[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]=0}))),g=this.get('onChange'),v={property:this,from:p,to:u,value:l,opts:n};i.__trgEv(i.events.propertyUpdate,v),g&&g(v),h&&this.__upTargetsStyle(((o={})[s]=l,o),n)},o.prototype.__upTargetsStyle=function(t,e){var n,o=null===(n=this.em)||void 0===n?void 0:n.get('StyleManager');null==o||o.addStyleTargets(vd(vd({},t),{__p:!!e.avoidStore}),e)},o.prototype._up=function(t,e){void 0===e&&(e={}),e.noTarget&&(e.__up=!0);var n=e.partial,o=yd(e,["partial"]);return t.__p=!(!o.avoidStore&&!n),this.set(t,vd(vd({},o),{avoidStore:t.__p}))},o.prototype.up=function(t,e){void 0===e&&(e={}),this.set(t,vd(vd({},e),{__up:!0}))},o.prototype.init=function(){},o.prototype.getId=function(){return this.get('id')},o.prototype.getType=function(){return this.get('type')},o.prototype.getName=function(){return this.get('property')},o.prototype.getLabel=function(t){var e;void 0===t&&(t={});var n=t.locale,o=void 0===n||n,r=this.getId(),i=this.get('name')||this.get('label');return o&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.properties.".concat(r)))||i},o.prototype.getValue=function(t){void 0===t&&(t={});var e=t.noDefault,n=this.get('value');return this.hasValue()||e?n:this.getDefaultValue()},o.prototype.hasValue=function(e){void 0===e&&(e={});var n=e.noParent&&this.getParentTarget(),o=this.get('value');return!(0,t.isUndefined)(o)&&''!==o&&!n},o.prototype.hasValueParent=function(){return this.hasValue()&&!this.hasValue({noParent:!0})},o.prototype.getStyle=function(t){var n;void 0===t&&(t={});var o=this.getName();return(n={})[t.camelCase?(0,e.camelCase)(o):o]=this.__getFullValue(t),n},o.prototype.getDefaultValue=function(){var e=this.get('default');return"".concat((0,t.isUndefined)(e)?this.get('defaults'):e)},o.prototype.upValue=function(t,e){void 0===e&&(e={});var n=null===t||''===t?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)},o.prototype.isVisible=function(){return!!this.get('visible')},o.prototype.clear=function(t){return void 0===t&&(t={}),this._up(this.__getClearProps(),vd(vd({},t),{__clear:!0})),this},o.prototype.canClear=function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})},o.prototype.getParent=function(){return this.__getParentProp()},o.prototype.isFull=function(){return!!this.get('full')},o.prototype.__parseValue=function(t,e){return this.parseValue(t,e)},o.prototype.__getClearProps=function(){return{value:''}},o.prototype.setValue=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n={});var o=this.parseValue(t),r=!e;!r&&this.set({value:void 0},{avoidStore:r,silent:!0}),this.set(o,vd({avoidStore:r},n))},o.prototype.setValueFromInput=function(t,e,n){void 0===n&&(n={}),this.setValue(t,e,vd(vd({},n),{fromInput:1}))},o.prototype.parseValue=function(e,n){void 0===n&&(n={});var o={value:e},r='!important',i=this.get('functionName')||'';if((0,t.isString)(e)&&-1!==e.indexOf(r)&&(o.value=e.replace(r,'').trim(),o.important=!0),!i&&!n.complete)return o;var s=[],a="".concat(o.value).trim(),l=a.indexOf('(')+1,c=i||a.substring(0,l-1);if(c&&(o.functionName=c),!i||0===a.indexOf("".concat(i,"("))){var u=a.lastIndexOf(')');s.push(l),u>=0&&s.push(u),o.value=String.prototype.substring.apply(a,s)}if(n.numeric){var p=parseFloat(o.value);o.unit=o.value.replace(p,''),o.value=p}return o},o.prototype.__getFullValue=function(t){var e=(void 0===t?{}:t).withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()},o.prototype.getFullValue=function(e,n){void 0===n&&(n={});var o=this.get('functionName'),r=this.getDefaultValue(),i=(0,t.isUndefined)(e)?this.get('value'):e,s=!(0,t.isUndefined)(i)&&''!==i;if(i&&r&&i===r)return r;if(o&&s){var a='url'===o?"'".concat(i.replace(/'|"/g,''),"'"):i;i="".concat(o,"(").concat(a,")")}return s&&this.get('important')&&!n.skipImportant&&(i="".concat(i," !important")),i||''},o.prototype.__setParentTarget=function(t){this.up({parentTarget:t})},o.prototype.getParentTarget=function(){return this.get('parentTarget')||null},o.prototype.__parseFn=function(t){void 0===t&&(t='');var 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()}},o.prototype.__checkVisibility=function(n){var o=n.target,r=n.component,i=n.sectors,s=r||o;if(!s)return!1;var a=this.getId(),l=this.getName(),c=this.get('toRequire'),u=this.get('requires'),p=this.get('requiresParent'),d=s.get('unstylable'),f=s.get('stylable-require'),h=s.get('stylable');if((0,t.isArray)(h)&&(h=h.indexOf(l)>=0),(0,t.isArray)(d)&&(h=d.indexOf(l)<0),c&&(h=!o||f&&(f.indexOf(a)>=0||f.indexOf(l)>=0)),i&&u){var g=(0,t.keys)(u);i.forEach((function(e){e.getProperties().forEach((function(e){if((0,t.includes)(g,e.id)){var n=u[e.id];h=h&&(0,t.includes)(n,e.get('value'))}}))}))}if(p){var v=r&&r.parent(),y=v&&v.getEl();if(y){var m=(0,e.hasWin)()?window.getComputedStyle(y):{};(0,t.each)(p,(function(e,n){h=h&&m[n]&&(0,t.includes)(e,m[n])}))}else h=!1}return!!h},o}(u.Hn);const _d=bd;bd.callParentInit=function(t,e,n,o){void 0===o&&(o={}),t.prototype.initialize.apply(e,[n,vd(vd({},o),{skipInit:1})])},bd.callInit=function(t,e,n){void 0===n&&(n={}),!n.skipInit&&t.init(e,n)};var wd=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xd=void 0&&(void 0).__assign||function(){return xd=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0},o.prototype.getLayer=function(t){return void 0===t&&(t=0),this.layers.at(t)||void 0},o.prototype.getSelectedLayer=function(){var t=this.get('selectedLayer');return t&&t.getIndex()>=0?t:void 0},o.prototype.selectLayer=function(t){return this.set('selectedLayer',t,{__select:!0})},o.prototype.selectLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e&&this.selectLayer(e)},o.prototype.moveLayer=function(e,n){void 0===n&&(n=0);var o=this.layers,r=e?e.getIndex():-1;r>=0&&(0,t.isNumber)(n)&&n>=0&&n\n
\n ")},o.prototype.templateLabel=function(t){var e=this.pfx,n=this.em,o=t.parent,r=t.attributes,i=r.icon,s=void 0===i?'':i,a=r.info,l=void 0===a?'':a,c=null==n?void 0:n.getConfig().icons,u=(null==c?void 0:c.close)||'';return"\n \n ").concat(t.getLabel(),"\n \n ").concat(o?'':"
").concat(u,"
"),"\n ")},o.prototype.templateInput=function(t){return"\n
\n \n
\n ")},o.prototype.remove=function(){var t=this;return u.G7.prototype.remove.apply(this,arguments),['em','input','$input','view'].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts()),this},o.prototype.updateStatus=function(){var t,e=this,n=e.model,o=e.pfx,r=e.ppfx,i=e.config,s="".concat(r,"four-color"),a="".concat(r,"color-warn"),l=this.$el.children(".".concat(o,"label")),c=this.getClearEl(),u=c?c.style:{};l.removeClass("".concat(s," ").concat(a)),u.display='none',n.hasValue({noParent:!0})&&i.highlightChanged?(l.addClass(s),i.clearProperties&&(u.display='')):n.hasValue()&&i.highlightComputed&&l.addClass(a),null===(t=this.parent)||void 0===t||t.updateStatus()},o.prototype.clear=function(t){t&&t.stopPropagation(),this.model.clear()},o.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat($d,"]"))),this.clearEl},o.prototype.inputValueChanged=function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)},o.prototype.onValueChange=function(t,e,n){void 0===n&&(n={}),this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},o.prototype.setValue=function(e){var n=this.model,o=(0,t.isUndefined)(e)||''===e?n.getDefaultValue():e;if(this.update)return this.__update(o);this.__setValueInput(o)},o.prototype.__setValueInput=function(t){var e=this.getInputEl();e&&(e.value=t)},o.prototype.getInputEl=function(){return this.input||(this.input=this.el.querySelector('input')),this.input},o.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?'':'none'},o.prototype.clearCached=function(){delete this.clearEl,delete this.input,delete this.$input},o.prototype.__unset=function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},o.prototype.__update=function(t){var e=this.update&&this.update.bind(this);e&&e(Bd(Bd({},this._getClbOpts()),{value:t}))},o.prototype.__change=function(){for(var t=[],e=0;e\n \n \n ")},e.prototype.remove=function(){var t;return null===(t=this.props)||void 0===t||t.remove(),Gd.prototype.remove.apply(this,arguments),this},e.prototype.onValueChange=function(){},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.get('properties');if(n.length&&!this.props){var o=e.isDetached(),r=new Zd({config:Jd(Jd({},this.config),{highlightComputed:o,highlightChanged:o}),collection:n,parent:this});r.render(),this.$el.find("#".concat(t,"input-holder")).append(r.el),this.props=r}},e.prototype.clearCached=function(){Gd.prototype.clearCached.apply(this,arguments),delete this.props},e}(Gd);const tf=Qd;var ef=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),nf=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return ef(n,e),n.prototype.events=function(){return{click:'select','click [data-close-layer]':'removeItem','mousedown [data-move-layer]':'initSorter','touchstart [data-move-layer]':'initSorter'}},n.prototype.template=function(){var t=this,e=t.pfx,n=t.ppfx,o=t.em,r=null==o?void 0:o.getConfig().icons,i=(null==r?void 0:r.close)||'',s=(null==r?void 0:r.move)||'';return"\n
\n
\n ").concat(s,"\n
\n
\n
\n
\n
\n
\n ").concat(i,"\n
\n
\n
\n ")},n.prototype.initialize=function(t){void 0===t&&(t={});var e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.propertyView=t.propertyView;var o=this.propertyView.model;this.listenTo(e,'destroy remove',this.remove),this.listenTo(e,'change:values',this.updateLabel),this.listenTo(o,'change:selectedLayer',this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data('model',e)},n.prototype.initSorter=function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)},n.prototype.removeItem=function(t){t&&t.stopPropagation(),this.model.remove()},n.prototype.select=function(){this.model.select()},n.prototype.getPropertiesWrapper=function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector('[data-properties]')),this.propsWrapEl},n.prototype.getPreviewEl=function(){return this.previewEl||(this.previewEl=this.el.querySelector('[data-preview]')),this.previewEl},n.prototype.getLabelEl=function(){return this.labelEl||(this.labelEl=this.el.querySelector('[data-label]')),this.labelEl},n.prototype.updateLabel=function(){var e=this.model,n=e.getLabel();if(this.getLabelEl().innerHTML=n,e.hasPreview()){var o=this.getPreviewEl(),r=e.getStylePreview({number:{min:-3,max:3}}),i=(0,t.keys)(r).map((function(t){return"".concat(t,":").concat(r[t])})).join(';');o.setAttribute('style',i)}},n.prototype.updateVisibility=function(){var t,e=this,n=e.pfx,o=e.model,r=e.propertyView,i=this.getPropertiesWrapper(),s=o.isSelected();i.style.display=s?'':'none',this.$el[s?'addClass':'removeClass']("".concat(n,"active")),s&&i.appendChild(null===(t=r.props)||void 0===t?void 0:t.el)},n.prototype.render=function(){var t=this,e=t.el,n=t.pfx,o=t.model;return e.innerHTML=this.template(),e.className="".concat(n,"layer"),o.hasPreview()&&(e.querySelector('[data-preview-box]').style.display=''),this.updateLabel(),this.updateVisibility(),this},n}(u.G7);const of=nf;var rf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),sf=function(t){function e(e){var n=t.call(this,e)||this,o=n.collection,r=e.config||{},i=r.em,s=r.stylePrefix||'',a=r.pStylePrefix||'';n.config=r,n.pfx=s,n.ppfx=a,n.propertyView=e.propertyView,n.className="".concat(s,"layers ").concat(a,"field"),n.listenTo(o,'add',n.addTo),n.listenTo(o,'reset',n.reset),n.items=[];var l=null==i?void 0:i.Utils;return n.sorter=l?new l.Sorter({container:n.el,ignoreViewChildren:1,containerSel:".".concat(s,"layers"),itemSel:".".concat(s,"layer"),pfx:r.pStylePrefix,em:i}):'',o.view=n,n.$el.data('model',o),n.$el.data('collection',o),n}return rf(e,t),e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var o=e||null,r=this,i=r.propertyView,s=r.config,a=r.sorter,l=r.$el,c=new of({model:t,config:s,sorter:a,propertyView:i}),u=c.render().el;if(this.items.push(c),o)o.appendChild(u);else if(void 0!==n){var p='before';l.children().length===n&&(n--,p='after'),n<0?l.append(u):l.children().eq(n)[p](u)}else l.append(u);return u},e.prototype.reset=function(t,e){this.clearItems(),this.render()},e.prototype.remove=function(){return this.clearItems(),u.G7.prototype.remove.apply(this,arguments),this},e.prototype.clearItems=function(){this.items.forEach((function(t){return t.remove()})),this.items=[]},e.prototype.render=function(){var t=this,e=this.$el,n=this.sorter,o=document.createDocumentFragment();return e.empty(),this.collection.forEach((function(e){return t.addToCollection(e,o)})),e.append(o),e.attr('class',this.className),n&&(n.plh=null),this},e}(u.G7);const af=sf;var lf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),cf=void 0&&(void 0).__assign||function(){return cf=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n
\n \n ")},e.prototype.init=function(){var t=this.model;this.listenTo(t.layers,'change reset',this.updateStatus),this.listenTo(t,'change:isEmptyValue',this.updateStatus)},e.prototype.addLayer=function(){this.model.addLayer({},{at:0})},e.prototype.setValue=function(){},e.prototype.remove=function(){var t;return null===(t=this.layersView)||void 0===t||t.remove(),tf.prototype.remove.apply(this,arguments),this},e.prototype.clearCached=function(){tf.prototype.clearCached.apply(this,arguments),delete this.layersView},e.prototype.onRender=function(){var t=this,e=t.model,n=t.el,o=t.config,r=e.get('properties');if(r.length&&!this.props){var i=new Zd({config:cf(cf({},o),{highlightComputed:!1,highlightChanged:!1}),collection:r,parent:this});i.render();var s=new af({collection:e.layers,config:o,propertyView:this});s.render(),n.querySelector('[data-layers-wrapper]').appendChild(s.el),this.props=i,this.layersView=s}},e}(tf);const pf=uf;var df=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ff=void 0&&(void 0).__assign||function(){return ff=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n
\n \n
\n
\n
\n
\n
\n
").concat(r,"
\n
\n \n ")},n.prototype.__setValueInput=function(t){var e=this.model,n=this.el,o=e.getDefaultValue(),r=n.querySelector('[data-preview-box]'),i=n.querySelector('[data-preview]');r.style.display=t&&t!==o?'':'none',i.style.backgroundImage=t||e.getDefaultValue()},n.prototype.openAssetManager=function(){var e,n=this,o=null===(e=this.em)||void 0===e?void 0:e.Assets;null==o||o.open({select:function(e,r){var i=(0,t.isString)(e)?e:e.get('src');n.model.upValue(i,{partial:!r}),r&&o.close()},types:['image'],accept:'image/*'})},n}(Gd);const gf=hf;var vf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),yf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vf(e,t),e.prototype.templateInput=function(t){return''},e.prototype.init=function(){var t=this.model;this.listenTo(t,'change:unit',this.onValueChange),this.listenTo(t,'change:units',this.render)},e.prototype.setValue=function(t){},e.prototype.onRender=function(){var t=this,e=t.ppfx,n=t.model,o=t.el;if(!this.inputInst){var r=n.input;r.ppfx=e,r.render(),o.querySelector(".".concat(e,"fields")).appendChild(r.el),this.input=r.inputEl.get(0),this.inputInst=r}},e.prototype.clearCached=function(){Gd.prototype.clearCached.apply(this,arguments),this.inputInst=null},e}(Gd);const mf=yf;var bf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),_f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return bf(e,t),e.prototype.setValue=function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})},e.prototype.remove=function(){var t=this;mf.prototype.remove.apply(this,arguments);var e=this.inputInst;return e&&e.remove&&e.remove(),['inputInst','$color'].forEach((function(e){return t[e]=null})),this},e.prototype.__handleChange=function(t,e){this.model.upValue(t,{partial:e})},e.prototype.onRender=function(){var t;if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var e=this,n=e.ppfx,o=e.model,r=e.em,i=e.el,s=new Ia({target:r,model:o,ppfx:n,onChange:this.__handleChange}).render();i.querySelector(".".concat(n,"fields")).appendChild(s.el),this.input=null===(t=s.inputEl)||void 0===t?void 0:t.get(0),this.inputInst=s}},e}(mf);const wf=_f;var xf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Cf=void 0&&(void 0).__assign||function(){return Cf=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n
\n
\n
\n \n ")},e.prototype.updateOptions=function(){delete this.input,this.onRender()},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.getOptions();if(!this.input){var o=[];n.forEach((function(t){var n=e.getOptionId(t),r=e.getOptionLabel(n),i=t.style?t.style.replace(/"/g,'"'):'',s=i?"style=\"".concat(i,"\""):'',a=n.replace(/"/g,'"');o.push(""))}));var r=this.el.querySelector("#".concat(t,"input-holder"));r.innerHTML=""),this.input=r.firstChild}},e.prototype.__setValueInput=function(t){var e=this.model,n=this.getInputEl(),o=e.getOptions()[0],r=o?e.getOptionId(o):'';n&&(n.value=t||r)},e}(Gd);var Pf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Af=void 0&&(void 0).__assign||function(){return Af=Object.assign||function(t){for(var e,n=1,o=arguments.length;n")},e.prototype.onRender=function(){var t=this.pfx,e=this.ppfx,n=this.model,o="".concat(e,"radio-item-label"),r=n.getName(),i=n.getOptions(),s="".concat(t,"radio ").concat(t,"radio-").concat(r),a=n.cid;if(!this.input){var l=[];i.forEach((function(i){var c=i.className?"".concat(i.className," ").concat(t,"icon ").concat(o):'',u=n.getOptionId(i),p="".concat(r,"-").concat(u,"-").concat(a),d=c?'':n.getOptionLabel(u),f=i.title?"title=\"".concat(i.title,"\""):'',h=n.getValue()===u?'checked':'';l.push("\n
\n \n \n
\n "))}));var c=this.el.querySelector(".".concat(e,"field"));c.innerHTML="
").concat(l.join(''),"
"),this.input=c.firstChild}},e.prototype.__setValueInput=function(t){var e,n=this.model,o=t||n.getDefaultValue(),r=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector("[value=\"".concat(o,"\"]"));r&&(r.checked=!0)},e}(Ef);const Df=Lf;var Nf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),If=void 0&&(void 0).__assign||function(){return If=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n \n ")},e.prototype.getSliderEl=function(){return this.slider||(this.slider=this.el.querySelector('input[type=range]')),this.slider},e.prototype.inputValueChanged=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value)},e.prototype.inputValueChangedSoft=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value,{partial:!0})},e.prototype.setValue=function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=''===t?e.getDefaultValue():parseFloat(n.value),mf.prototype.setValue.apply(this,arguments)},e.prototype.onRender=function(){mf.prototype.onRender.apply(this,arguments),this.model.get('showInput')||(this.inputInst.el.style.display='none')},e.prototype.clearCached=function(){mf.prototype.clearCached.apply(this,arguments),delete this.slider},e}(mf);const $f=u.FE.extend(tc).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:Hd,view:pf,isType:function(t){if(t&&'stack'==t.type)return t}},{id:'composite',model:Ld,view:tf,isType:function(t){if(t&&'composite'==t.type)return t}},{id:'file',model:_d,view:gf,isType:function(t){if(t&&'file'==t.type)return t}},{id:'color',model:_d,view:wf,isType:function(t){if(t&&'color'==t.type)return t}},{id:'select',model:Tf,view:Ef,isType:function(t){if(t&&'select'==t.type)return t}},{id:'radio',model:jf,view:Df,isType:function(t){if(t&&'radio'==t.type)return t}},{id:'slider',model:zf,view:Wf,isType:function(t){if(t&&'slider'==t.type)return t}},{id:'integer',model:Vf,view:mf,isType:function(t){if(t&&'integer'==t.type)return t}},{id:'number',model:Vf,view:mf,isType:function(t){if(t&&'number'==t.type)return t}},{id:'base',model:_d,view:Gd,isType:function(t){return t.type='base',t}}]});var qf=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Gf=void 0&&(void 0).__assign||function(){return Gf=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
$","
\n
","
\n \n "],["\n
\n
$","
\n
","
\n
\n "])),a,a,s,a,o)},e.prototype.events=function(){return{'click [data-sector-title]':'toggle'}},e.prototype.updateOpen=function(){var t=this,e=t.$el,n=t.model,o=t.pfx,r=n.isOpen();e[r?'addClass':'removeClass']("".concat(o,"open")),this.getPropertiesEl().style.display=r?'':'none'},e.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?'':'none'},e.prototype.getPropertiesEl=function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)},e.prototype.toggle=function(){var t=this.model;t.setOpen(!t.get('open'))},e.prototype.renderProperties=function(){var t=this.model,e=this.config,n=t.get('properties');if(n){var o=new Zd({collection:n,config:e});this.$el.append(o.render().el)}},e.prototype.render=function(){var t=this,e=t.pfx,n=t.model,o=t.$el,r=n.getId(),i=n.getName();return o.html(this.template({pfx:e,label:i})),this.renderProperties(),o.attr('class',"".concat(e,"sector ").concat(e,"sector__").concat(r," no-select")),this.updateOpen(),this},e}(u.G7);const uh=ch;var ph,dh=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),fh=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.module,r=e.config,i=n.collection;return n.pfx=(null==r?void 0:r.stylePrefix)||'',n.ppfx=(null==r?void 0:r.pStylePrefix)||'',n.config=r,n.module=o,n.listenTo(i,'add',n.addTo),n.listenTo(i,'reset',n.render),n}return dh(e,t),e.prototype.remove=function(){var t=this;return u.G7.prototype.remove.apply(this,arguments),['config','module','em'].forEach((function(e){return t[e]={}})),this},e.prototype.addTo=function(t,e,n){void 0===n&&(n={}),this.addToCollection(t,null,n)},e.prototype.addToCollection=function(t,e,n){void 0===n&&(n={});var o=this.config,r=this.el,i=e||r,s=new uh({model:t,config:o}).render().el;return(0,bt.$Q)(i,s,n.at),s},e.prototype.render=function(){var t=this,e=this,n=e.$el,o=e.pfx,r=e.ppfx;n.empty();var i=document.createDocumentFragment();return this.collection.each((function(e){return t.addToCollection(e,i)})),n.append(i),n.addClass("".concat(o,"sectors ").concat(r,"one-bg ").concat(r,"two-color")),this},e}(u.G7);const hh=fh;var gh=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vh=void 0&&(void 0).__assign||function(){return vh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0}))})):[]};p?(f=c.getRules("#".concat(p.getId())),g=(h=l?v(l.getSelectors().getFullName(d)):[]).concat(f)):(f=l?c.getRules("#".concat(l.getId())):[],h=v(e.getSelectors().getFullName(d)),g=f.concat(h));var y=g.filter((function(e){return(0,t.isUndefined)(r)?1:e.get('state')===r})).sort(u.sortRules).reverse();a=y.slice(y.indexOf(e)+1)}return a},o.prototype.addType=function(t,e){this.properties.addType(t,e)},o.prototype.getType=function(t){return this.properties.getType(t)},o.prototype.getTypes=function(){return this.properties.getTypes()},o.prototype.createType=function(t,e){var n=void 0===e?{}:e,o=n.model,r=void 0===o?{}:o,i=n.view,s=void 0===i?{}:i,a=this.config,l=this.getType(t);if(l)return new l.view(vh({model:new l.model(r),config:a},s))},o.prototype.render=function(){var t=this,e=t.config,n=t.em,o=t.SectView,r=o&&o.el;return this.SectView=new hh({el:r,em:n,config:e,module:this,collection:this.sectors}),this.SectView.render().el},o.prototype._logNoSector=function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},o.prototype.__emitCmpStyleUpdate=function(t,e){void 0===e&&(e={});var n=this.em;if(!t.__p){var o=this.getSelectedAll(),r=e.components||n.getSelectedAll(),i=Array.isArray(r)?r:[r],s=vh({},t);delete s.__p,i.forEach((function(t){return!o.includes(t)&&t.__onStyleChange(s)}))}},o.prototype.__upProps=function(t){var e=this;void 0===t&&(t={});var n=this.getSelected();if(n){var o=this.sectors,r=this.model.get('component'),i=this.getSelectedParents(),s=n.getStyle(),a=i.map((function(t){return{target:t,style:t.getStyle()}}));o.map((function(n){n.getProperties().map((function(n){e.__upProp(n,s,a,t)}))})),o.forEach((function(t){var e=t.getProperties();e.forEach((function(t){var e=t.__checkVisibility({target:n,component:r,sectors:o});t.set('visible',e)}));var i=e.some((function(t){return t.isVisible()}));t.set('visible',i)}))}},o.prototype.__upProp=function(t,e,n,o){var r=this,i=t.getName(),s=e[i],a=jh(s),l='stack'===t.getType(),c='composite'===t.getType(),u=vh(vh({},o),{__up:!0}),p=!c&&!l,d=t,f=t,h=l?d.__getLayersFromStyle(e):[],g=c?f.__getPropsFromStyle(e):{},v=a?s:null,y=null;if(l&&null===h||c&&null===g){var m=l?'__getLayersFromStyle':'__getPropsFromStyle';if(_=n.filter((function(t){return null!==d[m](t.style)}))[0]){v=_.style[i],y=_.target;var b=d[m](_.style);l?h=b:g=b}}else if(!a){var _;v=null,(_=n.filter((function(t){return jh(t.style[i])}))[0])&&(v=_.style[i],y=_.target)}if(t.__setParentTarget(y),p&&t.__getFullValue()!==v&&t.upValue(v,u),l&&d.__setLayers(h||[],{isEmptyValue:d.isEmptyValueStyle(e)}),c){var w=f.getProperties();if(f.isDetached()){var x=f.__getPropsFromStyle(e,{byName:!0})||{},C=n.map((function(t){return vh(vh({},t),{style:f.__getPropsFromStyle(t.style,{byName:!0})||{}})}));w.map((function(t){return r.__upProp(t,x,C,o)}))}else f.__setProperties(g||{},u),f.getProperties().map((function(t){return t.__setParentTarget(y)}))}},o.prototype.destroy=function(){var t;[this.properties,this.sectors].forEach((function(t){t.reset(),t.stopListening()})),null===(t=this.SectView)||void 0===t||t.remove(),this.model.stopListening(),this.upAll.cancel()},o}(b);const Dh=Lh;var Nh=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ih=void 0&&(void 0).__assign||function(){return Ih=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]=r.getStepsBeforeSave()&&this.store().catch((function(t){return o.logError(t)}))},o.prototype.loadModule=function(t){var e=new t(this);return this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),e},o.prototype.loadStorableModule=function(t){var e=this.loadModule(t);return this.storables.push(e),e},o.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set('Editor',t)},o.prototype.getEditor=function(){return this.get('Editor')},o.prototype.handleUpdates=function(t,e,n){var o=this;void 0===n&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get('ready')||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout((function(){var t=o.getDirtyCount()||0,e=(n.unset,Rh(n,["unset"]));o.set('changesCount',t+1,e)}),0))},o.prototype.changesUp=function(t){this.handleUpdates(0,0,t)},o.prototype.componentHovered=function(t,e,n){var o=this.previous('componentHovered');o&&this.trigger('component:unhovered',o,n),e&&this.trigger('component:hovered',e,n)},o.prototype.getSelected=function(){return this.selected.lastComponent()},o.prototype.getSelectedAll=function(){return this.selected.allComponents()},o.prototype.setSelected=function(e,n){var o=this;void 0===n&&(n={});var r=n.event,i=r&&(r.ctrlKey||r.metaKey),s=(r||{}).shiftKey,a=((0,t.isArray)(e)?e:[e]).map((function(t){var e,n;return(null===(n=null===(e=null==t?void 0:t.delegate)||void 0===e?void 0:e.select)||void 0===n?void 0:n.call(e,t))||t})).filter(Boolean),l=this.getSelectedAll(),c=this.getConfig().multipleSelection,u=(0,t.isArray)(e);!u&&e||this.removeSelected(l.filter((function(e){return!(0,t.contains)(a,e)}))),a.forEach((function(e){if(e&&(o.trigger('component:select:before',e,n),!e.get('selectable')||n.abort)){if(!n.useValid)return;for(var r=e.parent();r&&!r.get('selectable');)r=r.parent();e=r}if(i&&c)return o.toggleSelected(e);if(s&&c){o.clearSelection(o.Canvas.getWindow());var a,p,d=e.collection,f=e.index();if(o.getSelectedAll().forEach((function(e){var n=e.collection,o=e.index();n===d&&(of&&(p=(0,t.isUndefined)(p)?o:Math.min(p,o)))})),!(0,t.isUndefined)(a))for(;a!==f;)o.addSelected(d.at(a)),a++;if(!(0,t.isUndefined)(p))for(;p!==f;)o.addSelected(d.at(p)),p--;return o.addSelected(e)}!u&&o.removeSelected(l.filter((function(t){return t!==e}))),o.addSelected(e,n)}))},o.prototype.addSelected=function(e,n){var o=this;void 0===n&&(n={}),((0,t.isArray)(e)?e:[e]).forEach((function(e){var r=o.selected;e&&e.get('selectable')&&!e.parents().some((function(t){return r.hasComponent(t)}))&&(n.forceChange&&o.removeSelected(e,n),r.allComponents().filter((function(n){return(0,t.contains)(n.parents(),e)})).forEach((function(t){return o.removeSelected(t,n)})),r.addComponent(e,n),o.trigger('component:select',e,n),o.Canvas.addSpot({type:ut.q.Select,component:e}))}))},o.prototype.removeSelected=function(e,n){var o=this;void 0===n&&(n={}),this.selected.removeComponent(e,n),((0,t.isArray)(e)?e:[e]).forEach((function(t){return o.Canvas.removeSpots({type:ut.q.Select,component:t})}))},o.prototype.toggleSelected=function(e,n){var o=this;void 0===n&&(n={}),((0,t.isArray)(e)?e:[e]).forEach((function(t){o.selected.hasComponent(t)?o.removeSelected(t,n):o.addSelected(t,n)}))},o.prototype.setHovered=function(t,e){var n=this;void 0===e&&(e={});var o=function(t,e){var o=n,r=o.config,i=o.Canvas,s=n.getHovered(),a=n.getSelectedAll(),l=ut.q.Hover,c=ut.q.Spacing;n.set('componentHovered',t||null,e),s&&(i.removeSpots({type:l,component:s}),i.removeSpots({type:c,component:s})),t&&(i.addSpot({type:l,component:t}),a.includes(t)&&!r.showOffsetsSelected||i.addSpot({type:c,component:t}))};if(!t)return o();var r='component:hover';if(e.forceChange&&o(),this.trigger("".concat(r,":before"),t,e),!t.get('hoverable')){if(!e.useValid||e.abort)return;for(var i=t.parent();i&&!i.get('hoverable');)i=i.parent();t=i}e.abort||(o(t,e),this.trigger(r,t,e))},o.prototype.getHovered=function(){return this.get('componentHovered')},o.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.Components.setComponents(t,e)},o.prototype.getComponents=function(){var t=this.Components,e=this.CodeManager;if(t&&e){var n=t.getComponents();return e.getCode(n,'json')}},o.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.Css;return n.clear(e),n.getAll().add(t,e),this},o.prototype.addStyle=function(e,n){void 0===n&&(n={});var o=this.getStyle().add(e,n);return(0,t.isArray)(o)?o:[o]},o.prototype.getStyle=function(){return this.Css.getAll()},o.prototype.setState=function(t){return this.set('state',t),this},o.prototype.getState=function(){return this.get('state')||''},o.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,o=e.jsInHtml?this.getJs(t):'',r=t.component||this.Components.getComponent(),i=r?this.CodeManager.getCode(r,'html',Ih(Ih({},n),t)):'';return i+=o?"` : '';\n return html;\n }\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @returns {string} CSS string\n * @public\n */\n getCss(opts: { component?: Component; avoidProtected?: boolean } & CssGeneratorBuildOptions = {}) {\n const { config } = this;\n const { optsCss } = config;\n const avoidProt = opts.avoidProtected;\n const keepUnusedStyles = !isUndefined(opts.keepUnusedStyles) ? opts.keepUnusedStyles : config.keepUnusedStyles;\n const cssc = this.Css;\n const wrp = opts.component || this.Components.getComponent();\n const protCss = !avoidProt ? config.protectedCss! : '';\n const css =\n wrp &&\n this.CodeManager.getCode(wrp, 'css', {\n cssc,\n keepUnusedStyles,\n ...optsCss,\n ...opts,\n });\n return wrp ? (opts.json ? css : protCss + css) : '';\n }\n\n /**\n * Returns JS of all components\n * @return {string} JS string\n * @public\n */\n getJs(opts: { component?: Component } = {}) {\n var wrp = opts.component || this.Components.getWrapper();\n return wrp ? this.CodeManager.getCode(wrp, 'js').trim() : '';\n }\n\n /**\n * Store data to the current storage.\n * @public\n */\n async store(options?: T) {\n const data = this.storeData();\n await this.Storage.store(data, options);\n this.clearDirtyCount();\n return data;\n }\n\n /**\n * Load data from the current storage.\n * @public\n */\n async load(options?: T, loadOptions: EditorLoadOptions = {}) {\n const result = await this.Storage.load(options);\n this.loadData(result);\n // Wait in order to properly update the dirty counter (#5385)\n await wait();\n\n if (loadOptions.clear) {\n this.UndoManager.clear();\n this.clearDirtyCount();\n }\n\n return result;\n }\n\n storeData(): ProjectData {\n let result = {};\n // Sync content if there is an active RTE\n const editingCmp = this.getEditing();\n editingCmp && editingCmp.trigger('sync:content', { noCount: true });\n\n this.storables.forEach(m => {\n result = { ...result, ...m.store(1) };\n });\n return JSON.parse(JSON.stringify(result));\n }\n\n loadData(data: ProjectData = {}): ProjectData {\n if (!isEmptyObj(data)) {\n this.storables.forEach(module => module.clear());\n this.storables.forEach(module => module.load(data));\n }\n return data;\n }\n\n /**\n * Returns device model by name\n * @return {Device|null}\n * @private\n */\n getDeviceModel() {\n const name = this.get('device');\n return this.Devices.get(name);\n }\n\n /**\n * Run default command if setted\n * @param {Object} [opts={}] Options\n * @private\n */\n runDefault(opts = {}) {\n const command = this.get('Commands').get(this.config.defaultCommand);\n if (!command || this.defaultRunning) return;\n command.stop(this, this, opts);\n command.run(this, this, opts);\n this.defaultRunning = true;\n }\n\n /**\n * Stop default command\n * @param {Object} [opts={}] Options\n * @private\n */\n stopDefault(opts = {}) {\n const commands = this.get('Commands');\n const command = commands.get(this.config.defaultCommand);\n if (!command || !this.defaultRunning) return;\n command.stop(this, this, opts);\n this.defaultRunning = false;\n }\n\n /**\n * Update canvas dimensions and refresh data useful for tools positioning\n * @public\n */\n refreshCanvas(opts: any = {}) {\n this.Canvas.refresh({ spots: opts.tools });\n }\n\n /**\n * Clear all selected stuf inside the window, sometimes is useful to call before\n * doing some dragging opearation\n * @param {Window} win If not passed the current one will be used\n * @private\n */\n clearSelection(win?: Window) {\n var w = win || window;\n w.getSelection()?.removeAllRanges();\n }\n\n /**\n * Get the current media text\n * @return {string}\n */\n getCurrentMedia() {\n const config = this.config;\n const device = this.getDeviceModel();\n const condition = config.mediaCondition;\n const preview = config.devicePreviewMode;\n const width = device && device.get('widthMedia');\n return device && width && !preview ? `(${condition}: ${width})` : '';\n }\n\n /**\n * Return the component wrapper\n * @return {Component}\n */\n getWrapper(): ComponentWrapper | undefined {\n return this.Components.getWrapper();\n }\n\n setCurrentFrame(frameView?: FrameView) {\n return this.set('currentFrame', frameView);\n }\n\n getCurrentFrame(): FrameView | undefined {\n return this.get('currentFrame');\n }\n\n getCurrentFrameModel() {\n return (this.getCurrentFrame() || {})?.model;\n }\n\n getIcon(icon: string) {\n const icons = this.config.icons || {};\n return icons[icon] || '';\n }\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount(): number {\n return this.get('changesCount');\n }\n\n clearDirtyCount() {\n return this.set({ changesCount: 0 }, { isClear: true });\n }\n\n getZoomDecimal() {\n return this.Canvas.getZoomDecimal();\n }\n\n getZoomMultiplier() {\n return this.Canvas.getZoomMultiplier();\n }\n\n setDragMode(value: DragMode) {\n return this.set('dmode', value);\n }\n\n getDragMode(component?: Component): DragMode {\n const mode = component?.getDragMode() || this.get('dmode');\n return mode || '';\n }\n\n t(...args: any[]) {\n const i18n = this.get('I18n');\n return i18n?.t(...args);\n }\n\n /**\n * Returns true if the editor is in absolute mode\n * @returns {Boolean}\n */\n inAbsoluteMode(component?: Component) {\n return this.getDragMode(component) === 'absolute';\n }\n\n /**\n * Destroy editor\n */\n destroyAll() {\n const { config, view } = this;\n const editor = this.getEditor();\n // @ts-ignore\n const { editors = [] } = config.grapesjs || {};\n const shallow = this.get('shallow');\n this._storageTimeout && clearTimeout(this._storageTimeout);\n shallow?.destroyAll();\n this.stopListening();\n this.stopDefault();\n this.modules\n .slice()\n .reverse()\n .forEach(mod => mod.destroy());\n view && view.remove();\n this.clear({ silent: true });\n this.destroyed = true;\n ['_config', 'view', '_previousAttributes', '_events', '_listeners'].forEach(\n //@ts-ignore\n i => (this[i] = {})\n );\n editors.splice(editors.indexOf(editor), 1);\n //@ts-ignore\n hasWin() && $(config.el).empty().attr(this.attrsOrig);\n }\n\n getEditing(): Component | undefined {\n const res = this.get('editing');\n return (res && res.model) || undefined;\n }\n\n setEditing(value: boolean | ComponentView) {\n this.set('editing', value);\n return this;\n }\n\n isEditing() {\n return !!this.get('editing');\n }\n\n log(msg: string, opts: any = {}) {\n const { ns, level = 'debug' } = opts;\n this.trigger('log', msg, opts);\n level && this.trigger(`log:${level}`, msg, opts);\n\n if (ns) {\n const logNs = `log-${ns}`;\n this.trigger(logNs, msg, opts);\n level && this.trigger(`${logNs}:${level}`, msg, opts);\n }\n }\n\n logInfo(msg: string, opts?: any) {\n this.log(msg, { ...opts, level: 'info' });\n }\n\n logWarning(msg: string, opts?: any) {\n this.log(msg, { ...opts, level: 'warning' });\n }\n\n logError(msg: string, opts?: any) {\n this.log(msg, { ...opts, level: 'error' });\n }\n\n initBaseColorPicker(el: any, opts = {}) {\n const { config } = this;\n const { colorPicker = {} } = config;\n const elToAppend = config.el;\n const ppfx = config.stylePrefix;\n\n //@ts-ignore\n return $(el).spectrum({\n containerClassName: `${ppfx}one-bg ${ppfx}two-color`,\n appendTo: elToAppend || 'body',\n maxSelectionSize: 8,\n showPalette: true,\n palette: [],\n showAlpha: true,\n chooseText: 'Ok',\n cancelText: '⨯',\n ...opts,\n ...colorPicker,\n });\n }\n\n /**\n * Execute actions without triggering the storage and undo manager.\n * @param {Function} clb\n * @private\n */\n skip(clb: Function) {\n this.__skip = true;\n const um = this.UndoManager;\n um ? um.skip(clb) : clb();\n this.__skip = false;\n }\n\n /**\n * Set/get data from the HTMLElement\n * @param {HTMLElement} el\n * @param {string} name Data name\n * @param {any} value Date value\n * @return {any}\n * @private\n */\n data(el: any, name: string, value: any) {\n const varName = '_gjs-data';\n\n if (!el[varName]) {\n el[varName] = {};\n }\n\n if (isUndefined(value)) {\n return el[varName][name];\n } else {\n el[varName][name] = value;\n }\n }\n}\n","import { isObject } from 'underscore';\n\nexport default ({ $ }: { $: any }) => {\n if ($ && $.prototype && $.prototype.constructor.name !== 'jQuery') {\n const fn = $.fn;\n\n // Additional helpers\n\n fn.hide = function () {\n return this.css('display', 'none');\n };\n\n fn.show = function () {\n return this.css('display', 'block');\n };\n\n fn.focus = function () {\n const el = this.get(0);\n el && el.focus();\n return this;\n };\n\n // For spectrum compatibility\n\n fn.bind = function (ev: any, h: any) {\n return this.on(ev, h);\n };\n\n fn.unbind = function (ev: any, h: any) {\n if (isObject(ev)) {\n for (let name in ev) {\n ev.hasOwnProperty(name) && this.off(name, ev[name]);\n }\n\n return this;\n } else {\n return this.off(ev, h);\n }\n };\n\n fn.click = function (h: any) {\n return h ? this.on('click', h) : this.trigger('click');\n };\n\n fn.change = function (h: any) {\n return h ? this.on('change', h) : this.trigger('change');\n };\n\n fn.keydown = function (h: any) {\n return h ? this.on('keydown', h) : this.trigger('keydown');\n };\n\n fn.delegate = function (selector: any, events: any, data: any, handler: any) {\n if (!handler) {\n handler = data;\n }\n\n return this.on(events, selector, function (e: any) {\n e.data = data;\n handler(e);\n });\n };\n\n fn.scrollLeft = function () {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageXOffset : el.scrollLeft || 0;\n };\n\n fn.scrollTop = function () {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageYOffset : el.scrollTop || 0;\n };\n\n const offset = $.prototype.offset;\n fn.offset = function (coords: any) {\n let top, left;\n\n if (coords) {\n top = coords.top;\n left = coords.left;\n }\n\n if (typeof top != 'undefined') {\n this.css('top', `${top}px`);\n }\n if (typeof left != 'undefined') {\n this.css('left', `${left}px`);\n }\n\n return offset.call(this);\n };\n\n $.map = function (items: any, clb: any) {\n const ar = [];\n\n for (var i = 0; i < items.length; i++) {\n ar.push(clb(items[i], i));\n }\n\n return ar;\n };\n\n const indexOf = Array.prototype.indexOf;\n\n $.inArray = function (val: any, arr: any, i: any) {\n return arr == null ? -1 : indexOf.call(arr, val, i);\n };\n\n $.Event = function (src: any, props: any) {\n if (!(this instanceof $.Event)) {\n return new $.Event(src, props);\n }\n\n this.type = src;\n this.isDefaultPrevented = () => false;\n };\n }\n};\n","import { View, $ } from '../../common';\nimport { appendStyles } from '../../utils/mixins';\nimport EditorModel from '../model/Editor';\n\nexport default class EditorView extends View {\n constructor(model: EditorModel) {\n super({ model });\n //const { model } = this;\n const { Panels, UndoManager } = model.attributes;\n model.view = this;\n model.once('change:ready', () => {\n Panels.active();\n Panels.disableButtons();\n UndoManager.clear();\n setTimeout(() => {\n model.trigger('load', model.get('Editor'));\n model.clearDirtyCount();\n });\n });\n }\n\n render() {\n const { $el, model } = this;\n const { Panels, Canvas } = model.attributes;\n const { config, modules } = model;\n const pfx = config.stylePrefix;\n const classNames = [`${pfx}editor`];\n !config.customUI && classNames.push(`${pfx}one-bg ${pfx}two-color`);\n\n // @ts-ignore\n const contEl = $(config.el || `body ${config.container}`);\n config.cssIcons && appendStyles(config.cssIcons, { unique: true, prepand: true });\n $el.empty();\n\n // @ts-ignore\n if (config.width) contEl.css('width', config.width);\n // @ts-ignore\n if (config.height) contEl.css('height', config.height);\n\n $el.append(Canvas.render());\n $el.append(Panels.render());\n\n // Load shallow editor\n const shallow = model.get('shallow');\n const shallowCanvasEl = shallow.get('Canvas').render();\n shallowCanvasEl.style.display = 'none';\n $el.append(shallowCanvasEl);\n\n $el.attr('class', classNames.join(' '));\n // @ts-ignore\n contEl.addClass(`${pfx}editor-cont`).empty().append($el);\n modules.forEach(md => md.postRender && md.postRender(this));\n\n return this;\n }\n}\n","/**\n * Editor contains the top level API which you'll probably use to customize the editor or extend it with plugins.\n * You get the Editor instance on init method and you can pass options via its [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/editor/config/config.ts)\n *\n * ```js\n * const editor = grapesjs.init({\n * // options\n * });\n * ```\n *\n * ## Available Events\n *\n * You can make use of available events in this way\n * ```js\n * editor.on('EVENT-NAME', (some, argument) => {\n * // do something\n * })\n * ```\n *\n * * `update` - The structure of the template is updated (its HTML/CSS)\n * * `undo` - Undo executed\n * * `redo` - Redo executed\n * * `load` - Editor is loaded\n *\n * ### Components\n * Check the [Components](/api/components.html) module.\n * ### Keymaps\n * Check the [Keymaps](/api/keymaps.html) module.\n * ### Style Manager\n * Check the [Style Manager](/api/style_manager.html) module.\n * ### Storage\n * Check the [Storage](/api/storage_manager.html) module.\n * ### Canvas\n * Check the [Canvas](/api/canvas.html) module.\n * ### RTE\n * Check the [Rich Text Editor](/api/rich_text_editor.html) module.\n * ### Commands\n * Check the [Commands](/api/commands.html) module.\n * ### Selectors\n * Check the [Selectors](/api/selector_manager.html) module.\n * ### Blocks\n * Check the [Blocks](/api/block_manager.html) module.\n * ### Assets\n * Check the [Assets](/api/assets.html) module.\n * ### Modal\n * Check the [Modal](/api/modal_dialog.html) module.\n * ### Devices\n * Check the [Devices](/api/device_manager.html) module.\n * ### Parser\n * Check the [Parser](/api/parser.html) module.\n * ### Pages\n * Check the [Pages](/api/pages.html) module.\n *\n * ## Methods\n * @module docsjs.Editor\n */\nimport { IBaseModule } from '../abstract/Module';\nimport AssetManager from '../asset_manager';\nimport { AssetEvent } from '../asset_manager/types';\nimport BlockManager, { BlockEvent } from '../block_manager';\nimport CanvasModule, { CanvasEvent } from '../canvas';\nimport CodeManagerModule from '../code_manager';\nimport CommandsModule, { CommandEvent } from '../commands';\nimport { AddOptions, EventHandler, LiteralUnion } from '../common';\nimport CssComposer from '../css_composer';\nimport CssRule from '../css_composer/model/CssRule';\nimport CssRules from '../css_composer/model/CssRules';\nimport DeviceManager from '../device_manager';\nimport ComponentManager, { ComponentEvent } from '../dom_components';\nimport Component from '../dom_components/model/Component';\nimport Components from '../dom_components/model/Components';\nimport ComponentWrapper from '../dom_components/model/ComponentWrapper';\nimport { ComponentAdd, DragMode } from '../dom_components/model/types';\nimport I18nModule from '../i18n';\nimport KeymapsModule, { KeymapEvent } from '../keymaps';\nimport ModalModule, { ModalEvent } from '../modal_dialog';\nimport LayerManager from '../navigator';\nimport PageManager from '../pages';\nimport PanelManager from '../panels';\nimport ParserModule from '../parser';\nimport { CustomParserCss } from '../parser/config/config';\nimport RichTextEditorModule, { RichTextEditorEvent } from '../rich_text_editor';\nimport { CustomRTE } from '../rich_text_editor/config/config';\nimport SelectorManager, { SelectorEvent } from '../selector_manager';\nimport StorageManager, { StorageEvent, StorageOptions, ProjectData } from '../storage_manager';\nimport StyleManager, { StyleManagerEvent } from '../style_manager';\nimport TraitManager from '../trait_manager';\nimport UndoManagerModule from '../undo_manager';\nimport UtilsModule from '../utils';\nimport html from '../utils/html';\nimport defaults, { EditorConfig, EditorConfigKeys } from './config/config';\nimport EditorModel, { EditorLoadOptions } from './model/Editor';\nimport EditorView from './view/EditorView';\n\nexport type ParsedRule = {\n selectors: string;\n style: Record;\n atRule?: string;\n params?: string;\n};\n\ntype GeneralEvent = 'canvasScroll' | 'undo' | 'redo' | 'load' | 'update';\n\ntype EditorBuiltInEvents =\n | ComponentEvent\n | BlockEvent\n | AssetEvent\n | KeymapEvent\n | StyleManagerEvent\n | StorageEvent\n | CanvasEvent\n | SelectorEvent\n | RichTextEditorEvent\n | ModalEvent\n | CommandEvent\n | GeneralEvent;\n\ntype EditorEvent = LiteralUnion;\n\ntype EditorConfigType = EditorConfig & { pStylePrefix?: string };\n\ntype EditorModelParam = Parameters[N];\n\nexport type EditorParam = Parameters[N];\n\nexport default class Editor implements IBaseModule {\n editorView?: EditorView;\n editor: EditorModel;\n $: any;\n em: EditorModel;\n config: EditorConfigType;\n\n constructor(config: EditorConfig = {}, opts: any = {}) {\n this.config = {\n ...defaults,\n ...config,\n pStylePrefix: config.stylePrefix ?? defaults.stylePrefix,\n };\n this.em = new EditorModel(this.config);\n this.$ = opts.$;\n this.em.init(this);\n this.editor = this.em;\n }\n\n get Config() {\n return this.em.config;\n }\n get I18n(): I18nModule {\n return this.em.I18n;\n }\n get Utils(): UtilsModule {\n return this.em.Utils;\n }\n get Commands(): CommandsModule {\n return this.em.Commands;\n }\n get Keymaps(): KeymapsModule {\n return this.em.Keymaps;\n }\n get Modal(): ModalModule {\n return this.em.Modal;\n }\n get Panels(): PanelManager {\n return this.em.Panels;\n }\n get Canvas(): CanvasModule {\n return this.em.Canvas;\n }\n get Parser(): ParserModule {\n return this.em.Parser;\n }\n get CodeManager(): CodeManagerModule {\n return this.em.CodeManager;\n }\n get UndoManager(): UndoManagerModule {\n return this.em.UndoManager;\n }\n get RichTextEditor(): RichTextEditorModule {\n return this.em.RichTextEditor;\n }\n get Pages(): PageManager {\n return this.em.Pages;\n }\n get Components(): ComponentManager {\n return this.em.Components;\n }\n get DomComponents(): ComponentManager {\n return this.em.Components;\n }\n get Layers(): LayerManager {\n return this.em.Layers;\n }\n get LayerManager(): LayerManager {\n return this.em.Layers;\n }\n get Css(): CssComposer {\n return this.em.Css;\n }\n get CssComposer(): CssComposer {\n return this.em.Css;\n }\n get Storage(): StorageManager {\n return this.em.Storage;\n }\n get StorageManager(): StorageManager {\n return this.em.Storage;\n }\n get Assets(): AssetManager {\n return this.em.Assets;\n }\n get AssetManager(): AssetManager {\n return this.em.Assets;\n }\n get Blocks(): BlockManager {\n return this.em.Blocks;\n }\n get BlockManager(): BlockManager {\n return this.em.Blocks;\n }\n get Traits(): TraitManager {\n return this.em.Traits;\n }\n get TraitManager(): TraitManager {\n return this.em.Traits;\n }\n get Selectors(): SelectorManager {\n return this.em.Selectors;\n }\n get SelectorManager(): SelectorManager {\n return this.em.Selectors;\n }\n get Styles(): StyleManager {\n return this.em.Styles;\n }\n get StyleManager(): StyleManager {\n return this.em.Styles;\n }\n get Devices(): DeviceManager {\n return this.em.Devices;\n }\n get DeviceManager(): DeviceManager {\n return this.em.Devices;\n }\n\n get EditorModel() {\n return this.em;\n }\n\n /**\n * Returns configuration object\n * @returns {any} Returns the configuration object or the value of the specified property\n */\n getConfig<\n P extends EditorConfigKeys | undefined = undefined,\n R = P extends EditorConfigKeys ? EditorConfig[P] : EditorConfig\n >(prop?: P): R {\n return this.em.getConfig(prop);\n }\n\n /**\n * Returns HTML built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the HTML of a specific Component\n * @param {Boolean} [opts.cleanId=false] Remove unnecessary IDs (eg. those created automatically)\n * @returns {string} HTML string\n */\n getHtml(opts?: EditorModelParam<'getHtml', 0>) {\n return this.em.getHtml(opts);\n }\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the CSS of a specific Component\n * @param {Boolean} [opts.json=false] Return an array of CssRules instead of the CSS string\n * @param {Boolean} [opts.avoidProtected=false] Don't include protected CSS\n * @param {Boolean} [opts.onlyMatched=false] Return only rules matched by the passed component.\n * @param {Boolean} [opts.keepUnusedStyles=false] Force keep all defined rules. Toggle on in case output looks different inside/outside of the editor.\n * @returns {String|Array} CSS string or array of CssRules\n */\n getCss(opts?: EditorModelParam<'getCss', 0>) {\n return this.em.getCss(opts);\n }\n\n /**\n * Returns JS of all components\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Get the JS of a specific component\n * @returns {String} JS string\n */\n getJs(opts?: EditorModelParam<'getJs', 0>) {\n return this.em.getJs(opts);\n }\n\n /**\n * Return the complete tree of components. Use `getWrapper` to include also the wrapper\n * @return {Components}\n */\n getComponents(): Components {\n return this.Components.getComponents();\n }\n\n /**\n * Return the wrapper and its all components\n * @return {Component}\n */\n getWrapper(): ComponentWrapper | undefined {\n return this.Components.getWrapper();\n }\n\n /**\n * Set components inside editor's canvas. This method overrides actual components\n * @param {Array|Object|string} components HTML string or components model\n * @param {Object} opt the options object to be used by the [setComponents]{@link em#setComponents} method\n * @return {this}\n * @example\n * editor.setComponents('
New component
');\n * // or\n * editor.setComponents({\n * type: 'text',\n * classes:['cls'],\n * content: 'New component'\n * });\n */\n setComponents(components: ComponentAdd, opt: AddOptions = {}) {\n this.em.setComponents(components, opt);\n return this;\n }\n\n /**\n * Add components\n * @param {Array|Object|string} components HTML string or components model\n * @param {Object} opts Options\n * @param {Boolean} [opts.avoidUpdateStyle=false] If the HTML string contains styles,\n * by default, they will be created and, if already exist, updated. When this option\n * is true, styles already created will not be updated.\n * @return {Array}\n * @example\n * editor.addComponents('
New component
');\n * // or\n * editor.addComponents({\n * type: 'text',\n * classes:['cls'],\n * content: 'New component'\n * });\n */\n addComponents(components: ComponentAdd, opts?: AddOptions): Component[] {\n return this.getWrapper()!.append(components, opts);\n }\n\n /**\n * Returns style in JSON format object\n * @return {Object}\n */\n getStyle(): CssRules {\n return this.em.Css.getAll();\n }\n\n /**\n * Set style inside editor's canvas. This method overrides actual style\n * @param {Array|Object|string} style CSS string or style model\n * @return {this}\n * @example\n * editor.setStyle('.cls{color: red}');\n * //or\n * editor.setStyle({\n * selectors: ['cls'],\n * style: { color: 'red' }\n * });\n */\n setStyle(style: any, opt: any = {}) {\n this.em.setStyle(style, opt);\n return this;\n }\n\n /**\n * Add styles to the editor\n * @param {Array|Object|string} style CSS string or style model\n * @returns {Array} Array of created CssRule instances\n * @example\n * editor.addStyle('.cls{color: red}');\n */\n addStyle(style: any, opts = {}): CssRule[] {\n return this.em.addStyle(style, opts);\n }\n\n /**\n * Returns the last selected component, if there is one\n * @return {Model}\n */\n getSelected() {\n return this.em.getSelected();\n }\n\n /**\n * Returns an array of all selected components\n * @return {Array}\n */\n getSelectedAll() {\n return this.em.getSelectedAll();\n }\n\n /**\n * Get a stylable entity from the selected component.\n * If you select a component without classes the entity is the Component\n * itself and all changes will go inside its 'style' attribute. Otherwise,\n * if the selected component has one or more classes, the function will\n * return the corresponding CSS Rule\n * @return {Model}\n */\n getSelectedToStyle() {\n let selected = this.em.getSelected();\n\n if (selected) {\n return this.StyleManager.getModelToStyle(selected);\n }\n }\n\n /**\n * Select a component\n * @param {Component|HTMLElement} el Component to select\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.scroll] Scroll canvas to the selected element\n * @return {this}\n * @example\n * // Select dropped block\n * editor.on('block:drag:stop', function(model) {\n * editor.select(model);\n * });\n */\n select(el?: EditorModelParam<'setSelected', 0>, opts?: { scroll?: boolean }) {\n this.em.setSelected(el, opts);\n return this;\n }\n\n /**\n * Add component to selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectAdd(model);\n */\n // selectAdd(el: Parameters[0]) {\n selectAdd(el: EditorModelParam<'addSelected', 0>) {\n this.em.addSelected(el);\n return this;\n }\n\n /**\n * Remove component from selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectRemove(model);\n */\n selectRemove(el: EditorModelParam<'removeSelected', 0>) {\n this.em.removeSelected(el);\n return this;\n }\n\n /**\n * Toggle component selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectToggle(model);\n */\n selectToggle(el: EditorModelParam<'toggleSelected', 0>) {\n this.em.toggleSelected(el);\n return this;\n }\n\n /**\n * Returns, if active, the Component enabled in rich text editing mode.\n * @returns {Component|null}\n * @example\n * const textComp = editor.getEditing();\n * if (textComp) {\n * console.log('HTML: ', textComp.toHTML());\n * }\n */\n getEditing() {\n return this.em.getEditing();\n }\n\n /**\n * Set device to the editor. If the device exists it will\n * change the canvas to the proper width\n * @param {string} name Name of the device\n * @return {this}\n * @example\n * editor.setDevice('Tablet');\n */\n setDevice(name: string) {\n this.em.set('device', name);\n return this;\n }\n\n /**\n * Return the actual active device\n * @return {string} Device name\n * @example\n * var device = editor.getDevice();\n * console.log(device);\n * // 'Tablet'\n */\n getDevice(): string {\n return this.em.get('device');\n }\n\n /**\n * Execute command\n * @param {string} id Command ID\n * @param {Object} options Custom options\n * @return {*} The return is defined by the command\n * @example\n * editor.runCommand('myCommand', {someValue: 1});\n */\n runCommand(id: string, options: Record = {}) {\n return this.Commands.run(id, options);\n }\n\n /**\n * Stop the command if stop method was provided\n * @param {string} id Command ID\n * @param {Object} options Custom options\n * @return {*} The return is defined by the command\n * @example\n * editor.stopCommand('myCommand', {someValue: 1});\n */\n stopCommand(id: string, options: Record = {}) {\n return this.Commands.stop(id, options);\n }\n\n /**\n * Store data to the current storage.\n * This will reset the counter of changes (`editor.getDirtyCount()`).\n * @param {Object} [options] Storage options.\n * @returns {Object} Stored data.\n * @example\n * const storedData = await editor.store();\n */\n async store(options?: T) {\n return await this.em.store(options);\n }\n\n /**\n * Load data from the current storage.\n * @param {Object} [options] Storage options.\n * @param {Object} [loadOptions={}] Load options.\n * @param {Boolean} [loadOptions.clear=false] Clear the editor state (eg. dirty counter, undo manager, etc.).\n * @returns {Object} Loaded data.\n * @example\n * const data = await editor.load();\n */\n async load(options?: T, loadOptions: EditorLoadOptions = {}) {\n return await this.em.load(options, loadOptions);\n }\n\n /**\n * Get the JSON project data, which could be stored and loaded back with `editor.loadProjectData(json)`\n * @returns {Object}\n * @example\n * console.log(editor.getProjectData());\n * // { pages: [...], styles: [...], ... }\n */\n getProjectData() {\n return this.em.storeData();\n }\n\n /**\n * Load data from the JSON project\n * @param {Object} data Project to load\n * @example\n * editor.loadProjectData({ pages: [...], styles: [...], ... })\n */\n loadProjectData(data: ProjectData) {\n return this.em.loadData(data);\n }\n\n storeData() {\n return this.em.storeData();\n }\n\n loadData(data: any) {\n return this.em.loadData(data);\n }\n\n /**\n * Returns container element. The one which was indicated as 'container'\n * on init method\n * @return {HTMLElement}\n */\n getContainer() {\n return this.config.el;\n }\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount() {\n return this.em.getDirtyCount();\n }\n\n /**\n * Reset the counter of changes.\n */\n clearDirtyCount() {\n return this.em.clearDirtyCount();\n }\n\n /**\n * Update editor dimension offsets\n *\n * This method could be useful when you update, for example, some position\n * of the editor element (eg. canvas, panels, etc.) with CSS, where without\n * refresh you'll get misleading position of tools\n * @param {Object} [options] Options\n * @param {Boolean} [options.tools=false] Update the position of tools (eg. rich text editor, component highlighter, etc.)\n */\n refresh(opts?: { tools?: boolean }) {\n this.em.refreshCanvas(opts);\n }\n\n /**\n * Replace the built-in Rich Text Editor with a custom one.\n * @param {Object} obj Custom RTE Interface\n * @example\n * editor.setCustomRte({\n * // Function for enabling custom RTE\n * // el is the HTMLElement of the double clicked Text Component\n * // rte is the same instance you have returned the first time you call\n * // enable(). This is useful if need to check if the RTE is already enabled so\n * // ion this case you'll need to return the RTE and the end of the function\n * enable: function(el, rte) {\n * rte = new MyCustomRte(el, {}); // this depends on the Custom RTE API\n * ...\n * return rte; // return the RTE instance\n * }\n *\n * // Disable the editor, called for example when you unfocus the Text Component\n * disable: function(el, rte) {\n * rte.blur(); // this depends on the Custom RTE API\n * }\n *\n * // Called when the Text Component is focused again. If you returned the RTE instance\n * // from the enable function, the enable won't be called again instead will call focus,\n * // in this case to avoid double binding of the editor\n * focus: function (el, rte) {\n * rte.focus(); // this depends on the Custom RTE API\n * }\n * });\n */\n setCustomRte(obj: CustomRTE & ThisType) {\n this.RichTextEditor.customRte = obj;\n }\n\n /**\n * Replace the default CSS parser with a custom one.\n * The parser function receives a CSS string as a parameter and expects\n * an array of CSSRule objects as a result. If you need to remove the\n * custom parser, pass `null` as the argument\n * @param {Function|null} parser Parser function\n * @return {this}\n * @example\n * editor.setCustomParserCss(css => {\n * const result = [];\n * // ... parse the CSS string\n * result.push({\n * selectors: '.someclass, div .otherclass',\n * style: { color: 'red' }\n * })\n * // ...\n * return result;\n * });\n */\n setCustomParserCss(parser: CustomParserCss) {\n this.Parser.getConfig().parserCss = parser;\n return this;\n }\n\n /**\n * Change the global drag mode of components.\n * To get more about this feature read: https://github.com/GrapesJS/grapesjs/issues/1936\n * @param {String} value Drag mode, options: 'absolute' | 'translate'\n * @returns {this}\n */\n setDragMode(value: DragMode) {\n this.em.setDragMode(value);\n return this;\n }\n\n /**\n * Trigger event log message\n * @param {*} msg Message to log\n * @param {Object} [opts={}] Custom options\n * @param {String} [opts.ns=''] Namespace of the log (eg. to use in plugins)\n * @param {String} [opts.level='debug'] Level of the log, `debug`, `info`, `warning`, `error`\n * @return {this}\n * @example\n * editor.log('Something done!', { ns: 'from-plugin-x', level: 'info' });\n * // This will trigger following events\n * // `log`, `log:info`, `log-from-plugin-x`, `log-from-plugin-x:info`\n * // Callbacks of those events will always receive the message and\n * // options, as arguments, eg:\n * // editor.on('log:info', (msg, opts) => console.info(msg, opts))\n */\n log(msg: string, opts: { ns?: string; level?: string } = {}) {\n this.em.log(msg, opts);\n return this;\n }\n\n /**\n * Translate label\n * @param {String} key Label to translate\n * @param {Object} [opts] Options for the translation\n * @param {Object} [opts.params] Params for the translation\n * @param {Boolean} [opts.noWarn] Avoid warnings in case of missing resources\n * @returns {String}\n * @example\n * editor.t('msg');\n * // use params\n * editor.t('msg2', { params: { test: 'hello' } });\n * // custom local\n * editor.t('msg2', { params: { test: 'hello' } l: 'it' });\n */\n t(...args: any[]) {\n return this.em.t(...args);\n }\n\n /**\n * Attach event\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n on(event: EditorEvent, callback: EventHandler) {\n this.em.on(event, callback);\n return this;\n }\n\n /**\n * Attach event and detach it after the first run\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n once(event: EditorEvent, callback: EventHandler) {\n this.em.once(event, callback);\n return this;\n }\n\n /**\n * Detach event\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n off(event: EditorEvent, callback: EventHandler) {\n this.em.off(event, callback);\n return this;\n }\n\n /**\n * Trigger event\n * @param {string} event Event to trigger\n * @return {this}\n */\n trigger(event: EditorEvent, ...args: any[]) {\n this.em.trigger.apply(this.em, [event, ...args]);\n return this;\n }\n\n /**\n * Destroy the editor\n */\n destroy() {\n if (!this.em) return;\n this.em.destroyAll();\n this.editorView = undefined;\n }\n\n /**\n * Returns editor element\n * @return {HTMLElement}\n * @private\n */\n getEl() {\n return this.editorView?.el;\n }\n\n /**\n * Returns editor model\n * @return {Model}\n * @private\n */\n getModel() {\n return this.em;\n }\n\n /**\n * Render editor\n * @return {HTMLElement}\n */\n render() {\n this.editorView?.remove();\n this.editorView = new EditorView(this.em);\n return this.editorView.render().el;\n }\n\n /**\n * Trigger a callback once the editor is loaded and rendered.\n * The callback will be executed immediately if the method is called on the already rendered editor.\n * @param {Function} clb Callback to trigger\n * @example\n * editor.onReady(() => {\n * // perform actions\n * });\n */\n onReady(clb: EventHandler) {\n this.em.get('ready') ? clb(this) : this.em.on('load', clb);\n }\n\n /**\n * Print safe HTML by using ES6 tagged template strings.\n * @param {Array} literals\n * @param {Array} substs\n * @returns {String}\n * @example\n * const unsafeStr = '';\n * const safeStr = 'Hello';\n * // Use `$${var}` to avoid escaping\n * const strHtml = editor.html`Escaped ${unsafeStr} unescaped $${safeStr}`;\n */\n html = html;\n}\n","import { isString } from 'underscore';\nimport Editor from '../editor';\nimport { getGlobal } from '../utils/mixins';\n\ntype PluginOptions = Record;\n\nexport type Plugin = (editor: Editor, config: T) => void;\n\nconst getPluginById = (pluginId: string, plugins: PluginManager) => {\n let result = plugins.get(pluginId);\n\n // Try to search in global context\n if (!result) {\n const wplg = (getGlobal() as any)[pluginId];\n result = wplg?.default || wplg;\n }\n\n return result;\n};\n\nexport const getPlugin = (plugin: string | Plugin, plugins: PluginManager) => {\n return isString(plugin)\n ? getPluginById(plugin, plugins)\n : (plugin as unknown as { default: Plugin })?.default || plugin;\n};\n\nexport const logPluginWarn = (editor: Editor, plugin: string) => {\n editor.getModel().logWarning(`Plugin ${plugin} not found`, {\n context: 'plugins',\n plugin,\n });\n};\n\nexport default class PluginManager {\n plugins: Record = {};\n\n /**\n * Add new plugin. Plugins could not be overwritten\n * @param {string} id Plugin ID\n * @param {Function} plugin Function which contains all plugin logic\n * @return {Function} The plugin function\n * @deprecated Don't use named plugins, create plugins as simple functions. More about [Plugins](https://grapesjs.com/docs/modules/Plugins.html)\n * @example\n * PluginManager.add('some-plugin', function(editor) {\n * editor.Commands.add('new-command', {\n * run: function(editor, senderBtn){\n * console.log('Executed new-command');\n * }\n * })\n * });\n */\n add(id: string, plugin: Plugin) {\n const plg = this.get(id);\n\n if (plg) {\n return plg;\n }\n\n // @ts-ignore\n this.plugins[id] = plugin;\n\n return plugin;\n }\n\n /**\n * Returns plugin by ID\n * @param {string} id Plugin ID\n * @return {Function|undefined} Plugin\n * @example\n * var plugin = PluginManager.get('some-plugin');\n * plugin(editor);\n */\n get(id: string): Plugin | undefined {\n return this.plugins[id];\n }\n\n /**\n * Returns object with all plugins\n */\n getAll() {\n return this.plugins;\n }\n}\n","/**\n * File made for IE/Edge support\n * https://github.com/GrapesJS/grapesjs/issues/214\n */\nimport { hasWin } from './mixins';\n\nexport default () => {\n /**\n * Check if IE/Edge\n * @return {Boolean}\n */\n const isIE = () => {\n let match;\n const agent = window.navigator.userAgent;\n const rules: [string, RegExp][] = [\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/],\n ];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n match = rule[1].exec(agent);\n if (match) break;\n }\n\n return !!match;\n };\n\n if (hasWin() && isIE()) {\n const originalCreateHTMLDocument = DOMImplementation.prototype.createHTMLDocument;\n DOMImplementation.prototype.createHTMLDocument = title => {\n if (!title) title = '';\n return originalCreateHTMLDocument.apply(document.implementation, [title]);\n };\n }\n};\n","import { isElement } from 'underscore';\nimport Editor from './editor';\nimport { EditorConfig } from './editor/config/config';\nimport PluginManager, { Plugin, getPlugin, logPluginWarn } from './plugin_manager';\nimport $ from './utils/cash-dom';\nimport polyfills from './utils/polyfills';\n\ninterface InitEditorConfig extends EditorConfig {\n grapesjs?: typeof grapesjs;\n}\n\npolyfills();\n\nconst plugins = new PluginManager();\nconst editors: Editor[] = [];\n\nexport const usePlugin =

| string>(plugin: P, opts?: P extends Plugin ? C : {}) => {\n let pluginResult = getPlugin(plugin, plugins);\n\n return (editor: Editor) => {\n if (pluginResult) {\n pluginResult(editor, opts || {});\n } else {\n logPluginWarn(editor, plugin as string);\n }\n };\n};\n\nexport const grapesjs = {\n $,\n\n editors,\n\n plugins,\n\n usePlugin,\n\n // @ts-ignore Will be replaced on build\n version: __GJS_VERSION__,\n\n /**\n * Initialize the editor with passed options\n * @param {Object} config Configuration object\n * @param {string|HTMLElement} config.container Selector which indicates where render the editor\n * @param {Boolean} [config.autorender=true] If true, auto-render the content\n * @param {Array} [config.plugins=[]] Array of plugins to execute on start\n * @param {Object} [config.pluginsOpts={}] Custom options for plugins\n * @param {Boolean} [config.headless=false] Init headless editor\n * @return {Editor} Editor instance\n * @example\n * var editor = grapesjs.init({\n * container: '#myeditor',\n * components: '

Hello world
',\n * style: '.hello{color: red}',\n * })\n */\n init(config: EditorConfig = {}) {\n const { headless } = config;\n const els = config.container;\n if (!els && !headless) throw new Error(\"'container' is required\");\n const initConfig: InitEditorConfig = {\n autorender: true,\n plugins: [],\n pluginsOpts: {},\n ...config,\n grapesjs: this,\n el: headless ? undefined : isElement(els) ? els : (document.querySelector(els!) as HTMLElement),\n };\n const editor = new Editor(initConfig, { $ });\n const em = editor.getModel();\n\n // Load plugins\n initConfig.plugins!.forEach(pluginId => {\n const plugin = getPlugin(pluginId, plugins);\n const plgOptions = initConfig.pluginsOpts![pluginId as string] || {};\n\n if (plugin) {\n plugin(editor, plgOptions);\n } else {\n logPluginWarn(editor, pluginId as string);\n }\n });\n\n // Execute `onLoad` on modules once all plugins are initialized.\n // A plugin might have extended/added some custom type so this\n // is a good point to load stuff like components, css rules, etc.\n em.loadOnStart();\n initConfig.autorender && !headless && editor.render();\n editors.push(editor);\n\n return editor;\n },\n};\n\n/**\n * @deprecated Changed to CategoryProperties\n */\nexport type { CategoryProperties as BlockCategoryProperties } from './abstract/ModuleCategory';\n\n// Exports for TS\nexport type { default as Asset } from './asset_manager/model/Asset';\nexport type { default as Assets } from './asset_manager/model/Assets';\nexport type { default as Block } from './block_manager/model/Block';\nexport type { default as Blocks } from './block_manager/model/Blocks';\nexport type { default as Categories } from './abstract/ModuleCategories';\nexport type { default as Category } from './abstract/ModuleCategory';\nexport type { default as Canvas } from './canvas/model/Canvas';\nexport type { default as CanvasSpot } from './canvas/model/CanvasSpot';\nexport type { default as CanvasSpots } from './canvas/model/CanvasSpots';\nexport type { default as Frame } from './canvas/model/Frame';\nexport type { default as Frames } from './canvas/model/Frames';\nexport type { default as CssRule } from './css_composer/model/CssRule';\nexport type { default as CssRules } from './css_composer/model/CssRules';\nexport type { default as Device } from './device_manager/model/Device';\nexport type { default as Devices } from './device_manager/model/Devices';\nexport type { default as ComponentManager } from './dom_components';\nexport type { default as Component } from './dom_components/model/Component';\nexport type { default as Components } from './dom_components/model/Components';\nexport type { default as ComponentView } from './dom_components/view/ComponentView';\nexport type { default as Editor } from './editor';\nexport type { default as Modal } from './modal_dialog/model/Modal';\nexport type { default as Page } from './pages/model/Page';\nexport type { default as Pages } from './pages/model/Pages';\nexport type { default as Button } from './panels/model/Button';\nexport type { default as Buttons } from './panels/model/Buttons';\nexport type { default as Panel } from './panels/model/Panel';\nexport type { default as Panels } from './panels/model/Panels';\nexport type { default as Selector } from './selector_manager/model/Selector';\nexport type { default as Selectors } from './selector_manager/model/Selectors';\nexport type { default as State } from './selector_manager/model/State';\nexport type { default as Properties } from './style_manager/model/Properties';\nexport type { default as Property } from './style_manager/model/Property';\nexport type { default as PropertyRadio } from './style_manager/model/PropertyRadio';\nexport type { default as PropertySelect } from './style_manager/model/PropertySelect';\nexport type { default as PropertyNumber } from './style_manager/model/PropertyNumber';\nexport type { default as PropertySlider } from './style_manager/model/PropertySlider';\nexport type { default as PropertyComposite } from './style_manager/model/PropertyComposite';\nexport type { default as PropertyStack } from './style_manager/model/PropertyStack';\nexport type { default as Sector } from './style_manager/model/Sector';\nexport type { default as Sectors } from './style_manager/model/Sectors';\nexport type { default as Trait } from './trait_manager/model/Trait';\nexport type { default as Traits } from './trait_manager/model/Traits';\n\nexport default grapesjs;\n"],"names":["root","factory","exports","module","define","amd","globalThis","window","this","_","Backbone","core_slice","Array","prototype","slice","apply","fn","ctx","args","length","call","arr","index","hasKeys","obj","keys","isArray","arguments","all","key","getMagicFusionIndex","callstackWasIndexed","magicFusionIndex","indexCycle","defer","ObjectRegistry","registeredObjects","cidIndexes","onoff","which","objects","i","l","objectRegistry","register","unregister","isFunction","actionUndoRedo","action","type","undoTypes","object","before","after","options","managerUndoRedo","manager","stack","magic","everything","isCurrentlyUndoRedoing","pointer","actions","isUndo","clone","models","at","where","get","pop","shift","trigger","validateUndoActionCreation","undoTypesType","condition","addToStack","track","res","diff","add","maximumStackLength","isRegistered","cid","contains","push","splice","indexOf","map","concat","UndoTypes","collection","ignore","model","remove","undefined","isEmpty","each","unset","set","unsetData","afterAttributes","changedAttributes","keysAfter","previousAttributes","pick","keysPrevious","val","reset","previousModels","OwnedUndoTypes","manipulateUndoType","manipType","undoType","fns","undoTypesInstance","isObject","extend","Action","Model","defaults","undo","attributes","redo","UndoStack","Collection","Infinity","setMaxLength","UndoManager","initialize","attr","on","value","startTracking","isArguments","stopTracking","isTracking","_addToStack","unregisterAll","undoAll","redoAll","isAvailable","s","merge","undoManager","addUndoType","changeUndoType","removeUndoType","clear","defaultAttributes","self","g","global","$","previousBackbone","VERSION","noConflict","emulateHTTP","emulateJSON","_listening","Events","eventSplitter","eventsApi","iteratee","events","name","callback","opts","names","context","test","split","_events","onApi","listening","_listeners","id","interop","listenTo","_listenId","uniqueId","listeningTo","_listeningTo","Listening","error","tryCatchOn","handlers","count","e","off","offApi","listeners","stopListening","ids","remaining","j","handler","_callback","cleanup","once","onceMap","bind","listenToOnce","offer","Math","max","triggerApi","objEvents","allEvents","triggerEvents","ev","a1","a2","a3","listener","unbind","attrs","preinitialize","cidPrefix","parse","result","changed","validationError","idAttribute","toJSON","sync","escape","has","matches","_validate","silent","changes","changing","_changing","_previousAttributes","current","prev","isEqual","prevId","_pending","hasChanged","old","previous","fetch","success","resp","serverAttrs","wrapError","save","wait","validate","method","isNew","patch","xhr","destroy","url","base","urlError","replace","encodeURIComponent","constructor","isValid","comparator","_reset","setOptions","addOptions","array","insert","min","tail","singular","removed","_removeModels","added","merged","_isModel","toAdd","toMerge","toRemove","modelMap","sort","sortable","sortAttr","isString","existing","_prepareModel","_addReference","orderChanged","some","m","_removeReference","unshift","_byId","modelId","first","findWhere","Error","sortBy","pluck","create","callbackOpts","values","CollectionIterator","ITERATOR_VALUES","ITERATOR_KEYS","entries","ITERATOR_KEYSVALUES","_onModelEvent","event","$$iterator","Symbol","iterator","kind","_collection","_kind","_index","next","done","View","viewOptions","_ensureElement","delegateEventSplitter","tagName","selector","$el","find","render","_removeElement","setElement","element","undelegateEvents","_setElement","delegateEvents","el","match","delegate","eventName","undelegate","_createElement","document","createElement","className","_setAttributes","addMethod","attribute","cb","defaultVal","addUnderscoreMethods","Class","methods","instance","modelMatcher","matcher","collectionMethods","forEach","collect","reduce","foldl","inject","reduceRight","foldr","detect","filter","select","reject","every","any","include","includes","invoke","toArray","size","head","take","initial","rest","drop","last","without","difference","shuffle","lastIndexOf","chain","sample","partition","groupBy","countBy","indexBy","findIndex","findLastIndex","modelMethods","pairs","invert","omit","config","Base","mixin","mappings","functions","memo","methodMap","params","dataType","data","contentType","JSON","stringify","_method","beforeSend","setRequestHeader","processData","textStatus","errorThrown","ajax","Router","routes","_bindRoutes","optionalParam","namedParam","splatParam","escapeRegExp","route","isRegExp","_routeToRegExp","router","history","fragment","_extractParameters","execute","navigate","optional","RegExp","exec","param","decodeURIComponent","History","checkUrl","location","routeStripper","rootStripper","pathStripper","started","interval","atRoot","pathname","getSearch","matchRoot","decodeFragment","decodeURI","href","getHash","getPath","path","charAt","getFragment","_usePushState","_wantsHashChange","start","hashChange","_hasHashChange","documentMode","_useHashChange","_wantsPushState","pushState","_hasPushState","rootPath","iframe","src","style","display","tabIndex","body","iWindow","insertBefore","firstChild","contentWindow","open","close","hash","addEventListener","attachEvent","_checkUrlInterval","setInterval","loadUrl","stop","removeEventListener","detachEvent","removeChild","clearInterval","decodedFragment","title","assign","_updateHash","protoProps","staticProps","child","parent","__super__","CodeMirror","extendMode","commentStart","commentEnd","newlineAfterToken","_type","content","textAfter","state","jsonMode","lexical","inlineElements","inline","configuration","defineExtension","isComment","from","to","cm","curMode","innerMode","getMode","getTokenAt","mode","operation","replaceRange","line","ch","setCursor","selText","getRange","startIndex","endIndex","substr","substring","cmInstance","indentLine","outer","text","copyState","tabSize","getOption","out","lines","atSol","newline","stream","StringStream","eol","inner","token","cur","pos","string","blankLine","end","setSelection","getCursor","mod","userAgent","navigator","platform","gecko","ie_upto10","ie_11up","edge","ie","ie_version","webkit","qtwebkit","chrome","chrome_version","presto","safari","vendor","mac_geMountainLion","phantom","ios","maxTouchPoints","android","mobile","mac","chromeOS","windows","presto_version","Number","flipCtrlCmd","captureRightClick","classTest","cls","range","rmClass","node","removeChildren","childNodes","removeChildrenAndAdd","appendChild","elt","tag","cssText","createTextNode","eltP","setAttribute","nodeType","parentNode","host","activeElt","doc","activeElement","shadowRoot","addClass","joinClasses","a","b","as","createRange","endNode","r","setEnd","setStart","createTextRange","moveToElementText","collapse","moveEnd","moveStart","selectInput","wrapper","ownerDocument","win","defaultView","f","copyObj","target","overwrite","prop","hasOwnProperty","countColumn","startValue","search","n","nextTab","selectionStart","selectionEnd","_e","Delayed","time","onTimeout","Date","setTimeout","ms","clearTimeout","scrollerGap","Pass","toString","sel_dontScroll","scroll","sel_mouse","origin","sel_move","findColumn","goal","col","skipped","spaceStrs","spaceStr","lst","insertSorted","score","priority","nothing","createObj","props","inst","Object","nonASCIISingleCaseWordChar","isWordCharBasic","toUpperCase","toLowerCase","isWordChar","helper","source","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","str","dir","findFirst","pred","midF","mid","ceil","floor","iterateBidiSections","order","found","part","level","bidiOther","getBidiPartAt","sticky","bidiOrdering","lowTypes","arabicTypes","charType","code","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","direction","outerType","len","types","i$1","i$2","type$1","i$3","prev$1","type$2","i$4","type$3","i$5","cur$1","type$4","i$6","end$1","replace$1","j$1","i$7","isRTL","j$2","nstart","reverse","getOrder","noHandlers","emitter","_handlers","getHandlers","signal","signalDOMEvent","override","preventDefault","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","button","ctrlKey","zwspSupported","badBidiRects","dragAndDrop","div","zeroWidthElement","measure","offsetHeight","offsetWidth","hasBadBidiRects","txt","r0","getBoundingClientRect","r1","left","right","splitLinesAuto","nl","rt","hasSelection","getSelection","te","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","hasBadZoomedRects","normal","fromRange","abs","modes","mimeModes","defineMode","dependencies","defineMIME","mime","spec","resolveMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","properties","nstate","info","startState","lineOracle","lastColumnPos","lastColumnValue","lineStart","getLine","chunk","children","sz","chunkSize","getBetween","iter","getLines","updateLineHeight","height","lineNo","no","lineAtHeight","h","lh","isLine","lineNumberFor","String","lineNumberFormatter","firstLineNumber","Pos","cmp","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","clipPos","clipToLen","linelen","clipPosArray","sol","peek","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","hideFirstChars","lookAhead","oracle","baseToken","SavedContext","Context","maxLookAhead","baseTokens","baseTokenPos","highlightLine","forceToEnd","st","modeGen","lineClasses","runMode","loop","o","overlay","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","styleClasses","highlightFrontier","modeFrontier","precise","findStartLine","saved","fromSaved","processLine","viewFrom","viewTo","nextLine","startAt","callBlankLine","readToken","copy","Token","takeToken","asArray","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","minindent","minline","lim","indented","retreatFrontier","sawReadOnlySpans","sawCollapsedSpans","seeReadOnlySpans","seeCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","addMarkedSpan","op","inThisOp","WeakSet","markedSpans","attachLine","markedSpansBefore","startCh","isInsert","nw","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansAfter","endCh","startsBefore","stretchSpansOverChange","change","full","oldFirst","oldLast","sameLine","offset","span$1","clearEmptySpans","newMarkers","gapMarkers","gap","clearWhenEmpty","removeReadOnlyRanges","markers","mark","readOnly","parts","mk","p","newParts","dfrom","dto","detachMarkedSpans","detachLine","attachMarkedSpans","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","collapsedSpanAround","conflictingCollapsedRange","visualLine","visualLineEnd","visualLineContinued","visualLineNo","lineN","vis","visualLineEndNo","lastLine","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","found$1","findMaxLine","d","maxLine","maxLineLength","maxLineChanged","Line","estimateHeight","updateLine","estHeight","cleanUpLine","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","cache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","addToken","buildToken","buildTokenBadBidi","insertLineContent","externalMeasured","maps","caches","lastChild","querySelector","defaultSpecialCharPlaceholder","startStyle","endStyle","css","displayText","special","specialChars","mustWrap","createDocumentFragment","lastIndex","txt$1","tabWidth","specialCharPlaceholder","fullStyle","trailingBefore","spaceBefore","buildCollapsedSpan","ignoreWidget","widget","input","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","foundBookmarks","endStyles","upto","tokenText","LineView","hidden","buildViewArray","nextPos","view","operationGroup","pushOperation","ops","ownsGroup","delayedCallbacks","fireCallbacksForOps","group","callbacks","cursorActivityCalled","finishOperation","endCb","orphanDelayedCallbacks","signalLater","list","fireOrphanDelayed","delayed","updateLineForChanges","dims","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","zIndex","updateLineBackground","background","wrap","getLineContent","ext","built","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutterSpecs","gutterWidth","alignable","isWidget","nextSibling","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","position","marginLeft","widgetHeight","parentStyle","gutters","clientWidth","eventInWidget","getAttribute","sizer","mover","paddingTop","lineSpace","offsetTop","paddingVert","paddingH","cachedPaddingH","getComputedStyle","currentStyle","parseInt","paddingRight","isNaN","scrollGap","nativeBarWidth","displayWidth","scroller","barWidth","displayHeight","clientHeight","barHeight","ensureLineHeights","rect","wrapping","lineWrapping","curWidth","heights","rects","getClientRects","bottom","top","mapFromLineView","updateExternalMeasurement","lineMeasure","measureChar","bias","measureCharPrepared","prepareMeasureForLine","findViewForLine","findViewIndex","getDimensions","forceUpdate","hasHeights","prepared","varHeight","measureCharInner","bogus","rtop","rbottom","measureText","nullRect","nodeAndOffsetInLineMap","mStart","mEnd","coverStart","coverEnd","getUsefulRect","place","maybeUpdateRectForZooming","rSpan","charWidth","rbot","bot","singleCursorHeightPerLine","screen","logicalXDPI","deviceXDPI","scaleX","scaleY","logicalYDPI","deviceYDPI","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","cachedCharWidth","cachedTextHeight","lineNumChars","pageScrollX","pageXOffset","documentElement","scrollLeft","pageScrollY","marginTop","pageYOffset","scrollTop","widgetTopHeight","intoCoordSystem","includeWidgets","yOff","viewOffset","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","getBidi","partPos","other","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","rangeEnd","wrappedLineExtent","begin","wrappedLineExtentChar","boxIsAfter","box","ltr","coordsBidiPartWrapped","coordsBidiPart","baseX","chAround","boxAround","atLeft","atStart","_lineNo","ref","closestDist","endX","dist","textHeight","anchor","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","posFromMouse","liberal","forRect","space","clientX","clientY","e$1","colDiff","round","regChange","lendiff","updateLineNumbers","viewChanged","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","adjustView","countDirtyView","dirty","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","customCursor","$customCursor","sel","ranges","primIndex","empty","drawSelectionCursor","showCursorWhenSelecting","drawSelectionRange","cursor","cursorHeight","getWrapperElement","charPos","defaultCharWidth","otherCursor","cmpCoords","padding","leftSide","rightSide","sizerWidth","docLTR","drawForLine","fromArg","toArg","lineLen","wrapX","side","extent","fromPos","toPos","openStart","openEnd","openRight","topLeft","topRight","botLeft","botRight","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","blinker","cursorDiv","visibility","cursorBlinkRate","hasFocus","onBlur","ensureFocus","focus","onFocus","delayBlurEvent","delayingBlurEvent","draggingText","selForContextMenu","receivedFocus","updateHeightsInViewport","prevBottom","lineDiv","viewTop","oldHeight","mustScroll","updateWidgetHeight","chWidth","w","visibleLines","viewport","ensure","ensureFrom","ensureTo","maybeScrollWindow","doScroll","innerHeight","scrollNode","scrollIntoView","scrollPosIntoView","margin","limit","endCoords","scrollPos","calculateScrollPos","startTop","startLeft","updateScrollTop","setScrollLeft","snapMargin","screentop","docBottom","atTop","atBottom","newTop","gutterSpace","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","scrollToPos","cursorScrollMargin","scrollToCoords","scrollToRange","scrollToCoordsRange","sPos","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","isScroller","scrollWidth","alignHorizontally","measureForScrollbars","gutterW","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","checkedZeroWidth","minHeight","minWidth","update","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","bar","delay","maybeDisable","elementFromPoint","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","heightForcer","borderBottom","scrollbarFiller","coverGutterNextToScrollbar","gutterFiller","scrollbarModel","initScrollbars","scrollbarStyle","axis","nextOpId","startOperation","updateInput","typing","changeObjs","selectionChanged","updateMaxLine","markArrays","endOperation","endOperations","endOperation_R1","endOperation_W1","endOperation_R2","endOperation_W2","endOperation_finish","maybeClipScrollbars","mustUpdate","DisplayUpdate","updatedDisplay","updateDisplayIfNeeded","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","setDocumentHeight","postUpdateDisplay","wheelStartX","wheelStartY","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","methodOp","docMethodOp","highlight","highlightWorker","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","force","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","scrollbarsClipped","marginBottom","borderRightWidth","selectionSnapshot","active","anchorNode","anchorOffset","focusNode","focusOffset","restoreSelection","snapshot","nodeName","removeAllRanges","addRange","renderedView","maybeUpdateLineNumberWidth","viewportMargin","different","lastWrapHeight","lastWrapWidth","toUpdate","selSnapshot","patchDisplay","selectionDiv","reportedViewFrom","reportedViewTo","updateNumbersFrom","container","rm","currentWheelTarget","updateNumber","updateGutterSpace","alignWidgets","comp","align","innerW","lineGutter","lineNumInnerWidth","lineNumWidth","getGutters","sawLineNumbers","renderGutters","specs","gElt","updateGutters","Display","clipPath","draggable","wheelDX","wheelDY","activeTouch","init","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","onScrollWheel","chromeScrollHack","pointerEvents","pixelsPerUnit","deltaMode","deltaX","deltaY","canScrollX","canScrollY","pixels","movedX","movedY","Selection","equals","here","there","deepCopy","Range","somethingSelected","normalizeSelection","mayTouch","selectionsMayTouch","prim","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","computeReplacedSel","hint","oldPrev","newPrev","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","spansFor","linesFor","firstLine","lastText","lastSpans","nlines","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","directionChanged","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","lastChangeEvent","hist","addChangeToHistory","selAfter","opId","historyEventDelay","pushSelectionToHistory","selectionEventCanBeMerged","addSelectionToHistory","clearRedo","dest","removeClearedSpans","explicitlyCleared","getOldSpans","mergeOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","newChanges","extendRange","posBefore","extendSelection","extendSelections","heads","replaceOneSelection","setSimpleSelection","filterSelectionChange","setSelectionReplaceHistory","setSelectionNoUndo","NaN","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","preventCursorLeft","selectLeft","preventCursorRight","selectRight","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","suppress","antiChanges","returned","v","shiftDoc","distance","makeChangeSingleDocInEditor","recomputeMaxLength","checkWidthStart","changesHandler","changeHandler","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","ok","copied","changeLine","handle","changeType","LeafChunk","BranchChunk","removeInner","insertInner","iterN","leaf","maybeSpill","me","sibling","myIndex","used","LineWidget","opt","adjustScrollWhenAboveVisible","addLineWidget","insertAt","aboveVisible","this$1","oldH","nextMarkerId","TextMarker","markText","markTextShared","replacedWith","addToHistory","curLine","clearOnEnter","clearHistory","withOp","visual","dHeight","SharedTextMarker","cloneNode","isParent","findSharedMarkers","findMarks","copySharedMarkers","mFrom","mTo","subMark","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","getValue","join","lineSeparator","setValue","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","listSelections","extendSelectionsBy","setSelections","addSelection","getSelections","replaceSelection","dup","replaceSelections","newSel","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","removeLineClass","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","unlinkDoc","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","markAsReadAndPasteIfAllFilesAreRead","t","readTextFromFile","file","allowDropFileTypes","reader","onerror","onload","readAsText","text$1","getData","selected","onDragStart","setData","effectAllowed","setDragImage","img","_top","onDragOver","frag","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","editors","globalsRegistered","ensureGlobalHandlers","registerGlobalHandlers","resizeTimer","onResize","setSize","keyNames","fromCharCode","keyMap","normalizeKeyName","alt","ctrl","cmd","normalizeKeyMap","keymap","keyname","lookupKey","getKeyMap","fallthrough","isModifierKey","keyCode","addModifierNames","noShift","altKey","metaKey","shiftKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","moveCharLogically","moveLogically","endOfLine","visually","prep","targetTop","moveVisually","bidi","mv","getWrappedLineExtent","moveInStorageOrder","searchInVisualLine","getRes","nextCh","basic","pcDefault","emacsy","macDefault","commands","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","rightPos","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","lineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","lookupKeyForEditor","keyMaps","extraKeys","stopSeq","dispatchKey","seq","keySeq","dispatchKeyInner","handleKeyBinding","motion","handleCharBinding","lastStoppedKey","onKeyDown","getField","handled","showCrossHair","up","onKeyUp","onKeyPress","charCode","lastClick","lastDoubleClick","DOUBLECLICK_DELAY","PastClick","clickRepeat","now","compare","onMouseDown","supportsTouch","clickInGutter","repeat","selectingText","handleMappedButton","leftButtonDown","onContextMenu","configureMouse","option","unit","addNew","moveOnDrag","contained","behavior","dragDrop","leftButtonStartDrag","leftButtonSelect","moved","dragEnd","mouseMove","dragStart","preventScroll","e2","rangeForUnit","findWordAt","doc$1","ourRange","ourIndex","startSel","lastPos","extendTo","startCol","posCol","leftPos","oldRange","ranges$1","bidiSimplify","editorSize","counter","curCount","move","buttons","anchorLine","boundary","headIndex","usePart","gutterEvent","prevent","mX","mY","touches","lineBox","contextMenuInGutter","themeChanged","theme","Init","optionHandlers","defineOptions","deflt","notOnInit","defineOption","newBreaks","refresh","getInputField","spellcheck","autocorrect","autocapitalize","detach","attach","wrappingChanged","integer","blur","readOnlyChanged","screenReaderLabelChanged","dragDropChanged","resetPosition","funcs","dragFunctions","toggle","enter","over","leave","inputStyles","inputStyle","pasteIncoming","cutIncoming","autofocus","registerEventHandlers","finishInit","initHooks","textRendering","word","touchFinished","prevTouch","finishTouch","isMouseLikeTouchEvent","touch","radiusX","radiusY","farAway","pageX","pageY","inp","how","aggressive","indent","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","defineInitHook","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","recent","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","field","hiddenTextarea","border","addEditorMethods","helpers","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","modeSpec","removeOverlay","newRanges","getLineTokens","getTokenTypeAt","getHelper","getHelpers","help","_global","getStateAfter","defaultTextHeight","getViewport","addWidget","vspace","hspace","triggerOnKeyDown","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","findPosH","amount","hitSide","rtlMoveVisually","findPosV","goalColumn","goals","headPos","startChar","check","scrollTo","getScrollInfo","interpret","swapDoc","phrase","phraseText","phrases","getScrollerElement","getGutterElement","registerHelper","registerGlobalHelper","predicate","origDir","lineDir","findNextLine","moveOnce","boundToLine","astral","sawType","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","posToDOM","isInGutter","scan","badPos","bad","domTextBetween","closing","extraLinebreak","recognizeMarker","addText","walk","cmText","markerID","isBlock","textContent","nodeValue","domToPos","lineNode","locateNodeInLineView","textNode","topNode","curNode","previousSibling","dist$1","belongsToInput","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","contentEditable","updateFromDOM","readFromDOMSoon","forceCompositionEnd","label","removeAttribute","showMultipleSelections","curAnchor","curFocus","rng","rangeCount","getRangeAt","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","poll","pollSelection","pollInterval","pollContent","fromIndex","fromNode","toNode","toIndex","newText","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","TextareaInput","prevInput","pollingFast","resetting","fromTextArea","textarea","tabindex","placeholder","realSubmit","form","leaveSubmitMethodAlone","submit","wrappedSubmit","getTextArea","toTextArea","addLegacyProps","cmpPos","createField","prepareCopyCut","fastPoll","dispatchEvent","Event","_display","moveInputWithCursor","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldScrollY","oldCSS","oldWrapperCSS","wrapperBox","offsetParent","scrollY","rehide","detectingSelectAll","prepareSelectAllHack","mouseup","extval","disabled","dontDelegate","func","defineDocExtension","version","keySet","parserConfig","propertyKeywords","tokenHooks","documentTypes","mediaTypes","mediaFeatures","mediaValueKeywords","nonStandardPropertyKeywords","fontProperties","counterDescriptors","colorKeywords","valueKeywords","allowNested","lineComment","supportsAtComponent","highlightNonStandardPropertyKeywords","ret","tp","tokenBase","tokenize","tokenString","tokenParenthesized","quote","escaped","pushContext","popContext","pass","states","popAndPass","wordAsValue","stateArg","_stream","atBlock","cx","blockCommentStart","blockCommentEnd","blockCommentContinue","fold","documentTypes_","mediaTypes_","mediaFeatures_","mediaValueKeywords_","propertyKeywords_","nonStandardPropertyKeywords_","colorKeywords_","valueKeywords_","allWords","tokenCComment","maybeEnd","defaultTags","script","maybeBackup","pat","attrRegexpCache","getAttrRegexp","regexp","getAttrValue","getTagRegexp","anchored","addTags","findMatchingMode","tagInfo","tagText","htmlMode","multilineTagIndentFactor","multilineTagIndentPastTag","allowMissingTagName","tags","configTags","configScript","scriptTypes","html","htmlState","inTag","endTagA","endTag","localState","localMode","local","statementIndent","jsonldMode","jsonld","json","trackScope","isTS","typescript","wordRE","wordCharacters","keywords","kw","A","B","C","D","operator","atom","isOperatorChar","isJsonldKeyword","readRegexp","inSet","cont","tokenComment","expressionAllowed","tokenQuasi","lastType","propertyIsEnumerable","brackets","findFatArrow","fatArrowAt","arrow","depth","sawSomething","bracket","atomicTypes","JSLexical","inScope","varname","localVars","vars","parseJS","cc","marked","expression","statement","lex","inList","block","newContext","registerVarScoped","Var","globalVars","isModifier","defaultVars","pushcontext","pushblockcontext","popcontext","pushlex","poplex","expect","wanted","exp","vardef","parenExpr","maybeexpression","maybeelse","functiondef","forspec","enumdef","typename","typeexpr","maybelabel","maybeCatchBinding","afterExport","afterImport","funarg","expressionInner","expressionNoComma","noComma","arrowBodyNoComma","arrowBody","commasep","maybeop","maybeoperatorNoComma","maybeoperatorComma","classExpression","arrayLiteral","contCommasep","objprop","quasi","maybeTarget","expr","property","continueQuasi","targetNoComma","maybeTypeArgs","getterSetter","afterprop","maybetype","what","sep","proceed","maybetypeOrIn","mayberettype","isKW","afterType","typeprops","typearg","maybeReturnType","quasiType","typeprop","functiondecl","continueQuasiType","typeparam","maybeTypeDefault","maybeAssign","vardefCont","eltpattern","proppattern","forspec1","forspec2","classNameAfter","classBody","classfield","maybeFrom","exportField","importSpec","maybeMoreImports","maybeAs","enummember","isContinuedStatement","basecolumn","firstChar","c","doubleIndentSwitch","closeBrackets","skipExpression","htmlConfig","autoSelfClosers","implicitlyClosed","contextGrabbers","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","editorConf","config_","setStyle","inText","parser","inBlock","doctype","baseState","tagStart","inAttribute","stringStartCol","closure","isInAttribute","terminator","lower","startOfLine","noIndent","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","attrState","matchClosing","closeState","closeStateErr","attrEqState","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","alignCDATA","tagAfter","grabbers","skipAttribute","xmlCurrentTag","xmlCurrentContext","_module","em","CanvasSpotBuiltInTypes","getView","componentView","getBoxRect","cvView","Canvas","getCanvasView","boxRect","getElBoxRect","getStyle","translate","isType","CommandsEvents","run","ed","Components","Css","bindAll","editor","canvasModel","canvas","toggleMove","disableDragger","stopCommand","enableDragger","toggleDragger","enable","dragger","methodCls","getCanvas","classList","ppfx","getPosition","setPosition","onStart","onDrag","onEnd","methodEv","methodsEv","defineCommand","def","pfx","stylePrefix","pStylePrefix","hoverClass","badgeClass","plhClass","freezClass","onFrameScroll","getElement","getCanvasBody","getBody","getCanvasTools","getToolsEl","callRun","runBeforeCommand","_runCommand","abort","_abort","sender","runCommand","_run","callStop","stopBeforeCommand","_stopCommand","_stop","Commands","components","component","getSelectedAll","Boolean","logWarning","selectRemove","evName","getEl","guidesStatic","guidesTarget","setupGuides","getModel","isTran","guidesContainer","getGuidesContainer","getGuidesTarget","getGuidesStatic","drg","toggleDrag","getEventOpts","guides","item","guide","guidesEl","getConfig","elInfoX","elInfoY","guideContent","innerHTML","getGlobalToolsEl","elGuideInfoX","elGuideInfoY","elGuideInfoContentX","elGuideInfoContentY","debounce","updateGuides","debug","renderGuide","getElementGuides","lastEl","getElementPos","getGuidePosUpdate","originRect","un","guideSize","numEl","noScroll","getTranslate","transform","itemStr","trim","parseFloat","setTranslate","__p","styleUp","addStyle","avoidStore","Styles","__emitCmpStyleUpdate","getSelected","_getDragData","center","relPos","parentRel","pStyle","getMouseRelativeCanvas","offsetP","guidesInfo","renderGuideInfo","hideGuidesInfo","rectOrigin","isUndefined","isY","origEdge1","origEdge1Raw","origEdge2","origEdge2Raw","elGuideInfo","elGuideInfoCnt","guideInfoStyle","stat","statEdge2","isEdge1","statEdge1","statEdge1Raw","statEdge2Raw","posFirst","posSecond","pos2","sizeRaw","matched","toSelect","coll","snd","incr","getChildAt","wrappers","Pages","getAllWrappers","flatten","wrp","findType","rules","CssComposer","getAll","rule","md","modal","Modal","CodeManager","oHtmlEd","buildEditor","oCsslEd","htmlEditor","cssEditor","class","textViewCode","setContent","getHtml","optsHtml","getCss","optsCss","codeName","createViewer","EditorView","isEnabled","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","disable","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","fsChanged","targetEl","isElement","getContainer","noSelClass","getBadgeEl","getHighlighterEl","wp","$wrapper","initSorter","toggleClipboard","drag","cacheEl","startSelectPosition","frameEl","contentDocument","sorter","onEndMove","stopSelectComponent","getContentWindow","rollback","initSorterFromModel","onEndMoveFromModel","initSorterFromModels","lastModel","frameView","getCurrentFrame","toMove","onMoveClb","onSelect","endMove","$badge","getBadge","$hl","getHighlighter","removeClass","am","custom","__customData","onceClose","AssetManager","accept","modalTitle","setTarget","onClick","onDblClick","__behaviour","rendered","__trgCustom","assets","uploadEl","bm","appendTo","firstRender","pn","Panels","getPanel","addPanel","Blocks","lm","LayerManager","lmConfig","layers","panels","$cnt","DeviceManager","SelectorManager","StyleManager","trgEvCnt","$cntInner","$cntSlm","$cntSm","append","showDevices","devicePanel","dvEl","slmConfig","sm","smConfig","$header","pnCnt","toggleSm","show","hide","panelC","Config","tm","TraitManager","confTm","$cn","$cn2","toggleTm","clp","lastSelected","addOpts","doAdd","pageBody","getMainComponent","emitUpdate","pasteable","cop","canMove","cmdOutline","getPanels","preventDrag","tglEffects","mthEv","tlb","getToolbarEl","elP","querySelectorAll","shouldRunSwVisibility","isActive","stopDefault","editorEl","onclick","panel","canvasS","runDefault","canvasView","getResizerEl","prefix","posFetcher","mousePosFetcher","getMouseRelativePos","canvasResizer","forceNew","Utils","Resizer","command","Toolbar","mousedown","handleClick","getFrameEl","Editor","onRender","DomainViews","ToolbarView","itemView","showOffsets","activeResizer","frameOff","canvasOff","adjScroll","startSelectComponent","toggleSelectComponent","listenToEl","onFrameUpdated","onContainerChange","onHovered","updateGlobalPos","_upToolbar","updateAttached","getFrames","frame","getWindow","onHover","onOut","onFrameResize","getComponentView","parentEl","getComponentModel","currentDoc","setHovered","useValid","setCurrentFrame","updateLocalPos","views","getViewEl","elHovered","updateToolsLocal","toggleToolsEl","currentFrame","elSelected","updateToolsGlobal","initResize","getElSelected","getElHovered","showElementOffset","elPos","hideElementOffset","showFixedElementOffset","hideFixedElementOffset","hideHighlighter","opacity","isEditing","isChildOf","updateBadge","badge","bStyle","posOnly","icon","getIcon","clsBadge","customeLabel","customBadgeLabel","badgeLabel","getName","getTargetToElementFixed","leftOff","showHighlighter","elem","resizable","spotTypeResize","CanvasSpot","Resize","hasCustomResize","hasCustomSpot","removeSpots","addSpot","onMove","updateTarget","resizableOpts","docs","resizer","keyHeight","keyWidth","currentUnit","keepAutoHeight","keepAutoWidth","getModelToStyle","toggleFramesEvents","computedStyle","modelStyle","currentWidth","autoWidth","currentHeight","autoHeight","startDim","unitHeight","getUnitFromValue","unitWidth","store","selectedHandler","onlyHeight","onlyWidth","bodyw","getDragMode","finalStyle","updateToolbar","toolbarEl","toolbarStyle","toolbar","showToolbar","noCustomSpotSelect","Select","toolbarView","updateToolbarPos","getCanvasPosition","updateTools","refreshSpots","isCompSelected","isHoverEn","isNewEl","lastHovered","badgeOpts","customHoverSpot","Hover","showOffsetsSelected","toolsEl","canvasRectOffset","topOff","_trgToolUp","targetToElem","canvasOffsetTop","canvasOffsetLeft","refreshCanvas","hideBadge","cleanPrevious","status","hasWin","preserveSelected","setSelected","trg","isPointed","utils","Sorter","placer","getPlacerEl","containerSel","itemSel","wmargin","nested","canvasRelative","scale","getZoomDecimal","startSort","getOffsetDim","stopSelectPosition","posTargetCollection","posIndex","posMethod","cDim","posIsLastEl","posTargetEl","outsideElem","posTargetModel","nearFloat","isLast","getOffsetMethod","zoom","Spacing","stateVar","offsetViewer","marginT","marginB","marginL","marginR","padT","padB","padL","padR","stateLow","marginName","paddingName","marginV","paddingV","paddingEls","fullMargName","fullPadName","marginLeftSt","marginRightSt","marginRight","marginTopSt","marginBottomSt","mtStyle","mbStyle","mlStyle","mrStyle","ptStyle","pbStyle","plStyle","prStyle","posLeft","widthEl","marginSideH","marginSideT","padTop","padBot","padSideH","padSideT","padRight","toggleVis","cv","mth","_onFramesChange","handleFrames","frames","loaded","_upFrame","__ol","isDef","CoordinatesTypes","DEFAULT_COORDS","autoAdd","itemsView","itemType","reuseView","addTo","items","itemViewNotFound","ns","warn","typeField","clearItems","onRemoveBefore","onRemove","xyArr","snapOffset","lastScroll","lastScrollDiff","startPointer","startPosition","globScrollDiff","currentPointer","getDocumentEl","getContainerEl","getWindowEl","keyHandle","handleScroll","actualScroll","scrollDiff","getPointerPos","getStartPosition","currentPos","glDiff","lockedAxis","detectAxisLock","moveDelta","co","deltaPre","snapGuides","newDelta","trgX","trgY","axs","trgPoint","statPoint","deltaPoint","trgGuide","isPointIn","trgValue","setGuideLock","lock","ofst","trgName","cancelled","xPos","yPos","parentWindow","getPos","getPointerPosition","pEv","relX","relY","absX","absY","_Array$prototype","idRe","classRe","htmlRe","tagRe","getElementsByTagName","Cash","__cash","eles","getElementById","parseHTML","ready","cash","eq","ele","camelCaseRe","camelCaseWhitespaceRe","camelCase","letter","removeProp","guid","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","isNumeric","isFinite","getCompareFunction","is","splitValuesRe","getSplitValues","unique","computeStyle","isVariable","getPropertyValue","computeStyleInt","hasClass","removeAttr","_value","toggleClass","isForce","cssVariableRe","isCSSVariable","prefixedProps","docEl","vendorsPrefixes","getPrefixedProp","propCC","propUC","prefixedProp","numericProps","animationIterationCount","columnCount","flexGrow","flexShrink","fontWeight","lineHeight","orphans","widows","getSuffixedValue","setProperty","dataNamespace","dataAttributeRe","getDataCache","dataset","getExtraSpace","xAxis","hasNamespaces","ns1","ns2","removeEventListeners","_ref","hasData","_this","removeData","boxSizing","includeMargins","eventsNamespace","eventsNamespacesSeparator","getEventsCache","parseEventName","removeEvent","namespaces","eventCache","_ref2","eventFullName","_this2","_parseEventName","_one","_this3","_parseEventName2","finalCallback","namespace","thisArg","addEvent","one","readyState","evt","_parseEventName3","createEvent","initEvent","selectOneRe","selectMultipleRe","selectedIndex","getValueSelectSingle","getValueSelectMultiple","queryEncodeSpaceRe","skippableRe","checkableRe","serialize","query","elements","checked","queryEncode","isMultiple","eleValue","containers","fragmentRe","singleTagRe","table","tr","td","thead","tbody","tfoot","initContainers","$1","insertContent","prepend","isStr","insertAdjacentHTML","insertElement","_this4","outerHTML","insertAfter","_this5","_this6","_this7","_this8","_this9","prependTo","replaceWith","_this10","$eles","replaceAll","docEle","clientTop","contents","nextElementSibling","not","closest","parents","previousElementSibling","siblings","KEY_TAG","KEY_ATTR","motionsEv","isDoc","Node","DOCUMENT_NODE","removeEl","inputs","attrUp","isVisible","oldEl","newEl","appendAtIndex","total","createEl","createText","createCustomEvent","oEvent","err","_parentEvent","keyCodeVal","defineProperty","appendVNodes","vNodes","vnode","isTextNode","TEXT_NODE","isTaggableNode","COMMENT_NODE","isCommentNode","getElRect","rectText","selectNode","getDocumentScroll","getKeyCode","getKeyChar","getPointerEvent","isEscKey","isEnterKey","hasModifierKey","hasCtrlKey","evs","els","isBultInMethod","normalizeKey","mls","Promise","getGlobal","elProt","Element","getUiClass","defCls","appendStyles","stls","link","prepand","shallowDiff","objOrig","objNew","keysNew","origValue","newValue","upFirst","normalizeFloat","step","valueDef","stepDecimals","toFixed","hasDnd","nativeDnD","escapeNodeContent","deepMerge","targValue","srcValue","__cashData","isEmptyObj","capitalize","isRule","toCSS","__gjsv","isComponent","toHTML","setViewEl","createId","chars","random","buildBase64UrlFromSvg","svg","base64Str","btoa","Buffer","webpackContext","req","webpackContextResolve","__webpack_require__","resolve","Function","ArrayProto","ObjProto","SymbolProto","supportsArrayBuffer","ArrayBuffer","supportsDataView","DataView","nativeIsArray","nativeKeys","nativeCreate","nativeIsView","isView","_isNaN","_isFinite","hasEnumBug","nonEnumerableProps","MAX_ARRAY_INDEX","pow","restArguments","isNull","isBoolean","tagTester","nodelist","Int8Array","hasStringTagBug","isIE11","Map","isDataView","getInt8","isArrayBuffer","buffer","isSymbol","isNumber","constant","createSizePropertyCheck","getSizeProperty","sizeProperty","shallowProperty","typedArrayPattern","collectNonEnumProps","emulatedSet","nonEnumIdx","proto","isMatch","_keys","_wrapped","toBufferView","bufferSource","Uint8Array","byteOffset","valueOf","tagDataView","aStack","bStack","deepEq","areArrays","aCtor","bCtor","allKeys","ie11fingerprint","weakMapMethods","forEachName","hasName","commonInit","mapTail","mapMethods","setMethods","createAssigner","keysFunc","baseCreate","Ctor","extendOwn","tap","interceptor","toPath","deepGet","defaultValue","identity","optimizeCb","argCount","accumulator","baseIteratee","mapObject","results","currentKey","noop","propertyOf","times","accum","getTime","createEscaper","escaper","testRegexp","replaceRegexp","templateSettings","evaluate","interpolate","noMatch","escapes","escapeChar","bareIdentifier","template","settings","oldSettings","argument","variable","fallback","idCounter","_chain","executeBound","sourceFunc","boundFunc","callingContext","partial","boundArgs","TypeError","callArgs","strict","idx","memoize","hasher","address","throttle","timeout","later","leading","throttled","_now","trailing","immediate","passed","debounced","_args","negate","compose","findKey","createPredicateIndexFinder","sortedIndex","low","high","createIndexFinder","predicateFind","createReduce","reducer","guard","contextPath","computed","lastComputed","reStrSymbol","rand","temp","criteria","keyInObj","compact","otherArrays","uniq","isSorted","seen","arrays","intersection","argsLength","unzip","chainResult","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","enumerable","toStringTag","literals","raw","acc","lit","subst","substs","fromElement","projectData","noticeOnUnload","forceClass","log","baseCss","protectedCss","canvasCss","defaultCommand","devicePreviewMode","mediaCondition","tagVarStart","tagVarEnd","keepEmptyTextNodes","jsInHtml","multipleSelection","avoidInlineStyle","avoidDefaults","clearStyles","cssIcons","icons","plus","caret","delete","arrowUp","chevron","eye","eyeOff","i18n","assetManager","layerManager","storageManager","richTextEditor","domComponents","codeManager","cssComposer","selectorManager","deviceManager","styleManager","blockManager","traitManager","keepUnusedStyles","customUI","getByComponent","getComponent","addComponent","hasComponent","Selectable","lastComponent","allComponents","removeComponent","moduleName","collections","_em","_name","cfgParent","cfg","_disable","_config","postLoad","__logWarn","__destroy","__appendTo","elTo","private","skipListen","__initListen","getProjectData","storageKey","loadProjectData","onResult","getAllMap","__catchAllEvent","entity","__remove","removeBefore","__onAllEvent","renderProps","_createId","ln","allMap","__listenAdd","__listenRemove","__listenUpdate","Module","scripts","autoscrollLimit","extHl","frameContent","frameStyle","notTextable","allowExternalDrop","default","devices","widthMedia","checkUnit","pr","getWidthMedia","Devices","updateSelect","startAdd","updateDevice","devEl","devicesEl","getDeviceModel","device","getOptions","evAll","evPfx","evSelect","evUpdate","evAdd","evRemove","evRemoveBefore","chnSel","deviceEvents","Device","_onSelect","deviceId","newDevice","getDevices","ItemManagerModule","PagesEvents","modelConstructor","newModel","keyAutoW","keyAutoH","getDimension","dim","viewDim","endsWith","domc","conf","allRules","idMap","modOpts","Wrapper","getType","newStyles","Parser","parseCss","checkId","changesCount","refFrame","_undo","_undoexc","initRefs","framesById","changesUp","temporary","noCount","getStyles","getHead","setHead","addHeadItem","getHeadByAttr","removeHeadByAttr","addLink","removeLink","addScript","removeScript","getPage","page","_emitUpdated","hasAutoHeight","infiniteCanvas","ModuleModel","fromUndo","loadedItems","itemsToLoad","onAdd","onReset","itemLoaded","listenToLoadItems","listenToLoad","onZoomChange","onCoordsChange","onPointerChange","_pageUpdated","rulers","pointerScreen","mainPage","_initPage","getMainFrame","getCurrentFrameModel","noUndo","getPointerCoords","World","onChange","refreshDbn","spot","__trgEvent","spotAdd","spotUpdate","spotRemove","CanvasEvents","viewCollection","renderView","important","getDeclaration","getBlockId","atRules","addToCollection","fragmentEl","renderStarted","atRule","getAtRule","atRuleEl","styleEl","appendData","clsName","mediaText","defaultBlockId","blockId","getMediaWidth","contRules","sortRules","isMobFirst","prs","rootEl","toggleEffects","handleDragEnter","handleDragOver","handleDrop","handleDragLeave","__customTglEff","frameElement","sortOpts","customTarget","startCustom","endCustom","endDrop","dragStop","updateCounter","dt","dragContentOrigin","dragContent","inAbsoluteMode","getWrapper","canvasOffset","getOffset","postLeft","posTop","handleDragEnd","cnt","setDropContent","getContentByData","dragging","lastMaxHeight","tools","frameWrapView","showGlobalTools","cvModel","getCanvasModel","updateHead","renderStyles","allowfullscreen","getCoords","frameRect","canvasRect","getCanvasOffset","vwDelta","getViewportDelta","zoomM","getZoomMultiplier","headEl","attrStr","stl","getJsContainer","jsContainer","elTools","_getTool","getOffsetViewerEl","getRect","getOffsetRect","scrollBottom","scrollRight","_toggleEffects","startAutoscroll","_toggleAutoscrollFx","requestAnimationFrame","autoscroll","lastClientY","actualTop","limitTop","limitBottom","nextTop","spots","updateClientY","stopAutoscroll","mt","renderScripts","evLoad","evOpts","appendScript","scriptEl","hasAttribute","HTMLScriptElement","frameLoadHead","renderBody","frameLoadBody","write","frameLoad","normalize","prevStyles","_isEditor","passive","droppable","_emitUpdate","classAnim","updateOffset","updateSize","frameLoaded","updatePos","setupDragger","dragX","dragY","Dragger","posOpts","startDrag","__clear","destroyed","updateDim","__handleSize","noChanges","onScroll","onscroll","currW","currH","newW","newH","newWidth","newHeight","observer","ResizeObserver","observe","sizeObserver","disconnect","twrp","toolsWrapper","elTop","elRight","elBottom","elLeft","frameWrapperView","clsUnscale","_initFrames","clearOff","checkSelected","updateFrames","_onFramesUpdate","toggleListeners","_renderFrames","currFrame","onWheel","onPointer","screenToWorld","docScroll","screenCoords","isInputFocused","isZooming","newZoom","setZoom","Screen","pointerX","pointerY","zoomDelta","setCoords","toolsWrpEl","defOpts","updateFramesArea","timerZoom","framesArea","cvStyle","mpl","zoomDc","fitViewport","elFrame","elRect","noHeight","ignoreHeight","gapIsNum","gapX","gapY","boxWidth","boxHeight","canvasWidth","canvasHeight","widthRatio","heightRatio","zoomRatio","zoomMltp","yDelta","isElInViewport","getFrameOffset","rTop","rLeft","getRectToScreen","zoomMlt","frameX","frameY","canvasEl","toScreen","getViewportRect","toWorld","frmOff","cvsOff","winEl","frEl","frameOffset","frameTop","avoidFrameOffset","frameLeft","avoidFrameZoom","getElementOffsets","bEl","fo","updateScript","getId","scriptContainer","jsEl","scriptFn","getScriptString","scriptFnStr","scriptProps","__getScriptProps","scr","getFrameView","frms","mainFrame","renderFrames","$frames","toolsWrp","hlEl","badgeEl","placerEl","ghostEl","resizerEl","offsetEl","fixedOffsetEl","toolsGlobEl","spotsEl","getFrame","getFramesEl","getDocument","_getLocalEl","globalEl","compView","getGhostEl","getFixedOffsetViewerEl","getSpotsEl","setCustomBadgeLabel","topScroll","leftScroll","getTargetToElementDim","canvasPos","toRight","targetHeight","targetWidth","eventToTrigger","topPos","elementTop","elementLeft","elementWidth","elementHeight","canvasTop","canvasLeft","rectOff","getFrameElFromDoc","fullHeight","subWinOffset","yOffset","xOffset","addTop","addLeft","toIgnore","fr","getZoom","hasX","hasY","getPointer","addFrame","getLastDragResult","spotProps","getSpots","cmpView","customSpots","getWorldRectToScreen","draggableComponents","disableTextInnerChilds","processor","useFrameDoc","voidElements","htmlType","defaultType","modelAttrStart","compTypes","getPropAttribute","attrName","attrValue","valueLen","lastChar","splitPropsFromAttr","propsResult","parseStyle","decls","decl","parseClass","cl","parseNode","nodes","attrsLen","nodePrev","nodeChild","ct","compType","namespaceURI","inSvg","void","comps","textTypes","textTags","allTxt","foundTextNode","ci","cType","parserCss","cf","optionsHtml","preParser","parserHtml","DOMParser","mimeType","strF","parseFromString","BrowserParserHtml","allowScripts","allowUnsafeAttr","allowUnsafeAttrValue","__sanitizeNode","styleStr","resHtml","returnArray","startsWith","getLastStyleValue","extendStyle","propOrig","propNew","newStyle","noEvent","removeStyle","styleToString","imp","getSelectors","getSelectorsString","selectorsToString","getFullString","getComponentIds","getComponentsFromDefs","visitedCmps","restAttr","getNewId","addAttributes","newComponents","cmps","resetChildren","newIds","idsToKeep","keepIds","resetFromString","cssc","allByID","allById","parsed","parseString","newCmps","getRules","newRule","__checkInnerChilds","isTemp","prevColl","Selectors","canRemoveStyle","rulesRemoved","it","__postRemove","df","componentTypes","parseHtml","componentsById","optsToPass","addCollection","isMult","processDef","__firstAdd","mdl","ccid","modelPr","$$typeof","avoidInline","Component","ensureInList","setClassRule","__postAdd","recursive","TYPE_CLASS","TYPE_ID","namePreEsc","escapeName","nameEsc","Selector","protected","isId","isClass","getFullName","getLabel","setLabel","getActive","setActive","objLen","combine","curr","getStyleable","getValid","noDisabled","combination","getItemsByCategory","allItems","categorySet","Set","categoryMap","emptyItem","category","categoryItems","categoryWithItems","CATEGORY_KEY","initCategory","isDefined","catModel","getCategories","TraitsEvents","Categories","changeProp","cat","initValue","targetEvent","targetUpdated","locale","getTargetValue","valueOpts","trait","setTargetValue","getDefault","idSel","getOptionId","getOptionLabel","optId","propName","getCategoryLabel","catId","catLabel","useType","fromTarget","getAttributes","valueTrue","valueFalse","valueToSet","setValueFromInput","final","toSet","getInitValue","build","buildFromString","optionsTarget","categories","handleAdd","handleReset","tmOpts","tf","Traits","traits","CollectionWithCategories","eventDrag","keySymbols","keySymbol","keySymbolOvrd","keyUpdate","keyUpdateInside","removable","badgable","stylable","unstylable","highlightable","copyable","editable","layerable","selectable","hoverable","dmode","updated","parentAttr","toPropagate","initClasses","initComponents","initTraits","initToolbar","initScriptProps","scriptUpdated","tagUpdated","attrUpdated","_idUpdated","__emitUpdateTlb","__onChange","__propToParent","avoidUpdateStyle","__isSymbolOrInst","__initSymb","um","__hasUm","__changesUp","__propSelfToParent","__onStyleChange","styleKeys","pros","setDragMode","$els","closestType","setClass","attrPrev","setAttributes","noClass","removeAttributes","attrArr","compAttr","optsAdd","getIdRule","setIdRule","noStyle","addId","__getSymbol","__getSymbols","selectors","classe","getClasses","classStr","__logSymbol","toUp","symbol","symbols","__symbReady","__upSymbProps","__isSymbol","__isSymbolTop","__isSymbolNested","symbTopSelf","__getSymbTop","symbTop","__getAllById","symb","symbs","__isSymbOvrd","ovrd","prp","__getSymbToUp","fromInstance","noPropagate","propsChanged","__upSymbCls","__upSymbComps","optUp","toUpOpts","addSymb","addedInstances","toAppend","addedInst","addedTop","symbolInv","isSymbNested","toUpFn","symbPrnt","newMods","attrCls","toListen","clsArr","normalizeClasses","addChild","avoidChildren","__loadTraits","prevProps","newProps","prevPropsEv","newPropsEv","__scriptPropsChange","getLastChild","tb","traitsI","getTraits","setTraits","getTrait","updateTrait","getTraitIndex","removeTrait","addTrait","clm","_inner","cloned","newId","defName","nameTag","i18nPfx","i18nName","i18nNameTag","i18nDefName","customName","noCustom","sTag","customAttr","getAttrToHTML","withProps","valueRes","altQuoteAttr","attrString","getInnerHTML","__innerHTML","getChangedProps","setId","frm","getCurrentView","modelProps","scrStr","reg","onAll","clb","forEachChild","rmOpts","sameParent","isInstanceOf","byType","resetId","oldId","_getStyleRule","idS","_getStyleSelector","idUpdate","idPrev","getList","getDefaults","nextId","getIncrementId","ilen","uid","dm","__escapeContent","frameborder","svgAttrs","ratioDefault","cmdName","hasButtonBool","getSrcResult","isDefaultSrc","srcDef","parseUri","uri","URL","hostname","protocol","port","qrs","pair","getQueryObject","locked","defs","mapUrl","mapType","parseFromSrc","updateSrc","getMapUrl","addr","qr","q","z","columns","rows","rowsToAdd","columnsToAdd","yt","vi","ytnc","defProvider","hasParam","videoId","provider","ytUrl","ytncUrl","viUrl","poster","muted","autoplay","controls","color","modestbranding","sources","updatePropsFromAttr","updateTraits","getYoutubeTraits","getVimeoTraits","getSourceTraits","prov","getYoutubeSrc","getYoutubeNoCookieSrc","getVimeoSrc","getProviderTrait","getAutoplayTrait","getLoopTrait","getControlsTrait","isYtProv","isYtncProv","isViProv","isExtProv","childrenView","sameFrameView","getTypes","viewObject","logError","modelOpt","updateStyle","renderAttributes","updateHighlight","updateStatus","updateContent","handleChange","onActive","onDisable","avoidRender","getEvents","dragstart","_clbObj","__isDraggable","handleDragStart","updateClasses","importClasses","renderChildren","chgArr","selectedCls","selectedParentCls","freezedCls","hoveredCls","noPointerCls","pointerInitCls","selCls","noExtHl","noCustomSpotTarget","Target","avoidHover","clsStr","isTextable","hl","styleOpts","__cmpStyleOpts","onAttrUpdate","updateAttributes","textable","defaultAttr","contenteditable","hasComps","getChildrenContainer","prevDef","getChildrenSelector","getTemplate","gtop","gleft","assignRect","isInViewport","frameH","frameW","_setData","createDoc","postRender","createComment","__getSrc","dblclick","click","load","classEmpty","fetchFile","fu","Assets","FileUploader","uploadFile","asset","complete","getSrc","onError","onLoad","noDrag","updateContentText","syncContent","rte","RichTextEditor","fromDisable","disableEditing","canActivate","rteEnabled","sameInEdit","getEditing","isInnerText","getContent","lastContent","activeRte","toggleEvents","contentOpt","customRte","parseContent","insertComponent","startContainer","startOffset","useDomContent","onInput","disablePropagation","mixins","setEditing","elDocs","getIframe","ifrm","frameBorder","createElementNS","updateProvider","updateVideo","renderByProvider","videoEl","renderYoutube","renderYoutubeNoCookie","renderVimeo","renderSource","initVideoEl","CanMoveReason","ComponentView","ComponentsView","componentHovered","selectAdd","getComponents","setComponents","addType","extendView","extendFn","extendFnView","extendType","extendViewType","typeToExtend","modelToExt","viewToExt","getExtendedObj","srcToExt","parentFn","removeType","getShallowWrapper","shallow","shallowEm","reason","InvalidSource","srcModel","SourceReject","isTargetInside","TargetReject","getById","maxValue","MAX_VALUE","compCls","buildFromModel","codeJson","onlyMatched","matchedRules","mRules","buildFromRule","sortMediaObject","rulesStr","ruleStr","dump","selectorStrNoAdd","skipAdd","selectorsAdd","singleAtRule","__cleanSelector","getQueryLength","mediaQuery","itemsArr","mquery","getKey","CSS","ensureSelectors","atRuleType","typeStr","addSelector","selOpts","stateStr","skipState","allowEmpty","getDevice","deviceDefault","getState","stateValue","getStates","sngl","cmpId","ruleProps","wd","selAdd","a1S","a2S","CssRules","slc","singleSel","checkNode","console","sl","newSels","le","selec","modelExists","styleUpdate","addRules","setRule","atRuleParams","addStyles","getRule","optRuleSel","media","getCurrentMedia","getClassRule","getComponentRules","rulesView","sSel","blocks","appendOnClick","activate","getMedia","ctg","BlocksEvents","endDrag","dragend","__getModule","getSorter","validTarget","valid","__currentBlock","setDragHelper","__startDrag","handleDrag","__drag","__endDrag","clsAdd","catName","caretR","caretD","iconClass","activeClass","updateVisibility","getIconEl","getTypeEl","iconEl","typeEl","renderedCategories","noCatClass","blockContClass","catsClass","updateConfig","ignoreCategories","getCategoriesEl","catView","catsEl","getBlocksEl","blocksEl","Block","Category","blocksVisible","bhv","__getBehaviour","_dragBlock","dragResult","oldKey","oldActive","toActive","__getFrameViews","_bhv","fv","blocksView","getAllVisible","getDragBlock","getBlocksByCategory","toRender","external","colls","iconAdd","iconSync","iconTagOn","iconTagOff","iconTagRemove","componentFirst","State","inputProp","getInputEl","inputEl","startEditTag","endEditTag","rename","innerText","changeStatus","removeTag","removeSelected","$chk","mainCls","stateInputId","stateInputC","componentChanged","checkSync","__handleStateChange","renderClasses","tagRemoved","renderStates","labelInfo","labelHead","syncStyle","getTarget","cssC","getCommonSelectors","ruleComponents","getTargets","ruleComponent","updateStateVis","addToClasses","startNewTag","$addBtn","$input","endNewTag","onInputKeyUp","addNewTag","checkStates","statesEl","targets","trgs","validSelectors","__getCommonSelectors","_commonSelectors","__common","hasStyle","$btnSyncEl","getStatesC","updateSelector","elSel","__getName","selectedName","idRes","stateChanged","addSelected","$states","$statesC","labelStates","tmpOpts","renderRes","$classes","evCustom","evState","selectorEvents","cFirst","__update","__updateSelectedByComponents","__ctn","selTags","selectorTags","cOpts","cname","selModel","getSelector","newName","setState","setStates","__getCommon","duplicateSelected","commonSelectors","styleToApply","suffix","newSelector","getSelectedTargets","setComponentFirst","getComponentFirst","CSS_RULE_TYPES","AT_RULE_NAMES","AT_RULE_KEYS","SINGLE_AT_RULE_TYPES","NESTABLE_AT_RULE_NAMES","SINGLE_AT_RULE_NAMES","parseSelector","propValue","getPropertyPriority","parseCondition","conditionText","selectorText","createNode","selLen","lastClass","stateArr","getNestableAtRule","cssRules","keyText","isSingleAtRule","subRules","subAtRuleType","lens","subRule","selsParsed","selsAdd","selsArr","lastRule","len3","selsAddStr","sheet","parsedNode","classSets","classSet","autosave","autoload","stepsBeforeSave","recovery","onStore","checkLocal","remote","headers","urlStore","urlLoad","contentTypeJson","fetchOptions","credentials","hasLocal","localStorage","setItem","getItem","thr","_typeof","then","AggregateError","errors","message","P","rejectionReasons","catch","ex","setTimeoutFunc","_state","_handled","_deferreds","doResolve","deferred","_immediateFn","onFulfilled","onRejected","promise","finale","_unhandledRejectionFn","Handler","prom","promiseFinally","allSettled","race","setImmediate","rej","XMLHttpRequest","withCredentials","statusText","responseText","upload","onProgress","onprogress","send","request","__props","parsable","typeJson","fetchOpts","reqHead","typeHead","FormData","StorageEvents","STORAGE_LOCAL","STORAGE_REMOTE","storages","setCurrent","isAutosave","setAutosave","getStepsBeforeSave","setStepsBeforeSave","storage","getStorages","getCurrent","currentStorage","getCurrentStorage","getStorageOptions","getCurrentOptions","getRecoveryStorage","recoveryOpts","__exec","recoveryStorage","recoveryData","__askRecovery","getRecovery","confirm","response","toStore","__clearKeys","onAfter","itemKey","startLoad","startStore","evAfter","afterLoad","afterStore","endLoad","endStore","errorLoad","errorStore","canAutoload","appendInput","eventCapture","clsField","onValueChange","removeView","rerender","templateLabel","templateInput","getClbOpts","elInput","getInputElem","onUpdate","onEvent","getValueForTarget","setInputValue","postUpdate","renderLabel","tpl","createLabel","getModelValue","i18nAttr","getElInput","renderField","createInput","hasLabel","noLabel","tmpl","TraitView","labelButton","TraitButtonView","toInit","targetValue","handleModelChange","holderClass","inputClass","elementUpdated","__onInputChange","fromInput","plh","Input","defaultOpts","beforeShow","flat","showInput","showButtons","clickoutFiresChange","showInitial","showPalette","showPaletteOnly","hideAfterPaletteSelect","togglePaletteOnly","showSelectionPalette","localStorageKey","maxSelectionSize","cancelText","chooseText","togglePaletteMoreText","togglePaletteLessText","clearText","noColorSelectedText","preferredFormat","containerClassName","replacerClassName","showAlpha","palette","selectionPalette","spectrums","IE","rgbaSupport","backgroundColor","replaceInput","markup","gradientFix","dataID","spectrum","extra","spect","loadOpts","inputTypeColorSupport","_cachedResult","colorInput","localization","palettes","processNativeColorInputs","colorInputs","trimLeft","trimRight","tinyCounter","math","mathRound","mathMin","mathMax","mathRandom","tinycolor","rgb","format","named","matchers","rgba","hsl","hsla","hsv","hsva","hex8","convertHexToDecimal","parseIntFromHex","hex6","hex3","stringInputToObject","bound01","convertToPercentage","hsvToRgb","hue2rgb","hslToRgb","boundAlpha","inputToRGB","_originalInput","_r","_g","_b","_a","_roundA","_format","_gradientType","gradientType","_ok","_tc_id","isDark","getBrightness","isLight","getOriginalInput","getFormat","getAlpha","toRgb","setAlpha","toHsv","rgbToHsv","toHsvString","toHsl","rgbToHsl","toHslString","toHex","allow3Char","rgbToHex","toHexString","toHex8","rgbaToHex","toHex8String","toRgbString","toPercentageRgb","toPercentageRgbString","toName","hexNames","toFilter","secondColor","hex8String","secondHex8String","formatSet","formattedString","hasAlpha","_applyModification","lighten","brighten","darken","desaturate","saturate","greyscale","spin","_applyCombination","analogous","complement","monochromatic","splitcomplement","triad","tetrad","fromRatio","newColor","color1","color2","mix","w1","rgb1","rgb2","w2","readability","c1","c2","brightnessA","brightnessB","colorDiff","brightness","isReadable","mostReadable","baseColor","colorList","bestColor","bestScore","bestIsReadable","readable","CSS_UNIT","PERMISSIVE_MATCH3","PERMISSIVE_MATCH4","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","burntsienna","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","green","greenyellow","grey","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","flipped","flip","paletteTemplate","tiny","swatchStyle","callbackContext","instanceOptions","resize","reflow","throttler","isDragging","isDefault","dragWidth","dragHeight","dragHelperHeight","slideHeight","alphaWidth","alphaSlideHelperWidth","slideHelperHeight","currentHue","currentSaturation","currentValue","currentAlpha","paletteArray","paletteLookup","draggingClass","shiftMovementDirection","boundElement","pickerContainer","dragHelper","slider","slideHelper","alphaSliderInner","alphaSlider","alphaSlideHelper","textInput","paletteContainer","initialColorContainer","cancelButton","clearButton","chooseButton","toggleButton","isInput","isInputTypeColor","shouldReplace","replacer","offsetElement","previewElement","initialColor","colorOnShow","currentPreferredFormat","applyOptions","updateSelectionPaletteFromStorage","oldPalette","addColorToSelectionPalette","inArray","drawPalette","currentColor","getUniqueSelectionPalette","drawInitial","setFromTextInput","updateOriginalInput","isDefaultPrevented","hideAll","$doc","onkeydown","clickout","updateUI","revert","ignoreFormatChange","newHsv","updateHelperLocations","flatColor","realColor","displayColor","realHex","realRgb","alpha","realAlpha","gradient","alphaX","slideY","fireCallback","picker","offsetElm","pickerEl","rootElm","inputRect","pickerW","pickerH","innerWidth","scrollX","paletteElementClick","keydown","outerWidth","oldDragX","oldDragY","furtherFromX","paletteEvent","optionName","optionValue","coord","onmove","onstart","onstop","maxHeight","maxWidth","hasTouch","duringDragEvents","t0","hex","pad2","clamp01","hue","slices","modification","isOnePointZero","processPercent","isPercentage","ColorPicker","getColor","colorEl","getColorEl","tc","valueClr","noneColor","movedColor","colorPickerConfig","colorPicker","noDefault","contClass","validateInputValue","deepCheck","validObj","handleUnitChange","getUnitEl","handleKeyDown","upArrowClick","downArrowClick","unitEl","units","normalizeValue","downIncrement","moveIncrement","upIncrement","prValue","defValue","limitlessMax","limitlessMin","fixed","regFixed","valCopy","uN","InputNumber","inputNumber","$unit","resultName","valResult","ATTR_CATEGORIES","ATTR_NO_CATEGORIES","traitContClass","classNoCat","updatedCollection","getTraitsEl","traitsEl","TraitsView","number","checkbox","upAll","__upSel","__onUp","__onSelect","getTraitsByCategory","baseView","getTraitsViewer","hidable","hideTextnode","showWrapper","showHover","scrollCanvas","scrollLayers","highlightHover","onInit","parentView","sortContainer","ignoreViewChildren","avoidSelectOnEnd","viewLayer","ItemView","opened","commandsDef","defComOptions","getOnComponentDragStart","getOnComponentDrag","getOnComponentDragEnd","altMode","CommandAbstract","defaultCommands","nativeDrag","hideTlb","fromMove","cmdMove","oldCmd","noStop","cmdObj","__onRun","__onStop","inputNameCls","clsTitleC","clsTitle","clsCaret","clsCount","clsMove","clsChildren","clsNoChild","clsEdit","clsNoEdit","initComponent","clsInput","gut","clsBase","checkChildren","updateOpening","updateLayerable","updateName","__render","getInputName","getVisibilityEl","getItemContainer","hClass","toggleVisibility","stopImmediatePropagation","setVisible","handleEdit","handleEditKey","handleEditEnd","setName","inputName","clsOpen","clsChvOpen","getCaret","isOpen","toggleOpening","setOpen","handleSelect","setLayerData","handleHover","hovered","handleHoverOut","itemEl","countEl","setRoot","_rendered","__clearItems","__isLayerable","evRoot","evComponent","propsToListen","__onRootChange","__onComponent","getRoot","prevDspKey","prevDisplay","updateLayer","setLocked","isLocked","getLayerData","cmpOpts","fromLayers","noAssets","uploadName","multiUpload","multiUploadSuffix","customFetch","embedAsBase64","beforeUpload","showUrlInput","dropzone","openAssetsOnDrop","dropzoneContent","getFilename","getExtension","Asset","unitDim","__getBhv","getPreview","getInfo","AssetImageView","TypeableCollection","baseType","getBaseType","typeFound","recognizeType","typeView","ModelInst","ViewInst","extendViewApi","AssetsEvents","renderAssets","addToAsset","removedAsset","deselectAll","handleSubmit","getAddInput","assetsEl","getAssetsEl","globalCollection","inputUrl","toggleNoAssets","addAsset","fuRendered","AssetsView","uploadId","disableUpload","FileUploaderView","onUploadStart","__propEv","uploadStart","onUploadEnd","uploadEnd","onUploadError","uploadError","onUploadResponse","uploadResponse","fetchOptsResult","initDrop","that","uploadForm","ondragover","ondragleave","ondrop","initDropzone","addedCls","edEl","updatedCls","dropzoneCls","cleanEditorElCls","onDragLeave","promises","mimeTypeMatcher","Image","readAsDataURL","assetCmd","assetsVis","assts","__viewParams","editorView","defFrame","getAllFrames","typeMain","pages","_onPageChange","configPages","Layers","mainComp","addBefore","pg","getMain","selectBefore","pagesMap","traitInputAttr","localeFallback","detectLocale","messages","en","addButton","inputPlh","uploadTitle","labels","comment","image","video","row","cell","desktop","tablet","mobileLandscape","mobilePortrait","titles","preview","fullscreen","emptyState","hover","layer","fileButton","sectors","general","layout","typography","decorations","flex","dimension","false","_blank","recover","messagesAdd","I18nEvents","addMessages","_localLang","setLocale","valuePrev","getLocale","getMessages","lang","_debug","setMessages","msg","localeFlb","lFlb","_getMsg","_addParams","nav","language","userLanguage","msgSet","spotTarget","elT","elL","borderOffset","freezeClass","relative","offTop","offLeft","selectOnEnd","getScale","getDocuments","elDoc","dropModel","dropContent","updateTextViewCursorPosition","targetDoc","caretRangeFromPoint","poiner","rangeParent","rangeOffset","setContentEditable","activeTextModel","toggleSortCursor","clonedEl","moveDragHelper","posY","posX","dragHelperStyle","createPlaceholder","ins","prevTarget","sourceEl","getSourceModel","clearSelection","getTargetModel","isTextableActive","tempModel","selectTargetModel","targetModel","dsp","eO","rY","rX","mousePos","eventMove","sourceModel","dimsFromTarget","lastDims","findPosition","disableTextable","movePlaceholder","prevTargetDim","$plh","isInFlow","styleInFlow","$parent","overflow","propFloat","trgModel","dragInfo","dropInfo","targetP","validResult","getDim","cacheDimsP","getChildrenDim","cacheDims","nearBorders","targetParent","getTargetFromEl","targetPrev","nearElBorders","getCurrentPos","offsets","elIndex","dirValue","indexEl","leftLimit","xLimit","yLimit","xCenter","yCenter","dimDown","trgDim","marg","margI","elDim","pT","pL","bT","borderTopWidth","bL","borderLeftWidth","bWidth","obj1","obj2","ancester","s1","toMoveArr","dst","modelToDrop","created","srcEl","warns","targetCollection","srcIndex","sameCollection","onUpdateContainer","minDim","maxDim","silentFrames","avoidContainerUpdate","tl","cr","bl","bc","br","setup","hdl","createHandler","toggleFrames","isHandler","getFocusedEl","getParentEl","getBoundingRect","updateContainer","forceShow","handleMouseDown","mouseFetch","parentRect","handlerAttr","clickedHandler","rectDim","startPos","parentDim","calc","updateRect","getSelectedHandler","elStyle","parentW","parentH","startW","startH","ratioActive","ratio","_mods","_scope","_MODIFIERS","control","_MAP","backspace","tab","return","esc","down","del","home","pageup","pagedown","_downKeys","compareArray","modifierMap","updateModifierKey","clearModifier","assignKey","resetModifiers","scope","mods","getKeys","getMods","shortcut","getScope","mi","setScope","deleteScope","isPressed","getPressedKeyCodes","multipleKeys","modifiersMatch","dispatch","keymaster","keymaps","defKeys","handlerRes","removeAll","backdrop","updateOpen","updateTitle","getCollector","$collector","$content","getTitle","$title","updateAttr","currAttr","_evData","titl","setTitle","onceOpen","getContentEl","swv","expt","osm","otm","ola","obl","ful","prv","togglable","runDefaultCommand","stopDefaultCommand","deactivateAllExceptOne","except","deactivateAll","fromCollection","disableAllButtons","disableAllButtonsExceptOne","Buttons","btn","listen","activeCls","disableCls","btnsVisCls","updateActive","checkActive","updateBtnsVis","updateClassName","updateDisable","fromListen","$buttons","commandName","clicked","toggleActive","appendContent","toggleVisible","resz","resLen","resBools","forContainer","styleWidth","styleHeight","buttonsView","appendEl","getPanelsEl","PanelsViewObj","removePanel","panelId","removeButton","getButton","disableButtons","optsCodeViewer","htmlOpts","cleanId","beforeEach","isFunctionEmpty","mapModel","scrProps","mapJs","autoFormat","autoFormatRange","noRefresh","CodeMirrorEditor","defaultViewer","generators","viewers","defGenerators","js","defViewers","loadDefaultGenerators","loadDefaultViewers","addGenerator","generator","getGenerator","getGenerators","addViewer","viewer","getViewer","getViewers","txtarea","updateViewer","getCode","genId","trackSelection","hasSkip","getChanged","hasUndo","chn","beforeCache","hasRedo","getInstance","getStack","getStackGroup","getGroupedStack","createItem","goToGroup","goTo","adjustToolbar","RichTextEditorActionState","RTE_KEY","btnState","isValidTag","parentAnchor","parentFocus","customElAttr","defActions","bold","italic","underline","strikethrough","insertHTML","setEl","updateActiveActions","__onKeydown","__onPaste","acts","actionbar","inactive","isCustom","actionbarCont","actionbarContainer","addAction","styleWithCSS","getActions","currentState","INACTIVE","newState","queryCommandSupported","queryCommandState","ACTIVE","__dbdTrgCustom","enabled","__toggleEffects","actionbarEl","syncActions","onKeydown","onPaste","textHtml","deleteContents","nd","insertNode","toSel","eventsUp","initRte","globalRte","hideToolbar","actionRes","updatePosition","rteInst","currentView","hideNotStylable","highlightChanged","highlightComputed","showComputed","clearProperties","avoidComputed","functionName","fixedValues","toRequire","requires","requiresParent","parentTarget","__upTargets","Property","callInit","__getParentProp","parentProp","isClear","__getFullValue","kProps","__getClearProps","toProps","applyStyle","__up","__trgEv","propertyUpdate","__upTargetsStyle","addStyleTargets","_up","noTarget","hasValue","getDefaultValue","parentValue","getParentTarget","hasValueParent","noParent","upValue","__parseValue","canClear","getParent","__canClearProp","isFull","parseValue","valueStr","numeric","num","withDefault","getFullValue","fnParameter","skipImportant","__setParentTarget","__parseFn","__checkVisibility","stylableReq","sector","getProperties","callParentInit","skipInit","getIndex","getValues","getLayerLabel","isSelected","getSelectedLayer","selectLayer","removeLayer","moveLayer","getStylePreview","hasPreview","upValues","isNumberType","detached","separator","fromStyle","toStyle","__upProperties","getProperty","getPropertyAt","isDetached","byName","getSeparator","getSplitSeparator","getJoin","__getJoin","getStyleFromProps","__clearIn","__upTargetsStyleProps","__setProperties","__getSplitValue","__styleHasProps","nameProps","__splitValue","__splitStyleName","props4Nums","__getPropsFromStyle","valuesStr","VALUES_REG","PARTS_REG","emptyValue","layerSeparator","layerJoin","layerLabel","selectedLayer","layersColl","__upSelected","__upLayers","getLayers","hasLayers","getLayer","__select","selectLayerAt","currIndex","addLayer","removeLayerAt","getStyleFromLayer","joinLayers","__getJoinLayers","newVal","getLayerSeparator","hasEmptyValue","isEmptyValue","getStyleFromLayers","layerSelect","__layers","__setLayers","newLayers","layersNew","__parseLayer","parseFn","__getLayersFromStyle","isEmptyValueStyle","separatorLayers","inLayer","getEmptyValueStyle","emptyStyle","__getLayers","clearProp","__destroyFn","iconClose","_getClbOpts","computedCls","labelEl","clearStyleEl","getClearEl","clearStyle","clearEl","inputValueChanged","emit","__setValueInput","clearCached","__unset","__change","__updateStyle","createdEl","clsType","propsView","iconMove","propertyView","pModel","updateLabel","removeItem","getPropertiesWrapper","propsWrapEl","getPreviewEl","previewEl","getLabelEl","prvEl","wrapEl","iconPlus","layersView","prvBoxEl","backgroundImage","openAssetManager","inputInst","__handleChange","addOption","propId","__onOptionChange","updateOptions","styleAttr","inputH","firstOpt","firstId","itemCls","elId","titleAttr","inputHld","inputIn","getUnits","getUnit","getMin","getMax","getStep","upUnit","valueProp","unitProp","getSliderEl","inputValueChangedSoft","propertyAdd","propertyRemove","builded","buildProperties","buildProps","extendProperties","checkExtend","propsModel","extendBuilded","withValue","withParentValue","addProperty","moProps","pLen","mProps","isolated","mProp","mPProps","buildP","builtIn","sect","typeNumber","typeColor","typeRadio","typeSelect","typeFile","typeSlider","typeComposite","typeStack","unitsSize","unitsSizeNoPerc","unitsTime","unitsAngle","ss","optsFlex","optsFlexAlign","optsBgSize","optsBgAttach","optsBgRepeat","optsWrap","optsOverflow","optsDir","opstDisplay","optsTransitFn","optsCursor","optsFloat","optsPos","optsTextAlign","optsJustCont","optsAlignCont","optsAlignSelf","optsTransitProp","optsBorderStyle","optsBgPos","optsWeight","optsShadowType","optsFonts","font","fixedFontSizes","fixedLetSpace","requireFlex","__sub","propsToCreate","spread","propToUp","fromRes","iconCaret","clsPfx","getPropertiesEl","renderProperties","objs","evSector","evSectorAdd","evSectorRemove","evSectorUpdate","evProp","evPropAdd","evPropRemove","evPropUp","evLayerSelect","evTarget","propDef","stylesEvents","sectorAdd","sectorRemove","sectorUpdate","Sector","__clearStateTarget","upProps","__upProps","trgCustom","stateTarget","__getStateTarget","addSector","getSector","_logNoSector","getSectors","removeSector","sectorId","removeProperty","lastTarget","lastTargetParents","getParentRules","getSelectedParents","targetState","getBuiltIn","getBuiltInAll","addBuiltIn","smConf","useClasses","deviceW","cssGen","optsSel","cmpRules","otherRules","rulesBySelectors","rSels","rSel","createType","SectView","parentStyles","__upProp","sectorVisible","hasVal","isStack","isComposite","canUpdate","propStack","propComp","parentItem","deps","storableDeps","Window","ar","logs","warning","__skip","defaultRunning","dragMode","toLog","attrsOrig","pageManager","constr","loadModule","loadStorableModule","updateChanges","_checkReady","listenLog","eventFrom","eventTo","editing","clipboard","previousModel","storables","modules","toLoad","loadOnStart","headless","Storage","loadData","_storageTimeout","EditorModel","stm","getDirtyCount","updateItr","onbeforeunload","InitModule","Mod","handleUpdates","timedInterval","mltSel","multiple","toggleSelected","selColl","selIndex","forceChange","upHovered","getHovered","selectedAll","typeHover","typeSpacing","getJs","avoidProt","avoidProtected","protCss","storeData","clearDirtyCount","loadOptions","editingCmp","destroyAll","grapesjs","logNs","logInfo","initBaseColorPicker","elToAppend","varName","classNames","contEl","shallowCanvasEl","I18n","Keymaps","addComponents","getSelectedToStyle","selectToggle","setDevice","setCustomRte","setCustomParserCss","onReady","getPlugin","plugin","plugins","pluginId","wplg","getPluginById","logPluginWarn","plg","agent","isIE","DOMImplementation","createHTMLDocument","implementation","polyfills","usePlugin","pluginResult","initConfig","autorender","pluginsOpts","plgOptions"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"grapes.min.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,YAAcD,IAEtBD,EAAK,YAAcC,GACpB,CATD,CASyB,oBAAfK,WAA6BA,WAAgC,oBAAXC,OAAyBA,OAASC,MAAO,I,2BCTrG,UAYK,IAEH,EAAO,CAAC,MAAc,aAAoB,0BAAP,EAWlC,SAAUC,EAAGC,GAEf,IAAIC,EAAaC,MAAMC,UAAUC,MAUjC,SAASC,EAAOC,EAAIC,EA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AAqB,SAAA7iM,GAE/C,OADKA,IAAOA,EAAQ,IACb,EAA2B3d,MAAMoU,SAASqsM,eAAgB,CAAC9iM,GACpE,C,CAEH,CC1BD+iM,GAEA,IAAMX,GAAU,IAAI,GACdprJ,GAAoB,GAcbgqJ,GAAW,CACtBl2M,EAAC,aAEDksD,QAAO,GAEPorJ,QAAO,GAEPY,UAnBuB,SAAiCb,EAAWv2M,GACnE,IAAIq3M,EAAef,GAAUC,EAAQC,IAErC,OAAO,SAACz8H,GACFs9H,EACFA,EAAat9H,EAAQ/5E,GAAQ,CAAC,GAE9B42M,GAAc78H,EAAQw8H,EAE1B,CACF,EAYEruI,QAAS,UAkBT3vB,KAAI,SAACnqC,QAAA,IAAAA,IAAAA,EAAA,IACK,IAAA+kM,EAAa/kM,EAAM,SACrBs+F,EAAMt+F,EAAO2oC,UACnB,IAAK21D,IAAQymG,EAAU,MAAM,IAAIjrM,MAAM,2BACvC,IAAMovM,EAAU,OACdC,YAAY,EACZf,QAAS,GACTgB,YAAa,CAAC,GACXppM,GAAM,CACTgnM,SAAUl/M,KACVqU,GAAI4oM,OAAW33M,GAAY,IAAAoqF,WAAU8mB,GAAOA,EAAO7hG,SAAS4rB,cAAci2E,KAEtE3yB,EAAS,IAAI,GAAOu9H,EAAY,CAAEp4M,EAAC,eACnC05E,EAAKmB,EAAO4D,WAqBlB,OAlBA25H,EAAWd,QAAS5qM,SAAQ,SAAA6qM,GAC1B,IAAMF,EAASD,GAAUG,EAAUD,IAC7BiB,EAAaH,EAAWE,YAAaf,IAAuB,CAAC,EAE/DF,EACFA,EAAOx8H,EAAQ09H,GAEfb,GAAc78H,EAAQ08H,EAE1B,IAKA79H,EAAGs6H,cACHoE,EAAWC,aAAepE,GAAYp5H,EAAO/vE,SAC7CohD,GAAQtwD,KAAKi/E,GAENA,CACT,GAoDF,W","sources":["webpack://grapesjs/webpack/universalModuleDefinition","webpack://grapesjs/./node_modules/backbone-undo/Backbone.Undo.js","webpack://grapesjs/./node_modules/backbone/backbone.js","webpack://grapesjs/./node_modules/codemirror-formatting/formatting.js","webpack://grapesjs/./node_modules/codemirror/lib/codemirror.js","webpack://grapesjs/./node_modules/codemirror/mode/css/css.js","webpack://grapesjs/./node_modules/codemirror/mode/htmlmixed/htmlmixed.js","webpack://grapesjs/./node_modules/codemirror/mode/javascript/javascript.js","webpack://grapesjs/./node_modules/codemirror/mode/xml/xml.js","webpack://grapesjs/./src/abstract/ModuleModel.ts","webpack://grapesjs/./src/canvas/model/CanvasSpot.ts","webpack://grapesjs/./src/commands/types.ts","webpack://grapesjs/./src/commands/view/CanvasClear.ts","webpack://grapesjs/./src/commands/view/CanvasMove.ts","webpack://grapesjs/./src/commands/view/CommandAbstract.ts","webpack://grapesjs/./src/commands/view/ComponentDelete.ts","webpack://grapesjs/./src/commands/view/ComponentDrag.ts","webpack://grapesjs/./src/commands/view/ComponentEnter.ts","webpack://grapesjs/./src/commands/view/ComponentExit.ts","webpack://grapesjs/./src/commands/view/ComponentNext.ts","webpack://grapesjs/./src/commands/view/ComponentPrev.ts","webpack://grapesjs/./src/commands/view/ComponentStyleClear.ts","webpack://grapesjs/./src/commands/view/CopyComponent.ts","webpack://grapesjs/./src/commands/view/ExportTemplate.ts","webpack://grapesjs/./src/commands/view/Fullscreen.ts","webpack://grapesjs/./src/commands/view/MoveComponent.ts","webpack://grapesjs/./src/commands/view/OpenAssets.ts","webpack://grapesjs/./src/commands/view/OpenBlocks.ts","webpack://grapesjs/./src/commands/view/OpenLayers.ts","webpack://grapesjs/./src/commands/view/OpenStyleManager.ts","webpack://grapesjs/./src/commands/view/OpenTraitManager.ts","webpack://grapesjs/./src/commands/view/PasteComponent.ts","webpack://grapesjs/./src/commands/view/Preview.ts","webpack://grapesjs/./src/commands/view/Resize.ts","webpack://grapesjs/./src/dom_components/model/ToolbarButton.ts","webpack://grapesjs/./src/dom_components/model/Toolbar.ts","webpack://grapesjs/./src/dom_components/view/ToolbarButtonView.ts","webpack://grapesjs/./src/dom_components/view/ToolbarView.ts","webpack://grapesjs/./src/commands/view/SelectComponent.ts","webpack://grapesjs/./src/commands/view/SelectPosition.ts","webpack://grapesjs/./src/commands/view/ShowOffset.ts","webpack://grapesjs/./src/commands/view/SwitchVisibility.ts","webpack://grapesjs/./src/common/index.ts","webpack://grapesjs/./src/dom_components/types.ts","webpack://grapesjs/./src/domain_abstract/view/DomainViews.ts","webpack://grapesjs/./src/utils/Dragger.ts","webpack://grapesjs/./src/utils/cash-dom.ts","webpack://grapesjs/./src/utils/dom.ts","webpack://grapesjs/./src/utils/mixins.ts","webpack://grapesjs/./src/commands/view/ sync ^\\.\\/.*$","webpack://grapesjs/./node_modules/underscore/modules/_setup.js","webpack://grapesjs/./node_modules/underscore/modules/restArguments.js","webpack://grapesjs/./node_modules/underscore/modules/isObject.js","webpack://grapesjs/./node_modules/underscore/modules/isNull.js","webpack://grapesjs/./node_modules/underscore/modules/isUndefined.js","webpack://grapesjs/./node_modules/underscore/modules/isBoolean.js","webpack://grapesjs/./node_modules/underscore/modules/isElement.js","webpack://grapesjs/./node_modules/underscore/modules/_tagTester.js","webpack://grapesjs/./node_modules/underscore/modules/isString.js","webpack://grapesjs/./node_modules/underscore/modules/isNumber.js","webpack://grapesjs/./node_modules/underscore/modules/isDate.js","webpack://grapesjs/./node_modules/underscore/modules/isRegExp.js","webpack://grapesjs/./node_modules/underscore/modules/isError.js","webpack://grapesjs/./node_modules/underscore/modules/isSymbol.js","webpack://grapesjs/./node_modules/underscore/modules/isArrayBuffer.js","webpack://grapesjs/./node_modules/underscore/modules/isFunction.js","webpack://grapesjs/./node_modules/underscore/modules/_hasObjectTag.js","webpack://grapesjs/./node_modules/underscore/modules/_stringTagBug.js","webpack://grapesjs/./node_modules/underscore/modules/isDataView.js","webpack://grapesjs/./node_modules/underscore/modules/isArray.js","webpack://grapesjs/./node_modules/underscore/modules/_has.js","webpack://grapesjs/./node_modules/underscore/modules/isArguments.js","webpack://grapesjs/./node_modules/underscore/modules/isFinite.js","webpack://grapesjs/./node_modules/underscore/modules/isNaN.js","webpack://grapesjs/./node_modules/underscore/modules/constant.js","webpack://grapesjs/./node_modules/underscore/modules/_createSizePropertyCheck.js","webpack://grapesjs/./node_modules/underscore/modules/_shallowProperty.js","webpack://grapesjs/./node_modules/underscore/modules/_getByteLength.js","webpack://grapesjs/./node_modules/underscore/modules/_isBufferLike.js","webpack://grapesjs/./node_modules/underscore/modules/isTypedArray.js","webpack://grapesjs/./node_modules/underscore/modules/_getLength.js","webpack://grapesjs/./node_modules/underscore/modules/_collectNonEnumProps.js","webpack://grapesjs/./node_modules/underscore/modules/keys.js","webpack://grapesjs/./node_modules/underscore/modules/isEmpty.js","webpack://grapesjs/./node_modules/underscore/modules/isMatch.js","webpack://grapesjs/./node_modules/underscore/modules/underscore.js","webpack://grapesjs/./node_modules/underscore/modules/_toBufferView.js","webpack://grapesjs/./node_modules/underscore/modules/isEqual.js","webpack://grapesjs/./node_modules/underscore/modules/allKeys.js","webpack://grapesjs/./node_modules/underscore/modules/_methodFingerprint.js","webpack://grapesjs/./node_modules/underscore/modules/isMap.js","webpack://grapesjs/./node_modules/underscore/modules/isWeakMap.js","webpack://grapesjs/./node_modules/underscore/modules/isSet.js","webpack://grapesjs/./node_modules/underscore/modules/isWeakSet.js","webpack://grapesjs/./node_modules/underscore/modules/values.js","webpack://grapesjs/./node_modules/underscore/modules/pairs.js","webpack://grapesjs/./node_modules/underscore/modules/invert.js","webpack://grapesjs/./node_modules/underscore/modules/functions.js","webpack://grapesjs/./node_modules/underscore/modules/_createAssigner.js","webpack://grapesjs/./node_modules/underscore/modules/extend.js","webpack://grapesjs/./node_modules/underscore/modules/extendOwn.js","webpack://grapesjs/./node_modules/underscore/modules/defaults.js","webpack://grapesjs/./node_modules/underscore/modules/_baseCreate.js","webpack://grapesjs/./node_modules/underscore/modules/create.js","webpack://grapesjs/./node_modules/underscore/modules/clone.js","webpack://grapesjs/./node_modules/underscore/modules/tap.js","webpack://grapesjs/./node_modules/underscore/modules/toPath.js","webpack://grapesjs/./node_modules/underscore/modules/_toPath.js","webpack://grapesjs/./node_modules/underscore/modules/_deepGet.js","webpack://grapesjs/./node_modules/underscore/modules/get.js","webpack://grapesjs/./node_modules/underscore/modules/has.js","webpack://grapesjs/./node_modules/underscore/modules/identity.js","webpack://grapesjs/./node_modules/underscore/modules/matcher.js","webpack://grapesjs/./node_modules/underscore/modules/property.js","webpack://grapesjs/./node_modules/underscore/modules/_optimizeCb.js","webpack://grapesjs/./node_modules/underscore/modules/_baseIteratee.js","webpack://grapesjs/./node_modules/underscore/modules/iteratee.js","webpack://grapesjs/./node_modules/underscore/modules/_cb.js","webpack://grapesjs/./node_modules/underscore/modules/mapObject.js","webpack://grapesjs/./node_modules/underscore/modules/noop.js","webpack://grapesjs/./node_modules/underscore/modules/propertyOf.js","webpack://grapesjs/./node_modules/underscore/modules/times.js","webpack://grapesjs/./node_modules/underscore/modules/random.js","webpack://grapesjs/./node_modules/underscore/modules/now.js","webpack://grapesjs/./node_modules/underscore/modules/_createEscaper.js","webpack://grapesjs/./node_modules/underscore/modules/_escapeMap.js","webpack://grapesjs/./node_modules/underscore/modules/escape.js","webpack://grapesjs/./node_modules/underscore/modules/unescape.js","webpack://grapesjs/./node_modules/underscore/modules/_unescapeMap.js","webpack://grapesjs/./node_modules/underscore/modules/templateSettings.js","webpack://grapesjs/./node_modules/underscore/modules/template.js","webpack://grapesjs/./node_modules/underscore/modules/result.js","webpack://grapesjs/./node_modules/underscore/modules/uniqueId.js","webpack://grapesjs/./node_modules/underscore/modules/chain.js","webpack://grapesjs/./node_modules/underscore/modules/_executeBound.js","webpack://grapesjs/./node_modules/underscore/modules/partial.js","webpack://grapesjs/./node_modules/underscore/modules/bind.js","webpack://grapesjs/./node_modules/underscore/modules/_isArrayLike.js","webpack://grapesjs/./node_modules/underscore/modules/_flatten.js","webpack://grapesjs/./node_modules/underscore/modules/bindAll.js","webpack://grapesjs/./node_modules/underscore/modules/memoize.js","webpack://grapesjs/./node_modules/underscore/modules/delay.js","webpack://grapesjs/./node_modules/underscore/modules/defer.js","webpack://grapesjs/./node_modules/underscore/modules/throttle.js","webpack://grapesjs/./node_modules/underscore/modules/debounce.js","webpack://grapesjs/./node_modules/underscore/modules/wrap.js","webpack://grapesjs/./node_modules/underscore/modules/negate.js","webpack://grapesjs/./node_modules/underscore/modules/compose.js","webpack://grapesjs/./node_modules/underscore/modules/after.js","webpack://grapesjs/./node_modules/underscore/modules/before.js","webpack://grapesjs/./node_modules/underscore/modules/once.js","webpack://grapesjs/./node_modules/underscore/modules/findKey.js","webpack://grapesjs/./node_modules/underscore/modules/_createPredicateIndexFinder.js","webpack://grapesjs/./node_modules/underscore/modules/findIndex.js","webpack://grapesjs/./node_modules/underscore/modules/findLastIndex.js","webpack://grapesjs/./node_modules/underscore/modules/sortedIndex.js","webpack://grapesjs/./node_modules/underscore/modules/_createIndexFinder.js","webpack://grapesjs/./node_modules/underscore/modules/indexOf.js","webpack://grapesjs/./node_modules/underscore/modules/lastIndexOf.js","webpack://grapesjs/./node_modules/underscore/modules/find.js","webpack://grapesjs/./node_modules/underscore/modules/findWhere.js","webpack://grapesjs/./node_modules/underscore/modules/each.js","webpack://grapesjs/./node_modules/underscore/modules/map.js","webpack://grapesjs/./node_modules/underscore/modules/_createReduce.js","webpack://grapesjs/./node_modules/underscore/modules/reduce.js","webpack://grapesjs/./node_modules/underscore/modules/reduceRight.js","webpack://grapesjs/./node_modules/underscore/modules/filter.js","webpack://grapesjs/./node_modules/underscore/modules/reject.js","webpack://grapesjs/./node_modules/underscore/modules/every.js","webpack://grapesjs/./node_modules/underscore/modules/some.js","webpack://grapesjs/./node_modules/underscore/modules/contains.js","webpack://grapesjs/./node_modules/underscore/modules/invoke.js","webpack://grapesjs/./node_modules/underscore/modules/pluck.js","webpack://grapesjs/./node_modules/underscore/modules/where.js","webpack://grapesjs/./node_modules/underscore/modules/max.js","webpack://grapesjs/./node_modules/underscore/modules/min.js","webpack://grapesjs/./node_modules/underscore/modules/toArray.js","webpack://grapesjs/./node_modules/underscore/modules/sample.js","webpack://grapesjs/./node_modules/underscore/modules/shuffle.js","webpack://grapesjs/./node_modules/underscore/modules/sortBy.js","webpack://grapesjs/./node_modules/underscore/modules/_group.js","webpack://grapesjs/./node_modules/underscore/modules/groupBy.js","webpack://grapesjs/./node_modules/underscore/modules/indexBy.js","webpack://grapesjs/./node_modules/underscore/modules/countBy.js","webpack://grapesjs/./node_modules/underscore/modules/partition.js","webpack://grapesjs/./node_modules/underscore/modules/size.js","webpack://grapesjs/./node_modules/underscore/modules/_keyInObj.js","webpack://grapesjs/./node_modules/underscore/modules/pick.js","webpack://grapesjs/./node_modules/underscore/modules/omit.js","webpack://grapesjs/./node_modules/underscore/modules/initial.js","webpack://grapesjs/./node_modules/underscore/modules/first.js","webpack://grapesjs/./node_modules/underscore/modules/rest.js","webpack://grapesjs/./node_modules/underscore/modules/last.js","webpack://grapesjs/./node_modules/underscore/modules/compact.js","webpack://grapesjs/./node_modules/underscore/modules/flatten.js","webpack://grapesjs/./node_modules/underscore/modules/difference.js","webpack://grapesjs/./node_modules/underscore/modules/without.js","webpack://grapesjs/./node_modules/underscore/modules/uniq.js","webpack://grapesjs/./node_modules/underscore/modules/union.js","webpack://grapesjs/./node_modules/underscore/modules/intersection.js","webpack://grapesjs/./node_modules/underscore/modules/unzip.js","webpack://grapesjs/./node_modules/underscore/modules/zip.js","webpack://grapesjs/./node_modules/underscore/modules/object.js","webpack://grapesjs/./node_modules/underscore/modules/range.js","webpack://grapesjs/./node_modules/underscore/modules/chunk.js","webpack://grapesjs/./node_modules/underscore/modules/_chainResult.js","webpack://grapesjs/./node_modules/underscore/modules/mixin.js","webpack://grapesjs/./node_modules/underscore/modules/underscore-array-methods.js","webpack://grapesjs/./node_modules/underscore/modules/index-default.js","webpack://grapesjs/webpack/bootstrap","webpack://grapesjs/webpack/runtime/compat get default export","webpack://grapesjs/webpack/runtime/define property getters","webpack://grapesjs/webpack/runtime/global","webpack://grapesjs/webpack/runtime/hasOwnProperty shorthand","webpack://grapesjs/webpack/runtime/make namespace object","webpack://grapesjs/./src/utils/html.ts","webpack://grapesjs/./src/editor/config/config.ts","webpack://grapesjs/./src/editor/model/Selected.ts","webpack://grapesjs/./src/abstract/Module.ts","webpack://grapesjs/./src/canvas/config/config.ts","webpack://grapesjs/./src/device_manager/config/config.ts","webpack://grapesjs/./src/device_manager/model/Device.ts","webpack://grapesjs/./src/device_manager/model/Devices.ts","webpack://grapesjs/./src/device_manager/view/DevicesView.ts","webpack://grapesjs/./src/device_manager/index.ts","webpack://grapesjs/./src/pages/types.ts","webpack://grapesjs/./src/abstract/ModuleCollection.ts","webpack://grapesjs/./src/canvas/model/Frame.ts","webpack://grapesjs/./src/canvas/model/Frames.ts","webpack://grapesjs/./src/canvas/model/Canvas.ts","webpack://grapesjs/./src/canvas/model/CanvasSpots.ts","webpack://grapesjs/./src/canvas/types.ts","webpack://grapesjs/./src/abstract/ModuleView.ts","webpack://grapesjs/./src/abstract/ModuleDomainViews.ts","webpack://grapesjs/./src/css_composer/view/CssRuleView.ts","webpack://grapesjs/./src/css_composer/view/CssGroupRuleView.ts","webpack://grapesjs/./src/css_composer/view/CssRulesView.ts","webpack://grapesjs/./src/parser/model/BrowserParserHtml.ts","webpack://grapesjs/./src/parser/model/ParserHtml.ts","webpack://grapesjs/./src/domain_abstract/model/StyleableModel.ts","webpack://grapesjs/./src/dom_components/model/SymbolUtils.ts","webpack://grapesjs/./src/dom_components/model/Components.ts","webpack://grapesjs/./src/selector_manager/model/Selector.ts","webpack://grapesjs/./src/selector_manager/model/Selectors.ts","webpack://grapesjs/./src/abstract/ModuleCategory.ts","webpack://grapesjs/./src/abstract/CollectionWithCategories.ts","webpack://grapesjs/./src/abstract/ModuleCategories.ts","webpack://grapesjs/./src/trait_manager/types.ts","webpack://grapesjs/./src/trait_manager/model/Trait.ts","webpack://grapesjs/./src/trait_manager/model/TraitFactory.ts","webpack://grapesjs/./src/trait_manager/model/Traits.ts","webpack://grapesjs/./src/dom_components/model/Component.ts","webpack://grapesjs/./src/dom_components/model/ComponentHead.ts","webpack://grapesjs/./src/utils/Droppable.ts","webpack://grapesjs/./src/canvas/view/FrameView.ts","webpack://grapesjs/./src/canvas/view/FrameWrapView.ts","webpack://grapesjs/./src/canvas/view/FramesView.ts","webpack://grapesjs/./src/canvas/view/CanvasView.ts","webpack://grapesjs/./src/canvas/index.ts","webpack://grapesjs/./src/dom_components/config/config.ts","webpack://grapesjs/./src/dom_components/model/ComponentTextNode.ts","webpack://grapesjs/./src/dom_components/model/ComponentComment.ts","webpack://grapesjs/./src/dom_components/model/ComponentFrame.ts","webpack://grapesjs/./src/dom_components/model/ComponentImage.ts","webpack://grapesjs/./src/dom_components/model/ComponentText.ts","webpack://grapesjs/./src/dom_components/model/ComponentLabel.ts","webpack://grapesjs/./src/dom_components/model/ComponentLink.ts","webpack://grapesjs/./src/dom_components/model/ComponentMap.ts","webpack://grapesjs/./src/dom_components/model/ComponentScript.ts","webpack://grapesjs/./src/dom_components/model/ComponentSvg.ts","webpack://grapesjs/./src/dom_components/model/ComponentSvgIn.ts","webpack://grapesjs/./src/dom_components/model/ComponentTable.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableBody.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableCell.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableFoot.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableHead.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableRow.ts","webpack://grapesjs/./src/dom_components/model/ComponentVideo.ts","webpack://grapesjs/./src/dom_components/model/ComponentWrapper.ts","webpack://grapesjs/./src/dom_components/view/ComponentsView.ts","webpack://grapesjs/./src/dom_components/view/ComponentView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTextNodeView.ts","webpack://grapesjs/./src/dom_components/view/ComponentCommentView.ts","webpack://grapesjs/./src/dom_components/view/ComponentFrameView.ts","webpack://grapesjs/./src/dom_components/view/ComponentImageView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTextView.ts","webpack://grapesjs/./src/dom_components/view/ComponentLinkView.ts","webpack://grapesjs/./src/dom_components/view/ComponentLabelView.ts","webpack://grapesjs/./src/dom_components/view/ComponentMapView.ts","webpack://grapesjs/./src/dom_components/view/ComponentScriptView.ts","webpack://grapesjs/./src/dom_components/view/ComponentSvgView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableBodyView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableCellView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableFootView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableHeadView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableRowView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableView.ts","webpack://grapesjs/./src/dom_components/view/ComponentVideoView.ts","webpack://grapesjs/./src/dom_components/view/ComponentWrapperView.ts","webpack://grapesjs/./src/dom_components/model/Symbols.ts","webpack://grapesjs/./src/dom_components/index.ts","webpack://grapesjs/./src/css_composer/config/config.ts","webpack://grapesjs/./src/code_manager/model/CssGenerator.ts","webpack://grapesjs/./src/css_composer/model/CssRule.ts","webpack://grapesjs/./src/css_composer/model/CssRules.ts","webpack://grapesjs/./src/css_composer/index.ts","webpack://grapesjs/./src/block_manager/config/config.ts","webpack://grapesjs/./src/block_manager/model/Block.ts","webpack://grapesjs/./src/block_manager/model/Blocks.ts","webpack://grapesjs/./src/block_manager/types.ts","webpack://grapesjs/./src/block_manager/view/BlockView.ts","webpack://grapesjs/./src/abstract/ModuleCategoryView.ts","webpack://grapesjs/./src/block_manager/view/BlocksView.ts","webpack://grapesjs/./src/block_manager/index.ts","webpack://grapesjs/./src/selector_manager/config/config.ts","webpack://grapesjs/./src/selector_manager/model/State.ts","webpack://grapesjs/./src/selector_manager/view/ClassTagView.ts","webpack://grapesjs/./src/selector_manager/view/ClassTagsView.ts","webpack://grapesjs/./src/selector_manager/index.ts","webpack://grapesjs/./src/parser/config/config.ts","webpack://grapesjs/./src/parser/model/BrowserParserCss.ts","webpack://grapesjs/./src/parser/model/ParserCss.ts","webpack://grapesjs/./src/parser/index.ts","webpack://grapesjs/./src/storage_manager/config/config.ts","webpack://grapesjs/./src/storage_manager/model/LocalStorage.ts","webpack://grapesjs/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://grapesjs/./node_modules/promise-polyfill/src/finally.js","webpack://grapesjs/./node_modules/promise-polyfill/src/allSettled.js","webpack://grapesjs/./node_modules/promise-polyfill/src/any.js","webpack://grapesjs/./node_modules/promise-polyfill/src/index.js","webpack://grapesjs/./src/utils/fetch.ts","webpack://grapesjs/./src/storage_manager/model/RemoteStorage.ts","webpack://grapesjs/./src/storage_manager/types.ts","webpack://grapesjs/./src/storage_manager/index.ts","webpack://grapesjs/./src/trait_manager/config/config.ts","webpack://grapesjs/./src/trait_manager/view/TraitView.ts","webpack://grapesjs/./src/trait_manager/view/TraitButtonView.ts","webpack://grapesjs/./src/trait_manager/view/TraitCheckboxView.ts","webpack://grapesjs/./src/domain_abstract/ui/Input.ts","webpack://grapesjs/./src/domain_abstract/ui/InputColor.ts","webpack://grapesjs/./src/utils/ColorPicker.ts","webpack://grapesjs/./src/trait_manager/view/TraitColorView.ts","webpack://grapesjs/./src/domain_abstract/ui/InputNumber.ts","webpack://grapesjs/./src/trait_manager/view/TraitNumberView.ts","webpack://grapesjs/./src/trait_manager/view/TraitSelectView.ts","webpack://grapesjs/./src/trait_manager/view/TraitsView.ts","webpack://grapesjs/./src/trait_manager/index.ts","webpack://grapesjs/./src/navigator/config/config.ts","webpack://grapesjs/./src/navigator/view/ItemsView.ts","webpack://grapesjs/./src/commands/config/config.ts","webpack://grapesjs/./src/commands/index.ts","webpack://grapesjs/./src/navigator/view/ItemView.ts","webpack://grapesjs/./src/navigator/index.ts","webpack://grapesjs/./src/asset_manager/config/config.ts","webpack://grapesjs/./src/asset_manager/model/Asset.ts","webpack://grapesjs/./src/asset_manager/model/AssetImage.ts","webpack://grapesjs/./src/asset_manager/view/AssetView.ts","webpack://grapesjs/./src/asset_manager/view/AssetImageView.ts","webpack://grapesjs/./src/domain_abstract/model/TypeableCollection.ts","webpack://grapesjs/./src/asset_manager/model/Assets.ts","webpack://grapesjs/./src/asset_manager/types.ts","webpack://grapesjs/./src/asset_manager/view/AssetsView.ts","webpack://grapesjs/./src/asset_manager/view/FileUploader.ts","webpack://grapesjs/./src/asset_manager/index.ts","webpack://grapesjs/./src/pages/model/Page.ts","webpack://grapesjs/./src/pages/model/Pages.ts","webpack://grapesjs/./src/pages/index.ts","webpack://grapesjs/./src/i18n/locale/en.js","webpack://grapesjs/./src/i18n/config.ts","webpack://grapesjs/./src/i18n/types.ts","webpack://grapesjs/./src/i18n/index.ts","webpack://grapesjs/./src/utils/Sorter.ts","webpack://grapesjs/./src/utils/Resizer.ts","webpack://grapesjs/./src/utils/index.ts","webpack://grapesjs/./src/utils/keymaster.ts","webpack://grapesjs/./src/keymaps/config.ts","webpack://grapesjs/./src/keymaps/index.ts","webpack://grapesjs/./src/modal_dialog/config/config.ts","webpack://grapesjs/./src/modal_dialog/model/Modal.ts","webpack://grapesjs/./src/modal_dialog/view/ModalView.ts","webpack://grapesjs/./src/modal_dialog/index.ts","webpack://grapesjs/./src/panels/config/config.ts","webpack://grapesjs/./src/panels/model/Button.ts","webpack://grapesjs/./src/panels/model/Buttons.ts","webpack://grapesjs/./src/panels/model/Panel.ts","webpack://grapesjs/./src/panels/model/Panels.ts","webpack://grapesjs/./src/panels/view/ButtonView.ts","webpack://grapesjs/./src/panels/view/ButtonsView.ts","webpack://grapesjs/./src/panels/view/PanelView.ts","webpack://grapesjs/./src/panels/view/PanelsView.ts","webpack://grapesjs/./src/panels/index.ts","webpack://grapesjs/./src/code_manager/config/config.ts","webpack://grapesjs/./src/code_manager/model/HtmlGenerator.ts","webpack://grapesjs/./src/code_manager/model/JsonGenerator.ts","webpack://grapesjs/./src/code_manager/model/JsGenerator.ts","webpack://grapesjs/./src/code_manager/model/CodeMirrorEditor.ts","webpack://grapesjs/./src/code_manager/view/EditorView.ts","webpack://grapesjs/./src/code_manager/index.ts","webpack://grapesjs/./src/undo_manager/config.ts","webpack://grapesjs/./src/undo_manager/index.ts","webpack://grapesjs/./src/rich_text_editor/config/config.ts","webpack://grapesjs/./src/rich_text_editor/model/RichTextEditor.ts","webpack://grapesjs/./src/rich_text_editor/index.ts","webpack://grapesjs/./src/style_manager/config/config.ts","webpack://grapesjs/./src/style_manager/model/Property.ts","webpack://grapesjs/./src/style_manager/model/Layer.ts","webpack://grapesjs/./src/style_manager/model/Layers.ts","webpack://grapesjs/./src/style_manager/model/PropertyComposite.ts","webpack://grapesjs/./src/style_manager/model/PropertyStack.ts","webpack://grapesjs/./src/style_manager/view/PropertyView.ts","webpack://grapesjs/./src/style_manager/view/PropertiesView.ts","webpack://grapesjs/./src/style_manager/view/PropertyCompositeView.ts","webpack://grapesjs/./src/style_manager/view/LayerView.ts","webpack://grapesjs/./src/style_manager/view/LayersView.ts","webpack://grapesjs/./src/style_manager/view/PropertyStackView.ts","webpack://grapesjs/./src/style_manager/view/PropertyFileView.ts","webpack://grapesjs/./src/style_manager/view/PropertyNumberView.ts","webpack://grapesjs/./src/style_manager/view/PropertyColorView.ts","webpack://grapesjs/./src/style_manager/model/PropertySelect.ts","webpack://grapesjs/./src/style_manager/view/PropertySelectView.ts","webpack://grapesjs/./src/style_manager/model/PropertyRadio.ts","webpack://grapesjs/./src/style_manager/view/PropertyRadioView.ts","webpack://grapesjs/./src/style_manager/model/PropertyNumber.ts","webpack://grapesjs/./src/style_manager/model/PropertySlider.ts","webpack://grapesjs/./src/style_manager/view/PropertySliderView.ts","webpack://grapesjs/./src/style_manager/model/Properties.ts","webpack://grapesjs/./src/style_manager/model/Sector.ts","webpack://grapesjs/./src/style_manager/model/Sectors.ts","webpack://grapesjs/./src/style_manager/model/PropertyFactory.ts","webpack://grapesjs/./src/style_manager/view/SectorView.ts","webpack://grapesjs/./src/style_manager/view/SectorsView.ts","webpack://grapesjs/./src/style_manager/index.ts","webpack://grapesjs/./src/editor/model/Editor.ts","webpack://grapesjs/./src/utils/extender.ts","webpack://grapesjs/./src/editor/view/EditorView.ts","webpack://grapesjs/./src/editor/index.ts","webpack://grapesjs/./src/plugin_manager/index.ts","webpack://grapesjs/./src/utils/polyfills.ts","webpack://grapesjs/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"grapesjs\"] = factory();\n\telse\n\t\troot[\"grapesjs\"] = factory();\n})(typeof globalThis !== 'undefined' ? globalThis : (typeof window !== 'undefined' ? window : this), () => {\nreturn ","/*!\n * Backbone.Undo.js v0.2\n *\n * Copyright (c)2013 Oliver Sartun\n * Released under the MIT License\n *\n * Documentation and full license available at\n * https://github.com/osartun/Backbone.Undo.js\n */\n\n\n(function (factory) {\n\tif (typeof define === \"function\" && define.amd) {\n\t\t// AMD support\n\t\tdefine([\"underscore\", \"backbone\"], factory);\n\t} else if (typeof exports !== 'undefined') {\n\t\t// CommonJS support\n\t\tmodule.exports = factory(\n\t\t\trequire(\"underscore\"),\n\t\t\trequire(\"backbone\")\n\t\t);\n\t} else {\n\t\t// Non-modular execution\n\t\tfactory(_, Backbone);\n }\n})(function (_, Backbone) {\n\n\tvar core_slice = Array.prototype.slice;\n\n\t/**\n\t * As call is faster than apply, this is a faster version of apply as it uses call.\n\t *\n\t * @param {Function} fn \tThe function to execute\n\t * @param {Object} ctx \tThe context the function should be called in\n\t * @param {Array} args \tThe array of arguments that should be applied to the function\n\t * @return Forwards whatever the called function returns\n\t */\n\tfunction apply (fn, ctx, args) {\n\t\treturn args.length <= 4 ?\n\t\t\tfn.call(ctx, args[0], args[1], args[2], args[3]) :\n\t\t\tfn.apply(ctx, args);\n\t}\n\n\t/**\n\t * Uses slice on an array or an array-like object.\n\t *\n\t * @param {Array|Object} \tarr \tThe array or array-like object.\n\t * @param {Number} \t\t[index]\tThe index from where the array should be sliced. Default is 0.\n\t * @return {Array} The sliced array\n\t */\n\tfunction slice (arr, index) {\n\t\treturn core_slice.call(arr, index);\n\t}\n\n\t/**\n\t * Checks if an object has one or more specific keys. The keys\n\t * don't have to be an owned property.\n\t * You can call this function either this way:\n\t * hasKeys(obj, [\"a\", \"b\", \"c\"])\n\t * or this way:\n\t * hasKeys(obj, \"a\", \"b\", \"c\")\n\t *\n\t * @param {Object} \tobj \tThe object to check on\n\t * @param {Array} \tkeys \tThe keys to check for\n\t * @return {Boolean} True, if the object has all those keys\n\t */\n\tfunction hasKeys (obj, keys) {\n\t\tif (obj == null) return false;\n\t\tif (!_.isArray(keys)) {\n\t\t\tkeys = slice(arguments, 1);\n\t\t}\n\t\treturn _.all(keys, function (key) {\n\t\t\treturn key in obj;\n\t\t});\n\t}\n\n\t/**\n\t * Returns a number that is unique per call stack. The number gets\n\t * changed after the call stack has been completely processed.\n\t *\n\t * @return {number} MagicFusionIndex\n\t */\n\tvar getMagicFusionIndex = (function () {\n\t\t// If you add several models to a collection or set several\n\t\t// attributes on a model all in sequence and yet all for\n\t\t// example in one function, then several Undo-Actions are\n\t\t// generated.\n\t\t// If you want to undo your last action only the last model\n\t\t// would be removed from the collection or the last set\n\t\t// attribute would be changed back to its previous value.\n\t\t// To prevent that we have to figure out a way to combine\n\t\t// all those actions that happened \"at the same time\".\n\t\t// Timestamps aren't exact enough. A complex routine could\n\t\t// run several milliseconds and in that time produce a lot\n\t\t// of actions with different timestamps.\n\t\t// Instead we take advantage of the single-threadedness of\n\t\t// JavaScript:\n\n\t\tvar callstackWasIndexed = false, magicFusionIndex = -1;\n\t\tfunction indexCycle() {\n\t\t\tmagicFusionIndex++;\n\t\t\tcallstackWasIndexed = true;\n\t\t\t_.defer(function () {\n\t\t\t\t// Here comes the magic. With a Timeout of 0\n\t\t\t\t// milliseconds this function gets called whenever\n\t\t\t\t// the current callstack is completed\n\t\t\t\tcallstackWasIndexed = false;\n\t\t\t})\n\t\t}\n\t\treturn function () {\n\t\t\tif (!callstackWasIndexed) {\n\t\t\t\tindexCycle();\n\t\t\t}\n\t\t\treturn magicFusionIndex;\n\t\t}\n\t})();\n\n\t/**\n\t * To prevent binding a listener several times to one\n\t * object, we register the objects in an ObjectRegistry\n\t *\n\t * @constructor\n\t */\n\tfunction ObjectRegistry () {\n\t\t// This uses two different ways of storing\n\t\t// objects: In case the object has a cid\n\t\t// (which Backbone objects typically have)\n\t\t// it uses this cid as an index. That way\n\t\t// the Array's length attribute doesn't\n\t\t// change and the object isn't an item\n\t\t// in the array, but an object-property.\n\t\t// Otherwise it's added to the Array as an\n\t\t// item.\n\t\t// That way we can use the fast property-\n\t\t// lookup and only have to fall back to\n\t\t// iterating over the array in case\n\t\t// non-Backbone-objects are registered.\n\t\tthis.registeredObjects = [];\n\t\t// To return a list of all registered\n\t\t// objects in the 'get' method we have to\n\t\t// store the objects that have a cid in\n\t\t// an additional array.\n\t\tthis.cidIndexes = [];\n\t}\n\tObjectRegistry.prototype = {\n\t\t/**\n\t\t * Returns whether the object is already registered in this ObjectRegistry or not.\n\t\t *\n\t\t * @this \t{ObjectRegistry}\n\t\t * @param \t{Object} \t\t obj \tThe object to check\n\t\t * @return \t{Boolean} True if the object is already registered\n\t\t */\n\t\tisRegistered: function (obj) {\n\t\t\t// This is where we get a performance boost\n\t\t\t// by using the two different ways of storing\n\t\t\t// objects.\n\t\t\treturn obj && obj.cid ? this.registeredObjects[obj.cid] : _.contains(this.registeredObjects, obj);\n\t\t},\n\t\t/**\n\t\t * Registers an object in this ObjectRegistry.\n\t\t *\n\t\t * @this \t{ObjectRegistry}\n\t\t * @param \t{Object} \t\t obj \tThe object to register\n\t\t * @return \t{undefined}\n\t\t */\n\t\tregister: function (obj) {\n\t\t\tif (!this.isRegistered(obj)) {\n\t\t\t\tif (obj && obj.cid) {\n\t\t\t\t\tthis.registeredObjects[obj.cid] = obj;\n\t\t\t\t\tthis.cidIndexes.push(obj.cid);\n\t\t\t\t} else {\n\t\t\t\t\tthis.registeredObjects.push(obj);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/**\n\t\t * Unregisters an object from this ObjectRegistry.\n\t\t *\n\t\t * @this {ObjectRegistry}\n\t\t * @param {Object} obj The object to unregister\n\t\t * @return {undefined}\n\t\t */\n\t\tunregister: function (obj) {\n\t\t\tif (this.isRegistered(obj)) {\n\t\t\t\tif (obj && obj.cid) {\n\t\t\t\t\tdelete this.registeredObjects[obj.cid];\n\t\t\t\t\tthis.cidIndexes.splice(_.indexOf(this.cidIndexes, obj.cid), 1);\n\t\t\t\t} else {\n\t\t\t\t\tvar i = _.indexOf(this.registeredObjects, obj);\n\t\t\t\t\tthis.registeredObjects.splice(i, 1);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/**\n\t\t * Returns an array of all objects that are currently in this ObjectRegistry.\n\t\t *\n\t\t * @return {Array} An array of all the objects which are currently in the ObjectRegistry\n\t\t */\n\t\tget: function () {\n\t\t\treturn (_.map(this.cidIndexes, function (cid) {return this.registeredObjects[cid];}, this)).concat(this.registeredObjects);\n\t\t}\n\t}\n\n\t/**\n\t * Binds or unbinds the \"all\"-listener for one or more objects.\n\t *\n\t * @param {String} which \tEither \"on\" or \"off\"\n\t * @param {Object[]} objects \tArray of the objects on which the \"all\"-listener should be bound / unbound to\n\t * @param {Function} [fn] \t\tThe function that should be bound / unbound. Optional in case of \"off\"\n\t * @param {Object} [ctx] \tThe context the function should be called in\n\t * @return {undefined}\n\t */\n\tfunction onoff(which, objects, fn, ctx) {\n\t\tfor (var i = 0, l = objects.length, obj; i < l; i++) {\n\t\t\tobj = objects[i];\n\t\t\tif (!obj) continue;\n\t\t\tif (which === \"on\") {\n\t\t\t\tif (!ctx.objectRegistry.register(obj)) {\n\t\t\t\t\t// register returned false, so obj was already registered\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!ctx.objectRegistry.unregister(obj)) {\n\t\t\t\t\t// unregister returned false, so obj wasn't registered\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_.isFunction(obj[which])) {\n\t\t\t\tobj[which](\"all\", fn, ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Calls the undo/redo-function for a specific action.\n\t *\n\t * @param {String} which \tEither \"undo\" or \"redo\"\n\t * @param {Object} action \tThe Action's attributes\n\t * @return {undefined}\n\t */\n\tfunction actionUndoRedo (which, action) {\n\t\tvar type = action.type, undoTypes = action.undoTypes, fn = !undoTypes[type] || undoTypes[type][which];\n\t\tif (_.isFunction(fn)) {\n\t\t\tfn(action.object, action.before, action.after, action.options);\n\t\t}\n\t}\n\n\t/**\n\t * The main undo/redo function.\n\t *\n\t * @param {String} \t\twhich \t Either \"undo\" or \"redo\"\n\t * @param {UndoManager} \tmanager\t The UndoManager-instance on which an \"undo\"/\"redo\"-Event is triggered afterwards\n\t * @param {UndoStack} \t\tstack \t The UndoStack on which we perform\n\t * @param {Boolean} \t\tmagic \t If true, undoes / redoes all actions with the same magicFusionIndex\n\t * @param {Boolean} \t\teverything If true, undoes / redoes every action that had been tracked\n\t * @return {undefined}\n\t */\n\tfunction managerUndoRedo (which, manager, stack, magic, everything) {\n\t\tif (stack.isCurrentlyUndoRedoing ||\n\t\t\t(which === \"undo\" && stack.pointer === -1) ||\n\t\t\t(which === \"redo\" && stack.pointer === stack.length - 1)) {\n\t\t\t// We're either currently in an undo- / redo-process or\n\t\t\t// we reached the end of the stack\n\t\t\treturn;\n\t\t}\n\t\tstack.isCurrentlyUndoRedoing = true;\n\t\tvar action, actions, isUndo = which === \"undo\";\n\t\tif (everything) {\n\t\t\t// Undo / Redo all steps until you reach the stack's beginning / end\n\t\t\tactions = isUndo && stack.pointer === stack.length - 1 || // If at the stack's end calling undo\n\t\t\t\t\t !isUndo && stack.pointer === -1 ? // or at the stack's beginning calling redo\n\t\t\t\t\t _.clone(stack.models) : // => Take all the models. Otherwise:\n\t\t\t\t\t core_slice.apply(stack.models, isUndo ? [0, stack.pointer] : [stack.pointer, stack.length - 1]);\n\t\t} else {\n\t\t\t// Undo / Redo only one step\n\t\t\taction = stack.at(isUndo ? stack.pointer : stack.pointer + 1);\n\t\t\tactions = magic ? stack.where({\"magicFusionIndex\": action.get(\"magicFusionIndex\")}) : [action];\n\t\t}\n\n\t\tstack.pointer += (isUndo ? -1 : 1) * actions.length;\n\t\twhile (action = isUndo ? actions.pop() : actions.shift()) {\n\t\t\t// Here we're calling the Action's undo / redo method\n\t\t\taction[which]();\n\t\t}\n\t\tstack.isCurrentlyUndoRedoing = false;\n\n\t\tmanager.trigger(which, manager);\n\t}\n\n\t/**\n\t * Checks whether an UndoAction should be created or not. Therefore it checks\n\t * whether a \"condition\" property is set in the undoTypes-object of the specific\n\t * event type. If not, it returns true. If it's set and a boolean, it returns it.\n\t * If it's a function, it returns its result, converting it into a boolean.\n\t * Otherwise it returns true.\n\t *\n\t * @param {Object} \tundoTypesType \tThe object within the UndoTypes that holds the function for this event type (i.e. \"change\")\n\t * @param {Arguments} \targs \t\tThe arguments the \"condition\" function is called with\n\t * @return {Boolean} \tTrue, if an UndoAction should be created\n\t */\n\tfunction validateUndoActionCreation (undoTypesType, args) {\n\t\tvar condition = undoTypesType.condition, type = typeof condition;\n\t\treturn type === \"function\" ? !!apply(condition, undoTypesType, args) :\n\t\t\ttype === \"boolean\" ? condition : true;\n\t}\n\n\t/**\n\t * Adds an Undo-Action to the stack.\n\t *\n\t * @param {UndoStack} \t\tstack \t\tThe undostack the action should be added to.\n\t * @param {String} \t\t\ttype \t\tThe event type (i.e. \"change\")\n\t * @param {Arguments} \t\targs \t\tThe arguments passed to the undoTypes' \"on\"-handler\n\t * @param {OwnedUndoTypes} \tundoTypes \tThe undoTypes-object which has the \"on\"-handler\n\t * @return {undefined}\n\t */\n\tfunction addToStack(stack, type, args, undoTypes) {\n\t\tif (stack.track && !stack.isCurrentlyUndoRedoing && type in undoTypes &&\n\t\t\tvalidateUndoActionCreation(undoTypes[type], args)) {\n\t\t\t// An UndoAction should be created\n\t\t\tvar res = apply(undoTypes[type][\"on\"], undoTypes[type], args), diff;\n\t\t\tif (hasKeys(res, \"object\", \"before\", \"after\")) {\n\t\t\t\tres.type = type;\n\t\t\t\tres.magicFusionIndex = getMagicFusionIndex();\n\t\t\t\tres.undoTypes = undoTypes;\n\t\t\t\tif (stack.pointer < stack.length - 1) {\n\t\t\t\t\t// New Actions must always be added to the end of the stack.\n\t\t\t\t\t// If the pointer is not pointed to the last action in the\n\t\t\t\t\t// stack, presumably because actions were undone before, then\n\t\t\t\t\t// all following actions must be discarded\n\t\t\t\t\tvar diff = stack.length - stack.pointer - 1;\n\t\t\t\t\twhile (diff--) {\n\t\t\t\t\t\tstack.pop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstack.pointer = stack.length;\n\t\t\t\tstack.add(res);\n\t\t\t\tif (stack.length > stack.maximumStackLength) {\n\t\t\t\t\tstack.shift();\n\t\t\t\t\tstack.pointer--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * Predefined UndoTypes object with default handlers for the most common events.\n\t * @type {Object}\n\t */\n\tvar UndoTypes = {\n\t\t\"add\": {\n\t\t\t\"undo\": function (collection, ignore, model, options) {\n\t\t\t\t// Undo add = remove\n\t\t\t\tcollection.remove(model, options);\n\t\t\t},\n\t\t\t\"redo\": function (collection, ignore, model, options) {\n\t\t\t\t// Redo add = add\n\t\t\t\tif (options.index) {\n\t\t\t\t\toptions.at = options.index;\n\t\t\t\t}\n\t\t\t\tcollection.add(model, options);\n\t\t\t},\n\t\t\t\"on\": function (model, collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: undefined,\n\t\t\t\t\tafter: model,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"remove\": {\n\t\t\t\"undo\": function (collection, model, ignore, options) {\n\t\t\t\tif (\"index\" in options) {\n\t\t\t\t\toptions.at = options.index;\n\t\t\t\t}\n\t\t\t\tcollection.add(model, options);\n\t\t\t},\n\t\t\t\"redo\": function (collection, model, ignore, options) {\n\t\t\t\tcollection.remove(model, options);\n\t\t\t},\n\t\t\t\"on\": function (model, collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: model,\n\t\t\t\t\tafter: undefined,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"change\": {\n\t\t\t\"undo\": function (model, before, after, options) {\n\t\t\t\tif (_.isEmpty(before)) {\n\t\t\t\t\t_.each(_.keys(after), model.unset, model);\n\t\t\t\t} else {\n\t\t\t\t\tmodel.set(before);\n\t\t\t\t\tif (options && options.unsetData && options.unsetData.before && options.unsetData.before.length) {\n\t\t\t\t\t\t_.each(options.unsetData.before, model.unset, model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"redo\": function (model, before, after, options) {\n\t\t\t\tif (_.isEmpty(after)) {\n\t\t\t\t\t_.each(_.keys(before), model.unset, model);\n\t\t\t\t} else {\n\t\t\t\t\tmodel.set(after);\n\t\t\t\t\tif (options && options.unsetData && options.unsetData.after && options.unsetData.after.length) {\n\t\t\t\t\t\t_.each(options.unsetData.after, model.unset, model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"on\": function (model, options) {\n\t\t\t\tvar\n\t\t\t\tafterAttributes = model.changedAttributes(),\n\t\t\t\tkeysAfter = _.keys(afterAttributes),\n\t\t\t\tpreviousAttributes = _.pick(model.previousAttributes(), keysAfter),\n\t\t\t\tkeysPrevious = _.keys(previousAttributes),\n\t\t\t\tunsetData = (options || (options = {})).unsetData = {\n\t\t\t\t\tafter: [],\n\t\t\t\t\tbefore: []\n\t\t\t\t};\n\n\t\t\t\tif (keysAfter.length != keysPrevious.length) {\n\t\t\t\t\t// There are new attributes or old attributes have been unset\n\t\t\t\t\tif (keysAfter.length > keysPrevious.length) {\n\t\t\t\t\t\t// New attributes have been added\n\t\t\t\t\t\t_.each(keysAfter, function (val) {\n\t\t\t\t\t\t\tif (!(val in previousAttributes)) {\n\t\t\t\t\t\t\t\tunsetData.before.push(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Old attributes have been unset\n\t\t\t\t\t\t_.each(keysPrevious, function (val) {\n\t\t\t\t\t\t\tif (!(val in afterAttributes)) {\n\t\t\t\t\t\t\t\tunsetData.after.push(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tobject: model,\n\t\t\t\t\tbefore: previousAttributes,\n\t\t\t\t\tafter: afterAttributes,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"reset\": {\n\t\t\t\"undo\": function (collection, before, after) {\n\t\t\t\tcollection.reset(before);\n\t\t\t},\n\t\t\t\"redo\": function (collection, before, after) {\n\t\t\t\tcollection.reset(after);\n\t\t\t},\n\t\t\t\"on\": function (collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: options.previousModels,\n\t\t\t\t\tafter: _.clone(collection.models)\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Every UndoManager instance has an own undoTypes object\n\t * which is an instance of OwnedUndoTypes. OwnedUndoTypes'\n\t * prototype is the global UndoTypes object. Changes to the\n\t * global UndoTypes object take effect on every instance of\n\t * UndoManager as the object is its prototype. And yet every\n\t * local UndoTypes object can be changed individually.\n\t *\n\t * @constructor\n\t */\n\tfunction OwnedUndoTypes () {}\n\tOwnedUndoTypes.prototype = UndoTypes;\n\n\t/**\n\t * Adds, changes or removes an undo-type from an UndoTypes-object.\n\t * You can call it this way:\n\t * manipulateUndoType (1, \"reset\", {\"on\": function () {}}, undoTypes)\n\t * or this way to perform bulk actions:\n\t * manipulateUndoType (1, {\"reset\": {\"on\": function () {}}}, undoTypes)\n\t * In case of removing undo-types you can pass an Array for performing\n\t * bulk actions:\n\t * manipulateUndoType(2, [\"reset\", \"change\"], undoTypes)\n\t *\n\t * @param {Number} \t\t\t\t manipType \t\tIndicates the kind of action to execute: 0 for add, 1 for change, 2 for remove\n\t * @param {String|Object|Array} \t undoType \t\t\tThe type of undoType that should be added/changed/removed. Can be an object / array to perform bulk actions\n\t * @param {Object} \t\t\t\t [fns] \t\t\tObject with the functions to add / change. Is optional in case you passed an object as undoType that contains these functions\n\t * @param {OwnedUndoTypes|UndoTypes} undoTypesInstance The undoTypes object to act on\n\t * @return {undefined}\n\t */\n\tfunction manipulateUndoType (manipType, undoType, fns, undoTypesInstance) {\n\t\t// manipType, passed by the calling function\n\t\t// 0: add\n\t\t// 1: change\n\t\t// 2: remove\n\t\tif (typeof undoType === \"object\") {\n\t\t\t// bulk action. Iterate over this data.\n\t\t\treturn _.each(undoType, function (val, key) {\n\t\t\t\t\tif (manipType === 2) { // remove\n\t\t\t\t\t\t// undoType is an array\n\t\t\t\t\t\tmanipulateUndoType (manipType, val, fns, undoTypesInstance);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// undoType is an object\n\t\t\t\t\t\tmanipulateUndoType (manipType, key, val, fns);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\n\t\tswitch (manipType) {\n\t\t\tcase 0: // add\n\t\t\t\tif (hasKeys(fns, \"undo\", \"redo\", \"on\") && _.all(_.pick(fns, \"undo\", \"redo\", \"on\"), _.isFunction)) {\n\t\t\t\t\tundoTypesInstance[undoType] = fns;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 1: // change\n\t\t\t\tif (undoTypesInstance[undoType] && _.isObject(fns)) {\n\t\t\t\t\t// undoTypeInstance[undoType] may be a prototype's property\n\t\t\t\t\t// So, if we did this _.extend(undoTypeInstance[undoType], fns)\n\t\t\t\t\t// we would extend the object on the prototype which means\n\t\t\t\t\t// that this change would have a global effect\n\t\t\t\t\t// Instead we just want to manipulate this instance. That's why\n\t\t\t\t\t// we're doing this:\n\t\t\t\t\tundoTypesInstance[undoType] = _.extend({}, undoTypesInstance[undoType], fns);\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2: // remove\n\t\t\t\tdelete undoTypesInstance[undoType];\n\t\t\tbreak;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Instantiating \"Action\" creates the UndoActions that\n\t * are collected in an UndoStack. It holds all relevant\n\t * data to undo / redo an action and has an undo / redo\n\t * method.\n\t */\n\tvar Action = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\ttype: null, // \"add\", \"change\", \"reset\", etc.\n\t\t\tobject: null, // The object on which the action occurred\n\t\t\tbefore: null, // The previous values which were changed with this action\n\t\t\tafter: null, // The values after this action\n\t\t\tmagicFusionIndex: null // The magicFusionIndex helps to combine\n\t\t\t// all actions that occurred \"at the same time\" to undo/redo them altogether\n\t\t},\n\t\t/**\n\t\t * Undoes this action.\n\t\t * @param {OwnedUndoTypes|UndoTypes} undoTypes The undoTypes object which contains the \"undo\"-handler that should be used\n\t\t * @return {undefined}\n\t\t */\n\t\tundo: function (undoTypes) {\n\t\t\tactionUndoRedo(\"undo\", this.attributes);\n\t\t},\n\t\t/**\n\t\t * Redoes this action.\n\t\t * @param {OwnedUndoTypes|UndoTypes} undoTypes The undoTypes object which contains the \"redo\"-handler that should be used\n\t\t * @return {undefined}\n\t\t */\n\t\tredo: function (undoTypes) {\n\t\t\tactionUndoRedo(\"redo\", this.attributes);\n\t\t}\n\t}),\n\t/**\n\t * An UndoStack is a collection of UndoActions in\n\t * chronological order.\n\t */\n\tUndoStack = Backbone.Collection.extend({\n\t\tmodel: Action,\n\t\tpointer: -1, // The pointer indicates the index where we are located within the stack. We start at -1\n\t\ttrack: false,\n\t\tisCurrentlyUndoRedoing: false,\n\t\tmaximumStackLength: Infinity,\n\t\tsetMaxLength: function (val) {\n\t\t\tthis.maximumStackLength = val;\n\t\t}\n\t}),\n\t/**\n\t * An instance of UndoManager can keep track of\n\t * changes to objects and helps to undo them.\n\t */\n\tUndoManager = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\tmaximumStackLength: Infinity,\n\t\t\ttrack: false\n\t\t},\n\t\t/**\n\t\t * The constructor function.\n\t\t * @param {attr} \t\t[attr] Object with parameters. The available parameters are:\n\t\t * \t - maximumStackLength {number} \tSet the undo-stack's maximum size\n\t\t * - track \t\t\t\t{boolean}\tStart tracking changes right away\n\t\t * @return {undefined}\n\t\t */\n\t\tinitialize: function (attr) {\n\t\t\tthis.stack = new UndoStack;\n\t\t\tthis.objectRegistry = new ObjectRegistry();\n\t\t\tthis.undoTypes = new OwnedUndoTypes();\n\n\t\t\t// sync the maximumStackLength attribute with our stack\n\t\t\tthis.stack.setMaxLength(this.get(\"maximumStackLength\"));\n\t\t\tthis.on(\"change:maximumStackLength\", function (model, value) {\n\t\t\t\tthis.stack.setMaxLength(value);\n\t\t\t}, this);\n\n\t\t\t// Start tracking, if attr.track == true\n\t\t\tif (attr && attr.track) {\n\t\t\t\tthis.startTracking();\n\t\t\t}\n\n\t\t\t// Register objects passed in the \"register\" attribute\n\t\t\tif (attr && attr.register) {\n\t\t\t\tif (_.isArray(attr.register) || _.isArguments(attr.register)) {\n\t\t\t\t\tapply(this.register, this, attr.register);\n\t\t\t\t} else {\n\t\t\t\t\tthis.register(attr.register);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Starts tracking. Changes of registered objects won't be processed until you've called this function\n\t\t * @return {undefined}\n\t\t */\n\t\tstartTracking: function () {\n\t\t\tthis.set(\"track\", true);\n\t\t\tthis.stack.track = true;\n\t\t},\n\t\t/**\n\t\t * Stops tracking. Afterwards changes of registered objects won't be processed.\n\t\t * @return {undefined}\n\t\t */\n\t\tstopTracking: function () {\n\t\t\tthis.set(\"track\", false);\n\t\t\tthis.stack.track = false;\n\t\t},\n\t\t/**\n\t\t * Return the state of the tracking\n\t\t * @return {boolean}\n\t\t */\n\t\tisTracking: function () {\n\t\t\treturn this.get(\"track\");\n\t\t},\n\t\t/**\n\t\t * This is the \"all\"-handler which is bound to registered\n\t\t * objects. It creates an UndoAction from the event and adds\n\t\t * it to the stack.\n\t\t *\n\t\t * @param {String} \ttype \tThe event type\n\t\t * @return {undefined}\n\t\t */\n\t\t_addToStack: function (type) {\n\t\t\taddToStack(this.stack, type, slice(arguments, 1), this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Registers one or more objects to track their changes.\n\t\t * @param {...Object} \tobj \tThe object or objects of which changes should be tracked\n\t\t * @return {undefined}\n\t\t */\n\t\tregister: function () {\n\t\t\tonoff(\"on\", arguments, this._addToStack, this);\n\t\t},\n\t\t/**\n\t\t * Unregisters one or more objects.\n\t\t * @param {...Object} \tobj \tThe object or objects of which changes shouldn't be tracked any longer\n\t\t * @return {undefined}\n\t\t */\n\t\tunregister: function () {\n\t\t\tonoff(\"off\", arguments, this._addToStack, this);\n\t\t},\n\t\t/**\n\t\t * Unregisters all previously registered objects.\n\t\t * @return {undefined}\n\t\t */\n\t\tunregisterAll: function () {\n\t\t\tapply(this.unregister, this, this.objectRegistry.get());\n\t\t},\n\t\t/**\n\t\t * Undoes the last action or the last set of actions in case 'magic' is true.\n\t\t * @param {Boolean} \t[magic] \tIf true, all actions that happened basically at the same time are undone together\n\t\t * @return {undefined}\n\t\t */\n\t\tundo: function (magic) {\n\t\t\tmanagerUndoRedo(\"undo\", this, this.stack, magic);\n\t\t},\n\n\t\t/**\n\t\t * Undoes all actions ever tracked by the undo manager\n\t\t * @return {undefined}\n\t\t */\n\t\tundoAll: function () {\n\t\t\tmanagerUndoRedo(\"undo\", this, this.stack, false, true);\n\t\t},\n\n\t\t/**\n\t\t * Redoes a previously undone action or a set of actions.\n\t\t * @param {Boolean} \t[magic] \tIf true, all actions that happened basically at the same time are redone together\n\t\t * @return {undefined}\n\t\t */\n\t\tredo: function (magic) {\n\t\t\tmanagerUndoRedo(\"redo\", this, this.stack, magic);\n\t\t},\n\n\t\t/**\n\t\t * Redoes all actions ever tracked by the undo manager\n\t\t * @return {undefined}\n\t\t */\n\t\tredoAll: function () {\n\t\t\tmanagerUndoRedo(\"redo\", this, this.stack, false, true);\n\t\t},\n\t\t/**\n\t\t * Checks if there's an action in the stack that can be undone / redone\n\t\t * @param {String} \ttype \tEither \"undo\" or \"redo\"\n\t\t * @return {Boolean} True if there is a set of actions which can be undone / redone\n\t\t */\n\t\tisAvailable: function (type) {\n\t\t\tvar s = this.stack, l = s.length;\n\n\t\t\tswitch (type) {\n\t\t\t\tcase \"undo\": return l > 0 && s.pointer > -1;\n\t\t\t\tcase \"redo\": return l > 0 && s.pointer < l - 1;\n\t\t\t\tdefault: return false;\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Sets the stack-reference to the stack of another undoManager.\n\t\t * @param {UndoManager} \tundoManager \tThe undoManager whose stack-reference is set to this stack\n\t\t * @return {undefined}\n\t\t */\n\t\tmerge: function (undoManager) {\n\t\t\t// This sets the stack-reference to the stack of another\n\t\t\t// undoManager so that the stack of this other undoManager\n\t\t\t// is used by two different managers.\n\t\t\t// This enables to set up a main-undoManager and besides it\n\t\t\t// several others for special, exceptional cases (by using\n\t\t\t// instance-based custom UndoTypes). Models / collections\n\t\t\t// which need this special treatment are only registered at\n\t\t\t// those special undoManagers. Those special ones are then\n\t\t\t// merged into the main-undoManager to write on its stack.\n\t\t\t// That way it's easier to manage exceptional cases.\n\t\t\tvar args = _.isArray(undoManager) ? undoManager : slice(arguments), manager;\n\t\t\twhile (manager = args.pop()) {\n\t\t\t\tif (manager instanceof UndoManager &&\n\t\t\t\t\tmanager.stack instanceof UndoStack) {\n\t\t\t\t\t// set the stack reference to our stack\n\t\t\t\t\tmanager.stack = this.stack;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Add an UndoType to this specific UndoManager-instance.\n\t\t * @param {String} type The event this UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. Must have the properties \"undo\", \"redo\" and \"on\". Can have the property \"condition\".\n\t\t * @return {undefined}\n\t\t */\n\t\taddUndoType: function (type, fns) {\n\t\t\tmanipulateUndoType(0, type, fns, this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Overwrite properties of an existing UndoType for this specific UndoManager-instance.\n\t\t * @param {String} type The event the UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. It extends the existing object.\n\t\t * @return {undefined}\n\t\t */\n\t\tchangeUndoType: function (type, fns) {\n\t\t\tmanipulateUndoType(1, type, fns, this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Remove one or more UndoTypes of this specific UndoManager-instance to fall back to the global UndoTypes.\n\t\t * @param {String|Array} type The event the UndoType that should be removed is made for. You can also pass an array of events.\n\t\t * @return {undefined}\n\t\t */\n\t\tremoveUndoType: function (type) {\n\t\t\tmanipulateUndoType(2, type, undefined, this.undoTypes);\n\t\t},\n\n\t\t/**\n\t\t * Removes all actions from the stack.\n\t\t * @return {undefined}\n\t\t */\n\t\tclear: function() {\n\t\t\tthis.stack.reset();\n\t\t\tthis.stack.pointer = -1;\n\t\t}\n\t});\n\n\t_.extend(UndoManager, {\n\t\t/**\n\t\t * Change the UndoManager's default attributes\n\t\t * @param {Object} defaultAttributes An object with the new default values.\n\t\t * @return {undefined}\n\t\t */\n\t\tdefaults: function (defaultAttributes) {\n\t\t\t_.extend(UndoManager.prototype.defaults, defaultAttributes);\n\t\t},\n\t\t/**\n\t\t * Add an UndoType to the global UndoTypes-object.\n\t\t * @param {String} type The event this UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. Must have the properties \"undo\", \"redo\" and \"on\". Can have the property \"condition\".\n\t\t * @return {undefined}\n\t\t */\n\t\t\"addUndoType\": function (type, fns) {\n\t\t\tmanipulateUndoType(0, type, fns, UndoTypes);\n\t\t},\n\t\t/**\n\t\t * Overwrite properties of an existing UndoType in the global UndoTypes-object.\n\t\t * @param {String} type The event the UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. It extends the existing object.\n\t\t * @return {undefined}\n\t\t */\n\t\t\"changeUndoType\": function (type, fns) {\n\t\t\tmanipulateUndoType(1, type, fns, UndoTypes)\n\t\t},\n\t\t/**\n\t\t * Remove one or more UndoTypes of this specific UndoManager-instance to fall back to the global UndoTypes.\n\t\t * @param {String|Array} type The event the UndoType that should be removed is made for. You can also pass an array of events.\n\t\t * @return {undefined}\n\t\t */\n\t\t\"removeUndoType\": function (type) {\n\t\t\tmanipulateUndoType(2, type, undefined, UndoTypes);\n\t\t}\n\t})\n\n\treturn Backbone.UndoManager = UndoManager;\n\n});\n","// Backbone.js 1.4.1\n\n// (c) 2010-2022 Jeremy Ashkenas and DocumentCloud\n// Backbone may be freely distributed under the MIT license.\n// For all details and documentation:\n// http://backbonejs.org\n\n(function(factory) {\n\n // Establish the root object, `window` (`self`) in the browser, or `global` on the server.\n // We use `self` instead of `window` for `WebWorker` support.\n var root = typeof self == 'object' && self.self === self && self ||\n typeof global == 'object' && global.global === global && global;\n\n // Set up Backbone appropriately for the environment. Start with AMD.\n if (typeof define === 'function' && define.amd) {\n define(['underscore', 'jquery', 'exports'], function(_, $, exports) {\n // Export global even in AMD case in case this script is loaded with\n // others that may still expect a global Backbone.\n root.Backbone = factory(root, exports, _, $);\n });\n\n // Next for Node.js or CommonJS. jQuery may not be needed as a module.\n } else if (typeof exports !== 'undefined') {\n var _ = require('underscore'), $;\n try { $ = require('jquery'); } catch (e) {}\n factory(root, exports, _, $);\n\n // Finally, as a browser global.\n } else {\n root.Backbone = factory(root, {}, root._, root.jQuery || root.Zepto || root.ender || root.$);\n }\n\n})(function(root, Backbone, _, $) {\n\n // Initial Setup\n // -------------\n\n // Save the previous value of the `Backbone` variable, so that it can be\n // restored later on, if `noConflict` is used.\n var previousBackbone = root.Backbone;\n\n // Create a local reference to a common array method we'll want to use later.\n var slice = Array.prototype.slice;\n\n // Current version of the library. Keep in sync with `package.json`.\n Backbone.VERSION = '1.4.1';\n\n // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns\n // the `$` variable.\n Backbone.$ = $;\n\n // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable\n // to its previous owner. Returns a reference to this Backbone object.\n Backbone.noConflict = function() {\n root.Backbone = previousBackbone;\n return this;\n };\n\n // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option\n // will fake `\"PATCH\"`, `\"PUT\"` and `\"DELETE\"` requests via the `_method` parameter and\n // set a `X-Http-Method-Override` header.\n Backbone.emulateHTTP = false;\n\n // Turn on `emulateJSON` to support legacy servers that can't deal with direct\n // `application/json` requests ... this will encode the body as\n // `application/x-www-form-urlencoded` instead and will send the model in a\n // form param named `model`.\n Backbone.emulateJSON = false;\n\n // Backbone.Events\n // ---------------\n\n // A module that can be mixed in to *any object* in order to provide it with\n // a custom event channel. You may bind a callback to an event with `on` or\n // remove with `off`; `trigger`-ing an event fires all callbacks in\n // succession.\n //\n // var object = {};\n // _.extend(object, Backbone.Events);\n // object.on('expand', function(){ alert('expanded'); });\n // object.trigger('expand');\n //\n var Events = Backbone.Events = {};\n\n // Regular expression used to split event strings.\n var eventSplitter = /\\s+/;\n\n // A private global variable to share between listeners and listenees.\n var _listening;\n\n // Iterates over the standard `event, callback` (as well as the fancy multiple\n // space-separated events `\"change blur\", callback` and jQuery-style event\n // maps `{event: callback}`).\n var eventsApi = function(iteratee, events, name, callback, opts) {\n var i = 0, names;\n if (name && typeof name === 'object') {\n // Handle event maps.\n if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;\n for (names = _.keys(name); i < names.length ; i++) {\n events = eventsApi(iteratee, events, names[i], name[names[i]], opts);\n }\n } else if (name && eventSplitter.test(name)) {\n // Handle space-separated event names by delegating them individually.\n for (names = name.split(eventSplitter); i < names.length; i++) {\n events = iteratee(events, names[i], callback, opts);\n }\n } else {\n // Finally, standard events.\n events = iteratee(events, name, callback, opts);\n }\n return events;\n };\n\n // Bind an event to a `callback` function. Passing `\"all\"` will bind\n // the callback to all events fired.\n Events.on = function(name, callback, context) {\n this._events = eventsApi(onApi, this._events || {}, name, callback, {\n context: context,\n ctx: this,\n listening: _listening\n });\n\n if (_listening) {\n var listeners = this._listeners || (this._listeners = {});\n listeners[_listening.id] = _listening;\n // Allow the listening to use a counter, instead of tracking\n // callbacks for library interop\n _listening.interop = false;\n }\n\n return this;\n };\n\n // Inversion-of-control versions of `on`. Tell *this* object to listen to\n // an event in another object... keeping track of what it's listening to\n // for easier unbinding later.\n Events.listenTo = function(obj, name, callback) {\n if (!obj) return this;\n var id = obj._listenId || (obj._listenId = _.uniqueId('l'));\n var listeningTo = this._listeningTo || (this._listeningTo = {});\n var listening = _listening = listeningTo[id];\n\n // This object is not listening to any other events on `obj` yet.\n // Setup the necessary references to track the listening callbacks.\n if (!listening) {\n this._listenId || (this._listenId = _.uniqueId('l'));\n listening = _listening = listeningTo[id] = new Listening(this, obj);\n }\n\n // Bind callbacks on obj.\n var error = tryCatchOn(obj, name, callback, this);\n _listening = void 0;\n\n if (error) throw error;\n // If the target obj is not Backbone.Events, track events manually.\n if (listening.interop) listening.on(name, callback);\n\n return this;\n };\n\n // The reducing API that adds a callback to the `events` object.\n var onApi = function(events, name, callback, options) {\n if (callback) {\n var handlers = events[name] || (events[name] = []);\n var context = options.context, ctx = options.ctx, listening = options.listening;\n if (listening) listening.count++;\n\n handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});\n }\n return events;\n };\n\n // An try-catch guarded #on function, to prevent poisoning the global\n // `_listening` variable.\n var tryCatchOn = function(obj, name, callback, context) {\n try {\n obj.on(name, callback, context);\n } catch (e) {\n return e;\n }\n };\n\n // Remove one or many callbacks. If `context` is null, removes all\n // callbacks with that function. If `callback` is null, removes all\n // callbacks for the event. If `name` is null, removes all bound\n // callbacks for all events.\n Events.off = function(name, callback, context) {\n if (!this._events) return this;\n this._events = eventsApi(offApi, this._events, name, callback, {\n context: context,\n listeners: this._listeners\n });\n\n return this;\n };\n\n // Tell this object to stop listening to either specific events ... or\n // to every object it's currently listening to.\n Events.stopListening = function(obj, name, callback) {\n var listeningTo = this._listeningTo;\n if (!listeningTo) return this;\n\n var ids = obj ? [obj._listenId] : _.keys(listeningTo);\n for (var i = 0; i < ids.length; i++) {\n var listening = listeningTo[ids[i]];\n\n // If listening doesn't exist, this object is not currently\n // listening to obj. Break out early.\n if (!listening) break;\n\n listening.obj.off(name, callback, this);\n if (listening.interop) listening.off(name, callback);\n }\n if (_.isEmpty(listeningTo)) this._listeningTo = void 0;\n\n return this;\n };\n\n // The reducing API that removes a callback from the `events` object.\n var offApi = function(events, name, callback, options) {\n if (!events) return;\n\n var context = options.context, listeners = options.listeners;\n var i = 0, names;\n\n // Delete all event listeners and \"drop\" events.\n if (!name && !context && !callback) {\n for (names = _.keys(listeners); i < names.length; i++) {\n listeners[names[i]].cleanup();\n }\n return;\n }\n\n names = name ? [name] : _.keys(events);\n for (; i < names.length; i++) {\n name = names[i];\n var handlers = events[name];\n\n // Bail out if there are no events stored.\n if (!handlers) break;\n\n // Find any remaining events.\n var remaining = [];\n for (var j = 0; j < handlers.length; j++) {\n var handler = handlers[j];\n if (\n callback && callback !== handler.callback &&\n callback !== handler.callback._callback ||\n context && context !== handler.context\n ) {\n remaining.push(handler);\n } else {\n var listening = handler.listening;\n if (listening) listening.off(name, callback);\n }\n }\n\n // Replace events if there are any remaining. Otherwise, clean up.\n if (remaining.length) {\n events[name] = remaining;\n } else {\n delete events[name];\n }\n }\n\n return events;\n };\n\n // Bind an event to only be triggered a single time. After the first time\n // the callback is invoked, its listener will be removed. If multiple events\n // are passed in using the space-separated syntax, the handler will fire\n // once for each event, not once for a combination of all events.\n Events.once = function(name, callback, context) {\n // Map the event into a `{event: once}` object.\n var events = eventsApi(onceMap, {}, name, callback, this.off.bind(this));\n if (typeof name === 'string' && context == null) callback = void 0;\n return this.on(events, callback, context);\n };\n\n // Inversion-of-control versions of `once`.\n Events.listenToOnce = function(obj, name, callback) {\n // Map the event into a `{event: once}` object.\n var events = eventsApi(onceMap, {}, name, callback, this.stopListening.bind(this, obj));\n return this.listenTo(obj, events);\n };\n\n // Reduces the event callbacks into a map of `{event: onceWrapper}`.\n // `offer` unbinds the `onceWrapper` after it has been called.\n var onceMap = function(map, name, callback, offer) {\n if (callback) {\n var once = map[name] = _.once(function() {\n offer(name, once);\n callback.apply(this, arguments);\n });\n once._callback = callback;\n }\n return map;\n };\n\n // Trigger one or many events, firing all bound callbacks. Callbacks are\n // passed the same arguments as `trigger` is, apart from the event name\n // (unless you're listening on `\"all\"`, which will cause your callback to\n // receive the true name of the event as the first argument).\n Events.trigger = function(name) {\n if (!this._events) return this;\n\n var length = Math.max(0, arguments.length - 1);\n var args = Array(length);\n for (var i = 0; i < length; i++) args[i] = arguments[i + 1];\n\n eventsApi(triggerApi, this._events, name, void 0, args);\n return this;\n };\n\n // Handles triggering the appropriate event callbacks.\n var triggerApi = function(objEvents, name, callback, args) {\n if (objEvents) {\n var events = objEvents[name];\n var allEvents = objEvents.all;\n if (events && allEvents) allEvents = allEvents.slice();\n if (events) triggerEvents(events, args);\n if (allEvents) triggerEvents(allEvents, [name].concat(args));\n }\n return objEvents;\n };\n\n // A difficult-to-believe, but optimized internal dispatch function for\n // triggering events. Tries to keep the usual cases speedy (most internal\n // Backbone events have 3 arguments).\n var triggerEvents = function(events, args) {\n var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];\n switch (args.length) {\n case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;\n case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;\n case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;\n case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;\n default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;\n }\n };\n\n // A listening class that tracks and cleans up memory bindings\n // when all callbacks have been offed.\n var Listening = function(listener, obj) {\n this.id = listener._listenId;\n this.listener = listener;\n this.obj = obj;\n this.interop = true;\n this.count = 0;\n this._events = void 0;\n };\n\n Listening.prototype.on = Events.on;\n\n // Offs a callback (or several).\n // Uses an optimized counter if the listenee uses Backbone.Events.\n // Otherwise, falls back to manual tracking to support events\n // library interop.\n Listening.prototype.off = function(name, callback) {\n var cleanup;\n if (this.interop) {\n this._events = eventsApi(offApi, this._events, name, callback, {\n context: void 0,\n listeners: void 0\n });\n cleanup = !this._events;\n } else {\n this.count--;\n cleanup = this.count === 0;\n }\n if (cleanup) this.cleanup();\n };\n\n // Cleans up memory bindings between the listener and the listenee.\n Listening.prototype.cleanup = function() {\n delete this.listener._listeningTo[this.obj._listenId];\n if (!this.interop) delete this.obj._listeners[this.id];\n };\n\n // Aliases for backwards compatibility.\n Events.bind = Events.on;\n Events.unbind = Events.off;\n\n // Allow the `Backbone` object to serve as a global event bus, for folks who\n // want global \"pubsub\" in a convenient place.\n _.extend(Backbone, Events);\n\n // Backbone.Model\n // --------------\n\n // Backbone **Models** are the basic data object in the framework --\n // frequently representing a row in a table in a database on your server.\n // A discrete chunk of data and a bunch of useful, related methods for\n // performing computations and transformations on that data.\n\n // Create a new model with the specified attributes. A client id (`cid`)\n // is automatically generated and assigned for you.\n var Model = Backbone.Model = function(attributes, options) {\n var attrs = attributes || {};\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n this.cid = _.uniqueId(this.cidPrefix);\n this.attributes = {};\n if (options.collection) this.collection = options.collection;\n if (options.parse) attrs = this.parse(attrs, options) || {};\n var defaults = _.result(this, 'defaults');\n attrs = _.defaults(_.extend({}, defaults, attrs), defaults);\n this.set(attrs, options);\n this.changed = {};\n this.initialize.apply(this, arguments);\n };\n\n // Attach all inheritable methods to the Model prototype.\n _.extend(Model.prototype, Events, {\n\n // A hash of attributes whose current and previous value differ.\n changed: null,\n\n // The value returned during the last failed validation.\n validationError: null,\n\n // The default name for the JSON `id` attribute is `\"id\"`. MongoDB and\n // CouchDB users may want to set this to `\"_id\"`.\n idAttribute: 'id',\n\n // The prefix is used to create the client id which is used to identify models locally.\n // You may want to override this if you're experiencing name clashes with model ids.\n cidPrefix: 'c',\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Model.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // Return a copy of the model's `attributes` object.\n toJSON: function(options) {\n return _.clone(this.attributes);\n },\n\n // Proxy `Backbone.sync` by default -- but override this if you need\n // custom syncing semantics for *this* particular model.\n sync: function() {\n return Backbone.sync.apply(this, arguments);\n },\n\n // Get the value of an attribute.\n get: function(attr) {\n return this.attributes[attr];\n },\n\n // Get the HTML-escaped value of an attribute.\n escape: function(attr) {\n return _.escape(this.get(attr));\n },\n\n // Returns `true` if the attribute contains a value that is not null\n // or undefined.\n has: function(attr) {\n return this.get(attr) != null;\n },\n\n // Special-cased proxy to underscore's `_.matches` method.\n matches: function(attrs) {\n return !!_.iteratee(attrs, this)(this.attributes);\n },\n\n // Set a hash of model attributes on the object, firing `\"change\"`. This is\n // the core primitive operation of a model, updating the data and notifying\n // anyone who needs to know about the change in state. The heart of the beast.\n set: function(key, val, options) {\n if (key == null) return this;\n\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n var attrs;\n if (typeof key === 'object') {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options || (options = {});\n\n // Run validation.\n if (!this._validate(attrs, options)) return false;\n\n // Extract attributes and options.\n var unset = options.unset;\n var silent = options.silent;\n var changes = [];\n var changing = this._changing;\n this._changing = true;\n\n if (!changing) {\n this._previousAttributes = _.clone(this.attributes);\n this.changed = {};\n }\n\n var current = this.attributes;\n var changed = this.changed;\n var prev = this._previousAttributes;\n\n // For each `set` attribute, update or delete the current value.\n for (var attr in attrs) {\n val = attrs[attr];\n if (!_.isEqual(current[attr], val)) changes.push(attr);\n if (!_.isEqual(prev[attr], val)) {\n changed[attr] = val;\n } else {\n delete changed[attr];\n }\n unset ? delete current[attr] : current[attr] = val;\n }\n\n // Update the `id`.\n if (this.idAttribute in attrs) {\n var prevId = this.id;\n this.id = this.get(this.idAttribute);\n this.trigger('changeId', this, prevId, options);\n }\n\n // Trigger all relevant attribute changes.\n if (!silent) {\n if (changes.length) this._pending = options;\n for (var i = 0; i < changes.length; i++) {\n this.trigger('change:' + changes[i], this, current[changes[i]], options);\n }\n }\n\n // You might be wondering why there's a `while` loop here. Changes can\n // be recursively nested within `\"change\"` events.\n if (changing) return this;\n if (!silent) {\n while (this._pending) {\n options = this._pending;\n this._pending = false;\n this.trigger('change', this, options);\n }\n }\n this._pending = false;\n this._changing = false;\n return this;\n },\n\n // Remove an attribute from the model, firing `\"change\"`. `unset` is a noop\n // if the attribute doesn't exist.\n unset: function(attr, options) {\n return this.set(attr, void 0, _.extend({}, options, {unset: true}));\n },\n\n // Clear all attributes on the model, firing `\"change\"`.\n clear: function(options) {\n var attrs = {};\n for (var key in this.attributes) attrs[key] = void 0;\n return this.set(attrs, _.extend({}, options, {unset: true}));\n },\n\n // Determine if the model has changed since the last `\"change\"` event.\n // If you specify an attribute name, determine if that attribute has changed.\n hasChanged: function(attr) {\n if (attr == null) return !_.isEmpty(this.changed);\n return _.has(this.changed, attr);\n },\n\n // Return an object containing all the attributes that have changed, or\n // false if there are no changed attributes. Useful for determining what\n // parts of a view need to be updated and/or what attributes need to be\n // persisted to the server. Unset attributes will be set to undefined.\n // You can also pass an attributes object to diff against the model,\n // determining if there *would be* a change.\n changedAttributes: function(diff) {\n if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;\n var old = this._changing ? this._previousAttributes : this.attributes;\n var changed = {};\n var hasChanged;\n for (var attr in diff) {\n var val = diff[attr];\n if (_.isEqual(old[attr], val)) continue;\n changed[attr] = val;\n hasChanged = true;\n }\n return hasChanged ? changed : false;\n },\n\n // Get the previous value of an attribute, recorded at the time the last\n // `\"change\"` event was fired.\n previous: function(attr) {\n if (attr == null || !this._previousAttributes) return null;\n return this._previousAttributes[attr];\n },\n\n // Get all of the attributes of the model at the time of the previous\n // `\"change\"` event.\n previousAttributes: function() {\n return _.clone(this._previousAttributes);\n },\n\n // Fetch the model from the server, merging the response with the model's\n // local attributes. Any changed attributes will trigger a \"change\" event.\n fetch: function(options) {\n options = _.extend({parse: true}, options);\n var model = this;\n var success = options.success;\n options.success = function(resp) {\n var serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (!model.set(serverAttrs, options)) return false;\n if (success) success.call(options.context, model, resp, options);\n model.trigger('sync', model, resp, options);\n };\n wrapError(this, options);\n return this.sync('read', this, options);\n },\n\n // Set a hash of model attributes, and sync the model to the server.\n // If the server returns an attributes hash that differs, the model's\n // state will be `set` again.\n save: function(key, val, options) {\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n var attrs;\n if (key == null || typeof key === 'object') {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options = _.extend({validate: true, parse: true}, options);\n var wait = options.wait;\n\n // If we're not waiting and attributes exist, save acts as\n // `set(attr).save(null, opts)` with validation. Otherwise, check if\n // the model will be valid when the attributes, if any, are set.\n if (attrs && !wait) {\n if (!this.set(attrs, options)) return false;\n } else if (!this._validate(attrs, options)) {\n return false;\n }\n\n // After a successful server-side save, the client is (optionally)\n // updated with the server-side state.\n var model = this;\n var success = options.success;\n var attributes = this.attributes;\n options.success = function(resp) {\n // Ensure attributes are restored during synchronous saves.\n model.attributes = attributes;\n var serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);\n if (serverAttrs && !model.set(serverAttrs, options)) return false;\n if (success) success.call(options.context, model, resp, options);\n model.trigger('sync', model, resp, options);\n };\n wrapError(this, options);\n\n // Set temporary attributes if `{wait: true}` to properly find new ids.\n if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);\n\n var method = this.isNew() ? 'create' : options.patch ? 'patch' : 'update';\n if (method === 'patch' && !options.attrs) options.attrs = attrs;\n var xhr = this.sync(method, this, options);\n\n // Restore attributes.\n this.attributes = attributes;\n\n return xhr;\n },\n\n // Destroy this model on the server if it was already persisted.\n // Optimistically removes the model from its collection, if it has one.\n // If `wait: true` is passed, waits for the server to respond before removal.\n destroy: function(options) {\n options = options ? _.clone(options) : {};\n var model = this;\n var success = options.success;\n var wait = options.wait;\n\n var destroy = function() {\n model.stopListening();\n model.trigger('destroy', model, model.collection, options);\n };\n\n options.success = function(resp) {\n if (wait) destroy();\n if (success) success.call(options.context, model, resp, options);\n if (!model.isNew()) model.trigger('sync', model, resp, options);\n };\n\n var xhr = false;\n if (this.isNew()) {\n _.defer(options.success);\n } else {\n wrapError(this, options);\n xhr = this.sync('delete', this, options);\n }\n if (!wait) destroy();\n return xhr;\n },\n\n // Default URL for the model's representation on the server -- if you're\n // using Backbone's restful methods, override this to change the endpoint\n // that will be called.\n url: function() {\n var base =\n _.result(this, 'urlRoot') ||\n _.result(this.collection, 'url') ||\n urlError();\n if (this.isNew()) return base;\n var id = this.get(this.idAttribute);\n return base.replace(/[^\\/]$/, '$&/') + encodeURIComponent(id);\n },\n\n // **parse** converts a response into the hash of attributes to be `set` on\n // the model. The default implementation is just to pass the response along.\n parse: function(resp, options) {\n return resp;\n },\n\n // Create a new model with identical attributes to this one.\n clone: function() {\n return new this.constructor(this.attributes);\n },\n\n // A model is new if it has never been saved to the server, and lacks an id.\n isNew: function() {\n return !this.has(this.idAttribute);\n },\n\n // Check if the model is currently in a valid state.\n isValid: function(options) {\n return this._validate({}, _.extend({}, options, {validate: true}));\n },\n\n // Run validation against the next complete set of model attributes,\n // returning `true` if all is well. Otherwise, fire an `\"invalid\"` event.\n _validate: function(attrs, options) {\n if (!options.validate || !this.validate) return true;\n attrs = _.extend({}, this.attributes, attrs);\n var error = this.validationError = this.validate(attrs, options) || null;\n if (!error) return true;\n this.trigger('invalid', this, error, _.extend(options, {validationError: error}));\n return false;\n }\n\n });\n\n // Backbone.Collection\n // -------------------\n\n // If models tend to represent a single row of data, a Backbone Collection is\n // more analogous to a table full of data ... or a small slice or page of that\n // table, or a collection of rows that belong together for a particular reason\n // -- all of the messages in this particular folder, all of the documents\n // belonging to this particular author, and so on. Collections maintain\n // indexes of their models, both in order, and for lookup by `id`.\n\n // Create a new **Collection**, perhaps to contain a specific type of `model`.\n // If a `comparator` is specified, the Collection will maintain\n // its models in sort order, as they're added and removed.\n var Collection = Backbone.Collection = function(models, options) {\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n if (options.model) this.model = options.model;\n if (options.comparator !== void 0) this.comparator = options.comparator;\n this._reset();\n this.initialize.apply(this, arguments);\n if (models) this.reset(models, _.extend({silent: true}, options));\n };\n\n // Default options for `Collection#set`.\n var setOptions = {add: true, remove: true, merge: true};\n var addOptions = {add: true, remove: false};\n\n // Splices `insert` into `array` at index `at`.\n var splice = function(array, insert, at) {\n at = Math.min(Math.max(at, 0), array.length);\n var tail = Array(array.length - at);\n var length = insert.length;\n var i;\n for (i = 0; i < tail.length; i++) tail[i] = array[i + at];\n for (i = 0; i < length; i++) array[i + at] = insert[i];\n for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];\n };\n\n // Define the Collection's inheritable methods.\n _.extend(Collection.prototype, Events, {\n\n // The default model for a collection is just a **Backbone.Model**.\n // This should be overridden in most cases.\n model: Model,\n\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Collection.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // The JSON representation of a Collection is an array of the\n // models' attributes.\n toJSON: function(options) {\n return this.map(function(model) { return model.toJSON(options); });\n },\n\n // Proxy `Backbone.sync` by default.\n sync: function() {\n return Backbone.sync.apply(this, arguments);\n },\n\n // Add a model, or list of models to the set. `models` may be Backbone\n // Models or raw JavaScript objects to be converted to Models, or any\n // combination of the two.\n add: function(models, options) {\n return this.set(models, _.extend({merge: false}, options, addOptions));\n },\n\n // Remove a model, or a list of models from the set.\n remove: function(models, options) {\n options = _.extend({}, options);\n var singular = !_.isArray(models);\n models = singular ? [models] : models.slice();\n var removed = this._removeModels(models, options);\n if (!options.silent && removed.length) {\n options.changes = {added: [], merged: [], removed: removed};\n this.trigger('update', this, options);\n }\n return singular ? removed[0] : removed;\n },\n\n // Update a collection by `set`-ing a new list of models, adding new ones,\n // removing models that are no longer present, and merging models that\n // already exist in the collection, as necessary. Similar to **Model#set**,\n // the core operation for updating the data contained by the collection.\n set: function(models, options) {\n if (models == null) return;\n\n options = _.extend({}, setOptions, options);\n if (options.parse && !this._isModel(models)) {\n models = this.parse(models, options) || [];\n }\n\n var singular = !_.isArray(models);\n models = singular ? [models] : models.slice();\n\n var at = options.at;\n if (at != null) at = +at;\n if (at > this.length) at = this.length;\n if (at < 0) at += this.length + 1;\n\n var set = [];\n var toAdd = [];\n var toMerge = [];\n var toRemove = [];\n var modelMap = {};\n\n var add = options.add;\n var merge = options.merge;\n var remove = options.remove;\n\n var sort = false;\n var sortable = this.comparator && at == null && options.sort !== false;\n var sortAttr = _.isString(this.comparator) ? this.comparator : null;\n\n // Turn bare objects into model references, and prevent invalid models\n // from being added.\n var model, i;\n for (i = 0; i < models.length; i++) {\n model = models[i];\n\n // If a duplicate is found, prevent it from being added and\n // optionally merge it into the existing model.\n var existing = this.get(model);\n if (existing) {\n if (merge && model !== existing) {\n var attrs = this._isModel(model) ? model.attributes : model;\n if (options.parse) attrs = existing.parse(attrs, options);\n existing.set(attrs, options);\n toMerge.push(existing);\n if (sortable && !sort) sort = existing.hasChanged(sortAttr);\n }\n if (!modelMap[existing.cid]) {\n modelMap[existing.cid] = true;\n set.push(existing);\n }\n models[i] = existing;\n\n // If this is a new, valid model, push it to the `toAdd` list.\n } else if (add) {\n model = models[i] = this._prepareModel(model, options);\n if (model) {\n toAdd.push(model);\n this._addReference(model, options);\n modelMap[model.cid] = true;\n set.push(model);\n }\n }\n }\n\n // Remove stale models.\n if (remove) {\n for (i = 0; i < this.length; i++) {\n model = this.models[i];\n if (!modelMap[model.cid]) toRemove.push(model);\n }\n if (toRemove.length) this._removeModels(toRemove, options);\n }\n\n // See if sorting is needed, update `length` and splice in new models.\n var orderChanged = false;\n var replace = !sortable && add && remove;\n if (set.length && replace) {\n orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {\n return m !== set[index];\n });\n this.models.length = 0;\n splice(this.models, set, 0);\n this.length = this.models.length;\n } else if (toAdd.length) {\n if (sortable) sort = true;\n splice(this.models, toAdd, at == null ? this.length : at);\n this.length = this.models.length;\n }\n\n // Silently sort the collection if appropriate.\n if (sort) this.sort({silent: true});\n\n // Unless silenced, it's time to fire all appropriate add/sort/update events.\n if (!options.silent) {\n for (i = 0; i < toAdd.length; i++) {\n if (at != null) options.index = at + i;\n model = toAdd[i];\n model.trigger('add', model, this, options);\n }\n if (sort || orderChanged) this.trigger('sort', this, options);\n if (toAdd.length || toRemove.length || toMerge.length) {\n options.changes = {\n added: toAdd,\n removed: toRemove,\n merged: toMerge\n };\n this.trigger('update', this, options);\n }\n }\n\n // Return the added (or merged) model (or models).\n return singular ? models[0] : models;\n },\n\n // When you have more items than you want to add or remove individually,\n // you can reset the entire set with a new list of models, without firing\n // any granular `add` or `remove` events. Fires `reset` when finished.\n // Useful for bulk operations and optimizations.\n reset: function(models, options) {\n options = options ? _.clone(options) : {};\n for (var i = 0; i < this.models.length; i++) {\n this._removeReference(this.models[i], options);\n }\n options.previousModels = this.models;\n this._reset();\n models = this.add(models, _.extend({silent: true}, options));\n if (!options.silent) this.trigger('reset', this, options);\n return models;\n },\n\n // Add a model to the end of the collection.\n push: function(model, options) {\n return this.add(model, _.extend({at: this.length}, options));\n },\n\n // Remove a model from the end of the collection.\n pop: function(options) {\n var model = this.at(this.length - 1);\n return this.remove(model, options);\n },\n\n // Add a model to the beginning of the collection.\n unshift: function(model, options) {\n return this.add(model, _.extend({at: 0}, options));\n },\n\n // Remove a model from the beginning of the collection.\n shift: function(options) {\n var model = this.at(0);\n return this.remove(model, options);\n },\n\n // Slice out a sub-array of models from the collection.\n slice: function() {\n return slice.apply(this.models, arguments);\n },\n\n // Get a model from the set by id, cid, model object with id or cid\n // properties, or an attributes object that is transformed through modelId.\n get: function(obj) {\n if (obj == null) return void 0;\n return this._byId[obj] ||\n this._byId[this.modelId(this._isModel(obj) ? obj.attributes : obj, obj.idAttribute)] ||\n obj.cid && this._byId[obj.cid];\n },\n\n // Returns `true` if the model is in the collection.\n has: function(obj) {\n return this.get(obj) != null;\n },\n\n // Get the model at the given index.\n at: function(index) {\n if (index < 0) index += this.length;\n return this.models[index];\n },\n\n // Return models with matching attributes. Useful for simple cases of\n // `filter`.\n where: function(attrs, first) {\n return this[first ? 'find' : 'filter'](attrs);\n },\n\n // Return the first model with matching attributes. Useful for simple cases\n // of `find`.\n findWhere: function(attrs) {\n return this.where(attrs, true);\n },\n\n // Force the collection to re-sort itself. You don't need to call this under\n // normal circumstances, as the set will maintain sort order as each item\n // is added.\n sort: function(options) {\n var comparator = this.comparator;\n if (!comparator) throw new Error('Cannot sort a set without a comparator');\n options || (options = {});\n\n var length = comparator.length;\n if (_.isFunction(comparator)) comparator = comparator.bind(this);\n\n // Run sort based on type of `comparator`.\n if (length === 1 || _.isString(comparator)) {\n this.models = this.sortBy(comparator);\n } else {\n this.models.sort(comparator);\n }\n if (!options.silent) this.trigger('sort', this, options);\n return this;\n },\n\n // Pluck an attribute from each model in the collection.\n pluck: function(attr) {\n return this.map(attr + '');\n },\n\n // Fetch the default set of models for this collection, resetting the\n // collection when they arrive. If `reset: true` is passed, the response\n // data will be passed through the `reset` method instead of `set`.\n fetch: function(options) {\n options = _.extend({parse: true}, options);\n var success = options.success;\n var collection = this;\n options.success = function(resp) {\n var method = options.reset ? 'reset' : 'set';\n collection[method](resp, options);\n if (success) success.call(options.context, collection, resp, options);\n collection.trigger('sync', collection, resp, options);\n };\n wrapError(this, options);\n return this.sync('read', this, options);\n },\n\n // Create a new instance of a model in this collection. Add the model to the\n // collection immediately, unless `wait: true` is passed, in which case we\n // wait for the server to agree.\n create: function(model, options) {\n options = options ? _.clone(options) : {};\n var wait = options.wait;\n model = this._prepareModel(model, options);\n if (!model) return false;\n if (!wait) this.add(model, options);\n var collection = this;\n var success = options.success;\n options.success = function(m, resp, callbackOpts) {\n if (wait) collection.add(m, callbackOpts);\n if (success) success.call(callbackOpts.context, m, resp, callbackOpts);\n };\n model.save(null, options);\n return model;\n },\n\n // **parse** converts a response into a list of models to be added to the\n // collection. The default implementation is just to pass it through.\n parse: function(resp, options) {\n return resp;\n },\n\n // Create a new collection with an identical list of models as this one.\n clone: function() {\n return new this.constructor(this.models, {\n model: this.model,\n comparator: this.comparator\n });\n },\n\n // Define how to uniquely identify models in the collection.\n modelId: function(attrs, idAttribute) {\n return attrs[idAttribute || this.model.prototype.idAttribute || 'id'];\n },\n\n // Get an iterator of all models in this collection.\n values: function() {\n return new CollectionIterator(this, ITERATOR_VALUES);\n },\n\n // Get an iterator of all model IDs in this collection.\n keys: function() {\n return new CollectionIterator(this, ITERATOR_KEYS);\n },\n\n // Get an iterator of all [ID, model] tuples in this collection.\n entries: function() {\n return new CollectionIterator(this, ITERATOR_KEYSVALUES);\n },\n\n // Private method to reset all internal state. Called when the collection\n // is first initialized or reset.\n _reset: function() {\n this.length = 0;\n this.models = [];\n this._byId = {};\n },\n\n // Prepare a hash of attributes (or other model) to be added to this\n // collection.\n _prepareModel: function(attrs, options) {\n if (this._isModel(attrs)) {\n if (!attrs.collection) attrs.collection = this;\n return attrs;\n }\n options = options ? _.clone(options) : {};\n options.collection = this;\n\n var model;\n if (this.model.prototype) {\n model = new this.model(attrs, options);\n } else {\n // ES class methods didn't have prototype\n model = this.model(attrs, options);\n }\n\n if (!model.validationError) return model;\n this.trigger('invalid', this, model.validationError, options);\n return false;\n },\n\n // Internal method called by both remove and set.\n _removeModels: function(models, options) {\n var removed = [];\n for (var i = 0; i < models.length; i++) {\n var model = this.get(models[i]);\n if (!model) continue;\n\n var index = this.indexOf(model);\n this.models.splice(index, 1);\n this.length--;\n\n // Remove references before triggering 'remove' event to prevent an\n // infinite loop. #3693\n delete this._byId[model.cid];\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) delete this._byId[id];\n\n if (!options.silent) {\n options.index = index;\n model.trigger('remove', model, this, options);\n }\n\n removed.push(model);\n this._removeReference(model, options);\n }\n return removed;\n },\n\n // Method for checking whether an object should be considered a model for\n // the purposes of adding to the collection.\n _isModel: function(model) {\n return model instanceof Model;\n },\n\n // Internal method to create a model's ties to a collection.\n _addReference: function(model, options) {\n this._byId[model.cid] = model;\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) this._byId[id] = model;\n model.on('all', this._onModelEvent, this);\n },\n\n // Internal method to sever a model's ties to a collection.\n _removeReference: function(model, options) {\n delete this._byId[model.cid];\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) delete this._byId[id];\n if (this === model.collection) delete model.collection;\n model.off('all', this._onModelEvent, this);\n },\n\n // Internal method called every time a model in the set fires an event.\n // Sets need to update their indexes when models change ids. All other\n // events simply proxy through. \"add\" and \"remove\" events that originate\n // in other collections are ignored.\n _onModelEvent: function(event, model, collection, options) {\n if (model) {\n if ((event === 'add' || event === 'remove') && collection !== this) return;\n if (event === 'destroy') this.remove(model, options);\n if (event === 'changeId') {\n var prevId = this.modelId(model.previousAttributes(), model.idAttribute);\n var id = this.modelId(model.attributes, model.idAttribute);\n if (prevId != null) delete this._byId[prevId];\n if (id != null) this._byId[id] = model;\n }\n }\n this.trigger.apply(this, arguments);\n }\n\n });\n\n // Defining an @@iterator method implements JavaScript's Iterable protocol.\n // In modern ES2015 browsers, this value is found at Symbol.iterator.\n /* global Symbol */\n var $$iterator = typeof Symbol === 'function' && Symbol.iterator;\n if ($$iterator) {\n Collection.prototype[$$iterator] = Collection.prototype.values;\n }\n\n // CollectionIterator\n // ------------------\n\n // A CollectionIterator implements JavaScript's Iterator protocol, allowing the\n // use of `for of` loops in modern browsers and interoperation between\n // Backbone.Collection and other JavaScript functions and third-party libraries\n // which can operate on Iterables.\n var CollectionIterator = function(collection, kind) {\n this._collection = collection;\n this._kind = kind;\n this._index = 0;\n };\n\n // This \"enum\" defines the three possible kinds of values which can be emitted\n // by a CollectionIterator that correspond to the values(), keys() and entries()\n // methods on Collection, respectively.\n var ITERATOR_VALUES = 1;\n var ITERATOR_KEYS = 2;\n var ITERATOR_KEYSVALUES = 3;\n\n // All Iterators should themselves be Iterable.\n if ($$iterator) {\n CollectionIterator.prototype[$$iterator] = function() {\n return this;\n };\n }\n\n CollectionIterator.prototype.next = function() {\n if (this._collection) {\n\n // Only continue iterating if the iterated collection is long enough.\n if (this._index < this._collection.length) {\n var model = this._collection.at(this._index);\n this._index++;\n\n // Construct a value depending on what kind of values should be iterated.\n var value;\n if (this._kind === ITERATOR_VALUES) {\n value = model;\n } else {\n var id = this._collection.modelId(model.attributes, model.idAttribute);\n if (this._kind === ITERATOR_KEYS) {\n value = id;\n } else { // ITERATOR_KEYSVALUES\n value = [id, model];\n }\n }\n return {value: value, done: false};\n }\n\n // Once exhausted, remove the reference to the collection so future\n // calls to the next method always return done.\n this._collection = void 0;\n }\n\n return {value: void 0, done: true};\n };\n\n // Backbone.View\n // -------------\n\n // Backbone Views are almost more convention than they are actual code. A View\n // is simply a JavaScript object that represents a logical chunk of UI in the\n // DOM. This might be a single item, an entire list, a sidebar or panel, or\n // even the surrounding frame which wraps your whole app. Defining a chunk of\n // UI as a **View** allows you to define your DOM events declaratively, without\n // having to worry about render order ... and makes it easy for the view to\n // react to specific changes in the state of your models.\n\n // Creating a Backbone.View creates its initial element outside of the DOM,\n // if an existing element is not provided...\n var View = Backbone.View = function(options) {\n this.cid = _.uniqueId('view');\n this.preinitialize.apply(this, arguments);\n _.extend(this, _.pick(options, viewOptions));\n this._ensureElement();\n this.initialize.apply(this, arguments);\n };\n\n // Cached regex to split keys for `delegate`.\n var delegateEventSplitter = /^(\\S+)\\s*(.*)$/;\n\n // List of view options to be set as properties.\n var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];\n\n // Set up all inheritable **Backbone.View** properties and methods.\n _.extend(View.prototype, Events, {\n\n // The default `tagName` of a View's element is `\"div\"`.\n tagName: 'div',\n\n // jQuery delegate for element lookup, scoped to DOM elements within the\n // current view. This should be preferred to global lookups where possible.\n $: function(selector) {\n return this.$el.find(selector);\n },\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the View\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // **render** is the core function that your view should override, in order\n // to populate its element (`this.el`), with the appropriate HTML. The\n // convention is for **render** to always return `this`.\n render: function() {\n return this;\n },\n\n // Remove this view by taking the element out of the DOM, and removing any\n // applicable Backbone.Events listeners.\n remove: function() {\n this._removeElement();\n this.stopListening();\n return this;\n },\n\n // Remove this view's element from the document and all event listeners\n // attached to it. Exposed for subclasses using an alternative DOM\n // manipulation API.\n _removeElement: function() {\n this.$el.remove();\n },\n\n // Change the view's element (`this.el` property) and re-delegate the\n // view's events on the new element.\n setElement: function(element) {\n this.undelegateEvents();\n this._setElement(element);\n this.delegateEvents();\n return this;\n },\n\n // Creates the `this.el` and `this.$el` references for this view using the\n // given `el`. `el` can be a CSS selector or an HTML string, a jQuery\n // context or an element. Subclasses can override this to utilize an\n // alternative DOM manipulation API and are only required to set the\n // `this.el` property.\n _setElement: function(el) {\n this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);\n this.el = this.$el[0];\n },\n\n // Set callbacks, where `this.events` is a hash of\n //\n // *{\"event selector\": \"callback\"}*\n //\n // {\n // 'mousedown .title': 'edit',\n // 'click .button': 'save',\n // 'click .open': function(e) { ... }\n // }\n //\n // pairs. Callbacks will be bound to the view, with `this` set properly.\n // Uses event delegation for efficiency.\n // Omitting the selector binds the event to `this.el`.\n delegateEvents: function(events) {\n events || (events = _.result(this, 'events'));\n if (!events) return this;\n this.undelegateEvents();\n for (var key in events) {\n var method = events[key];\n if (!_.isFunction(method)) method = this[method];\n if (!method) continue;\n var match = key.match(delegateEventSplitter);\n this.delegate(match[1], match[2], method.bind(this));\n }\n return this;\n },\n\n // Add a single event listener to the view's element (or a child element\n // using `selector`). This only works for delegate-able events: not `focus`,\n // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.\n delegate: function(eventName, selector, listener) {\n this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);\n return this;\n },\n\n // Clears all callbacks previously bound to the view by `delegateEvents`.\n // You usually don't need to use this, but may wish to if you have multiple\n // Backbone views attached to the same DOM element.\n undelegateEvents: function() {\n if (this.$el) this.$el.off('.delegateEvents' + this.cid);\n return this;\n },\n\n // A finer-grained `undelegateEvents` for removing a single delegated event.\n // `selector` and `listener` are both optional.\n undelegate: function(eventName, selector, listener) {\n this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);\n return this;\n },\n\n // Produces a DOM element to be assigned to your view. Exposed for\n // subclasses using an alternative DOM manipulation API.\n _createElement: function(tagName) {\n return document.createElement(tagName);\n },\n\n // Ensure that the View has a DOM element to render into.\n // If `this.el` is a string, pass it through `$()`, take the first\n // matching element, and re-assign it to `el`. Otherwise, create\n // an element from the `id`, `className` and `tagName` properties.\n _ensureElement: function() {\n if (!this.el) {\n var attrs = _.extend({}, _.result(this, 'attributes'));\n if (this.id) attrs.id = _.result(this, 'id');\n if (this.className) attrs['class'] = _.result(this, 'className');\n this.setElement(this._createElement(_.result(this, 'tagName')));\n this._setAttributes(attrs);\n } else {\n this.setElement(_.result(this, 'el'));\n }\n },\n\n // Set attributes from a hash on this view's element. Exposed for\n // subclasses using an alternative DOM manipulation API.\n _setAttributes: function(attributes) {\n this.$el.attr(attributes);\n }\n\n });\n\n // Proxy Backbone class methods to Underscore functions, wrapping the model's\n // `attributes` object or collection's `models` array behind the scenes.\n //\n // collection.filter(function(model) { return model.get('age') > 10 });\n // collection.each(this.addView);\n //\n // `Function#apply` can be slow so we use the method's arg count, if we know it.\n var addMethod = function(base, length, method, attribute) {\n switch (length) {\n case 1: return function() {\n return base[method](this[attribute]);\n };\n case 2: return function(value) {\n return base[method](this[attribute], value);\n };\n case 3: return function(iteratee, context) {\n return base[method](this[attribute], cb(iteratee, this), context);\n };\n case 4: return function(iteratee, defaultVal, context) {\n return base[method](this[attribute], cb(iteratee, this), defaultVal, context);\n };\n default: return function() {\n var args = slice.call(arguments);\n args.unshift(this[attribute]);\n return base[method].apply(base, args);\n };\n }\n };\n\n var addUnderscoreMethods = function(Class, base, methods, attribute) {\n _.each(methods, function(length, method) {\n if (base[method]) Class.prototype[method] = addMethod(base, length, method, attribute);\n });\n };\n\n // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.\n var cb = function(iteratee, instance) {\n if (_.isFunction(iteratee)) return iteratee;\n if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);\n if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };\n return iteratee;\n };\n var modelMatcher = function(attrs) {\n var matcher = _.matches(attrs);\n return function(model) {\n return matcher(model.attributes);\n };\n };\n\n // Underscore methods that we want to implement on the Collection.\n // 90% of the core usefulness of Backbone Collections is actually implemented\n // right here:\n var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,\n foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,\n select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,\n contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,\n head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,\n without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,\n isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,\n sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};\n\n\n // Underscore methods that we want to implement on the Model, mapped to the\n // number of arguments they take.\n var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,\n omit: 0, chain: 1, isEmpty: 1};\n\n // Mix in each Underscore method as a proxy to `Collection#models`.\n\n _.each([\n [Collection, collectionMethods, 'models'],\n [Model, modelMethods, 'attributes']\n ], function(config) {\n var Base = config[0],\n methods = config[1],\n attribute = config[2];\n\n Base.mixin = function(obj) {\n var mappings = _.reduce(_.functions(obj), function(memo, name) {\n memo[name] = 0;\n return memo;\n }, {});\n addUnderscoreMethods(Base, obj, mappings, attribute);\n };\n\n addUnderscoreMethods(Base, _, methods, attribute);\n });\n\n // Backbone.sync\n // -------------\n\n // Override this function to change the manner in which Backbone persists\n // models to the server. You will be passed the type of request, and the\n // model in question. By default, makes a RESTful Ajax request\n // to the model's `url()`. Some possible customizations could be:\n //\n // * Use `setTimeout` to batch rapid-fire updates into a single request.\n // * Send up the models as XML instead of JSON.\n // * Persist models via WebSockets instead of Ajax.\n //\n // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests\n // as `POST`, with a `_method` parameter containing the true HTTP method,\n // as well as all requests with the body as `application/x-www-form-urlencoded`\n // instead of `application/json` with the model in a param named `model`.\n // Useful when interfacing with server-side languages like **PHP** that make\n // it difficult to read the body of `PUT` requests.\n Backbone.sync = function(method, model, options) {\n var type = methodMap[method];\n\n // Default options, unless specified.\n _.defaults(options || (options = {}), {\n emulateHTTP: Backbone.emulateHTTP,\n emulateJSON: Backbone.emulateJSON\n });\n\n // Default JSON-request options.\n var params = {type: type, dataType: 'json'};\n\n // Ensure that we have a URL.\n if (!options.url) {\n params.url = _.result(model, 'url') || urlError();\n }\n\n // Ensure that we have the appropriate request data.\n if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {\n params.contentType = 'application/json';\n params.data = JSON.stringify(options.attrs || model.toJSON(options));\n }\n\n // For older servers, emulate JSON by encoding the request into an HTML-form.\n if (options.emulateJSON) {\n params.contentType = 'application/x-www-form-urlencoded';\n params.data = params.data ? {model: params.data} : {};\n }\n\n // For older servers, emulate HTTP by mimicking the HTTP method with `_method`\n // And an `X-HTTP-Method-Override` header.\n if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {\n params.type = 'POST';\n if (options.emulateJSON) params.data._method = type;\n var beforeSend = options.beforeSend;\n options.beforeSend = function(xhr) {\n xhr.setRequestHeader('X-HTTP-Method-Override', type);\n if (beforeSend) return beforeSend.apply(this, arguments);\n };\n }\n\n // Don't process data on a non-GET request.\n if (params.type !== 'GET' && !options.emulateJSON) {\n params.processData = false;\n }\n\n // Pass along `textStatus` and `errorThrown` from jQuery.\n var error = options.error;\n options.error = function(xhr, textStatus, errorThrown) {\n options.textStatus = textStatus;\n options.errorThrown = errorThrown;\n if (error) error.call(options.context, xhr, textStatus, errorThrown);\n };\n\n // Make the request, allowing the user to override any Ajax options.\n var xhr = options.xhr = Backbone.ajax(_.extend(params, options));\n model.trigger('request', model, xhr, options);\n return xhr;\n };\n\n // Map from CRUD to HTTP for our default `Backbone.sync` implementation.\n var methodMap = {\n 'create': 'POST',\n 'update': 'PUT',\n 'patch': 'PATCH',\n 'delete': 'DELETE',\n 'read': 'GET'\n };\n\n // Set the default implementation of `Backbone.ajax` to proxy through to `$`.\n // Override this if you'd like to use a different library.\n Backbone.ajax = function() {\n return Backbone.$.ajax.apply(Backbone.$, arguments);\n };\n\n // Backbone.Router\n // ---------------\n\n // Routers map faux-URLs to actions, and fire events when routes are\n // matched. Creating a new one sets its `routes` hash, if not set statically.\n var Router = Backbone.Router = function(options) {\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n if (options.routes) this.routes = options.routes;\n this._bindRoutes();\n this.initialize.apply(this, arguments);\n };\n\n // Cached regular expressions for matching named param parts and splatted\n // parts of route strings.\n var optionalParam = /\\((.*?)\\)/g;\n var namedParam = /(\\(\\?)?:\\w+/g;\n var splatParam = /\\*\\w+/g;\n var escapeRegExp = /[\\-{}\\[\\]+?.,\\\\\\^$|#\\s]/g;\n\n // Set up all inheritable **Backbone.Router** properties and methods.\n _.extend(Router.prototype, Events, {\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Router.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // Manually bind a single named route to a callback. For example:\n //\n // this.route('search/:query/p:num', 'search', function(query, num) {\n // ...\n // });\n //\n route: function(route, name, callback) {\n if (!_.isRegExp(route)) route = this._routeToRegExp(route);\n if (_.isFunction(name)) {\n callback = name;\n name = '';\n }\n if (!callback) callback = this[name];\n var router = this;\n Backbone.history.route(route, function(fragment) {\n var args = router._extractParameters(route, fragment);\n if (router.execute(callback, args, name) !== false) {\n router.trigger.apply(router, ['route:' + name].concat(args));\n router.trigger('route', name, args);\n Backbone.history.trigger('route', router, name, args);\n }\n });\n return this;\n },\n\n // Execute a route handler with the provided parameters. This is an\n // excellent place to do pre-route setup or post-route cleanup.\n execute: function(callback, args, name) {\n if (callback) callback.apply(this, args);\n },\n\n // Simple proxy to `Backbone.history` to save a fragment into the history.\n navigate: function(fragment, options) {\n Backbone.history.navigate(fragment, options);\n return this;\n },\n\n // Bind all defined routes to `Backbone.history`. We have to reverse the\n // order of the routes here to support behavior where the most general\n // routes can be defined at the bottom of the route map.\n _bindRoutes: function() {\n if (!this.routes) return;\n this.routes = _.result(this, 'routes');\n var route, routes = _.keys(this.routes);\n while ((route = routes.pop()) != null) {\n this.route(route, this.routes[route]);\n }\n },\n\n // Convert a route string into a regular expression, suitable for matching\n // against the current location hash.\n _routeToRegExp: function(route) {\n route = route.replace(escapeRegExp, '\\\\$&')\n .replace(optionalParam, '(?:$1)?')\n .replace(namedParam, function(match, optional) {\n return optional ? match : '([^/?]+)';\n })\n .replace(splatParam, '([^?]*?)');\n return new RegExp('^' + route + '(?:\\\\?([\\\\s\\\\S]*))?$');\n },\n\n // Given a route, and a URL fragment that it matches, return the array of\n // extracted decoded parameters. Empty or unmatched parameters will be\n // treated as `null` to normalize cross-browser behavior.\n _extractParameters: function(route, fragment) {\n var params = route.exec(fragment).slice(1);\n return _.map(params, function(param, i) {\n // Don't decode the search params.\n if (i === params.length - 1) return param || null;\n return param ? decodeURIComponent(param) : null;\n });\n }\n\n });\n\n // Backbone.History\n // ----------------\n\n // Handles cross-browser history management, based on either\n // [pushState](http://diveintohtml5.info/history.html) and real URLs, or\n // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)\n // and URL fragments. If the browser supports neither (old IE, natch),\n // falls back to polling.\n var History = Backbone.History = function() {\n this.handlers = [];\n this.checkUrl = this.checkUrl.bind(this);\n\n // Ensure that `History` can be used outside of the browser.\n if (typeof window !== 'undefined') {\n this.location = window.location;\n this.history = window.history;\n }\n };\n\n // Cached regex for stripping a leading hash/slash and trailing space.\n var routeStripper = /^[#\\/]|\\s+$/g;\n\n // Cached regex for stripping leading and trailing slashes.\n var rootStripper = /^\\/+|\\/+$/g;\n\n // Cached regex for stripping urls of hash.\n var pathStripper = /#.*$/;\n\n // Has the history handling already been started?\n History.started = false;\n\n // Set up all inheritable **Backbone.History** properties and methods.\n _.extend(History.prototype, Events, {\n\n // The default interval to poll for hash changes, if necessary, is\n // twenty times a second.\n interval: 50,\n\n // Are we at the app root?\n atRoot: function() {\n var path = this.location.pathname.replace(/[^\\/]$/, '$&/');\n return path === this.root && !this.getSearch();\n },\n\n // Does the pathname match the root?\n matchRoot: function() {\n var path = this.decodeFragment(this.location.pathname);\n var rootPath = path.slice(0, this.root.length - 1) + '/';\n return rootPath === this.root;\n },\n\n // Unicode characters in `location.pathname` are percent encoded so they're\n // decoded for comparison. `%25` should not be decoded since it may be part\n // of an encoded parameter.\n decodeFragment: function(fragment) {\n return decodeURI(fragment.replace(/%25/g, '%2525'));\n },\n\n // In IE6, the hash fragment and search params are incorrect if the\n // fragment contains `?`.\n getSearch: function() {\n var match = this.location.href.replace(/#.*/, '').match(/\\?.+/);\n return match ? match[0] : '';\n },\n\n // Gets the true hash value. Cannot use location.hash directly due to bug\n // in Firefox where location.hash will always be decoded.\n getHash: function(window) {\n var match = (window || this).location.href.match(/#(.*)$/);\n return match ? match[1] : '';\n },\n\n // Get the pathname and search params, without the root.\n getPath: function() {\n var path = this.decodeFragment(\n this.location.pathname + this.getSearch()\n ).slice(this.root.length - 1);\n return path.charAt(0) === '/' ? path.slice(1) : path;\n },\n\n // Get the cross-browser normalized URL fragment from the path or hash.\n getFragment: function(fragment) {\n if (fragment == null) {\n if (this._usePushState || !this._wantsHashChange) {\n fragment = this.getPath();\n } else {\n fragment = this.getHash();\n }\n }\n return fragment.replace(routeStripper, '');\n },\n\n // Start the hash change handling, returning `true` if the current URL matches\n // an existing route, and `false` otherwise.\n start: function(options) {\n if (History.started) throw new Error('Backbone.history has already been started');\n History.started = true;\n\n // Figure out the initial configuration. Do we need an iframe?\n // Is pushState desired ... is it available?\n this.options = _.extend({root: '/'}, this.options, options);\n this.root = this.options.root;\n this._wantsHashChange = this.options.hashChange !== false;\n this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7);\n this._useHashChange = this._wantsHashChange && this._hasHashChange;\n this._wantsPushState = !!this.options.pushState;\n this._hasPushState = !!(this.history && this.history.pushState);\n this._usePushState = this._wantsPushState && this._hasPushState;\n this.fragment = this.getFragment();\n\n // Normalize root to always include a leading and trailing slash.\n this.root = ('/' + this.root + '/').replace(rootStripper, '/');\n\n // Transition from hashChange to pushState or vice versa if both are\n // requested.\n if (this._wantsHashChange && this._wantsPushState) {\n\n // If we've started off with a route from a `pushState`-enabled\n // browser, but we're currently in a browser that doesn't support it...\n if (!this._hasPushState && !this.atRoot()) {\n var rootPath = this.root.slice(0, -1) || '/';\n this.location.replace(rootPath + '#' + this.getPath());\n // Return immediately as browser will do redirect to new url\n return true;\n\n // Or if we've started out with a hash-based route, but we're currently\n // in a browser where it could be `pushState`-based instead...\n } else if (this._hasPushState && this.atRoot()) {\n this.navigate(this.getHash(), {replace: true});\n }\n\n }\n\n // Proxy an iframe to handle location events if the browser doesn't\n // support the `hashchange` event, HTML5 history, or the user wants\n // `hashChange` but not `pushState`.\n if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {\n this.iframe = document.createElement('iframe');\n this.iframe.src = 'javascript:0';\n this.iframe.style.display = 'none';\n this.iframe.tabIndex = -1;\n var body = document.body;\n // Using `appendChild` will throw on IE < 9 if the document is not ready.\n var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;\n iWindow.document.open();\n iWindow.document.close();\n iWindow.location.hash = '#' + this.fragment;\n }\n\n // Add a cross-platform `addEventListener` shim for older browsers.\n var addEventListener = window.addEventListener || function(eventName, listener) {\n return attachEvent('on' + eventName, listener);\n };\n\n // Depending on whether we're using pushState or hashes, and whether\n // 'onhashchange' is supported, determine how we check the URL state.\n if (this._usePushState) {\n addEventListener('popstate', this.checkUrl, false);\n } else if (this._useHashChange && !this.iframe) {\n addEventListener('hashchange', this.checkUrl, false);\n } else if (this._wantsHashChange) {\n this._checkUrlInterval = setInterval(this.checkUrl, this.interval);\n }\n\n if (!this.options.silent) return this.loadUrl();\n },\n\n // Disable Backbone.history, perhaps temporarily. Not useful in a real app,\n // but possibly useful for unit testing Routers.\n stop: function() {\n // Add a cross-platform `removeEventListener` shim for older browsers.\n var removeEventListener = window.removeEventListener || function(eventName, listener) {\n return detachEvent('on' + eventName, listener);\n };\n\n // Remove window listeners.\n if (this._usePushState) {\n removeEventListener('popstate', this.checkUrl, false);\n } else if (this._useHashChange && !this.iframe) {\n removeEventListener('hashchange', this.checkUrl, false);\n }\n\n // Clean up the iframe if necessary.\n if (this.iframe) {\n document.body.removeChild(this.iframe);\n this.iframe = null;\n }\n\n // Some environments will throw when clearing an undefined interval.\n if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);\n History.started = false;\n },\n\n // Add a route to be tested when the fragment changes. Routes added later\n // may override previous routes.\n route: function(route, callback) {\n this.handlers.unshift({route: route, callback: callback});\n },\n\n // Checks the current URL to see if it has changed, and if it has,\n // calls `loadUrl`, normalizing across the hidden iframe.\n checkUrl: function(e) {\n var current = this.getFragment();\n\n // If the user pressed the back button, the iframe's hash will have\n // changed and we should use that for comparison.\n if (current === this.fragment && this.iframe) {\n current = this.getHash(this.iframe.contentWindow);\n }\n\n if (current === this.fragment) return false;\n if (this.iframe) this.navigate(current);\n this.loadUrl();\n },\n\n // Attempt to load the current URL fragment. If a route succeeds with a\n // match, returns `true`. If no defined routes matches the fragment,\n // returns `false`.\n loadUrl: function(fragment) {\n // If the root doesn't match, no routes can match either.\n if (!this.matchRoot()) return false;\n fragment = this.fragment = this.getFragment(fragment);\n return _.some(this.handlers, function(handler) {\n if (handler.route.test(fragment)) {\n handler.callback(fragment);\n return true;\n }\n });\n },\n\n // Save a fragment into the hash history, or replace the URL state if the\n // 'replace' option is passed. You are responsible for properly URL-encoding\n // the fragment in advance.\n //\n // The options object can contain `trigger: true` if you wish to have the\n // route callback be fired (not usually desirable), or `replace: true`, if\n // you wish to modify the current URL without adding an entry to the history.\n navigate: function(fragment, options) {\n if (!History.started) return false;\n if (!options || options === true) options = {trigger: !!options};\n\n // Normalize the fragment.\n fragment = this.getFragment(fragment || '');\n\n // Don't include a trailing slash on the root.\n var rootPath = this.root;\n if (fragment === '' || fragment.charAt(0) === '?') {\n rootPath = rootPath.slice(0, -1) || '/';\n }\n var url = rootPath + fragment;\n\n // Strip the fragment of the query and hash for matching.\n fragment = fragment.replace(pathStripper, '');\n\n // Decode for matching.\n var decodedFragment = this.decodeFragment(fragment);\n\n if (this.fragment === decodedFragment) return;\n this.fragment = decodedFragment;\n\n // If pushState is available, we use it to set the fragment as a real URL.\n if (this._usePushState) {\n this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);\n\n // If hash changes haven't been explicitly disabled, update the hash\n // fragment to store history.\n } else if (this._wantsHashChange) {\n this._updateHash(this.location, fragment, options.replace);\n if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) {\n var iWindow = this.iframe.contentWindow;\n\n // Opening and closing the iframe tricks IE7 and earlier to push a\n // history entry on hash-tag change. When replace is true, we don't\n // want this.\n if (!options.replace) {\n iWindow.document.open();\n iWindow.document.close();\n }\n\n this._updateHash(iWindow.location, fragment, options.replace);\n }\n\n // If you've told us that you explicitly don't want fallback hashchange-\n // based history, then `navigate` becomes a page refresh.\n } else {\n return this.location.assign(url);\n }\n if (options.trigger) return this.loadUrl(fragment);\n },\n\n // Update the hash location, either replacing the current entry, or adding\n // a new one to the browser history.\n _updateHash: function(location, fragment, replace) {\n if (replace) {\n var href = location.href.replace(/(javascript:|#).*$/, '');\n location.replace(href + '#' + fragment);\n } else {\n // Some browsers require that `hash` contains a leading #.\n location.hash = '#' + fragment;\n }\n }\n\n });\n\n // Create the default Backbone.history.\n Backbone.history = new History;\n\n // Helpers\n // -------\n\n // Helper function to correctly set up the prototype chain for subclasses.\n // Similar to `goog.inherits`, but uses a hash of prototype properties and\n // class properties to be extended.\n var extend = function(protoProps, staticProps) {\n var parent = this;\n var child;\n\n // The constructor function for the new subclass is either defined by you\n // (the \"constructor\" property in your `extend` definition), or defaulted\n // by us to simply call the parent constructor.\n if (protoProps && _.has(protoProps, 'constructor')) {\n child = protoProps.constructor;\n } else {\n child = function(){ return parent.apply(this, arguments); };\n }\n\n // Add static properties to the constructor function, if supplied.\n _.extend(child, parent, staticProps);\n\n // Set the prototype chain to inherit from `parent`, without calling\n // `parent`'s constructor function and add the prototype properties.\n child.prototype = _.create(parent.prototype, protoProps);\n child.prototype.constructor = child;\n\n // Set a convenience property in case the parent's prototype is needed\n // later.\n child.__super__ = parent.prototype;\n\n return child;\n };\n\n // Set up inheritance for the model, collection, router, view and history.\n Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;\n\n // Throw an error when a URL is needed, and none is supplied.\n var urlError = function() {\n throw new Error('A \"url\" property or function must be specified');\n };\n\n // Wrap an optional error callback with a fallback error event.\n var wrapError = function(model, options) {\n var error = options.error;\n options.error = function(resp) {\n if (error) error.call(options.context, model, resp, options);\n model.trigger('error', model, resp, options);\n };\n };\n\n return Backbone;\n});\n","(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"codemirror/lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"codemirror/lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\n CodeMirror.extendMode(\"css\", {\n commentStart: \"/*\",\n commentEnd: \"*/\",\n newlineAfterToken: function(_type, content) {\n return /^[;{}]$/.test(content);\n }\n });\n\n CodeMirror.extendMode(\"javascript\", {\n commentStart: \"/*\",\n commentEnd: \"*/\",\n // FIXME semicolons inside of for\n newlineAfterToken: function(_type, content, textAfter, state) {\n if (this.jsonMode) {\n return /^[\\[,{]$/.test(content) || /^}/.test(textAfter);\n } else {\n if (content == \";\" && state.lexical && state.lexical.type == \")\") return false;\n return /^[;{}]$/.test(content) && !/^;/.test(textAfter);\n }\n }\n });\n\n var inlineElements = /^(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)$/;\n\n CodeMirror.extendMode(\"xml\", {\n commentStart: \"\",\n newlineAfterToken: function(type, content, textAfter, state) {\n var inline = false;\n if (this.configuration == \"html\")\n inline = state.context ? inlineElements.test(state.context.tagName) : false;\n return !inline && ((type == \"tag\" && />$/.test(content) && state.context) ||\n /^ -1 && endIndex > -1 && endIndex > startIndex) {\n // Take string till comment start\n selText = selText.substr(0, startIndex) +\n // From comment start till comment end\n selText.substring(startIndex + curMode.commentStart.length, endIndex) +\n // From comment end till string end\n selText.substr(endIndex + curMode.commentEnd.length);\n }\n cm.replaceRange(selText, from, to);\n }\n });\n });\n\n // Applies automatic mode-aware indentation to the specified range\n CodeMirror.defineExtension(\"autoIndentRange\", function (from, to) {\n var cmInstance = this;\n this.operation(function () {\n for (var i = from.line; i <= to.line; i++) {\n cmInstance.indentLine(i, \"smart\");\n }\n });\n });\n\n // Applies automatic formatting to the specified range\n CodeMirror.defineExtension(\"autoFormatRange\", function (from, to) {\n var cm = this;\n var outer = cm.getMode(), text = cm.getRange(from, to).split(\"\\n\");\n var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state);\n var tabSize = cm.getOption(\"tabSize\");\n\n var out = \"\", lines = 0, atSol = from.ch === 0;\n function newline() {\n out += \"\\n\";\n atSol = true;\n ++lines;\n }\n\n for (var i = 0; i < text.length; ++i) {\n var stream = new CodeMirror.StringStream(text[i], tabSize);\n while (!stream.eol()) {\n var inner = CodeMirror.innerMode(outer, state);\n var style = outer.token(stream, state), cur = stream.current();\n stream.start = stream.pos;\n if (!atSol || /\\S/.test(cur)) {\n out += cur;\n atSol = false;\n }\n if (!atSol && inner.mode.newlineAfterToken &&\n inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i+1] || \"\", inner.state))\n newline();\n }\n if (!stream.pos && outer.blankLine) outer.blankLine(state);\n if (!atSol && i < text.length - 1) newline();\n }\n\n cm.operation(function () {\n cm.replaceRange(out, from, to);\n for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur)\n cm.indentLine(cur, \"smart\");\n cm.setSelection(from, cm.getCursor(false));\n });\n });\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(doc) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = doc.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(doc(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(doc(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(doc(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(doc(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc$1 = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc$1.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc$1.sel.primary();\n ourIndex = doc$1.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc$1, new Selection([ourRange], 0), sel_mouse);\n startSel = doc$1.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc$1.sel;\n } else {\n replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head));\n setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(doc(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc$1);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc$1.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(div.ownerDocument);\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(this.div.ownerDocument) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(textarea.ownerDocument);\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.15\";\n\n return CodeMirror;\n\n})));\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"css\", function(config, parserConfig) {\n var inline = parserConfig.inline\n if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode(\"text/css\");\n\n var indentUnit = config.indentUnit,\n tokenHooks = parserConfig.tokenHooks,\n documentTypes = parserConfig.documentTypes || {},\n mediaTypes = parserConfig.mediaTypes || {},\n mediaFeatures = parserConfig.mediaFeatures || {},\n mediaValueKeywords = parserConfig.mediaValueKeywords || {},\n propertyKeywords = parserConfig.propertyKeywords || {},\n nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},\n fontProperties = parserConfig.fontProperties || {},\n counterDescriptors = parserConfig.counterDescriptors || {},\n colorKeywords = parserConfig.colorKeywords || {},\n valueKeywords = parserConfig.valueKeywords || {},\n allowNested = parserConfig.allowNested,\n lineComment = parserConfig.lineComment,\n supportsAtComponent = parserConfig.supportsAtComponent === true,\n highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false;\n\n var type, override;\n function ret(style, tp) { type = tp; return style; }\n\n // Tokenizers\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (tokenHooks[ch]) {\n var result = tokenHooks[ch](stream, state);\n if (result !== false) return result;\n }\n if (ch == \"@\") {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"def\", stream.current());\n } else if (ch == \"=\" || (ch == \"~\" || ch == \"|\") && stream.eat(\"=\")) {\n return ret(null, \"compare\");\n } else if (ch == \"\\\"\" || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \"#\") {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"atom\", \"hash\");\n } else if (ch == \"!\") {\n stream.match(/^\\s*\\w*/);\n return ret(\"keyword\", \"important\");\n } else if (/\\d/.test(ch) || ch == \".\" && stream.eat(/\\d/)) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n } else if (ch === \"-\") {\n if (/[\\d.]/.test(stream.peek())) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n } else if (stream.match(/^-[\\w\\\\\\-]*/)) {\n stream.eatWhile(/[\\w\\\\\\-]/);\n if (stream.match(/^\\s*:/, false))\n return ret(\"variable-2\", \"variable-definition\");\n return ret(\"variable-2\", \"variable\");\n } else if (stream.match(/^\\w+-/)) {\n return ret(\"meta\", \"meta\");\n }\n } else if (/[,+>*\\/]/.test(ch)) {\n return ret(null, \"select-op\");\n } else if (ch == \".\" && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {\n return ret(\"qualifier\", \"qualifier\");\n } else if (/[:;{}\\[\\]\\(\\)]/.test(ch)) {\n return ret(null, ch);\n } else if (stream.match(/^[\\w-.]+(?=\\()/)) {\n if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) {\n state.tokenize = tokenParenthesized;\n }\n return ret(\"variable callee\", \"variable\");\n } else if (/[\\w\\\\\\-]/.test(ch)) {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"property\", \"word\");\n } else {\n return ret(null, null);\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n if (quote == \")\") stream.backUp(1);\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n if (ch == quote || !escaped && quote != \")\") state.tokenize = null;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenParenthesized(stream, state) {\n stream.next(); // Must be '('\n if (!stream.match(/^\\s*[\\\"\\')]/, false))\n state.tokenize = tokenString(\")\");\n else\n state.tokenize = null;\n return ret(null, \"(\");\n }\n\n // Context management\n\n function Context(type, indent, prev) {\n this.type = type;\n this.indent = indent;\n this.prev = prev;\n }\n\n function pushContext(state, stream, type, indent) {\n state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);\n return type;\n }\n\n function popContext(state) {\n if (state.context.prev)\n state.context = state.context.prev;\n return state.context.type;\n }\n\n function pass(type, stream, state) {\n return states[state.context.type](type, stream, state);\n }\n function popAndPass(type, stream, state, n) {\n for (var i = n || 1; i > 0; i--)\n state.context = state.context.prev;\n return pass(type, stream, state);\n }\n\n // Parser\n\n function wordAsValue(stream) {\n var word = stream.current().toLowerCase();\n if (valueKeywords.hasOwnProperty(word))\n override = \"atom\";\n else if (colorKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else\n override = \"variable\";\n }\n\n var states = {};\n\n states.top = function(type, stream, state) {\n if (type == \"{\") {\n return pushContext(state, stream, \"block\");\n } else if (type == \"}\" && state.context.prev) {\n return popContext(state);\n } else if (supportsAtComponent && /@component/i.test(type)) {\n return pushContext(state, stream, \"atComponentBlock\");\n } else if (/^@(-moz-)?document$/i.test(type)) {\n return pushContext(state, stream, \"documentTypes\");\n } else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {\n return pushContext(state, stream, \"atBlock\");\n } else if (/^@(font-face|counter-style)/i.test(type)) {\n state.stateArg = type;\n return \"restricted_atBlock_before\";\n } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {\n return \"keyframes\";\n } else if (type && type.charAt(0) == \"@\") {\n return pushContext(state, stream, \"at\");\n } else if (type == \"hash\") {\n override = \"builtin\";\n } else if (type == \"word\") {\n override = \"tag\";\n } else if (type == \"variable-definition\") {\n return \"maybeprop\";\n } else if (type == \"interpolation\") {\n return pushContext(state, stream, \"interpolation\");\n } else if (type == \":\") {\n return \"pseudo\";\n } else if (allowNested && type == \"(\") {\n return pushContext(state, stream, \"parens\");\n }\n return state.context.type;\n };\n\n states.block = function(type, stream, state) {\n if (type == \"word\") {\n var word = stream.current().toLowerCase();\n if (propertyKeywords.hasOwnProperty(word)) {\n override = \"property\";\n return \"maybeprop\";\n } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {\n override = highlightNonStandardPropertyKeywords ? \"string-2\" : \"property\";\n return \"maybeprop\";\n } else if (allowNested) {\n override = stream.match(/^\\s*:(?:\\s|$)/, false) ? \"property\" : \"tag\";\n return \"block\";\n } else {\n override += \" error\";\n return \"maybeprop\";\n }\n } else if (type == \"meta\") {\n return \"block\";\n } else if (!allowNested && (type == \"hash\" || type == \"qualifier\")) {\n override = \"error\";\n return \"block\";\n } else {\n return states.top(type, stream, state);\n }\n };\n\n states.maybeprop = function(type, stream, state) {\n if (type == \":\") return pushContext(state, stream, \"prop\");\n return pass(type, stream, state);\n };\n\n states.prop = function(type, stream, state) {\n if (type == \";\") return popContext(state);\n if (type == \"{\" && allowNested) return pushContext(state, stream, \"propBlock\");\n if (type == \"}\" || type == \"{\") return popAndPass(type, stream, state);\n if (type == \"(\") return pushContext(state, stream, \"parens\");\n\n if (type == \"hash\" && !/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(stream.current())) {\n override += \" error\";\n } else if (type == \"word\") {\n wordAsValue(stream);\n } else if (type == \"interpolation\") {\n return pushContext(state, stream, \"interpolation\");\n }\n return \"prop\";\n };\n\n states.propBlock = function(type, _stream, state) {\n if (type == \"}\") return popContext(state);\n if (type == \"word\") { override = \"property\"; return \"maybeprop\"; }\n return state.context.type;\n };\n\n states.parens = function(type, stream, state) {\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state);\n if (type == \")\") return popContext(state);\n if (type == \"(\") return pushContext(state, stream, \"parens\");\n if (type == \"interpolation\") return pushContext(state, stream, \"interpolation\");\n if (type == \"word\") wordAsValue(stream);\n return \"parens\";\n };\n\n states.pseudo = function(type, stream, state) {\n if (type == \"meta\") return \"pseudo\";\n\n if (type == \"word\") {\n override = \"variable-3\";\n return state.context.type;\n }\n return pass(type, stream, state);\n };\n\n states.documentTypes = function(type, stream, state) {\n if (type == \"word\" && documentTypes.hasOwnProperty(stream.current())) {\n override = \"tag\";\n return state.context.type;\n } else {\n return states.atBlock(type, stream, state);\n }\n };\n\n states.atBlock = function(type, stream, state) {\n if (type == \"(\") return pushContext(state, stream, \"atBlock_parens\");\n if (type == \"}\" || type == \";\") return popAndPass(type, stream, state);\n if (type == \"{\") return popContext(state) && pushContext(state, stream, allowNested ? \"block\" : \"top\");\n\n if (type == \"interpolation\") return pushContext(state, stream, \"interpolation\");\n\n if (type == \"word\") {\n var word = stream.current().toLowerCase();\n if (word == \"only\" || word == \"not\" || word == \"and\" || word == \"or\")\n override = \"keyword\";\n else if (mediaTypes.hasOwnProperty(word))\n override = \"attribute\";\n else if (mediaFeatures.hasOwnProperty(word))\n override = \"property\";\n else if (mediaValueKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else if (propertyKeywords.hasOwnProperty(word))\n override = \"property\";\n else if (nonStandardPropertyKeywords.hasOwnProperty(word))\n override = highlightNonStandardPropertyKeywords ? \"string-2\" : \"property\";\n else if (valueKeywords.hasOwnProperty(word))\n override = \"atom\";\n else if (colorKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else\n override = \"error\";\n }\n return state.context.type;\n };\n\n states.atComponentBlock = function(type, stream, state) {\n if (type == \"}\")\n return popAndPass(type, stream, state);\n if (type == \"{\")\n return popContext(state) && pushContext(state, stream, allowNested ? \"block\" : \"top\", false);\n if (type == \"word\")\n override = \"error\";\n return state.context.type;\n };\n\n states.atBlock_parens = function(type, stream, state) {\n if (type == \")\") return popContext(state);\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state, 2);\n return states.atBlock(type, stream, state);\n };\n\n states.restricted_atBlock_before = function(type, stream, state) {\n if (type == \"{\")\n return pushContext(state, stream, \"restricted_atBlock\");\n if (type == \"word\" && state.stateArg == \"@counter-style\") {\n override = \"variable\";\n return \"restricted_atBlock_before\";\n }\n return pass(type, stream, state);\n };\n\n states.restricted_atBlock = function(type, stream, state) {\n if (type == \"}\") {\n state.stateArg = null;\n return popContext(state);\n }\n if (type == \"word\") {\n if ((state.stateArg == \"@font-face\" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||\n (state.stateArg == \"@counter-style\" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))\n override = \"error\";\n else\n override = \"property\";\n return \"maybeprop\";\n }\n return \"restricted_atBlock\";\n };\n\n states.keyframes = function(type, stream, state) {\n if (type == \"word\") { override = \"variable\"; return \"keyframes\"; }\n if (type == \"{\") return pushContext(state, stream, \"top\");\n return pass(type, stream, state);\n };\n\n states.at = function(type, stream, state) {\n if (type == \";\") return popContext(state);\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state);\n if (type == \"word\") override = \"tag\";\n else if (type == \"hash\") override = \"builtin\";\n return \"at\";\n };\n\n states.interpolation = function(type, stream, state) {\n if (type == \"}\") return popContext(state);\n if (type == \"{\" || type == \";\") return popAndPass(type, stream, state);\n if (type == \"word\") override = \"variable\";\n else if (type != \"variable\" && type != \"(\" && type != \")\") override = \"error\";\n return \"interpolation\";\n };\n\n return {\n startState: function(base) {\n return {tokenize: null,\n state: inline ? \"block\" : \"top\",\n stateArg: null,\n context: new Context(inline ? \"block\" : \"top\", base || 0, null)};\n },\n\n token: function(stream, state) {\n if (!state.tokenize && stream.eatSpace()) return null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style && typeof style == \"object\") {\n type = style[1];\n style = style[0];\n }\n override = style;\n if (type != \"comment\")\n state.state = states[state.state](type, stream, state);\n return override;\n },\n\n indent: function(state, textAfter) {\n var cx = state.context, ch = textAfter && textAfter.charAt(0);\n var indent = cx.indent;\n if (cx.type == \"prop\" && (ch == \"}\" || ch == \")\")) cx = cx.prev;\n if (cx.prev) {\n if (ch == \"}\" && (cx.type == \"block\" || cx.type == \"top\" ||\n cx.type == \"interpolation\" || cx.type == \"restricted_atBlock\")) {\n // Resume indentation from parent context.\n cx = cx.prev;\n indent = cx.indent;\n } else if (ch == \")\" && (cx.type == \"parens\" || cx.type == \"atBlock_parens\") ||\n ch == \"{\" && (cx.type == \"at\" || cx.type == \"atBlock\")) {\n // Dedent relative to current context.\n indent = Math.max(0, cx.indent - indentUnit);\n }\n }\n return indent;\n },\n\n electricChars: \"}\",\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n blockCommentContinue: \" * \",\n lineComment: lineComment,\n fold: \"brace\"\n };\n});\n\n function keySet(array) {\n var keys = {};\n for (var i = 0; i < array.length; ++i) {\n keys[array[i].toLowerCase()] = true;\n }\n return keys;\n }\n\n var documentTypes_ = [\n \"domain\", \"regexp\", \"url\", \"url-prefix\"\n ], documentTypes = keySet(documentTypes_);\n\n var mediaTypes_ = [\n \"all\", \"aural\", \"braille\", \"handheld\", \"print\", \"projection\", \"screen\",\n \"tty\", \"tv\", \"embossed\"\n ], mediaTypes = keySet(mediaTypes_);\n\n var mediaFeatures_ = [\n \"width\", \"min-width\", \"max-width\", \"height\", \"min-height\", \"max-height\",\n \"device-width\", \"min-device-width\", \"max-device-width\", \"device-height\",\n \"min-device-height\", \"max-device-height\", \"aspect-ratio\",\n \"min-aspect-ratio\", \"max-aspect-ratio\", \"device-aspect-ratio\",\n \"min-device-aspect-ratio\", \"max-device-aspect-ratio\", \"color\", \"min-color\",\n \"max-color\", \"color-index\", \"min-color-index\", \"max-color-index\",\n \"monochrome\", \"min-monochrome\", \"max-monochrome\", \"resolution\",\n \"min-resolution\", \"max-resolution\", \"scan\", \"grid\", \"orientation\",\n \"device-pixel-ratio\", \"min-device-pixel-ratio\", \"max-device-pixel-ratio\",\n \"pointer\", \"any-pointer\", \"hover\", \"any-hover\", \"prefers-color-scheme\",\n \"dynamic-range\", \"video-dynamic-range\"\n ], mediaFeatures = keySet(mediaFeatures_);\n\n var mediaValueKeywords_ = [\n \"landscape\", \"portrait\", \"none\", \"coarse\", \"fine\", \"on-demand\", \"hover\",\n \"interlace\", \"progressive\",\n \"dark\", \"light\",\n \"standard\", \"high\"\n ], mediaValueKeywords = keySet(mediaValueKeywords_);\n\n var propertyKeywords_ = [\n \"align-content\", \"align-items\", \"align-self\", \"alignment-adjust\",\n \"alignment-baseline\", \"all\", \"anchor-point\", \"animation\", \"animation-delay\",\n \"animation-direction\", \"animation-duration\", \"animation-fill-mode\",\n \"animation-iteration-count\", \"animation-name\", \"animation-play-state\",\n \"animation-timing-function\", \"appearance\", \"azimuth\", \"backdrop-filter\",\n \"backface-visibility\", \"background\", \"background-attachment\",\n \"background-blend-mode\", \"background-clip\", \"background-color\",\n \"background-image\", \"background-origin\", \"background-position\",\n \"background-position-x\", \"background-position-y\", \"background-repeat\",\n \"background-size\", \"baseline-shift\", \"binding\", \"bleed\", \"block-size\",\n \"bookmark-label\", \"bookmark-level\", \"bookmark-state\", \"bookmark-target\",\n \"border\", \"border-bottom\", \"border-bottom-color\", \"border-bottom-left-radius\",\n \"border-bottom-right-radius\", \"border-bottom-style\", \"border-bottom-width\",\n \"border-collapse\", \"border-color\", \"border-image\", \"border-image-outset\",\n \"border-image-repeat\", \"border-image-slice\", \"border-image-source\",\n \"border-image-width\", \"border-left\", \"border-left-color\", \"border-left-style\",\n \"border-left-width\", \"border-radius\", \"border-right\", \"border-right-color\",\n \"border-right-style\", \"border-right-width\", \"border-spacing\", \"border-style\",\n \"border-top\", \"border-top-color\", \"border-top-left-radius\",\n \"border-top-right-radius\", \"border-top-style\", \"border-top-width\",\n \"border-width\", \"bottom\", \"box-decoration-break\", \"box-shadow\", \"box-sizing\",\n \"break-after\", \"break-before\", \"break-inside\", \"caption-side\", \"caret-color\",\n \"clear\", \"clip\", \"color\", \"color-profile\", \"column-count\", \"column-fill\",\n \"column-gap\", \"column-rule\", \"column-rule-color\", \"column-rule-style\",\n \"column-rule-width\", \"column-span\", \"column-width\", \"columns\", \"contain\",\n \"content\", \"counter-increment\", \"counter-reset\", \"crop\", \"cue\", \"cue-after\",\n \"cue-before\", \"cursor\", \"direction\", \"display\", \"dominant-baseline\",\n \"drop-initial-after-adjust\", \"drop-initial-after-align\",\n \"drop-initial-before-adjust\", \"drop-initial-before-align\", \"drop-initial-size\",\n \"drop-initial-value\", \"elevation\", \"empty-cells\", \"fit\", \"fit-content\", \"fit-position\",\n \"flex\", \"flex-basis\", \"flex-direction\", \"flex-flow\", \"flex-grow\",\n \"flex-shrink\", \"flex-wrap\", \"float\", \"float-offset\", \"flow-from\", \"flow-into\",\n \"font\", \"font-family\", \"font-feature-settings\", \"font-kerning\",\n \"font-language-override\", \"font-optical-sizing\", \"font-size\",\n \"font-size-adjust\", \"font-stretch\", \"font-style\", \"font-synthesis\",\n \"font-variant\", \"font-variant-alternates\", \"font-variant-caps\",\n \"font-variant-east-asian\", \"font-variant-ligatures\", \"font-variant-numeric\",\n \"font-variant-position\", \"font-variation-settings\", \"font-weight\", \"gap\",\n \"grid\", \"grid-area\", \"grid-auto-columns\", \"grid-auto-flow\", \"grid-auto-rows\",\n \"grid-column\", \"grid-column-end\", \"grid-column-gap\", \"grid-column-start\",\n \"grid-gap\", \"grid-row\", \"grid-row-end\", \"grid-row-gap\", \"grid-row-start\",\n \"grid-template\", \"grid-template-areas\", \"grid-template-columns\",\n \"grid-template-rows\", \"hanging-punctuation\", \"height\", \"hyphens\", \"icon\",\n \"image-orientation\", \"image-rendering\", \"image-resolution\", \"inline-box-align\",\n \"inset\", \"inset-block\", \"inset-block-end\", \"inset-block-start\", \"inset-inline\",\n \"inset-inline-end\", \"inset-inline-start\", \"isolation\", \"justify-content\",\n \"justify-items\", \"justify-self\", \"left\", \"letter-spacing\", \"line-break\",\n \"line-height\", \"line-height-step\", \"line-stacking\", \"line-stacking-ruby\",\n \"line-stacking-shift\", \"line-stacking-strategy\", \"list-style\",\n \"list-style-image\", \"list-style-position\", \"list-style-type\", \"margin\",\n \"margin-bottom\", \"margin-left\", \"margin-right\", \"margin-top\", \"marks\",\n \"marquee-direction\", \"marquee-loop\", \"marquee-play-count\", \"marquee-speed\",\n \"marquee-style\", \"mask-clip\", \"mask-composite\", \"mask-image\", \"mask-mode\",\n \"mask-origin\", \"mask-position\", \"mask-repeat\", \"mask-size\",\"mask-type\",\n \"max-block-size\", \"max-height\", \"max-inline-size\",\n \"max-width\", \"min-block-size\", \"min-height\", \"min-inline-size\", \"min-width\",\n \"mix-blend-mode\", \"move-to\", \"nav-down\", \"nav-index\", \"nav-left\", \"nav-right\",\n \"nav-up\", \"object-fit\", \"object-position\", \"offset\", \"offset-anchor\",\n \"offset-distance\", \"offset-path\", \"offset-position\", \"offset-rotate\",\n \"opacity\", \"order\", \"orphans\", \"outline\", \"outline-color\", \"outline-offset\",\n \"outline-style\", \"outline-width\", \"overflow\", \"overflow-style\",\n \"overflow-wrap\", \"overflow-x\", \"overflow-y\", \"padding\", \"padding-bottom\",\n \"padding-left\", \"padding-right\", \"padding-top\", \"page\", \"page-break-after\",\n \"page-break-before\", \"page-break-inside\", \"page-policy\", \"pause\",\n \"pause-after\", \"pause-before\", \"perspective\", \"perspective-origin\", \"pitch\",\n \"pitch-range\", \"place-content\", \"place-items\", \"place-self\", \"play-during\",\n \"position\", \"presentation-level\", \"punctuation-trim\", \"quotes\",\n \"region-break-after\", \"region-break-before\", \"region-break-inside\",\n \"region-fragment\", \"rendering-intent\", \"resize\", \"rest\", \"rest-after\",\n \"rest-before\", \"richness\", \"right\", \"rotate\", \"rotation\", \"rotation-point\",\n \"row-gap\", \"ruby-align\", \"ruby-overhang\", \"ruby-position\", \"ruby-span\",\n \"scale\", \"scroll-behavior\", \"scroll-margin\", \"scroll-margin-block\",\n \"scroll-margin-block-end\", \"scroll-margin-block-start\", \"scroll-margin-bottom\",\n \"scroll-margin-inline\", \"scroll-margin-inline-end\",\n \"scroll-margin-inline-start\", \"scroll-margin-left\", \"scroll-margin-right\",\n \"scroll-margin-top\", \"scroll-padding\", \"scroll-padding-block\",\n \"scroll-padding-block-end\", \"scroll-padding-block-start\",\n \"scroll-padding-bottom\", \"scroll-padding-inline\", \"scroll-padding-inline-end\",\n \"scroll-padding-inline-start\", \"scroll-padding-left\", \"scroll-padding-right\",\n \"scroll-padding-top\", \"scroll-snap-align\", \"scroll-snap-type\",\n \"shape-image-threshold\", \"shape-inside\", \"shape-margin\", \"shape-outside\",\n \"size\", \"speak\", \"speak-as\", \"speak-header\", \"speak-numeral\",\n \"speak-punctuation\", \"speech-rate\", \"stress\", \"string-set\", \"tab-size\",\n \"table-layout\", \"target\", \"target-name\", \"target-new\", \"target-position\",\n \"text-align\", \"text-align-last\", \"text-combine-upright\", \"text-decoration\",\n \"text-decoration-color\", \"text-decoration-line\", \"text-decoration-skip\",\n \"text-decoration-skip-ink\", \"text-decoration-style\", \"text-emphasis\",\n \"text-emphasis-color\", \"text-emphasis-position\", \"text-emphasis-style\",\n \"text-height\", \"text-indent\", \"text-justify\", \"text-orientation\",\n \"text-outline\", \"text-overflow\", \"text-rendering\", \"text-shadow\",\n \"text-size-adjust\", \"text-space-collapse\", \"text-transform\",\n \"text-underline-position\", \"text-wrap\", \"top\", \"touch-action\", \"transform\", \"transform-origin\",\n \"transform-style\", \"transition\", \"transition-delay\", \"transition-duration\",\n \"transition-property\", \"transition-timing-function\", \"translate\",\n \"unicode-bidi\", \"user-select\", \"vertical-align\", \"visibility\", \"voice-balance\",\n \"voice-duration\", \"voice-family\", \"voice-pitch\", \"voice-range\", \"voice-rate\",\n \"voice-stress\", \"voice-volume\", \"volume\", \"white-space\", \"widows\", \"width\",\n \"will-change\", \"word-break\", \"word-spacing\", \"word-wrap\", \"writing-mode\", \"z-index\",\n // SVG-specific\n \"clip-path\", \"clip-rule\", \"mask\", \"enable-background\", \"filter\", \"flood-color\",\n \"flood-opacity\", \"lighting-color\", \"stop-color\", \"stop-opacity\", \"pointer-events\",\n \"color-interpolation\", \"color-interpolation-filters\",\n \"color-rendering\", \"fill\", \"fill-opacity\", \"fill-rule\", \"image-rendering\",\n \"marker\", \"marker-end\", \"marker-mid\", \"marker-start\", \"paint-order\", \"shape-rendering\", \"stroke\",\n \"stroke-dasharray\", \"stroke-dashoffset\", \"stroke-linecap\", \"stroke-linejoin\",\n \"stroke-miterlimit\", \"stroke-opacity\", \"stroke-width\", \"text-rendering\",\n \"baseline-shift\", \"dominant-baseline\", \"glyph-orientation-horizontal\",\n \"glyph-orientation-vertical\", \"text-anchor\", \"writing-mode\",\n ], propertyKeywords = keySet(propertyKeywords_);\n\n var nonStandardPropertyKeywords_ = [\n \"accent-color\", \"aspect-ratio\", \"border-block\", \"border-block-color\", \"border-block-end\",\n \"border-block-end-color\", \"border-block-end-style\", \"border-block-end-width\",\n \"border-block-start\", \"border-block-start-color\", \"border-block-start-style\",\n \"border-block-start-width\", \"border-block-style\", \"border-block-width\",\n \"border-inline\", \"border-inline-color\", \"border-inline-end\",\n \"border-inline-end-color\", \"border-inline-end-style\",\n \"border-inline-end-width\", \"border-inline-start\", \"border-inline-start-color\",\n \"border-inline-start-style\", \"border-inline-start-width\",\n \"border-inline-style\", \"border-inline-width\", \"content-visibility\", \"margin-block\",\n \"margin-block-end\", \"margin-block-start\", \"margin-inline\", \"margin-inline-end\",\n \"margin-inline-start\", \"overflow-anchor\", \"overscroll-behavior\", \"padding-block\", \"padding-block-end\",\n \"padding-block-start\", \"padding-inline\", \"padding-inline-end\",\n \"padding-inline-start\", \"scroll-snap-stop\", \"scrollbar-3d-light-color\",\n \"scrollbar-arrow-color\", \"scrollbar-base-color\", \"scrollbar-dark-shadow-color\",\n \"scrollbar-face-color\", \"scrollbar-highlight-color\", \"scrollbar-shadow-color\",\n \"scrollbar-track-color\", \"searchfield-cancel-button\", \"searchfield-decoration\",\n \"searchfield-results-button\", \"searchfield-results-decoration\", \"shape-inside\", \"zoom\"\n ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);\n\n var fontProperties_ = [\n \"font-display\", \"font-family\", \"src\", \"unicode-range\", \"font-variant\",\n \"font-feature-settings\", \"font-stretch\", \"font-weight\", \"font-style\"\n ], fontProperties = keySet(fontProperties_);\n\n var counterDescriptors_ = [\n \"additive-symbols\", \"fallback\", \"negative\", \"pad\", \"prefix\", \"range\",\n \"speak-as\", \"suffix\", \"symbols\", \"system\"\n ], counterDescriptors = keySet(counterDescriptors_);\n\n var colorKeywords_ = [\n \"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\", \"beige\",\n \"bisque\", \"black\", \"blanchedalmond\", \"blue\", \"blueviolet\", \"brown\",\n \"burlywood\", \"cadetblue\", \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\",\n \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\", \"darkgoldenrod\",\n \"darkgray\", \"darkgreen\", \"darkgrey\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\",\n \"darkorange\", \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\",\n \"darkslateblue\", \"darkslategray\", \"darkslategrey\", \"darkturquoise\", \"darkviolet\",\n \"deeppink\", \"deepskyblue\", \"dimgray\", \"dimgrey\", \"dodgerblue\", \"firebrick\",\n \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\", \"ghostwhite\",\n \"gold\", \"goldenrod\", \"gray\", \"grey\", \"green\", \"greenyellow\", \"honeydew\",\n \"hotpink\", \"indianred\", \"indigo\", \"ivory\", \"khaki\", \"lavender\",\n \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\", \"lightcoral\",\n \"lightcyan\", \"lightgoldenrodyellow\", \"lightgray\", \"lightgreen\", \"lightgrey\", \"lightpink\",\n \"lightsalmon\", \"lightseagreen\", \"lightskyblue\", \"lightslategray\", \"lightslategrey\",\n \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\", \"linen\", \"magenta\",\n \"maroon\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\",\n \"mediumseagreen\", \"mediumslateblue\", \"mediumspringgreen\", \"mediumturquoise\",\n \"mediumvioletred\", \"midnightblue\", \"mintcream\", \"mistyrose\", \"moccasin\",\n \"navajowhite\", \"navy\", \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\",\n \"orchid\", \"palegoldenrod\", \"palegreen\", \"paleturquoise\", \"palevioletred\",\n \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\",\n \"purple\", \"rebeccapurple\", \"red\", \"rosybrown\", \"royalblue\", \"saddlebrown\",\n \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"silver\", \"skyblue\",\n \"slateblue\", \"slategray\", \"slategrey\", \"snow\", \"springgreen\", \"steelblue\", \"tan\",\n \"teal\", \"thistle\", \"tomato\", \"turquoise\", \"violet\", \"wheat\", \"white\",\n \"whitesmoke\", \"yellow\", \"yellowgreen\"\n ], colorKeywords = keySet(colorKeywords_);\n\n var valueKeywords_ = [\n \"above\", \"absolute\", \"activeborder\", \"additive\", \"activecaption\", \"afar\",\n \"after-white-space\", \"ahead\", \"alias\", \"all\", \"all-scroll\", \"alphabetic\", \"alternate\",\n \"always\", \"amharic\", \"amharic-abegede\", \"antialiased\", \"appworkspace\",\n \"arabic-indic\", \"armenian\", \"asterisks\", \"attr\", \"auto\", \"auto-flow\", \"avoid\", \"avoid-column\", \"avoid-page\",\n \"avoid-region\", \"axis-pan\", \"background\", \"backwards\", \"baseline\", \"below\", \"bidi-override\", \"binary\",\n \"bengali\", \"blink\", \"block\", \"block-axis\", \"blur\", \"bold\", \"bolder\", \"border\", \"border-box\",\n \"both\", \"bottom\", \"break\", \"break-all\", \"break-word\", \"brightness\", \"bullets\", \"button\",\n \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"calc\", \"cambodian\",\n \"capitalize\", \"caps-lock-indicator\", \"caption\", \"captiontext\", \"caret\",\n \"cell\", \"center\", \"checkbox\", \"circle\", \"cjk-decimal\", \"cjk-earthly-branch\",\n \"cjk-heavenly-stem\", \"cjk-ideographic\", \"clear\", \"clip\", \"close-quote\",\n \"col-resize\", \"collapse\", \"color\", \"color-burn\", \"color-dodge\", \"column\", \"column-reverse\",\n \"compact\", \"condensed\", \"conic-gradient\", \"contain\", \"content\", \"contents\",\n \"content-box\", \"context-menu\", \"continuous\", \"contrast\", \"copy\", \"counter\", \"counters\", \"cover\", \"crop\",\n \"cross\", \"crosshair\", \"cubic-bezier\", \"currentcolor\", \"cursive\", \"cyclic\", \"darken\", \"dashed\", \"decimal\",\n \"decimal-leading-zero\", \"default\", \"default-button\", \"dense\", \"destination-atop\",\n \"destination-in\", \"destination-out\", \"destination-over\", \"devanagari\", \"difference\",\n \"disc\", \"discard\", \"disclosure-closed\", \"disclosure-open\", \"document\",\n \"dot-dash\", \"dot-dot-dash\",\n \"dotted\", \"double\", \"down\", \"drop-shadow\", \"e-resize\", \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\",\n \"element\", \"ellipse\", \"ellipsis\", \"embed\", \"end\", \"ethiopic\", \"ethiopic-abegede\",\n \"ethiopic-abegede-am-et\", \"ethiopic-abegede-gez\", \"ethiopic-abegede-ti-er\",\n \"ethiopic-abegede-ti-et\", \"ethiopic-halehame-aa-er\",\n \"ethiopic-halehame-aa-et\", \"ethiopic-halehame-am-et\",\n \"ethiopic-halehame-gez\", \"ethiopic-halehame-om-et\",\n \"ethiopic-halehame-sid-et\", \"ethiopic-halehame-so-et\",\n \"ethiopic-halehame-ti-er\", \"ethiopic-halehame-ti-et\", \"ethiopic-halehame-tig\",\n \"ethiopic-numeric\", \"ew-resize\", \"exclusion\", \"expanded\", \"extends\", \"extra-condensed\",\n \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fill-box\", \"fixed\", \"flat\", \"flex\", \"flex-end\", \"flex-start\", \"footnotes\",\n \"forwards\", \"from\", \"geometricPrecision\", \"georgian\", \"grayscale\", \"graytext\", \"grid\", \"groove\",\n \"gujarati\", \"gurmukhi\", \"hand\", \"hangul\", \"hangul-consonant\", \"hard-light\", \"hebrew\",\n \"help\", \"hidden\", \"hide\", \"higher\", \"highlight\", \"highlighttext\",\n \"hiragana\", \"hiragana-iroha\", \"horizontal\", \"hsl\", \"hsla\", \"hue\", \"hue-rotate\", \"icon\", \"ignore\",\n \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\",\n \"infobackground\", \"infotext\", \"inherit\", \"initial\", \"inline\", \"inline-axis\",\n \"inline-block\", \"inline-flex\", \"inline-grid\", \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\",\n \"italic\", \"japanese-formal\", \"japanese-informal\", \"justify\", \"kannada\",\n \"katakana\", \"katakana-iroha\", \"keep-all\", \"khmer\",\n \"korean-hangul-formal\", \"korean-hanja-formal\", \"korean-hanja-informal\",\n \"landscape\", \"lao\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lighten\",\n \"line-through\", \"linear\", \"linear-gradient\", \"lines\", \"list-item\", \"listbox\", \"listitem\",\n \"local\", \"logical\", \"loud\", \"lower\", \"lower-alpha\", \"lower-armenian\",\n \"lower-greek\", \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\",\n \"lower-roman\", \"lowercase\", \"ltr\", \"luminosity\", \"malayalam\", \"manipulation\", \"match\", \"matrix\", \"matrix3d\",\n \"media-play-button\", \"media-slider\", \"media-sliderthumb\",\n \"media-volume-slider\", \"media-volume-sliderthumb\", \"medium\",\n \"menu\", \"menulist\", \"menulist-button\",\n \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\",\n \"mix\", \"mongolian\", \"monospace\", \"move\", \"multiple\", \"multiple_mask_images\", \"multiply\", \"myanmar\", \"n-resize\",\n \"narrower\", \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\",\n \"no-open-quote\", \"no-repeat\", \"none\", \"normal\", \"not-allowed\", \"nowrap\",\n \"ns-resize\", \"numbers\", \"numeric\", \"nw-resize\", \"nwse-resize\", \"oblique\", \"octal\", \"opacity\", \"open-quote\",\n \"optimizeLegibility\", \"optimizeSpeed\", \"oriya\", \"oromo\", \"outset\",\n \"outside\", \"outside-shape\", \"overlay\", \"overline\", \"padding\", \"padding-box\",\n \"painted\", \"page\", \"paused\", \"persian\", \"perspective\", \"pinch-zoom\", \"plus-darker\", \"plus-lighter\",\n \"pointer\", \"polygon\", \"portrait\", \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\",\n \"progress\", \"push-button\", \"radial-gradient\", \"radio\", \"read-only\",\n \"read-write\", \"read-write-plaintext-only\", \"rectangle\", \"region\",\n \"relative\", \"repeat\", \"repeating-linear-gradient\", \"repeating-radial-gradient\",\n \"repeating-conic-gradient\", \"repeat-x\", \"repeat-y\", \"reset\", \"reverse\",\n \"rgb\", \"rgba\", \"ridge\", \"right\", \"rotate\", \"rotate3d\", \"rotateX\", \"rotateY\",\n \"rotateZ\", \"round\", \"row\", \"row-resize\", \"row-reverse\", \"rtl\", \"run-in\", \"running\",\n \"s-resize\", \"sans-serif\", \"saturate\", \"saturation\", \"scale\", \"scale3d\", \"scaleX\", \"scaleY\", \"scaleZ\", \"screen\",\n \"scroll\", \"scrollbar\", \"scroll-position\", \"se-resize\", \"searchfield\",\n \"searchfield-cancel-button\", \"searchfield-decoration\",\n \"searchfield-results-button\", \"searchfield-results-decoration\", \"self-start\", \"self-end\",\n \"semi-condensed\", \"semi-expanded\", \"separate\", \"sepia\", \"serif\", \"show\", \"sidama\",\n \"simp-chinese-formal\", \"simp-chinese-informal\", \"single\",\n \"skew\", \"skewX\", \"skewY\", \"skip-white-space\", \"slide\", \"slider-horizontal\",\n \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\",\n \"small\", \"small-caps\", \"small-caption\", \"smaller\", \"soft-light\", \"solid\", \"somali\",\n \"source-atop\", \"source-in\", \"source-out\", \"source-over\", \"space\", \"space-around\", \"space-between\", \"space-evenly\", \"spell-out\", \"square\",\n \"square-button\", \"start\", \"static\", \"status-bar\", \"stretch\", \"stroke\", \"stroke-box\", \"sub\",\n \"subpixel-antialiased\", \"svg_masks\", \"super\", \"sw-resize\", \"symbolic\", \"symbols\", \"system-ui\", \"table\",\n \"table-caption\", \"table-cell\", \"table-column\", \"table-column-group\",\n \"table-footer-group\", \"table-header-group\", \"table-row\", \"table-row-group\",\n \"tamil\",\n \"telugu\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thai\",\n \"thick\", \"thin\", \"threeddarkshadow\", \"threedface\", \"threedhighlight\",\n \"threedlightshadow\", \"threedshadow\", \"tibetan\", \"tigre\", \"tigrinya-er\",\n \"tigrinya-er-abegede\", \"tigrinya-et\", \"tigrinya-et-abegede\", \"to\", \"top\",\n \"trad-chinese-formal\", \"trad-chinese-informal\", \"transform\",\n \"translate\", \"translate3d\", \"translateX\", \"translateY\", \"translateZ\",\n \"transparent\", \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"unidirectional-pan\", \"unset\", \"up\",\n \"upper-alpha\", \"upper-armenian\", \"upper-greek\", \"upper-hexadecimal\",\n \"upper-latin\", \"upper-norwegian\", \"upper-roman\", \"uppercase\", \"urdu\", \"url\",\n \"var\", \"vertical\", \"vertical-text\", \"view-box\", \"visible\", \"visibleFill\", \"visiblePainted\",\n \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"wider\",\n \"window\", \"windowframe\", \"windowtext\", \"words\", \"wrap\", \"wrap-reverse\", \"x-large\", \"x-small\", \"xor\",\n \"xx-large\", \"xx-small\"\n ], valueKeywords = keySet(valueKeywords_);\n\n var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)\n .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)\n .concat(valueKeywords_);\n CodeMirror.registerHelper(\"hintWords\", \"css\", allWords);\n\n function tokenCComment(stream, state) {\n var maybeEnd = false, ch;\n while ((ch = stream.next()) != null) {\n if (maybeEnd && ch == \"/\") {\n state.tokenize = null;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return [\"comment\", \"comment\"];\n }\n\n CodeMirror.defineMIME(\"text/css\", {\n documentTypes: documentTypes,\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n fontProperties: fontProperties,\n counterDescriptors: counterDescriptors,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (!stream.eat(\"*\")) return false;\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n },\n name: \"css\"\n });\n\n CodeMirror.defineMIME(\"text/x-scss\", {\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n fontProperties: fontProperties,\n allowNested: true,\n lineComment: \"//\",\n tokenHooks: {\n \"/\": function(stream, state) {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return [\"comment\", \"comment\"];\n } else if (stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n } else {\n return [\"operator\", \"operator\"];\n }\n },\n \":\": function(stream) {\n if (stream.match(/^\\s*\\{/, false))\n return [null, null]\n return false;\n },\n \"$\": function(stream) {\n stream.match(/^[\\w-]+/);\n if (stream.match(/^\\s*:/, false))\n return [\"variable-2\", \"variable-definition\"];\n return [\"variable-2\", \"variable\"];\n },\n \"#\": function(stream) {\n if (!stream.eat(\"{\")) return false;\n return [null, \"interpolation\"];\n }\n },\n name: \"css\",\n helperType: \"scss\"\n });\n\n CodeMirror.defineMIME(\"text/x-less\", {\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n fontProperties: fontProperties,\n allowNested: true,\n lineComment: \"//\",\n tokenHooks: {\n \"/\": function(stream, state) {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return [\"comment\", \"comment\"];\n } else if (stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n } else {\n return [\"operator\", \"operator\"];\n }\n },\n \"@\": function(stream) {\n if (stream.eat(\"{\")) return [null, \"interpolation\"];\n if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\\b/i, false)) return false;\n stream.eatWhile(/[\\w\\\\\\-]/);\n if (stream.match(/^\\s*:/, false))\n return [\"variable-2\", \"variable-definition\"];\n return [\"variable-2\", \"variable\"];\n },\n \"&\": function() {\n return [\"atom\", \"atom\"];\n }\n },\n name: \"css\",\n helperType: \"less\"\n });\n\n CodeMirror.defineMIME(\"text/x-gss\", {\n documentTypes: documentTypes,\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n fontProperties: fontProperties,\n counterDescriptors: counterDescriptors,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n supportsAtComponent: true,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (!stream.eat(\"*\")) return false;\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n },\n name: \"css\",\n helperType: \"gss\"\n });\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../xml/xml\"), require(\"../javascript/javascript\"), require(\"../css/css\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../xml/xml\", \"../javascript/javascript\", \"../css/css\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var defaultTags = {\n script: [\n [\"lang\", /(javascript|babel)/i, \"javascript\"],\n [\"type\", /^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, \"javascript\"],\n [\"type\", /./, \"text/plain\"],\n [null, null, \"javascript\"]\n ],\n style: [\n [\"lang\", /^css$/i, \"css\"],\n [\"type\", /^(text\\/)?(x-)?(stylesheet|css)$/i, \"css\"],\n [\"type\", /./, \"text/plain\"],\n [null, null, \"css\"]\n ]\n };\n\n function maybeBackup(stream, pat, style) {\n var cur = stream.current(), close = cur.search(pat);\n if (close > -1) {\n stream.backUp(cur.length - close);\n } else if (cur.match(/<\\/?$/)) {\n stream.backUp(cur.length);\n if (!stream.match(pat, false)) stream.match(cur);\n }\n return style;\n }\n\n var attrRegexpCache = {};\n function getAttrRegexp(attr) {\n var regexp = attrRegexpCache[attr];\n if (regexp) return regexp;\n return attrRegexpCache[attr] = new RegExp(\"\\\\s+\" + attr + \"\\\\s*=\\\\s*('|\\\")?([^'\\\"]+)('|\\\")?\\\\s*\");\n }\n\n function getAttrValue(text, attr) {\n var match = text.match(getAttrRegexp(attr))\n return match ? /^\\s*(.*?)\\s*$/.exec(match[2])[1] : \"\"\n }\n\n function getTagRegexp(tagName, anchored) {\n return new RegExp((anchored ? \"^\" : \"\") + \"<\\/\\\\s*\" + tagName + \"\\\\s*>\", \"i\");\n }\n\n function addTags(from, to) {\n for (var tag in from) {\n var dest = to[tag] || (to[tag] = []);\n var source = from[tag];\n for (var i = source.length - 1; i >= 0; i--)\n dest.unshift(source[i])\n }\n }\n\n function findMatchingMode(tagInfo, tagText) {\n for (var i = 0; i < tagInfo.length; i++) {\n var spec = tagInfo[i];\n if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];\n }\n }\n\n CodeMirror.defineMode(\"htmlmixed\", function (config, parserConfig) {\n var htmlMode = CodeMirror.getMode(config, {\n name: \"xml\",\n htmlMode: true,\n multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,\n multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag,\n allowMissingTagName: parserConfig.allowMissingTagName,\n });\n\n var tags = {};\n var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;\n addTags(defaultTags, tags);\n if (configTags) addTags(configTags, tags);\n if (configScript) for (var i = configScript.length - 1; i >= 0; i--)\n tags.script.unshift([\"type\", configScript[i].matches, configScript[i].mode])\n\n function html(stream, state) {\n var style = htmlMode.token(stream, state.htmlState), tag = /\\btag\\b/.test(style), tagName\n if (tag && !/[<>\\s\\/]/.test(stream.current()) &&\n (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&\n tags.hasOwnProperty(tagName)) {\n state.inTag = tagName + \" \"\n } else if (state.inTag && tag && />$/.test(stream.current())) {\n var inTag = /^([\\S]+) (.*)/.exec(state.inTag)\n state.inTag = null\n var modeSpec = stream.current() == \">\" && findMatchingMode(tags[inTag[1]], inTag[2])\n var mode = CodeMirror.getMode(config, modeSpec)\n var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);\n state.token = function (stream, state) {\n if (stream.match(endTagA, false)) {\n state.token = html;\n state.localState = state.localMode = null;\n return null;\n }\n return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));\n };\n state.localMode = mode;\n state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, \"\", \"\"));\n } else if (state.inTag) {\n state.inTag += stream.current()\n if (stream.eol()) state.inTag += \" \"\n }\n return style;\n };\n\n return {\n startState: function () {\n var state = CodeMirror.startState(htmlMode);\n return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};\n },\n\n copyState: function (state) {\n var local;\n if (state.localState) {\n local = CodeMirror.copyState(state.localMode, state.localState);\n }\n return {token: state.token, inTag: state.inTag,\n localMode: state.localMode, localState: local,\n htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};\n },\n\n token: function (stream, state) {\n return state.token(stream, state);\n },\n\n indent: function (state, textAfter, line) {\n if (!state.localMode || /^\\s*<\\//.test(textAfter))\n return htmlMode.indent(state.htmlState, textAfter, line);\n else if (state.localMode.indent)\n return state.localMode.indent(state.localState, textAfter, line);\n else\n return CodeMirror.Pass;\n },\n\n innerMode: function (state) {\n return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};\n }\n };\n }, \"xml\", \"javascript\", \"css\");\n\n CodeMirror.defineMIME(\"text/html\", \"htmlmixed\");\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n pushcontext.lex = pushblockcontext.lex = true\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(maybeexpression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n if (type == \"quasi\") { return pass(quasiType, afterType); }\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function quasiType(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasiType);\n return cont(typeexpr, continueQuasiType);\n }\n function continueQuasiType(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasiType);\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+#?[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"!\") return cont(classfield)\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n parseJS(state, \"atom\", \"atom\", \"true\", new CodeMirror.StringStream(\"\", 2, null))\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n allowMissingTagName: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n }\n }\n\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function lower(tagName) {\n return tagName && tagName.toLowerCase();\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName || \"\";\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(lower(parentTagName)) ||\n !config.contextGrabbers[lower(parentTagName)].hasOwnProperty(lower(nextTagName))) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return attrState(type, stream, state);\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(lower(state.context.tagName)))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return closeState(type, stream, state);\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(lower(tagName))) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /$/,\n blockCommentStart: \"\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n },\n\n xmlCurrentTag: function(state) {\n return state.tagName ? {name: state.tagName, close: state.type == \"closeTag\"} : null\n },\n\n xmlCurrentContext: function(state) {\n var context = []\n for (var cx = state.context; cx; cx = cx.prev)\n context.push(cx.tagName)\n return context.reverse()\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n","import { Model, ObjectHash, SetOptions, CombinedModelConstructorOptions } from '../common';\nimport EditorModel from '../editor/model/Editor';\nimport Module, { IBaseModule } from './Module';\n\nexport default class ModuleModel<\n TModule extends IBaseModule = Module,\n T extends ObjectHash = any,\n S = SetOptions,\n E = any\n> extends Model {\n private _module: TModule;\n\n constructor(module: TModule, attributes?: T, options?: CombinedModelConstructorOptions) {\n super(attributes, options);\n this._module = module;\n }\n\n public get module() {\n return this._module;\n }\n\n public get config(): TModule extends IBaseModule ? C : unknown {\n return this._module.config;\n }\n\n public get em(): EditorModel {\n return this._module.em;\n }\n}\n","import CanvasModule from '..';\nimport { ModuleModel } from '../../abstract';\nimport { BoxRect, LiteralUnion } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport ComponentView from '../../dom_components/view/ComponentView';\nimport { GetBoxRectOptions } from '../types';\nimport Frame from './Frame';\n\nexport enum CanvasSpotBuiltInTypes {\n Select = 'select',\n Hover = 'hover',\n Spacing = 'spacing',\n Target = 'target',\n Resize = 'resize',\n}\n\nexport type CanvasSpotBuiltInType = `${CanvasSpotBuiltInTypes}`;\n\nexport type CanvasSpotType = LiteralUnion;\n\n/** @private */\nexport interface CanvasSpotBase {\n /**\n * Spot type, eg. `select`.\n */\n type: T;\n /**\n * Spot ID.\n */\n id: string;\n /**\n * Fixed box rect of the spot, eg. `{ width: 100, height: 100, x: 0, y: 0 }`.\n */\n boxRect?: BoxRect;\n /**\n * Component to which the spot will be attached.\n */\n component?: Component;\n /**\n * ComponentView to which the spot will be attached.\n */\n componentView?: ComponentView;\n frame?: Frame;\n}\n\nexport interface CanvasSpotProps extends CanvasSpotBase {}\n\n/**\n * Canvas spots are elements drawn on top of the canvas. They can be used to represent anything you\n * might need but the most common use case of canvas spots is rendering information and managing\n * components rendered in the canvas.\n * Read here for more information about [Canvas Spots](https://grapesjs.com/docs/modules/Canvas.html#canvas-spots)\n *\n * [Component]: component.html\n *\n * @property {String} id Spot ID.\n * @property {String} type Spot type.\n * @property {[Component]} [component] Component to which the spot will be attached.\n * @property {ComponentView} [componentView] ComponentView to which the spot will be attached.\n * @property {Object} [boxRect] Fixed box rect of the spot, eg. `{ width: 100, height: 100, x: 0, y: 0 }`.\n *\n */\nexport default class CanvasSpot extends ModuleModel {\n defaults() {\n return {\n id: '',\n type: '',\n } as T;\n }\n\n get type() {\n return this.get('type') || '';\n }\n\n get component() {\n const cmp = this.get('component');\n return cmp || this.get('componentView')?.model;\n }\n\n get componentView() {\n const cmpView = this.get('componentView');\n return cmpView || this.get('component')?.getView();\n }\n\n get el() {\n return this.componentView?.el;\n }\n\n /**\n * Get the box rect of the spot.\n * @param {Object} [opts={}]\n * @returns {Object} The box rect object\n * @example\n * canvasSpot.getBoxRect();\n * // { width: 100, height: 50, x: 0, y: 0 }\n */\n getBoxRect(opts?: GetBoxRectOptions) {\n const { el, em } = this;\n const cvView = em.Canvas.getCanvasView();\n const boxRect = this.get('boxRect');\n\n if (boxRect) {\n return boxRect;\n } else if (el && cvView) {\n return cvView.getElBoxRect(el, opts);\n }\n\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n\n /**\n * Get the style object of the spot.\n * @param {Object} [opts={}]\n * @returns {CSSStyleDeclaration} [opts]\n * @example\n * canvasSpot.getStyle();\n * // { width: '100px', height: '...', ... }\n */\n getStyle(opts: { boxRect?: BoxRect } & GetBoxRectOptions = {}): Partial {\n const { width, height, x, y } = opts.boxRect || this.getBoxRect(opts);\n\n return {\n width: `${width}px`,\n height: `${height}px`,\n top: '0',\n left: '0',\n position: 'absolute',\n translate: `${x}px ${y}px`,\n };\n }\n\n /**\n * Check the spot type.\n * @param {String} type\n * @returns {Boolean}\n * @example\n * canvasSpot.isType('select');\n */\n isType(type: E['type']): this is CanvasSpot {\n return this.type === type;\n }\n}\n","/**{START_EVENTS}*/\nexport enum CommandsEvents {\n /**\n * @event `command:run` Triggered on run of any command.\n * @example\n * editor.on('command:run', ({ id, result, options }) => {\n * console.log('Command id', id, 'command result', result);\n * });\n */\n run = 'command:run',\n _run = 'run',\n\n /**\n * @event `command:run:COMMAND_ID` Triggered on run of a specific command.\n * @example\n * editor.on('command:run:my-command', ({ result, options }) => { ... });\n */\n runCommand = 'command:run:',\n _runCommand = 'run:',\n\n /**\n * @event `command:run:before:COMMAND_ID` Triggered before the command is called.\n * @example\n * editor.on('command:run:before:my-command', ({ options }) => { ... });\n */\n runBeforeCommand = 'command:run:before:',\n\n /**\n * @event `command:abort:COMMAND_ID` Triggered when the command execution is aborted.\n * @example\n * editor.on('command:abort:my-command', ({ options }) => { ... });\n *\n * // The command could be aborted during the before event\n * editor.on('command:run:before:my-command', ({ options }) => {\n * if (someCondition) {\n * options.abort = true;\n * }\n * });\n */\n abort = 'command:abort:',\n _abort = 'abort:',\n\n /**\n * @event `command:stop` Triggered on stop of any command.\n * @example\n * editor.on('command:stop', ({ id, result, options }) => {\n * console.log('Command id', id, 'command result', result);\n * });\n */\n stop = 'command:stop',\n _stop = 'stop',\n\n /**\n * @event `command:stop:COMMAND_ID` Triggered on stop of a specific command.\n * @example\n * editor.on('command:run:my-command', ({ result, options }) => { ... });\n */\n stopCommand = 'command:stop:',\n _stopCommand = 'stop:',\n\n /**\n * @event `command:stop:before:COMMAND_ID` Triggered before the command is called to stop.\n * @example\n * editor.on('command:stop:before:my-command', ({ options }) => { ... });\n */\n stopBeforeCommand = 'command:stop:before:',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default CommandsEvents;\n","import { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n ed.Components.clear();\n ed.Css.clear();\n },\n} as CommandObject;\n","import { bindAll } from 'underscore';\nimport Dragger from '../../utils/Dragger';\nimport { getKeyChar, off, on } from '../../utils/dom';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n bindAll(this, 'onKeyUp', 'enableDragger', 'disableDragger');\n this.editor = ed;\n this.canvasModel = this.canvas.getCanvasView().model;\n this.toggleMove(1);\n },\n stop(ed) {\n this.toggleMove();\n this.disableDragger();\n },\n\n onKeyUp(ev: KeyboardEvent) {\n if (getKeyChar(ev) === ' ') {\n this.editor.stopCommand(this.id);\n }\n },\n\n enableDragger(ev: Event) {\n this.toggleDragger(1, ev);\n },\n\n disableDragger(ev: Event) {\n this.toggleDragger(0, ev);\n },\n\n toggleDragger(enable: boolean, ev: Event) {\n const { canvasModel, em } = this;\n let { dragger } = this;\n const methodCls = enable ? 'add' : 'remove';\n this.getCanvas().classList[methodCls](`${this.ppfx}is__grabbing`);\n\n if (!dragger) {\n dragger = new Dragger({\n getPosition() {\n return {\n x: canvasModel.get('x'),\n y: canvasModel.get('y'),\n };\n },\n setPosition({ x, y }) {\n canvasModel.set({ x, y });\n },\n onStart(ev, dragger) {\n em.trigger('canvas:move:start', dragger);\n },\n onDrag(ev, dragger) {\n em.trigger('canvas:move', dragger);\n },\n onEnd(ev, dragger) {\n em.trigger('canvas:move:end', dragger);\n },\n });\n this.dragger = dragger;\n }\n\n enable ? dragger.start(ev) : dragger.stop();\n },\n\n toggleMove(enable: boolean) {\n const { ppfx } = this;\n const methodCls = enable ? 'add' : 'remove';\n const methodEv = enable ? 'on' : 'off';\n const methodsEv = { on, off };\n const canvas = this.getCanvas();\n const classes = [`${ppfx}is__grab`];\n !enable && classes.push(`${ppfx}is__grabbing`);\n classes.forEach(cls => canvas.classList[methodCls](cls));\n methodsEv[methodEv](document, 'keyup', this.onKeyUp);\n methodsEv[methodEv](canvas, 'mousedown', this.enableDragger);\n methodsEv[methodEv](document, 'mouseup', this.disableDragger);\n },\n} as CommandObject<\n any,\n {\n [key: string]: any;\n }\n>;\n","import CanvasModule from '../../canvas';\nimport { Model, ObjectAny } from '../../common';\nimport Editor from '../../editor';\nimport EditorModel from '../../editor/model/Editor';\nimport CommandsEvents from '../types';\n\ninterface ICommand {\n run?: CommandAbstract['run'];\n stop?: CommandAbstract['stop'];\n id?: string;\n [key: string]: unknown;\n}\n\nexport type CommandFunction = CommandAbstract['run'];\n\nexport type Command = CommandObject | CommandFunction;\n\nexport type CommandOptions = Record;\n\nexport type CommandObject = ICommand &\n T &\n ThisType>;\n\nexport function defineCommand(def: CommandObject) {\n return def;\n}\n\nexport default class CommandAbstract extends Model {\n config: any;\n em: EditorModel;\n pfx: string;\n ppfx: string;\n hoverClass: string;\n badgeClass: string;\n plhClass: string;\n freezClass: string;\n canvas: CanvasModule;\n\n constructor(o: any) {\n super(0);\n this.config = o || {};\n this.em = this.config.em || {};\n const pfx = this.config.stylePrefix;\n this.pfx = pfx;\n this.ppfx = this.config.pStylePrefix;\n this.hoverClass = `${pfx}hover`;\n this.badgeClass = `${pfx}badge`;\n this.plhClass = `${pfx}placeholder`;\n this.freezClass = `${this.ppfx}freezed`;\n this.canvas = this.em.Canvas;\n this.init(this.config);\n }\n\n /**\n * On frame scroll callback\n * @param {[type]} e [description]\n * @return {[type]} [description]\n */\n onFrameScroll(e: any) {}\n\n /**\n * Returns canval element\n * @return {HTMLElement}\n */\n getCanvas() {\n return this.canvas.getElement();\n }\n\n /**\n * Get canvas body element\n * @return {HTMLElement}\n */\n getCanvasBody() {\n return this.canvas.getBody();\n }\n\n /**\n * Get canvas wrapper element\n * @return {HTMLElement}\n */\n getCanvasTools() {\n return this.canvas.getToolsEl();\n }\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return {Object}\n */\n offset(el: HTMLElement) {\n var rect = el.getBoundingClientRect();\n return {\n top: rect.top + el.ownerDocument.body.scrollTop,\n left: rect.left + el.ownerDocument.body.scrollLeft,\n };\n }\n\n /**\n * Callback triggered after initialize\n * @param {Object} o Options\n * @private\n * */\n init(o: any) {}\n\n /**\n * Method that run command\n * @param {Object} editor Editor instance\n * @param {Object} [options={}] Options\n * @private\n * */\n callRun(editor: Editor, options: any = {}) {\n const { id } = this;\n editor.trigger(`${CommandsEvents.runBeforeCommand}${id}`, { options });\n editor.trigger(`${CommandsEvents._runCommand}${id}:before`, options);\n\n if (options.abort) {\n editor.trigger(`${CommandsEvents.abort}${id}`, { options });\n editor.trigger(`${CommandsEvents._abort}${id}`, options);\n return;\n }\n\n const sender = options.sender || editor;\n const result = this.run(editor, sender, options);\n const data = { id, result, options };\n editor.trigger(`${CommandsEvents.runCommand}${id}`, data);\n editor.trigger(CommandsEvents.run, data);\n // deprecated\n editor.trigger(`${CommandsEvents._runCommand}${id}`, result, options);\n editor.trigger(CommandsEvents._run, id, result, options);\n return result;\n }\n\n /**\n * Method that run command\n * @param {Object} editor Editor instance\n * @param {Object} [options={}] Options\n * @private\n * */\n callStop(editor: Editor, options: any = {}) {\n const { id } = this;\n const sender = options.sender || editor;\n editor.trigger(`${CommandsEvents.stopBeforeCommand}${id}`, { options });\n editor.trigger(`${CommandsEvents._stopCommand}${id}:before`, options);\n const result = this.stop(editor, sender, options);\n const data = { id, result, options };\n editor.trigger(`${CommandsEvents.stopCommand}${id}`, data);\n editor.trigger(CommandsEvents.stop, data);\n\n // deprecated\n editor.trigger(`${CommandsEvents._stopCommand}${id}`, result, options);\n editor.trigger(CommandsEvents._stop, id, result, options);\n return result;\n }\n\n /**\n * Stop current command\n */\n stopCommand(opts?: any) {\n this.em.Commands.stop(this.id as string, opts);\n }\n\n /**\n * Method that run command\n * @param {Object} em Editor model\n * @param {Object} sender Button sender\n * @private\n * */\n run(em: Editor, sender: any, options: O) {}\n\n /**\n * Method that stop command\n * @param {Object} em Editor model\n * @param {Object} sender Button sender\n * @private\n * */\n stop(em: Editor, sender: any, options: O) {}\n}\n","import { isArray } from 'underscore';\nimport Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nconst command: CommandObject<{ component?: Component }> = {\n run(ed, s, opts = {}) {\n const removed: Component[] = [];\n let components = opts.component || ed.getSelectedAll();\n components = isArray(components) ? [...components] : [components];\n\n components.filter(Boolean).forEach(component => {\n if (!component.get('removable')) {\n return this.em.logWarning('The element is not removable', {\n component,\n });\n }\n\n removed.push(component);\n const cmp = component.delegate?.remove?.(component) || component;\n cmp.remove();\n });\n\n ed.selectRemove(removed);\n\n return removed;\n },\n};\n\nexport default command;\n","import { keys, bindAll, each, isUndefined, debounce } from 'underscore';\nimport Dragger from '../../utils/Dragger';\nimport { CommandObject } from './CommandAbstract';\n\ntype Rect = { left: number; width: number; top: number; height: number };\ntype OrigRect = { left: number; width: number; top: number; height: number; rect: Rect };\n\ntype Guide = {\n type: string;\n y: number;\n x: number;\n origin: HTMLElement;\n originRect: OrigRect;\n guide: HTMLElement;\n};\n\nconst evName = 'dmode';\n\nexport default {\n run(editor, sender, opts = {}) {\n bindAll(\n this,\n 'setPosition',\n 'onStart',\n 'onDrag',\n 'onEnd',\n 'getPosition',\n 'getGuidesStatic',\n 'renderGuide',\n 'getGuidesTarget'\n );\n const { target, event, mode, dragger = {} } = opts;\n const el = target.getEl();\n const config = {\n doc: el.ownerDocument,\n onStart: this.onStart,\n onEnd: this.onEnd,\n onDrag: this.onDrag,\n getPosition: this.getPosition,\n setPosition: this.setPosition,\n guidesStatic: () => this.guidesStatic,\n guidesTarget: () => this.guidesTarget,\n ...dragger,\n };\n this.setupGuides();\n this.opts = opts;\n this.editor = editor;\n this.em = editor.getModel();\n this.target = target;\n this.isTran = mode == 'translate';\n this.guidesContainer = this.getGuidesContainer();\n this.guidesTarget = this.getGuidesTarget();\n this.guidesStatic = this.getGuidesStatic();\n let drg = this.dragger;\n\n if (!drg) {\n drg = new Dragger(config);\n this.dragger = drg;\n } else {\n drg.setOptions(config);\n }\n\n event && drg.start(event);\n this.toggleDrag(1);\n this.em.trigger(`${evName}:start`, this.getEventOpts());\n\n return drg;\n },\n\n getEventOpts() {\n return {\n mode: this.opts.mode,\n target: this.target,\n guidesTarget: this.guidesTarget,\n guidesStatic: this.guidesStatic,\n };\n },\n\n stop() {\n this.toggleDrag();\n },\n\n setupGuides() {\n (this.guides || []).forEach((item: any) => {\n const { guide } = item;\n guide && guide.parentNode.removeChild(guide);\n });\n this.guides = [];\n },\n\n getGuidesContainer() {\n let { guidesEl } = this;\n\n if (!guidesEl) {\n const { editor, em, opts } = this;\n const pfx = editor.getConfig().stylePrefix;\n const elInfoX = document.createElement('div');\n const elInfoY = document.createElement('div');\n const guideContent = `
\n
\n
`;\n guidesEl = document.createElement('div');\n guidesEl.className = `${pfx}guides`;\n elInfoX.className = `${pfx}guide-info ${pfx}guide-info__x`;\n elInfoY.className = `${pfx}guide-info ${pfx}guide-info__y`;\n elInfoX.innerHTML = guideContent;\n elInfoY.innerHTML = guideContent;\n guidesEl.appendChild(elInfoX);\n guidesEl.appendChild(elInfoY);\n editor.Canvas.getGlobalToolsEl().appendChild(guidesEl);\n this.guidesEl = guidesEl;\n this.elGuideInfoX = elInfoX;\n this.elGuideInfoY = elInfoY;\n this.elGuideInfoContentX = elInfoX.querySelector(`.${pfx}guide-info__content`);\n this.elGuideInfoContentY = elInfoY.querySelector(`.${pfx}guide-info__content`);\n\n em.on(\n 'canvas:update frame:scroll',\n debounce(() => {\n this.updateGuides();\n opts.debug && this.guides?.forEach((item: any) => this.renderGuide(item));\n }, 200)\n );\n }\n\n return guidesEl;\n },\n\n getGuidesStatic() {\n let result: any = [];\n const el = this.target.getEl();\n const { parentNode = {} } = el;\n each(parentNode.children, item => (result = result.concat(el !== item ? this.getElementGuides(item) : [])));\n\n return result.concat(this.getElementGuides(parentNode));\n },\n\n getGuidesTarget() {\n return this.getElementGuides(this.target.getEl());\n },\n\n updateGuides(guides: any) {\n let lastEl: any;\n let lastPos: any;\n (guides || this.guides).forEach((item: any) => {\n const { origin } = item;\n const pos = lastEl === origin ? lastPos : this.getElementPos(origin);\n lastEl = origin;\n lastPos = pos;\n each(this.getGuidePosUpdate(item, pos), (val, key) => (item[key] = val));\n item.originRect = pos;\n });\n },\n\n getGuidePosUpdate(item: any, rect: any) {\n const result: { x?: number; y?: number } = {};\n const { top, height, left, width } = rect;\n\n switch (item.type) {\n case 't':\n result.y = top;\n break;\n case 'b':\n result.y = top + height;\n break;\n case 'l':\n result.x = left;\n break;\n case 'r':\n result.x = left + width;\n break;\n case 'x':\n result.x = left + width / 2;\n break;\n case 'y':\n result.y = top + height / 2;\n break;\n }\n\n return result;\n },\n\n renderGuide(item: any = {}) {\n const el = item.guide || document.createElement('div');\n const un = 'px';\n const guideSize = item.active ? 2 : 1;\n let numEl = el.children[0];\n el.style = `position: absolute; background-color: ${item.active ? 'green' : 'red'};`;\n\n if (!el.children.length) {\n numEl = document.createElement('div');\n numEl.style = 'position: absolute; color: red; padding: 5px; top: 0; left: 0;';\n el.appendChild(numEl);\n }\n\n if (item.y) {\n el.style.width = '100%';\n el.style.height = `${guideSize}${un}`;\n el.style.top = `${item.y}${un}`;\n el.style.left = 0;\n } else {\n el.style.width = `${guideSize}${un}`;\n el.style.height = '100%';\n el.style.left = `${item.x}${un}`;\n el.style.top = `0${un}`;\n }\n\n !item.guide && this.guidesContainer.appendChild(el);\n return el;\n },\n\n getElementPos(el: HTMLElement) {\n return this.editor.Canvas.getElementPos(el, { noScroll: 1 });\n },\n\n getElementGuides(el: HTMLElement) {\n const { opts } = this;\n const originRect = this.getElementPos(el);\n const { top, height, left, width } = originRect;\n // @ts-ignore\n const guides: Guide[] = [\n { type: 't', y: top }, // Top\n { type: 'b', y: top + height }, // Bottom\n { type: 'l', x: left }, // Left\n { type: 'r', x: left + width }, // Right\n { type: 'x', x: left + width / 2 }, // Mid x\n { type: 'y', y: top + height / 2 }, // Mid y\n ].map(item => ({\n ...item,\n origin: el,\n originRect,\n guide: opts.debug && this.renderGuide(item),\n }));\n guides.forEach(item => this.guides?.push(item));\n\n return guides;\n },\n\n getTranslate(transform: string, axis = 'x') {\n let result = 0;\n (transform || '').split(' ').forEach(item => {\n const itemStr = item.trim();\n const fn = `translate${axis.toUpperCase()}(`;\n if (itemStr.indexOf(fn) === 0) result = parseFloat(itemStr.replace(fn, ''));\n });\n return result;\n },\n\n setTranslate(transform: string, axis: string, value: string) {\n const fn = `translate${axis.toUpperCase()}(`;\n const val = `${fn}${value})`;\n let result = (transform || '')\n .split(' ')\n .map(item => {\n const itemStr = item.trim();\n if (itemStr.indexOf(fn) === 0) item = val;\n return item;\n })\n .join(' ');\n if (result.indexOf(fn) < 0) result += ` ${val}`;\n\n return result;\n },\n\n getPosition() {\n const { target, isTran } = this;\n const { left, top, transform } = target.getStyle();\n let x = 0;\n let y = 0;\n\n if (isTran) {\n x = this.getTranslate(transform);\n y = this.getTranslate(transform, 'y');\n } else {\n x = parseFloat(left || 0);\n y = parseFloat(top || 0);\n }\n\n return { x, y };\n },\n\n setPosition({ x, y, end, position, width, height }: any) {\n const { target, isTran, em } = this;\n const unit = 'px';\n const __p = !end; // Indicate if partial change\n const left = `${parseInt(x, 10)}${unit}`;\n const top = `${parseInt(y, 10)}${unit}`;\n let styleUp = {};\n\n if (isTran) {\n let transform = target.getStyle()['transform'] || '';\n transform = this.setTranslate(transform, 'x', left);\n transform = this.setTranslate(transform, 'y', top);\n styleUp = { transform, __p };\n target.addStyle(styleUp, { avoidStore: !end });\n } else {\n const adds: any = { position, width, height };\n const style: any = { left, top, __p };\n keys(adds).forEach(add => {\n const prop = adds[add];\n if (prop) style[add] = prop;\n });\n styleUp = style;\n target.addStyle(styleUp, { avoidStore: !end });\n }\n\n em?.Styles.__emitCmpStyleUpdate(styleUp, { components: em.getSelected() });\n },\n\n _getDragData() {\n const { target } = this;\n return {\n target,\n parent: target.parent(),\n index: target.index(),\n };\n },\n\n onStart(event: Event) {\n const { target, editor, isTran, opts } = this;\n const { center, onStart } = opts;\n const { Canvas } = editor;\n const style = target.getStyle();\n const position = 'absolute';\n const relPos = [position, 'relative'];\n onStart && onStart(this._getDragData());\n if (isTran) return;\n\n if (style.position !== position) {\n let { left, top, width, height } = Canvas.offset(target.getEl());\n let parent = target.parent();\n let parentRel;\n\n // Check for the relative parent\n do {\n const pStyle = parent.getStyle();\n parentRel = relPos.indexOf(pStyle.position) >= 0 ? parent : null;\n parent = parent.parent();\n } while (parent && !parentRel);\n\n // Center the target to the pointer position (used in Droppable for Blocks)\n if (center) {\n const { x, y } = Canvas.getMouseRelativeCanvas(event);\n left = x;\n top = y;\n } else if (parentRel) {\n const offsetP = Canvas.offset(parentRel.getEl());\n left = left - offsetP.left;\n top = top - offsetP.top;\n }\n\n this.setPosition({\n x: left,\n y: top,\n width: `${width}px`,\n height: `${height}px`,\n position,\n });\n }\n },\n\n onDrag(...args: any) {\n const { guidesTarget, opts } = this;\n const { onDrag } = opts;\n this.updateGuides(guidesTarget);\n opts.debug && guidesTarget.forEach((item: any) => this.renderGuide(item));\n opts.guidesInfo && this.renderGuideInfo(guidesTarget.filter((item: any) => item.active));\n onDrag && onDrag(this._getDragData());\n },\n\n onEnd(ev: Event, dragger: any, opt = {}) {\n const { editor, opts, id } = this;\n const { onEnd } = opts;\n onEnd && onEnd(ev, opt, { event: ev, ...opt, ...this._getDragData() });\n editor.stopCommand(id);\n this.hideGuidesInfo();\n this.em.trigger(`${evName}:end`, this.getEventOpts());\n },\n\n hideGuidesInfo() {\n ['X', 'Y'].forEach(item => {\n const guide = this[`elGuideInfo${item}`];\n if (guide) guide.style.display = 'none';\n });\n },\n\n /**\n * Render guides with spacing information\n */\n renderGuideInfo(guides: Guide[] = []) {\n const { guidesStatic } = this;\n this.hideGuidesInfo();\n guides.forEach(item => {\n const { origin, x } = item;\n const rectOrigin = this.getElementPos(origin);\n const axis = isUndefined(x) ? 'y' : 'x';\n const isY = axis === 'y';\n const origEdge1 = rectOrigin[isY ? 'left' : 'top'];\n const origEdge1Raw = rectOrigin.rect[isY ? 'left' : 'top'];\n const origEdge2 = isY ? origEdge1 + rectOrigin.width : origEdge1 + rectOrigin.height;\n const origEdge2Raw = isY ? origEdge1Raw + rectOrigin.rect.width : origEdge1Raw + rectOrigin.rect.height;\n const elGuideInfo = this[`elGuideInfo${axis.toUpperCase()}`];\n const elGuideInfoCnt = this[`elGuideInfoContent${axis.toUpperCase()}`];\n const guideInfoStyle = elGuideInfo.style;\n\n // Find the nearest element\n const res = guidesStatic\n ?.filter(stat => stat.type === item.type)\n .map(stat => {\n const { left, width, top, height } = stat.originRect;\n const statEdge1 = isY ? left : top;\n const statEdge2 = isY ? left + width : top + height;\n return {\n gap: statEdge2 < origEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2,\n guide: stat,\n };\n })\n .filter(item => item.gap > 0)\n .sort((a, b) => a.gap - b.gap)\n .map(item => item.guide)[0];\n\n if (res) {\n const { left, width, top, height, rect } = res.originRect;\n const isEdge1 = isY ? left < rectOrigin.left : top < rectOrigin.top;\n const statEdge1 = isY ? left : top;\n const statEdge1Raw = isY ? rect.left : rect.top;\n const statEdge2 = isY ? left + width : top + height;\n const statEdge2Raw = isY ? rect.left + rect.width : rect.top + rect.height;\n const posFirst = isY ? item.y : item.x;\n const posSecond = isEdge1 ? statEdge2 : origEdge2;\n const pos2 = `${posFirst}px`;\n const size = isEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2;\n const sizeRaw = isEdge1 ? origEdge1Raw - statEdge2Raw : statEdge1Raw - origEdge2Raw;\n guideInfoStyle.display = '';\n guideInfoStyle[isY ? 'top' : 'left'] = pos2;\n guideInfoStyle[isY ? 'left' : 'top'] = `${posSecond}px`;\n guideInfoStyle[isY ? 'width' : 'height'] = `${size}px`;\n elGuideInfoCnt.innerHTML = `${Math.round(sizeRaw)}px`;\n this.em.trigger(`${evName}:active`, {\n ...this.getEventOpts(),\n guide: item,\n guidesStatic,\n matched: res,\n posFirst,\n posSecond,\n size,\n sizeRaw,\n elGuideInfo,\n elGuideInfoCnt,\n });\n }\n });\n },\n\n toggleDrag(enable: boolean) {\n const { ppfx, editor } = this;\n const methodCls = enable ? 'add' : 'remove';\n const classes = [`${ppfx}is__grabbing`];\n const { Canvas } = editor;\n const body = Canvas.getBody();\n classes.forEach(cls => body.classList[methodCls](cls));\n Canvas[enable ? 'startAutoscroll' : 'stopAutoscroll']();\n },\n} as CommandObject<\n any,\n {\n guidesStatic?: Guide[];\n guides?: Guide[];\n [k: string]: any;\n }\n>;\n","import Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect: Component[] = [];\n\n ed.getSelectedAll().forEach(component => {\n const coll = component.components();\n const next = coll && coll.filter((c: any) => c.get('selectable'))[0];\n next && toSelect.push(next);\n });\n\n toSelect.length && ed.select(toSelect);\n },\n} as CommandObject;\n","import Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed, snd, opts = {}) {\n if (!ed.Canvas.hasFocus() && !opts.force) return;\n const toSelect: Component[] = [];\n\n ed.getSelectedAll().forEach(component => {\n let next = component.parent();\n\n // Recurse through the parent() chain until a selectable parent is found\n while (next && !next.get('selectable')) {\n next = next.parent();\n }\n\n next && toSelect.push(next);\n });\n\n toSelect.length && ed.select(toSelect);\n },\n} as CommandObject;\n","import Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect: Component[] = [];\n\n ed.getSelectedAll().forEach(cmp => {\n const parent = cmp.parent();\n if (!parent) return;\n\n const len = parent.components().length;\n let incr = 0;\n let at = 0;\n let next: any;\n\n // Get the next selectable component\n do {\n incr++;\n at = cmp.index() + incr;\n next = at <= len ? parent.getChildAt(at) : null;\n } while (next && !next.get('selectable'));\n\n toSelect.push(next || cmp);\n });\n\n toSelect.length && ed.select(toSelect);\n },\n} as CommandObject;\n","import Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect: Component[] = [];\n\n ed.getSelectedAll().forEach(cmp => {\n const parent = cmp.parent();\n if (!parent) return;\n\n let incr = 0;\n let at = 0;\n let next: any;\n\n // Get the first selectable component\n do {\n incr++;\n at = cmp.index() - incr;\n next = at >= 0 ? parent.getChildAt(at) : null;\n } while (next && !next.get('selectable'));\n\n toSelect.push(next || cmp);\n });\n\n toSelect.length && ed.select(toSelect);\n },\n} as CommandObject;\n","import { flatten } from 'underscore';\nimport CssRule from '../../css_composer/model/CssRule';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed, s, opts = {}) {\n const { target } = opts;\n let toRemove: CssRule[] = [];\n\n if (!target.get('styles')) return toRemove;\n\n // Find all components in the project, of the target component type\n const type = target.get('type');\n const wrappers = ed.Pages.getAllWrappers();\n const len = flatten(wrappers.map(wrp => wrp.findType(type))).length;\n\n // Remove component related styles only if there are no more components\n // of that type in the project\n if (!len) {\n const rules = ed.CssComposer.getAll();\n toRemove = rules.filter(rule => rule.get('group') === `cmp:${type}`);\n rules.remove(toRemove);\n }\n\n return toRemove;\n },\n} as CommandObject;\n","import { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n const em = ed.getModel();\n const models = [...ed.getSelectedAll()].map(md => md.delegate?.copy?.(md) || md).filter(Boolean);\n models.length && em.set('clipboard', models);\n },\n} as CommandObject;\n","import { CommandObject } from './CommandAbstract';\nimport { EditorParam } from '../../editor';\nimport { createEl } from '../../utils/dom';\n\ninterface ExportTemplateRunOptions {\n optsHtml?: EditorParam<'getHtml', 0>;\n optsCss?: EditorParam<'getCss', 0>;\n}\n\nexport default {\n run(editor, sender, opts: ExportTemplateRunOptions = {}) {\n sender && sender.set && sender.set('active', 0);\n const config = editor.getConfig();\n const modal = editor.Modal;\n const pfx = config.stylePrefix;\n this.cm = editor.CodeManager || null;\n\n if (!this.editors) {\n const oHtmlEd = this.buildEditor('htmlmixed', 'hopscotch', 'HTML');\n const oCsslEd = this.buildEditor('css', 'hopscotch', 'CSS');\n this.htmlEditor = oHtmlEd.model;\n this.cssEditor = oCsslEd.model;\n const editors = createEl('div', { class: `${pfx}export-dl` });\n editors.appendChild(oHtmlEd.el);\n editors.appendChild(oCsslEd.el);\n this.editors = editors;\n }\n\n modal\n .open({\n title: config.textViewCode,\n content: this.editors,\n })\n .getModel()\n .once('change:open', () => editor.stopCommand(`${this.id}`));\n this.htmlEditor.setContent(editor.getHtml(opts.optsHtml));\n this.cssEditor.setContent(editor.getCss(opts.optsCss));\n },\n\n stop(editor) {\n const modal = editor.Modal;\n modal && modal.close();\n },\n\n buildEditor(codeName: string, theme: string, label: string) {\n const cm = this.em.CodeManager;\n const model = cm.createViewer({\n label,\n codeName,\n theme,\n });\n\n const el = new cm.EditorView({\n model,\n config: cm.getConfig(),\n } as any).render().el;\n\n return { model, el };\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { isElement } from 'underscore';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n /**\n * Check if fullscreen mode is enabled\n * @return {Boolean}\n */\n isEnabled() {\n const d = document;\n // @ts-ignore\n if (d.fullscreenElement || d.webkitFullscreenElement || d.mozFullScreenElement) {\n return true;\n }\n return false;\n },\n\n /**\n * Enable fullscreen mode and return browser prefix\n * @param {HTMLElement} el\n * @return {string}\n */\n enable(el: any) {\n let pfx = '';\n\n if (el.requestFullscreen) {\n el.requestFullscreen();\n } else if (el.webkitRequestFullscreen) {\n pfx = 'webkit';\n el.webkitRequestFullscreen();\n } else if (el.mozRequestFullScreen) {\n pfx = 'moz';\n el.mozRequestFullScreen();\n } else if (el.msRequestFullscreen) {\n el.msRequestFullscreen();\n }\n\n return pfx;\n },\n\n /**\n * Disable fullscreen mode\n */\n disable() {\n const d: any = document;\n\n if (this.isEnabled()) {\n if (d.exitFullscreen) d.exitFullscreen();\n else if (d.webkitExitFullscreen) d.webkitExitFullscreen();\n else if (d.mozCancelFullScreen) d.mozCancelFullScreen();\n else if (d.msExitFullscreen) d.msExitFullscreen();\n }\n },\n\n /**\n * Triggered when the state of the fullscreen is changed. Inside detects if\n * it's enabled\n * @param {strinf} pfx Browser prefix\n * @param {Event} e\n */\n fsChanged(pfx: string) {\n if (!this.isEnabled()) {\n this.stopCommand({ sender: this.sender });\n document.removeEventListener(`${pfx || ''}fullscreenchange`, this.fsChanged);\n }\n },\n\n run(editor, sender, opts = {}) {\n this.sender = sender;\n const { target } = opts;\n const targetEl = isElement(target) ? target : document.querySelector(target!);\n const pfx = this.enable(targetEl || editor.getContainer());\n this.fsChanged = this.fsChanged.bind(this, pfx);\n document.addEventListener(pfx + 'fullscreenchange', this.fsChanged);\n },\n\n stop(editor, sender) {\n if (sender && sender.set) sender.set('active', false);\n this.disable();\n },\n} as CommandObject<{ target?: HTMLElement | string }, { [k: string]: any }>;\n","import { bindAll, extend } from 'underscore';\nimport { $ } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport { off, on } from '../../utils/dom';\nimport { CommandObject } from './CommandAbstract';\nimport SelectComponent from './SelectComponent';\nimport SelectPosition from './SelectPosition';\n\nexport default extend({}, SelectPosition, SelectComponent, {\n init(o: any) {\n SelectComponent.init.apply(this, arguments);\n bindAll(this, 'initSorter', 'rollback', 'onEndMove');\n this.opt = o;\n this.hoverClass = this.ppfx + 'highlighter-warning';\n this.badgeClass = this.ppfx + 'badge-warning';\n this.noSelClass = this.ppfx + 'no-select';\n },\n\n enable(...args: any) {\n SelectComponent.enable.apply(this, args);\n this.getBadgeEl().addClass(this.badgeClass);\n this.getHighlighterEl().addClass(this.hoverClass);\n var wp = this.$wrapper;\n wp.css('cursor', 'move');\n wp.on('mousedown', this.initSorter);\n\n // Avoid strange moving behavior\n wp.addClass(this.noSelClass);\n },\n\n /**\n * Overwrite for doing nothing\n * @private\n */\n toggleClipboard() {},\n\n /**\n * Delegate sorting\n * @param {Event} e\n * @private\n * */\n initSorter(e: any) {\n var el = $(e.target).data('model');\n var drag = el.get('draggable');\n if (!drag) return;\n\n // Avoid badge showing on move\n this.cacheEl = null;\n this.startSelectPosition(e.target, this.frameEl.contentDocument);\n this.sorter.draggable = drag;\n this.sorter.onEndMove = this.onEndMove.bind(this);\n this.stopSelectComponent();\n this.$wrapper.off('mousedown', this.initSorter);\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Init sorter from model\n * @param {Object} model\n * @private\n */\n initSorterFromModel(model: Component) {\n var drag = model.get('draggable');\n if (!drag) return;\n // Avoid badge showing on move\n this.cacheEl = null;\n // @ts-ignore\n var el = model.view.el;\n this.startSelectPosition(el, this.frameEl.contentDocument);\n this.sorter.draggable = drag;\n this.sorter.onEndMove = this.onEndMoveFromModel.bind(this);\n\n /*\n this.sorter.setDragHelper(el);\n var dragHelper = this.sorter.dragHelper;\n dragHelper.className = this.ppfx + 'drag-helper';\n dragHelper.innerHTML = '';\n dragHelper.backgroundColor = 'white';\n */\n\n this.stopSelectComponent();\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Init sorter from models\n * @param {Object} model\n * @private\n */\n initSorterFromModels(models: Component[]) {\n // TODO: if one only check for `draggable`\n // Avoid badge showing on move\n this.cacheEl = null;\n const lastModel = models[models.length - 1];\n const frameView = this.em.getCurrentFrame();\n const el = lastModel.getEl(frameView?.model)!;\n const doc = el.ownerDocument;\n this.startSelectPosition(el, doc, { onStart: this.onStart });\n this.sorter.draggable = lastModel.get('draggable');\n this.sorter.toMove = models;\n this.sorter.onMoveClb = this.onDrag;\n this.sorter.onEndMove = this.onEndMoveFromModel.bind(this);\n this.stopSelectComponent();\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n onEndMoveFromModel() {\n off(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Callback after sorting\n * @private\n */\n onEndMove() {\n this.enable();\n off(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Say what to do after the component was selected (selectComponent)\n * @param {Event} e\n * @param {Object} Selected element\n * @private\n * */\n onSelect(e: any, el: any) {},\n\n /**\n * Used to bring the previous situation before start moving the component\n * @param {Event} e\n * @param {Boolean} Indicates if rollback in anycase\n * @private\n * */\n rollback(e: any, force: boolean) {\n var key = e.which || e.keyCode;\n if (key == 27 || force) {\n this.sorter.moved = false;\n this.sorter.endMove();\n }\n return;\n },\n\n /**\n * Returns badge element\n * @return {HTMLElement}\n * @private\n */\n getBadgeEl() {\n if (!this.$badge) this.$badge = $(this.getBadge());\n return this.$badge;\n },\n\n /**\n * Returns highlighter element\n * @return {HTMLElement}\n * @private\n */\n getHighlighterEl() {\n if (!this.$hl) this.$hl = $(this.canvas.getHighlighter());\n return this.$hl;\n },\n\n stop(...args) {\n // @ts-ignore\n SelectComponent.stop.apply(this, args);\n this.getBadgeEl().removeClass(this.badgeClass);\n this.getHighlighterEl().removeClass(this.hoverClass);\n var wp = this.$wrapper;\n wp.css('cursor', '').unbind().removeClass(this.noSelClass);\n },\n} as CommandObject<{}, { [k: string]: any }>);\n","import { isFunction } from 'underscore';\nimport Asset from '../../asset_manager/model/Asset';\nimport { createEl } from '../../utils/dom';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n open(content: string) {\n const { editor, title, config, am } = this;\n const { custom } = config;\n if (isFunction(custom.open)) {\n return custom.open(am.__customData());\n }\n const { Modal } = editor;\n Modal.open({ title, content }).onceClose(() => editor.stopCommand(this.id));\n },\n\n close() {\n const { custom } = this.config;\n if (isFunction(custom.close)) {\n return custom.close(this.am.__customData());\n }\n const { Modal } = this.editor;\n Modal && Modal.close();\n },\n\n run(editor, sender, opts = {}) {\n const am = editor.AssetManager;\n const config = am.getConfig();\n const { types = [], accept, select } = opts;\n this.title = opts.modalTitle || editor.t('assetManager.modalTitle') || '';\n this.editor = editor;\n this.config = config;\n this.am = am;\n\n am.setTarget(opts.target);\n am.onClick(opts.onClick);\n am.onDblClick(opts.onDblClick);\n am.onSelect(opts.onSelect);\n am.__behaviour({\n select,\n types,\n options: opts,\n });\n\n if (config.custom) {\n this.rendered = this.rendered || createEl('div');\n this.rendered.className = `${config.stylePrefix}custom-wrp`;\n am.__behaviour({ container: this.rendered });\n am.__trgCustom();\n } else {\n if (!this.rendered || types) {\n let assets: Asset[] = am.getAll().filter((i: Asset) => i);\n\n if (types && types.length) {\n assets = assets.filter(a => types.indexOf(a.get('type')) !== -1);\n }\n\n am.render(assets);\n this.rendered = am.getContainer();\n }\n\n if (accept) {\n const uploadEl = this.rendered.querySelector(`input#${config.stylePrefix}uploadFile`);\n uploadEl && uploadEl.setAttribute('accept', accept);\n }\n }\n\n this.open(this.rendered);\n return this;\n },\n\n stop(editor) {\n this.editor = editor;\n this.close(this.rendered);\n },\n} as CommandObject;\n","import { isFunction } from 'underscore';\nimport { createEl } from '../../utils/dom';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n open() {\n const { container, editor, bm, config } = this;\n const { custom, appendTo } = config;\n\n if (isFunction(custom.open)) {\n return custom.open(bm.__customData());\n }\n\n if (this.firstRender && !appendTo) {\n const id = 'views-container';\n const pn = editor.Panels;\n const panels = pn.getPanel(id) || pn.addPanel({ id });\n panels.set('appendContent', container).trigger('change:appendContent');\n if (!custom) container.appendChild(bm.render());\n }\n\n if (container) container.style.display = 'block';\n },\n\n close() {\n const { container, config } = this;\n const { custom } = config;\n\n if (isFunction(custom.close)) {\n return custom.close(this.bm.__customData());\n }\n\n if (container) container.style.display = 'none';\n },\n\n run(editor) {\n const bm = editor.Blocks;\n this.config = bm.getConfig();\n this.firstRender = !this.container;\n this.container = this.container || createEl('div');\n this.editor = editor;\n this.bm = bm;\n const { container } = this;\n bm.__behaviour({\n container,\n });\n\n if (this.config.custom) {\n bm.__trgCustom();\n }\n\n this.open();\n },\n\n stop() {\n this.close();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { CommandObject } from './CommandAbstract';\n\nexport default {\n run(editor) {\n const lm = editor.LayerManager;\n const pn = editor.Panels;\n const lmConfig = lm.getConfig();\n\n if (lmConfig.appendTo) return;\n\n if (!this.layers) {\n const id = 'views-container';\n const layers = document.createElement('div');\n // @ts-ignore\n const panels = pn.getPanel(id) || pn.addPanel({ id });\n\n if (lmConfig.custom) {\n lm.__trgCustom({ container: layers });\n } else {\n layers.appendChild(lm.render());\n }\n\n panels.set('appendContent', layers).trigger('change:appendContent');\n this.layers = layers;\n }\n\n this.layers.style.display = 'block';\n },\n\n stop() {\n const { layers } = this;\n layers && (layers.style.display = 'none');\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { $ } from '../../common';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(editor, sender) {\n this.sender = sender;\n\n if (!this.$cnt) {\n const config = editor.getConfig();\n const { Panels, DeviceManager, SelectorManager, StyleManager } = editor;\n const trgEvCnt = 'change:appendContent';\n const $cnt = $('
');\n const $cntInner = $('
');\n const $cntSlm = $('
');\n const $cntSm = $('
');\n this.$cnt = $cnt;\n this.$cntInner = $cntInner;\n $cntInner.append($cntSlm);\n $cntInner.append($cntSm);\n $cnt.append($cntInner);\n\n // Device Manager\n if (DeviceManager && config.showDevices) {\n const devicePanel = Panels.addPanel({ id: 'devices-c' });\n const dvEl = DeviceManager.render();\n devicePanel.set('appendContent', dvEl).trigger(trgEvCnt);\n }\n\n // Selector Manager container\n const slmConfig = SelectorManager.getConfig();\n if (slmConfig.custom) {\n SelectorManager.__trgCustom({ container: $cntSlm.get(0) });\n } else if (!slmConfig.appendTo) {\n $cntSlm.append(SelectorManager.render([]));\n }\n\n // Style Manager\n this.sm = StyleManager;\n const smConfig = StyleManager.getConfig();\n const pfx = smConfig.stylePrefix;\n this.$header = $(`
${editor.t('styleManager.empty')}
`);\n $cnt.append(this.$header);\n\n if (smConfig.custom) {\n StyleManager.__trgCustom({ container: $cntSm.get(0) });\n } else if (!smConfig.appendTo) {\n $cntSm.append(StyleManager.render());\n }\n\n // Create panel if not exists\n const pnCnt = 'views-container';\n const pnl = Panels.getPanel(pnCnt) || Panels.addPanel({ id: pnCnt });\n\n // Add all containers to the panel\n pnl.set('appendContent', $cnt).trigger(trgEvCnt);\n\n // Toggle Style Manager on target selection\n const em = editor.getModel();\n this.listenTo(em, StyleManager.events.target, this.toggleSm);\n }\n\n this.toggleSm();\n },\n\n /**\n * Toggle Style Manager visibility\n * @private\n */\n toggleSm() {\n const { sender, sm, $cntInner, $header } = this;\n if ((sender && sender.get && !sender.get('active')) || !sm) return;\n\n if (sm.getSelected()) {\n $cntInner?.show();\n $header?.hide();\n } else {\n $cntInner?.hide();\n $header?.show();\n }\n },\n\n stop() {\n this.$cntInner?.hide();\n this.$header?.hide();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { CommandObject } from './CommandAbstract';\nimport { $ } from '../../common';\n\nexport default {\n run(editor, sender) {\n this.sender = sender;\n const em = editor.getModel();\n\n const config = editor.Config;\n const pfx = config.stylePrefix;\n const tm = editor.TraitManager;\n const confTm = tm.getConfig();\n let panelC;\n\n if (confTm.appendTo) return;\n\n if (!this.$cn) {\n this.$cn = $('
');\n this.$cn2 = $('
');\n this.$cn.append(this.$cn2);\n this.$header = $('
').append(`
${em.t('traitManager.empty')}
`);\n this.$cn.append(this.$header);\n\n if (confTm.custom) {\n tm.__trgCustom({ container: this.$cn2.get(0) });\n } else {\n this.$cn2.append(`
${em.t('traitManager.label')}
`);\n this.$cn2.append(tm.render());\n }\n\n var panels = editor.Panels;\n\n if (!panels.getPanel('views-container')) {\n // @ts-ignore\n panelC = panels.addPanel({ id: 'views-container' });\n } else {\n panelC = panels.getPanel('views-container');\n }\n\n panelC?.set('appendContent', this.$cn.get(0)).trigger('change:appendContent');\n\n this.target = editor.getModel();\n this.listenTo(this.target, 'component:toggled', this.toggleTm);\n }\n\n this.toggleTm();\n },\n\n /**\n * Toggle Trait Manager visibility\n * @private\n */\n toggleTm() {\n const sender = this.sender;\n if (sender && sender.get && !sender.get('active')) return;\n\n if (this.target.getSelectedAll().length === 1) {\n this.$cn2.show();\n this.$header.hide();\n } else {\n this.$cn2.hide();\n this.$header.show();\n }\n },\n\n stop() {\n this.$cn2 && this.$cn2.hide();\n this.$header && this.$header.hide();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { isArray, contains } from 'underscore';\nimport Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\nimport Editor from '../../editor';\n\nexport default {\n run(ed, s, opts = {}) {\n const em = ed.getModel();\n const clp: Component[] | null = em.get('clipboard');\n const lastSelected = ed.getSelected();\n\n if (clp?.length && lastSelected) {\n ed.getSelectedAll().forEach(sel => {\n const selected = sel.delegate?.copy?.(sel) || sel;\n const { collection } = selected;\n let added;\n if (collection) {\n const at = selected.index() + 1;\n const addOpts = { at, action: opts.action || 'paste-component' };\n\n if (contains(clp, selected) && selected.get('copyable')) {\n added = collection.add(selected.clone(), addOpts);\n } else {\n added = doAdd(ed, clp, selected.parent()!, addOpts);\n }\n } else {\n // Page body is selected\n // Paste at the end of the body\n const pageBody = em.Pages.getSelected()?.getMainComponent();\n const addOpts = { at: pageBody?.components().length || 0, action: opts.action || 'paste-component' };\n\n added = doAdd(ed, clp, pageBody as Component, addOpts);\n }\n\n added = isArray(added) ? added : [added];\n added.forEach(add => ed.trigger('component:paste', add));\n });\n\n lastSelected.emitUpdate();\n }\n },\n} as CommandObject;\n\nfunction doAdd(ed: Editor, clp: Component[], parent: Component, addOpts: any): Component[] | Component {\n const copyable = clp.filter(cop => cop.get('copyable'));\n const pasteable = copyable.filter(cop => ed.Components.canMove(parent, cop).result);\n return parent.components().add(\n pasteable.map(cop => cop.clone()),\n addOpts\n );\n}\n","import { each } from 'underscore';\nimport Editor from '../../editor';\nimport { CommandObject } from './CommandAbstract';\n\nconst cmdOutline = 'core:component-outline';\n\nexport default {\n getPanels(editor: Editor) {\n if (!this.panels) {\n this.panels = editor.Panels.getPanels();\n }\n\n return this.panels;\n },\n\n preventDrag(opts: any) {\n opts.abort = 1;\n },\n\n tglEffects(on: boolean) {\n const { em } = this;\n const mthEv = on ? 'on' : 'off';\n if (em) {\n const canvas = em.Canvas;\n const body = canvas.getBody();\n const tlb = canvas.getToolbarEl();\n tlb && (tlb.style.display = on ? 'none' : '');\n const elP = body.querySelectorAll(`.${this.ppfx}no-pointer`);\n each(elP, item => ((item as HTMLElement).style.pointerEvents = on ? 'all' : ''));\n em[mthEv]('run:tlb-move:before', this.preventDrag);\n }\n },\n\n run(editor, sender) {\n this.sender = sender;\n this.selected = [...editor.getSelectedAll()];\n editor.select();\n\n if (!this.shouldRunSwVisibility) {\n this.shouldRunSwVisibility = editor.Commands.isActive(cmdOutline);\n }\n\n this.shouldRunSwVisibility && editor.stopCommand(cmdOutline);\n editor.getModel().stopDefault();\n\n const panels = this.getPanels(editor);\n const canvas = editor.Canvas.getElement();\n const editorEl = editor.getEl()!;\n const pfx = editor.Config.stylePrefix;\n\n if (!this.helper) {\n const helper = document.createElement('span');\n helper.className = `${pfx}off-prv fa fa-eye-slash`;\n editorEl.appendChild(helper);\n helper.onclick = () => this.stopCommand();\n this.helper = helper;\n }\n\n this.helper.style.display = 'inline-block';\n\n panels.forEach((panel: any) => panel.set('visible', false));\n\n const canvasS = canvas.style;\n canvasS.width = '100%';\n canvasS.height = '100%';\n canvasS.top = '0';\n canvasS.left = '0';\n canvasS.padding = '0';\n canvasS.margin = '0';\n editor.refresh();\n this.tglEffects(1);\n },\n\n stop(editor) {\n const { sender = {}, selected } = this;\n sender.set && sender.set('active', 0);\n const panels = this.getPanels(editor);\n\n if (this.shouldRunSwVisibility) {\n editor.runCommand(cmdOutline);\n this.shouldRunSwVisibility = false;\n }\n\n editor.getModel().runDefault();\n panels.forEach((panel: any) => panel.set('visible', true));\n\n const canvas = editor.Canvas.getElement();\n canvas.setAttribute('style', '');\n selected && editor.select(selected);\n delete this.selected;\n\n if (this.helper) {\n this.helper.style.display = 'none';\n }\n\n editor.refresh();\n this.tglEffects();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import Resizer, { ResizerOptions } from '../../utils/Resizer';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(editor, sender, opts) {\n const opt = opts || {};\n const canvas = editor.Canvas;\n const canvasView = canvas.getCanvasView();\n const options: ResizerOptions = {\n appendTo: canvas.getResizerEl(),\n prefix: editor.getConfig().stylePrefix,\n posFetcher: canvasView.getElementPos.bind(canvasView),\n mousePosFetcher: canvas.getMouseRelativePos.bind(canvas),\n ...(opt.options || {}),\n };\n let { canvasResizer } = this;\n\n // Create the resizer for the canvas if not yet created\n if (!canvasResizer || opt.forceNew) {\n this.canvasResizer = new editor.Utils.Resizer(options);\n canvasResizer = this.canvasResizer;\n }\n\n canvasResizer.setOptions(options, true);\n canvasResizer.blur();\n canvasResizer.focus(opt.el);\n return canvasResizer;\n },\n\n stop() {\n this.canvasResizer?.blur();\n },\n} as CommandObject<{ options?: {}; forceNew?: boolean; el: HTMLElement }, { canvasResizer?: Resizer }>;\n","import { CommandFunction } from '../../commands/view/CommandAbstract';\nimport { Model, ObjectAny } from '../../common';\n\nexport interface ToolbarButtonProps {\n /**\n * Command name.\n */\n command: CommandFunction | string;\n\n /**\n * Button label.\n */\n label?: string;\n\n id?: string;\n attributes?: ObjectAny;\n events?: ObjectAny;\n}\n\nexport default class ToolbarButton extends Model {\n defaults() {\n return {\n command: '',\n attributes: {},\n };\n }\n}\n","import { Collection } from '../../common';\nimport ToolbarButton from './ToolbarButton';\n\nexport default class Toolbar extends Collection {}\n\nToolbar.prototype.model = ToolbarButton;\n","import { isFunction, isString } from 'underscore';\nimport { View } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport ToolbarButton from '../model/ToolbarButton';\n\nexport type ToolbarViewProps = { em: EditorModel };\n\nexport default class ToolbarButtonView extends View {\n em: EditorModel;\n\n events() {\n return (\n this.model.get('events') || {\n mousedown: 'handleClick',\n }\n );\n }\n\n // @ts-ignore\n attributes() {\n return this.model.get('attributes');\n }\n\n constructor(props: { config: ToolbarViewProps; model: ToolbarButton }) {\n super(props);\n this.em = props.config.em;\n }\n\n handleClick(event: MouseEvent) {\n event.preventDefault();\n event.stopPropagation();\n\n /*\n * Since the toolbar lives outside the canvas frame, the event's\n * generated on it have clientX and clientY relative to the page.\n *\n * This causes issues during events like dragging, where they depend\n * on the clientX and clientY.\n *\n * This makes sure the offsets are calculated.\n *\n * More information on\n * https://github.com/GrapesJS/grapesjs/issues/2372\n * https://github.com/GrapesJS/grapesjs/issues/2207\n */\n\n const { em } = this;\n const { left, top } = em.Canvas.getFrameEl().getBoundingClientRect();\n const ev = {\n ...event,\n clientX: event.clientX - left,\n clientY: event.clientY - top,\n };\n\n em.trigger('toolbar:run:before', { event: ev });\n this.execCommand(ev);\n }\n\n execCommand(event: MouseEvent) {\n const { em, model } = this;\n const opts = { event };\n const command = model.get('command');\n const editor = em.Editor;\n\n if (isFunction(command)) {\n command(editor, null, opts);\n }\n\n if (isString(command)) {\n editor.runCommand(command, opts);\n }\n }\n\n render() {\n const { em, $el, model } = this;\n const id = model.get('id');\n const label = model.get('label');\n const pfx = em.getConfig().stylePrefix;\n $el.addClass(`${pfx}toolbar-item`);\n id && $el.addClass(`${pfx}toolbar-item__${id}`);\n label && $el.append(label);\n return this;\n }\n}\n","import DomainViews from '../../domain_abstract/view/DomainViews';\nimport EditorModel from '../../editor/model/Editor';\nimport ToolbarButtonView, { ToolbarViewProps } from './ToolbarButtonView';\n\nexport default class ToolbarView extends DomainViews {\n em: EditorModel;\n\n constructor(opts: ToolbarViewProps) {\n super(opts);\n const { em } = opts;\n this.em = em;\n this.config = { em };\n this.listenTo(this.collection, 'reset', this.render);\n }\n\n onRender() {\n const pfx = this.em.config.stylePrefix!;\n this.el.className = `${pfx}toolbar-items`;\n }\n}\n\n// @ts-ignore\nToolbarView.prototype.itemView = ToolbarButtonView;\n","import { bindAll, debounce, isElement } from 'underscore';\nimport Component from '../../dom_components/model/Component';\nimport Toolbar from '../../dom_components/model/Toolbar';\nimport ToolbarView from '../../dom_components/view/ToolbarView';\nimport { isDoc, isTaggableNode, isVisible, off, on } from '../../utils/dom';\nimport { getComponentModel, getComponentView, getUnitFromValue, getViewEl, hasWin, isObject } from '../../utils/mixins';\nimport { CommandObject } from './CommandAbstract';\nimport { CanvasSpotBuiltInTypes } from '../../canvas/model/CanvasSpot';\nimport { ResizerOptions } from '../../utils/Resizer';\nimport { ComponentsEvents } from '../../dom_components/types';\n\nlet showOffsets: boolean;\n/**\n * This command is responsible for show selecting components and displaying\n * all the necessary tools around (component toolbar, badge, highlight box, etc.)\n *\n * The command manages different boxes to display tools and when something in\n * the canvas is updated, the command triggers the appropriate method to update\n * their position (across multiple frames/components):\n * - Global Tools (updateToolsGlobal/updateGlobalPos)\n * This box contains tools intended to be displayed only on ONE component per time,\n * like Component Toolbar (updated by updateToolbar/updateToolbarPos), this means\n * you won't be able to see more than one Component Toolbar (even with multiple\n * frames or multiple selected components)\n * - Local Tools (updateToolsLocal/updateLocalPos)\n * Each frame in the canvas has its own local box, so we're able to see more than\n * one active container at the same time. When you put a mouse over an element\n * you can see stuff like the highlight box, badge, margins/paddings offsets, etc.\n * so those elements are inside the Local Tools box\n *\n *\n */\nexport default {\n activeResizer: false,\n\n init() {\n this.onSelect = debounce(this.onSelect, 0);\n bindAll(\n this,\n 'onHover',\n 'onOut',\n 'onClick',\n 'onFrameScroll',\n 'onFrameResize',\n 'onFrameUpdated',\n 'onContainerChange'\n );\n },\n\n enable() {\n this.frameOff = this.canvasOff = this.adjScroll = null;\n this.startSelectComponent();\n showOffsets = true;\n },\n\n /**\n * Start select component event\n * @private\n * */\n startSelectComponent() {\n this.toggleSelectComponent(1);\n this.em.getSelected() && this.onSelect();\n },\n\n /**\n * Stop select component event\n * @private\n * */\n stopSelectComponent() {\n this.toggleSelectComponent();\n },\n\n /**\n * Toggle select component event\n * @private\n * */\n toggleSelectComponent(enable: boolean) {\n const { em } = this;\n const listenToEl = em.getConfig().listenToEl!;\n const { parentNode } = em.getContainer()!;\n const method = enable ? 'on' : 'off';\n const methods = { on, off };\n const eventCmpUpdate = ComponentsEvents.update;\n !listenToEl.length && parentNode && listenToEl.push(parentNode as HTMLElement);\n const trigger = (win: Window, body: HTMLBodyElement) => {\n methods[method](body, 'mouseover', this.onHover);\n methods[method](body, 'mouseleave', this.onOut);\n methods[method](body, 'click', this.onClick);\n methods[method](win, 'scroll', this.onFrameScroll, true);\n methods[method](win, 'resize', this.onFrameResize);\n };\n methods[method](window, 'resize', this.onFrameUpdated);\n methods[method](listenToEl, 'scroll', this.onContainerChange);\n em[method](`component:toggled ${eventCmpUpdate} undo redo`, this.onSelect, this);\n em[method]('change:componentHovered', this.onHovered, this);\n em[method]('component:resize styleable:change component:input', this.updateGlobalPos, this);\n em[method](`${eventCmpUpdate}:toolbar`, this._upToolbar, this);\n em[method]('frame:updated', this.onFrameUpdated, this);\n em[method]('canvas:updateTools', this.onFrameUpdated, this);\n em[method](em.Canvas.events.refresh, this.updateAttached, this);\n em.Canvas.getFrames().forEach(frame => {\n const { view } = frame;\n const win = view?.getWindow();\n win && trigger(win, view?.getBody()!);\n });\n },\n\n /**\n * Hover command\n * @param {Object} e\n * @private\n */\n onHover(ev: Event) {\n ev.stopPropagation();\n const { em } = this;\n const el = ev.target as HTMLElement;\n const view = getComponentView(el);\n const frameView = view?.frameView;\n let model = view?.model;\n\n // Get first valid model\n if (!model) {\n let parentEl = el.parentNode;\n while (!model && parentEl && !isDoc(parentEl)) {\n model = getComponentModel(parentEl);\n parentEl = parentEl.parentNode;\n }\n }\n\n this.currentDoc = el.ownerDocument;\n em.setHovered(model, { useValid: true });\n frameView && em.setCurrentFrame(frameView);\n },\n\n onFrameUpdated() {\n this.updateLocalPos();\n this.updateGlobalPos();\n },\n\n onHovered(em: any, component: Component) {\n let result = {};\n\n if (component) {\n component.views?.forEach(view => {\n const el = view.el;\n const pos = this.getElementPos(el);\n result = { el, pos, component, view: getViewEl(el) };\n\n if (el.ownerDocument === this.currentDoc) {\n this.elHovered = result;\n }\n\n this.updateToolsLocal(result);\n });\n } else {\n this.currentDoc = null;\n this.elHovered = 0;\n this.updateToolsLocal();\n this.canvas.getFrames().forEach(frame => {\n const { view } = frame;\n const el = view && view.getToolsEl();\n el && this.toggleToolsEl(0, 0, { el });\n });\n }\n },\n\n /**\n * Say what to do after the component was selected\n * @param {Object} e\n * @param {Object} el\n * @private\n * */\n onSelect() {\n const { em } = this;\n const component = em.getSelected();\n const currentFrame = em.getCurrentFrame();\n const view = component && component.getView(currentFrame?.model);\n let el = view && view.el;\n let result = {};\n\n if (el && isVisible(el)) {\n const pos = this.getElementPos(el);\n result = { el, pos, component, view: getViewEl(el) };\n }\n\n this.elSelected = result;\n this.updateToolsGlobal();\n // This will hide some elements from the select component\n this.updateLocalPos(result);\n this.initResize(component);\n },\n\n updateGlobalPos() {\n const sel = this.getElSelected();\n if (!sel.el) return;\n sel.pos = this.getElementPos(sel.el);\n this.updateToolsGlobal();\n },\n\n updateLocalPos(data: any) {\n const sel = this.getElHovered();\n if (!sel.el) return;\n sel.pos = this.getElementPos(sel.el);\n this.updateToolsLocal(data);\n },\n\n getElHovered() {\n return this.elHovered || {};\n },\n\n getElSelected() {\n return this.elSelected || {};\n },\n\n onOut() {\n this.em.setHovered();\n },\n\n toggleToolsEl(on: boolean, view: any, opts: any = {}) {\n const el = opts.el || this.canvas.getToolsEl(view);\n el && (el.style.display = on ? '' : 'none');\n return el || {};\n },\n\n /**\n * Show element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n showElementOffset(el: HTMLElement, pos: any, opts: any = {}) {\n if (!showOffsets) return;\n this.editor.runCommand('show-offset', {\n el,\n elPos: pos,\n view: opts.view,\n force: 1,\n top: 0,\n left: 0,\n });\n },\n\n /**\n * Hide element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n hideElementOffset(view: any) {\n this.editor.stopCommand('show-offset', {\n view,\n });\n },\n\n /**\n * Show fixed element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n showFixedElementOffset(el: HTMLElement, pos: any) {\n this.editor.runCommand('show-offset', {\n el,\n elPos: pos,\n state: 'Fixed',\n });\n },\n\n /**\n * Hide fixed element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n hideFixedElementOffset() {\n if (this.editor) this.editor.stopCommand('show-offset', { state: 'Fixed' });\n },\n\n /**\n * Hide Highlighter element\n */\n hideHighlighter(view: any) {\n this.canvas.getHighlighter(view).style.opacity = 0;\n },\n\n /**\n * On element click\n * @param {Event} e\n * @private\n */\n onClick(ev: Event) {\n ev.stopPropagation();\n ev.preventDefault();\n const { em } = this;\n\n if (em.get('_cmpDrag')) return em.set('_cmpDrag');\n\n const el = ev.target as HTMLElement;\n let model = getComponentModel(el);\n\n if (!model) {\n let parentEl = el.parentNode;\n\n while (!model && parentEl && !isDoc(parentEl)) {\n model = getComponentModel(parentEl);\n parentEl = parentEl.parentNode;\n }\n }\n\n if (model) {\n // Avoid selection of inner text components during editing\n if (em.isEditing() && !model.get('textable') && model.isChildOf('text')) {\n return;\n }\n this.select(model, ev);\n }\n },\n\n /**\n * Select component\n * @param {Component} model\n * @param {Event} event\n */\n select(model: Component, event = {}) {\n if (!model) return;\n this.editor.select(model, { event, useValid: true });\n this.initResize(model);\n },\n\n /**\n * Update badge for the component\n * @param {Object} Component\n * @param {Object} pos Position object\n * @private\n * */\n updateBadge(el: HTMLElement, pos: any, opts: any = {}) {\n const { canvas } = this;\n const model = getComponentModel(el);\n const badge = this.getBadge(opts);\n const bStyle = badge.style;\n\n if (!model || !model.get('badgable')) {\n bStyle.display = 'none';\n return;\n }\n\n if (!opts.posOnly) {\n const config = this.canvas.getConfig();\n const icon = model.getIcon();\n const ppfx = config.pStylePrefix || '';\n const clsBadge = `${ppfx}badge`;\n const customeLabel = config.customBadgeLabel;\n const badgeLabel = `${icon ? `
${icon}
` : ''}\n
${model.getName()}
`;\n badge.innerHTML = customeLabel ? customeLabel(model) : badgeLabel;\n }\n\n const un = 'px';\n bStyle.display = 'block';\n\n const targetToElem = canvas.getTargetToElementFixed(el, badge, {\n pos: pos,\n });\n\n const top = targetToElem.top; //opts.topOff - badgeH < 0 ? -opts.topOff : posTop;\n const left = opts.leftOff < 0 ? -opts.leftOff : 0;\n\n bStyle.top = top + un;\n bStyle.left = left + un;\n },\n\n /**\n * Update highlighter element\n * @param {HTMLElement} el\n * @param {Object} pos Position object\n * @private\n */\n showHighlighter(view: any) {\n this.canvas.getHighlighter(view).style.opacity = '';\n },\n\n /**\n * Init resizer on the element if possible\n * @param {HTMLElement|Component} elem\n * @private\n */\n initResize(elem: HTMLElement) {\n const { em, canvas } = this;\n const editor = em.Editor;\n const model = !isElement(elem) && isTaggableNode(elem) ? elem : em.getSelected();\n const resizable = model?.get('resizable');\n const spotTypeResize = CanvasSpotBuiltInTypes.Resize;\n const hasCustomResize = canvas.hasCustomSpot(spotTypeResize);\n canvas.removeSpots({ type: spotTypeResize });\n\n if (model && resizable) {\n canvas.addSpot({ type: spotTypeResize, component: model });\n const el = isElement(elem) ? elem : model.getEl();\n const {\n onStart = () => {},\n onMove = () => {},\n onEnd = () => {},\n updateTarget = () => {},\n ...resizableOpts\n } = isObject(resizable) ? resizable : {};\n\n if (hasCustomResize || !el || this.activeResizer) return;\n\n let modelToStyle: any;\n const { config } = em;\n const pfx = config.stylePrefix || '';\n const resizeClass = `${pfx}resizing`;\n const self = this;\n const resizeEventOpts = {\n component: model,\n el,\n };\n\n const toggleBodyClass = (method: string, e: any, opts: any) => {\n const docs = opts.docs;\n docs &&\n docs.forEach((doc: Document) => {\n const body = doc.body;\n const cls = body.className || '';\n body.className = (method == 'add' ? `${cls} ${resizeClass}` : cls.replace(resizeClass, '')).trim();\n });\n };\n\n const options: ResizerOptions = {\n // Here the resizer is updated with the current element height and width\n onStart(ev, opts) {\n onStart(ev, opts);\n const { el, config, resizer } = opts;\n const { keyHeight, keyWidth, currentUnit, keepAutoHeight, keepAutoWidth } = config;\n toggleBodyClass('add', ev, opts);\n modelToStyle = em.Styles.getModelToStyle(model);\n canvas.toggleFramesEvents(false);\n const computedStyle = getComputedStyle(el);\n const modelStyle = modelToStyle.getStyle();\n\n let currentWidth = modelStyle[keyWidth];\n config.autoWidth = keepAutoWidth && currentWidth === 'auto';\n if (isNaN(parseFloat(currentWidth))) {\n currentWidth = computedStyle[keyWidth];\n }\n\n let currentHeight = modelStyle[keyHeight];\n config.autoHeight = keepAutoHeight && currentHeight === 'auto';\n if (isNaN(parseFloat(currentHeight))) {\n currentHeight = computedStyle[keyHeight];\n }\n\n resizer.startDim!.w = parseFloat(currentWidth);\n resizer.startDim!.h = parseFloat(currentHeight);\n showOffsets = false;\n\n if (currentUnit) {\n config.unitHeight = getUnitFromValue(currentHeight);\n config.unitWidth = getUnitFromValue(currentWidth);\n }\n self.activeResizer = true;\n editor.trigger('component:resize', { ...resizeEventOpts, type: 'start' });\n },\n\n // Update all positioned elements (eg. component toolbar)\n onMove(ev) {\n onMove(ev);\n editor.trigger('component:resize', { ...resizeEventOpts, type: 'move' });\n },\n\n onEnd(ev, opts) {\n onEnd(ev, opts);\n toggleBodyClass('remove', ev, opts);\n editor.trigger('component:resize', { ...resizeEventOpts, type: 'end' });\n canvas.toggleFramesEvents(true);\n showOffsets = true;\n self.activeResizer = false;\n },\n\n updateTarget(el, rect, options) {\n updateTarget(el, rect, options);\n if (!modelToStyle) {\n return;\n }\n\n const { store, selectedHandler, config } = options;\n const { keyHeight, keyWidth, autoHeight, autoWidth, unitWidth, unitHeight } = config;\n const onlyHeight = ['tc', 'bc'].indexOf(selectedHandler!) >= 0;\n const onlyWidth = ['cl', 'cr'].indexOf(selectedHandler!) >= 0;\n const style: any = {};\n\n if (!onlyHeight) {\n const bodyw = canvas.getBody().offsetWidth;\n const width = rect.w < bodyw ? rect.w : bodyw;\n style[keyWidth!] = autoWidth ? 'auto' : `${width}${unitWidth}`;\n }\n\n if (!onlyWidth) {\n style[keyHeight!] = autoHeight ? 'auto' : `${rect.h}${unitHeight}`;\n }\n\n if (em.getDragMode(model)) {\n style.top = `${rect.t}${unitHeight}`;\n style.left = `${rect.l}${unitWidth}`;\n }\n\n const finalStyle = {\n ...style,\n // value for the partial update\n __p: !store,\n };\n modelToStyle.addStyle(finalStyle, { avoidStore: !store });\n em.Styles.__emitCmpStyleUpdate(finalStyle, { components: em.getSelected() });\n },\n ...resizableOpts,\n };\n\n this.resizer = editor.runCommand('resize', { el, options, force: 1 });\n } else {\n if (hasCustomResize) return;\n\n editor.stopCommand('resize');\n this.resizer = null;\n }\n },\n\n /**\n * Update toolbar if the component has one\n * @param {Object} mod\n */\n updateToolbar(mod: Component) {\n const { canvas } = this;\n const { em } = this.config;\n const model = mod === em ? em.getSelected() : mod;\n const toolbarEl = canvas.getToolbarEl()!;\n const toolbarStyle = toolbarEl.style;\n const toolbar = model.get('toolbar');\n const showToolbar = em.config.showToolbar;\n const noCustomSpotSelect = !canvas.hasCustomSpot(CanvasSpotBuiltInTypes.Select);\n\n if (model && showToolbar && toolbar && toolbar.length && noCustomSpotSelect) {\n toolbarStyle.display = '';\n if (!this.toolbar) {\n toolbarEl.innerHTML = '';\n this.toolbar = new Toolbar(toolbar);\n // @ts-ignore\n const toolbarView = new ToolbarView({ collection: this.toolbar, em });\n toolbarEl.appendChild(toolbarView.render().el);\n }\n\n this.toolbar.reset(toolbar);\n toolbarStyle.top = '-100px';\n toolbarStyle.left = '0';\n } else {\n toolbarStyle.display = 'none';\n }\n },\n\n /**\n * Update toolbar positions\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n updateToolbarPos(pos: any) {\n const unit = 'px';\n const { style } = this.canvas.getToolbarEl()!;\n style.top = `${pos.top}${unit}`;\n style.left = `${pos.left}${unit}`;\n style.opacity = '';\n },\n\n /**\n * Return canvas dimensions and positions\n * @return {Object}\n */\n getCanvasPosition() {\n return this.canvas.getCanvasView().getPosition();\n },\n\n /**\n * Returns badge element\n * @return {HTMLElement}\n * @private\n */\n getBadge(opts: any = {}) {\n return this.canvas.getBadgeEl(opts.view);\n },\n\n /**\n * On frame scroll callback\n * @private\n */\n onFrameScroll() {\n this.updateTools();\n this.canvas.refreshSpots();\n },\n\n onFrameResize() {\n this.canvas.refresh({ all: true });\n },\n\n updateTools() {\n this.updateLocalPos();\n this.updateGlobalPos();\n },\n\n isCompSelected(comp: Component) {\n return comp && comp.get('status') === 'selected';\n },\n\n /**\n * Update tools visible on hover\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n updateToolsLocal(data: any) {\n const config = this.em.getConfig();\n const { el, pos, view, component } = data || this.getElHovered();\n\n if (!el) {\n this.lastHovered = 0;\n return;\n }\n\n const isHoverEn = component.get('hoverable');\n const isNewEl = this.lastHovered !== el;\n const badgeOpts = isNewEl ? {} : { posOnly: 1 };\n const customHoverSpot = this.canvas.hasCustomSpot(CanvasSpotBuiltInTypes.Hover);\n\n if (isNewEl && isHoverEn) {\n this.lastHovered = el;\n customHoverSpot ? this.hideHighlighter(view) : this.showHighlighter(view);\n this.showElementOffset(el, pos, { view });\n }\n\n if (this.isCompSelected(component)) {\n this.hideHighlighter(view);\n !config.showOffsetsSelected && this.hideElementOffset(view);\n }\n\n const unit = 'px';\n const toolsEl = this.toggleToolsEl(1, view);\n const { style } = toolsEl;\n const frameOff = this.canvas.canvasRectOffset(el, pos);\n const topOff = frameOff.top;\n const leftOff = frameOff.left;\n\n !customHoverSpot &&\n this.updateBadge(el, pos, {\n ...badgeOpts,\n view,\n topOff,\n leftOff,\n });\n\n style.top = topOff + unit;\n style.left = leftOff + unit;\n style.width = pos.width + unit;\n style.height = pos.height + unit;\n\n this._trgToolUp('local', {\n component,\n el: toolsEl,\n top: topOff,\n left: leftOff,\n width: pos.width,\n height: pos.height,\n });\n },\n\n _upToolbar: debounce(function () {\n // @ts-ignore\n this.updateToolsGlobal({ force: 1 });\n }, 0),\n\n _trgToolUp(type: string, opts = {}) {\n this.em.trigger('canvas:tools:update', {\n type,\n ...opts,\n });\n },\n\n updateToolsGlobal(opts: any = {}) {\n const { el, pos, component } = this.getElSelected();\n\n if (!el) {\n this.toggleToolsEl(); // Hides toolbar\n this.lastSelected = 0;\n return;\n }\n\n const { canvas } = this;\n const isNewEl = this.lastSelected !== el;\n\n if (isNewEl || opts.force) {\n this.lastSelected = el;\n this.updateToolbar(component);\n }\n\n const unit = 'px';\n const toolsEl = this.toggleToolsEl(1);\n const { style } = toolsEl;\n const targetToElem = canvas.getTargetToElementFixed(el, canvas.getToolbarEl()!, { pos });\n const topOff = targetToElem.canvasOffsetTop;\n const leftOff = targetToElem.canvasOffsetLeft;\n style.top = topOff + unit;\n style.left = leftOff + unit;\n style.width = pos.width + unit;\n style.height = pos.height + unit;\n\n this.updateToolbarPos({ top: targetToElem.top, left: targetToElem.left });\n this._trgToolUp('global', {\n component,\n el: toolsEl,\n top: topOff,\n left: leftOff,\n width: pos.width,\n height: pos.height,\n });\n },\n\n /**\n * Update attached elements, eg. component toolbar\n */\n updateAttached: debounce(function () {\n // @ts-ignore\n this.updateGlobalPos();\n }, 0),\n\n onContainerChange: debounce(function () {\n // @ts-ignore\n this.em.refreshCanvas();\n }, 150),\n\n /**\n * Returns element's data info\n * @param {HTMLElement} el\n * @return {Object}\n * @private\n */\n getElementPos(el: HTMLElement) {\n return this.canvas.getCanvasView().getElementPos(el, { noScroll: true });\n },\n\n /**\n * Hide badge\n * @private\n * */\n hideBadge() {\n this.getBadge().style.display = 'none';\n },\n\n /**\n * Clean previous model from different states\n * @param {Component} model\n * @private\n */\n cleanPrevious(model: Component) {\n model &&\n model.set({\n status: '',\n state: '',\n });\n },\n\n /**\n * Returns content window\n * @private\n */\n getContentWindow() {\n return this.canvas.getWindow();\n },\n\n run(editor) {\n if (!hasWin()) return;\n // @ts-ignore\n this.editor = editor && editor.get('Editor');\n this.enable();\n },\n\n stop(ed, sender, opts = {}) {\n if (!hasWin()) return;\n const { em, editor } = this;\n this.onHovered(); // force to hide toolbar\n this.stopSelectComponent();\n !opts.preserveSelected && em.setSelected();\n this.toggleToolsEl();\n editor && editor.stopCommand('resize');\n },\n} as CommandObject;\n","import { $ } from '../../common';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n /**\n * Start select position event\n * @param {HTMLElement} trg\n * @private\n * */\n startSelectPosition(trg: HTMLElement, doc: Document, opts: any = {}) {\n this.isPointed = false;\n const utils = this.em.Utils;\n const container = trg.ownerDocument.body;\n\n if (utils && !this.sorter)\n this.sorter = new utils.Sorter({\n // @ts-ignore\n container,\n placer: this.canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: this.ppfx,\n direction: 'a',\n document: doc,\n wmargin: 1,\n nested: 1,\n em: this.em,\n canvasRelative: 1,\n scale: () => this.em.getZoomDecimal(),\n });\n\n if (opts.onStart) this.sorter.onStart = opts.onStart;\n trg && this.sorter.startSort(trg, { container });\n },\n\n /**\n * Get frame position\n * @return {Object}\n * @private\n */\n getOffsetDim() {\n var frameOff = this.offset(this.canvas.getFrameEl());\n var canvasOff = this.offset(this.canvas.getElement());\n var top = frameOff.top - canvasOff.top;\n var left = frameOff.left - canvasOff.left;\n return { top, left };\n },\n\n /**\n * Stop select position event\n * @private\n * */\n stopSelectPosition() {\n this.posTargetCollection = null;\n this.posIndex = this.posMethod == 'after' && this.cDim.length !== 0 ? this.posIndex + 1 : this.posIndex; //Normalize\n if (this.sorter) {\n this.sorter.moved = 0;\n this.sorter.endMove();\n }\n if (this.cDim) {\n this.posIsLastEl = this.cDim.length !== 0 && this.posMethod == 'after' && this.posIndex == this.cDim.length;\n this.posTargetEl =\n this.cDim.length === 0\n ? $(this.outsideElem)\n : !this.posIsLastEl && this.cDim[this.posIndex]\n ? $(this.cDim[this.posIndex][5]).parent()\n : $(this.outsideElem);\n this.posTargetModel = this.posTargetEl.data('model');\n this.posTargetCollection = this.posTargetEl.data('model-comp');\n }\n },\n\n /**\n * Enabel select position\n * @private\n */\n enable() {\n this.startSelectPosition();\n },\n\n /**\n * Check if the pointer is near to the float component\n * @param {number} index\n * @param {string} method\n * @param {Array} dims\n * @return {Boolean}\n * @private\n * */\n nearFloat(index: number, method: string, dims: any[]) {\n var i = index || 0;\n var m = method || 'before';\n var len = dims.length;\n var isLast = len !== 0 && m == 'after' && i == len;\n if (len !== 0 && ((!isLast && !dims[i][4]) || (dims[i - 1] && !dims[i - 1][4]) || (isLast && !dims[i - 1][4])))\n return 1;\n return 0;\n },\n\n run() {\n this.enable();\n },\n\n stop() {\n this.stopSelectPosition();\n this.$wrapper.css('cursor', '');\n this.$wrapper.unbind();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { isUndefined } from 'underscore';\nimport { CanvasSpotBuiltInTypes } from '../../canvas/model/CanvasSpot';\nimport { $ } from '../../common';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n getOffsetMethod(state: string) {\n var method = state || '';\n return 'get' + method + 'OffsetViewerEl';\n },\n\n run(editor, sender, opts) {\n const { canvas } = this;\n const opt = opts || {};\n const state = opt.state || '';\n const config = editor.getConfig();\n const zoom = this.em.getZoomDecimal();\n const el = opt.el as HTMLElement | undefined;\n\n if (!config.showOffsets || !(el instanceof HTMLElement) || (!config.showOffsetsSelected && state == 'Fixed')) {\n editor.stopCommand(`${this.id}`, opts);\n return;\n }\n\n if (canvas.hasCustomSpot(CanvasSpotBuiltInTypes.Spacing)) {\n return;\n }\n\n var pos = { ...(opt.elPos || canvas.getElementPos(el)) };\n\n if (!isUndefined(opt.top)) {\n pos.top = opt.top;\n }\n if (!isUndefined(opt.left)) {\n pos.left = opt.left;\n }\n\n var style = window.getComputedStyle(el);\n var ppfx = this.ppfx;\n var stateVar = state + 'State';\n var method = this.getOffsetMethod(state);\n // @ts-ignore\n var offsetViewer = canvas[method](opts.view);\n offsetViewer.style.opacity = '';\n\n let marginT = this['marginT' + state];\n let marginB = this['marginB' + state];\n let marginL = this['marginL' + state];\n let marginR = this['marginR' + state];\n let padT = this['padT' + state];\n let padB = this['padB' + state];\n let padL = this['padL' + state];\n let padR = this['padR' + state];\n\n if (offsetViewer.childNodes.length) {\n this[stateVar] = '1';\n marginT = offsetViewer.querySelector('[data-offset-m-t]');\n marginB = offsetViewer.querySelector('[data-offset-m-b]');\n marginL = offsetViewer.querySelector('[data-offset-m-l]');\n marginR = offsetViewer.querySelector('[data-offset-m-r]');\n padT = offsetViewer.querySelector('[data-offset-p-t]');\n padB = offsetViewer.querySelector('[data-offset-p-b]');\n padL = offsetViewer.querySelector('[data-offset-p-l]');\n padR = offsetViewer.querySelector('[data-offset-p-r]');\n }\n\n if (!this[stateVar]) {\n var stateLow = state.toLowerCase();\n var marginName = stateLow + 'margin-v';\n var paddingName = stateLow + 'padding-v';\n var marginV = $(`
`).get(0) as HTMLElement;\n var paddingV = $(`
`).get(0) as HTMLElement;\n var marginEls = ppfx + marginName + '-el';\n var paddingEls = ppfx + paddingName + '-el';\n const fullMargName = `${marginEls} ${ppfx + marginName}`;\n const fullPadName = `${paddingEls} ${ppfx + paddingName}`;\n marginT = $(`
`).get(0);\n marginB = $(`
`).get(0);\n marginL = $(`
`).get(0);\n marginR = $(`
`).get(0);\n padT = $(`
`).get(0);\n padB = $(`
`).get(0);\n padL = $(`
`).get(0);\n padR = $(`
`).get(0);\n this['marginT' + state] = marginT;\n this['marginB' + state] = marginB;\n this['marginL' + state] = marginL;\n this['marginR' + state] = marginR;\n this['padT' + state] = padT;\n this['padB' + state] = padB;\n this['padL' + state] = padL;\n this['padR' + state] = padR;\n marginV.appendChild(marginT);\n marginV.appendChild(marginB);\n marginV.appendChild(marginL);\n marginV.appendChild(marginR);\n paddingV.appendChild(padT);\n paddingV.appendChild(padB);\n paddingV.appendChild(padL);\n paddingV.appendChild(padR);\n offsetViewer.appendChild(marginV);\n offsetViewer.appendChild(paddingV);\n this[stateVar] = '1';\n }\n\n var unit = 'px';\n var marginLeftSt = parseFloat(style.marginLeft.replace(unit, '')) * zoom;\n var marginRightSt = parseFloat(style.marginRight.replace(unit, '')) * zoom;\n var marginTopSt = parseFloat(style.marginTop.replace(unit, '')) * zoom;\n var marginBottomSt = parseFloat(style.marginBottom.replace(unit, '')) * zoom;\n var mtStyle = marginT.style;\n var mbStyle = marginB.style;\n var mlStyle = marginL.style;\n var mrStyle = marginR.style;\n var ptStyle = padT.style;\n var pbStyle = padB.style;\n var plStyle = padL.style;\n var prStyle = padR.style;\n var posLeft = parseFloat(pos.left);\n var widthEl = parseFloat(style.width) * zoom + unit;\n\n // Margin style\n mtStyle.height = marginTopSt + unit;\n mtStyle.width = widthEl;\n mtStyle.top = pos.top - marginTopSt + unit;\n mtStyle.left = posLeft + unit;\n\n mbStyle.height = marginBottomSt + unit;\n mbStyle.width = widthEl;\n mbStyle.top = pos.top + pos.height + unit;\n mbStyle.left = posLeft + unit;\n\n var marginSideH = pos.height + marginTopSt + marginBottomSt + unit;\n var marginSideT = pos.top - marginTopSt + unit;\n mlStyle.height = marginSideH;\n mlStyle.width = marginLeftSt + unit;\n mlStyle.top = marginSideT;\n mlStyle.left = posLeft - marginLeftSt + unit;\n\n mrStyle.height = marginSideH;\n mrStyle.width = marginRightSt + unit;\n mrStyle.top = marginSideT;\n mrStyle.left = posLeft + pos.width + unit;\n\n // Padding style\n var padTop = parseFloat(style.paddingTop) * zoom;\n ptStyle.height = padTop + unit;\n // ptStyle.width = widthEl;\n // ptStyle.top = pos.top + unit;\n // ptStyle.left = posLeft + unit;\n\n var padBot = parseFloat(style.paddingBottom) * zoom;\n pbStyle.height = padBot + unit;\n // pbStyle.width = widthEl;\n // pbStyle.top = pos.top + pos.height - padBot + unit;\n // pbStyle.left = posLeft + unit;\n\n var padSideH = pos.height - padBot - padTop + unit;\n var padSideT = pos.top + padTop + unit;\n plStyle.height = padSideH;\n plStyle.width = parseFloat(style.paddingLeft) * zoom + unit;\n plStyle.top = padSideT;\n // plStyle.left = pos.left + unit;\n // plStyle.right = 0;\n\n var padRight = parseFloat(style.paddingRight) * zoom;\n prStyle.height = padSideH;\n prStyle.width = padRight + unit;\n prStyle.top = padSideT;\n // prStyle.left = pos.left + pos.width - padRight + unit;\n // prStyle.left = 0;\n },\n\n stop(editor, sender, opts = {}) {\n var opt = opts || {};\n var state = opt.state || '';\n var method = this.getOffsetMethod(state);\n const { view } = opts;\n const canvas = this.canvas;\n // @ts-ignore\n var offsetViewer = canvas[method](view);\n offsetViewer.style.opacity = 0;\n },\n} as CommandObject;\n","import { bindAll } from 'underscore';\nimport Frame from '../../canvas/model/Frame';\nimport Editor from '../../editor';\nimport { CommandObject } from './CommandAbstract';\nimport { isDef } from '../../utils/mixins';\n\nexport default {\n init() {\n bindAll(this, '_onFramesChange');\n },\n\n run(ed) {\n this.toggleVis(ed, true);\n },\n\n stop(ed) {\n this.toggleVis(ed, false);\n },\n\n toggleVis(ed: Editor, active = true) {\n if (!ed.Commands.isActive('preview')) {\n const cv = ed.Canvas;\n const mth = active ? 'on' : 'off';\n const canvasModel = cv.getModel();\n canvasModel[mth]('change:frames', this._onFramesChange);\n this.handleFrames(cv.getFrames(), active);\n }\n },\n\n handleFrames(frames: Frame[], active?: boolean) {\n frames.forEach((frame: Frame & { __ol?: boolean }) => {\n frame.view?.loaded && this._upFrame(frame, active);\n\n if (!frame.__ol) {\n frame.on('loaded', () => this._upFrame(frame));\n frame.__ol = true;\n }\n });\n },\n\n _onFramesChange(_: any, frames: Frame[]) {\n this.handleFrames(frames);\n },\n\n _upFrame(frame: Frame, active?: boolean) {\n const { ppfx, em, id } = this;\n const isActive = isDef(active) ? active : em.Commands.isActive(id as string);\n const method = isActive ? 'add' : 'remove';\n const cls = `${ppfx}dashed`;\n frame.view?.getBody().classList[method](cls);\n },\n} as CommandObject<\n {},\n {\n [key: string]: any;\n }\n>;\n","import Backbone from 'backbone';\nexport { default as $ } from '../utils/cash-dom';\n\ninterface NOOP {}\n\nexport type Debounced = Function & { cancel(): void };\n\nexport type SetOptions = Backbone.ModelSetOptions & { avoidStore?: boolean };\n\nexport type AddOptions = Backbone.AddOptions & { temporary?: boolean; action?: string };\n\nexport type DisableOptions = { fromMove?: boolean };\n\nexport type LocaleOptions = { locale?: boolean };\n\nexport type RemoveOptions = Backbone.Silenceable;\n\nexport type EventHandler = Backbone.EventHandler;\n\nexport type ObjectHash = Backbone.ObjectHash;\n\nexport type ObjectAny = Record;\n\nexport type ObjectStrings = Record;\n\nexport type Nullable = undefined | null | false;\n\nexport interface OptionAsDocument {\n /**\n * Treat the HTML string as document (option valid on the root component, eg. will include doctype, html, head, etc.).\n */\n asDocument?: boolean;\n}\n\n// https://github.com/microsoft/TypeScript/issues/29729#issuecomment-1483854699\nexport type LiteralUnion = T | (U & NOOP);\n\nexport type Position = {\n x: number;\n y: number;\n};\n\nexport interface Coordinates {\n x: number;\n y: number;\n}\n\nexport interface Dimensions {\n height: number;\n width: number;\n}\n\nexport interface BoxRect extends Coordinates, Dimensions {}\n\nexport type ElementRect = {\n top: number;\n left: number;\n width: number;\n height: number;\n};\n\nexport type CombinedModelConstructorOptions<\n E,\n M extends Model = Model\n> = Backbone.ModelConstructorOptions & E;\n\nexport interface ViewOptions\n extends Backbone.ViewOptions {}\n\nexport class Model extends Backbone.Model {}\n\nexport class Collection extends Backbone.Collection {}\n\nexport class View extends Backbone.View {}\n\nexport type PickMatching = { [K in keyof T as T[K] extends V ? K : never]: T[K] };\n\nexport type ExtractMethods = PickMatching;\n\nexport enum CoordinatesTypes {\n Screen = 'screen',\n World = 'world',\n}\n\nexport const DEFAULT_COORDS: Coordinates = {\n x: 0,\n y: 0,\n};\n\nexport const DEFAULT_BOXRECT: BoxRect = {\n ...DEFAULT_COORDS,\n width: 0,\n height: 0,\n};\n\nexport type PrevToNewIdMap = Record;\n","import Component from './model/Component';\n\nexport enum ActionLabelComponents {\n remove = 'component:remove',\n add = 'component:add',\n move = 'component:move',\n}\n\nexport interface SymbolInfo {\n isSymbol: boolean;\n isMain: boolean;\n isInstance: boolean;\n isRoot: boolean;\n main?: Component;\n instances: Component[];\n relatives: Component[];\n}\n\nexport enum ComponentsEvents {\n /**\n * @event `component:add` New component added.\n * @example\n * editor.on('component:add', (component) => { ... });\n */\n add = 'component:add',\n\n /**\n * @event `component:remove` Component removed.\n * @example\n * editor.on('component:remove', (component) => { ... });\n */\n remove = 'component:remove',\n removeBefore = 'component:remove:before',\n\n /**\n * @event `component:create` Component created.\n * @example\n * editor.on('component:create', (component) => { ... });\n */\n create = 'component:create',\n\n /**\n * @event `component:update` Component is updated, the component is passed as an argument to the callback.\n * @example\n * editor.on('component:update', (component) => { ... });\n */\n update = 'component:update',\n updateInside = 'component:update-inside',\n\n /**\n * @event `symbol:main:add` Added new main symbol.\n * @example\n * editor.on('symbol:main:add', ({ component }) => { ... });\n */\n symbolMainAdd = 'symbol:main:add',\n\n /**\n * @event `symbol:main:update` Main symbol updated.\n * @example\n * editor.on('symbol:main:update', ({ component }) => { ... });\n */\n symbolMainUpdate = 'symbol:main:update',\n symbolMainUpdateDeep = 'symbol:main:update-deep',\n\n /**\n * @event `symbol:main:remove` Main symbol removed.\n * @example\n * editor.on('symbol:main:remove', ({ component }) => { ... });\n */\n symbolMainRemove = 'symbol:main:remove',\n\n /**\n * @event `symbol:main` Catch-all event related to main symbol updates.\n * @example\n * editor.on('symbol:main', ({ event, component }) => { ... });\n */\n symbolMain = 'symbol:main',\n\n /**\n * @event `symbol:instance:add` Added new root instance symbol.\n * @example\n * editor.on('symbol:instance:add', ({ component }) => { ... });\n */\n symbolInstanceAdd = 'symbol:instance:add',\n\n /**\n * @event `symbol:instance:remove` Root instance symbol removed.\n * @example\n * editor.on('symbol:instance:remove', ({ component }) => { ... });\n */\n symbolInstanceRemove = 'symbol:instance:remove',\n\n /**\n * @event `symbol:instance` Catch-all event related to instance symbol updates.\n * @example\n * editor.on('symbol:instance', ({ event, component }) => { ... });\n */\n symbolInstance = 'symbol:instance',\n\n /**\n * @event `symbol` Catch-all event for any symbol update (main or instance).\n * @example\n * editor.on('symbol', () => { ... });\n */\n symbol = 'symbol',\n}\n","import { includes } from 'underscore';\nimport { ObjectAny, View } from '../../common';\n\nexport default class DomainViews extends View {\n config?: any;\n items: any[];\n ns?: string;\n itemView?: any;\n\n // Defines the View per type\n itemsView = '' as any;\n\n itemType = 'type';\n\n reuseView = false;\n\n constructor(opts: any = {}, config?: any, autoAdd = false) {\n super(opts);\n this.config = config || opts.config || {};\n autoAdd && this.listenTo(this.collection, 'add', this.addTo);\n this.items = [];\n }\n\n /**\n * Add new model to the collection\n * @param {Model} model\n * @private\n * */\n addTo(model: any) {\n this.add(model);\n }\n\n itemViewNotFound(type: string) {\n const { config, ns } = this;\n const { em } = config;\n const warn = `${ns ? `[${ns}]: ` : ''}'${type}' type not found`;\n em && em.logWarning(warn);\n }\n\n /**\n * Render new model inside the view\n * @param {Model} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n add(model: any, fragment?: DocumentFragment) {\n const { config, reuseView, items } = this;\n const itemsView = (this.itemsView || {}) as ObjectAny;\n const inputTypes = [\n 'button',\n 'checkbox',\n 'color',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n ];\n var frag = fragment || null;\n var itemView = this.itemView;\n var typeField = model.get(this.itemType);\n let view;\n\n if (itemsView[typeField]) {\n itemView = itemsView[typeField];\n } else if (typeField && !itemsView[typeField] && !includes(inputTypes, typeField)) {\n this.itemViewNotFound(typeField);\n }\n\n if (model.view && reuseView) {\n view = model.view;\n } else {\n view = new itemView({ model, config }, config);\n }\n\n items && items.push(view);\n const rendered = view.render().el;\n\n if (frag) frag.appendChild(rendered);\n else this.$el.append(rendered);\n }\n\n render() {\n var frag = document.createDocumentFragment();\n this.clearItems();\n this.$el.empty();\n\n if (this.collection.length)\n this.collection.each(function (model) {\n // @ts-ignore\n this.add(model, frag);\n }, this);\n\n this.$el.append(frag);\n this.onRender();\n return this;\n }\n\n onRender() {}\n onRemoveBefore(items?: any, opts?: any) {}\n onRemove(items?: any, opts?: any) {}\n\n remove(opts = {}) {\n const { items } = this;\n this.onRemoveBefore(items, opts);\n this.clearItems();\n super.remove();\n this.onRemove(items, opts);\n return this;\n }\n\n clearItems() {\n const items = this.items || [];\n // TODO Traits do not update the target anymore\n // items.forEach(item => item.remove());\n // this.items = [];\n }\n}\n\n// Default view\nDomainViews.prototype.itemView = '';\n","import { bindAll, isFunction, isUndefined, result } from 'underscore';\nimport { Position } from '../common';\nimport { getPointerEvent, isEscKey, off, on } from './dom';\n\ntype DraggerPosition = Position & { end?: boolean };\n\ntype PositionXY = keyof Omit;\n\ntype Guide = {\n x: number;\n y: number;\n lock?: number;\n active?: boolean;\n};\n\ninterface DraggerOptions {\n /**\n * Element on which the drag will be executed. By default, the document will be used\n */\n container?: HTMLElement;\n\n /**\n * Callback on drag start.\n * @example\n * onStart(ev, dragger) {\n * console.log('pointer start', dragger.startPointer, 'position start', dragger.startPosition);\n * }\n */\n onStart?: (ev: Event, dragger: Dragger) => void;\n\n /**\n * Callback on drag.\n * @example\n * onDrag(ev, dragger) {\n * console.log('pointer', dragger.currentPointer, 'position', dragger.position, 'delta', dragger.delta);\n * }\n */\n onDrag?: (ev: Event, dragger: Dragger) => void;\n\n /**\n * Callback on drag end.\n * @example\n * onEnd(ev, dragger) {\n * console.log('pointer', dragger.currentPointer, 'position', dragger.position, 'delta', dragger.delta);\n * }\n */\n onEnd?: (ev: Event, dragger: Dragger, opts: { cancelled: boolean }) => void;\n\n /**\n * Indicate a callback where to pass an object with new coordinates\n */\n setPosition?: (position: DraggerPosition) => void;\n\n /**\n * Indicate a callback where to get initial coordinates.\n * @example\n * getPosition: () => {\n * // ...\n * return { x: 10, y: 100 }\n * }\n */\n getPosition?: () => DraggerPosition;\n\n /**\n * Indicate a callback where to get pointer coordinates.\n */\n getPointerPosition?: (ev: Event) => DraggerPosition;\n\n /**\n * Static guides to be snapped.\n */\n guidesStatic?: () => Guide[];\n\n /**\n * Target guides that will snap to static one.\n */\n guidesTarget?: () => Guide[];\n\n /**\n * Offset before snap to guides.\n * @default 5\n */\n snapOffset?: number;\n\n /**\n * Document on which listen to pointer events.\n */\n doc?: Document;\n\n /**\n * Scale result points, can also be a function.\n * @default 1\n */\n scale?: number | (() => number);\n}\n\nconst resetPos = () => ({ x: 0, y: 0 });\n\nconst xyArr: PositionXY[] = ['x', 'y'];\n\nexport default class Dragger {\n opts: DraggerOptions;\n startPointer: DraggerPosition;\n delta: DraggerPosition;\n lastScroll: DraggerPosition;\n lastScrollDiff: DraggerPosition;\n startPosition: DraggerPosition;\n globScrollDiff: DraggerPosition;\n currentPointer: DraggerPosition;\n position: DraggerPosition;\n el?: HTMLElement;\n guidesStatic: Guide[];\n guidesTarget: Guide[];\n lockedAxis?: any;\n docs: Document[];\n trgX?: Guide;\n trgY?: Guide;\n\n /**\n * Init the dragger\n * @param {Object} opts\n */\n constructor(opts: DraggerOptions = {}) {\n this.opts = {\n snapOffset: 5,\n scale: 1,\n };\n bindAll(this, 'drag', 'stop', 'keyHandle', 'handleScroll');\n this.setOptions(opts);\n this.delta = resetPos();\n this.lastScroll = resetPos();\n this.lastScrollDiff = resetPos();\n this.startPointer = resetPos();\n this.startPosition = resetPos();\n this.globScrollDiff = resetPos();\n this.currentPointer = resetPos();\n this.position = resetPos();\n this.guidesStatic = [];\n this.guidesTarget = [];\n this.docs = [];\n return this;\n }\n\n /**\n * Update options\n * @param {Object} options\n */\n setOptions(opts: Partial = {}) {\n this.opts = {\n ...this.opts,\n ...opts,\n };\n }\n\n toggleDrag(enable?: boolean) {\n const docs = this.getDocumentEl();\n const container = this.getContainerEl();\n const win = this.getWindowEl();\n const method = enable ? 'on' : 'off';\n const methods = { on, off };\n methods[method](container, 'mousemove dragover', this.drag);\n methods[method](docs, 'mouseup dragend touchend', this.stop);\n methods[method](docs, 'keydown', this.keyHandle);\n methods[method](win, 'scroll', this.handleScroll);\n }\n\n handleScroll() {\n const { lastScroll, delta } = this;\n const actualScroll = this.getScrollInfo();\n const scrollDiff = {\n x: actualScroll.x - lastScroll!.x,\n y: actualScroll.y - lastScroll!.y,\n };\n this.move(delta.x + scrollDiff.x, delta.y + scrollDiff.y);\n this.lastScrollDiff = scrollDiff;\n }\n\n /**\n * Start dragging\n * @param {Event} e\n */\n start(ev: Event) {\n const { opts } = this;\n const { onStart } = opts;\n this.toggleDrag(true);\n this.startPointer = this.getPointerPos(ev);\n this.guidesStatic = result(opts, 'guidesStatic') || [];\n this.guidesTarget = result(opts, 'guidesTarget') || [];\n isFunction(onStart) && onStart(ev, this);\n this.startPosition = this.getStartPosition();\n this.lastScrollDiff = resetPos();\n this.globScrollDiff = resetPos();\n this.drag(ev);\n }\n\n /**\n * Drag event\n * @param {Event} event\n */\n drag(ev: Event) {\n const { opts, lastScrollDiff, globScrollDiff } = this;\n const { onDrag } = opts;\n const { startPointer } = this;\n const currentPos = this.getPointerPos(ev);\n const glDiff = {\n x: globScrollDiff.x + lastScrollDiff.x,\n y: globScrollDiff.y + lastScrollDiff.y,\n };\n this.globScrollDiff = glDiff;\n const delta = {\n x: currentPos.x - startPointer.x + glDiff.x,\n y: currentPos.y - startPointer.y + glDiff.y,\n };\n this.lastScrollDiff = resetPos();\n let { lockedAxis } = this;\n\n // @ts-ignore Lock one axis\n if (ev.shiftKey) {\n lockedAxis = !lockedAxis && this.detectAxisLock(delta.x, delta.y);\n } else {\n lockedAxis = null;\n }\n\n if (lockedAxis === 'x') {\n delta.x = startPointer.x;\n } else if (lockedAxis === 'y') {\n delta.y = startPointer.y;\n }\n\n const moveDelta = (delta: DraggerPosition) => {\n xyArr.forEach(co => (delta[co] = delta[co] * result(opts, 'scale')));\n this.delta = delta;\n this.move(delta.x, delta.y);\n isFunction(onDrag) && onDrag(ev, this);\n };\n const deltaPre = { ...delta };\n this.currentPointer = currentPos;\n this.lockedAxis = lockedAxis;\n this.lastScroll = this.getScrollInfo();\n moveDelta(delta);\n\n if (this.guidesTarget.length) {\n const { newDelta, trgX, trgY } = this.snapGuides(deltaPre);\n (trgX || trgY) && moveDelta(newDelta);\n }\n\n // @ts-ignore In case the mouse button was released outside of the window\n ev.which === 0 && this.stop(ev);\n }\n\n /**\n * Check if the delta hits some guide\n */\n snapGuides(delta: DraggerPosition) {\n const newDelta = delta;\n let { trgX, trgY } = this;\n\n this.guidesTarget.forEach(trg => {\n // Skip the guide if its locked axis already exists\n if ((trg.x && this.trgX) || (trg.y && this.trgY)) return;\n trg.active = false;\n\n this.guidesStatic.forEach(stat => {\n if ((trg.y && stat.x) || (trg.x && stat.y)) return;\n const isY = trg.y && stat.y;\n const axs = isY ? 'y' : 'x';\n const trgPoint = trg[axs];\n const statPoint = stat[axs];\n const deltaPoint = delta[axs];\n const trgGuide = isY ? trgY : trgX;\n\n if (this.isPointIn(trgPoint, statPoint)) {\n if (isUndefined(trgGuide)) {\n const trgValue = deltaPoint - (trgPoint - statPoint);\n this.setGuideLock(trg, trgValue);\n }\n }\n });\n });\n\n trgX = this.trgX;\n trgY = this.trgY;\n\n xyArr.forEach(co => {\n const axis = co.toUpperCase();\n // @ts-ignore\n let trg = this[`trg${axis}`];\n\n if (trg && !this.isPointIn(delta[co], trg.lock)) {\n this.setGuideLock(trg, null);\n trg = null;\n }\n\n if (trg && !isUndefined(trg.lock)) {\n newDelta[co] = trg.lock;\n }\n });\n\n return {\n newDelta,\n trgX: this.trgX,\n trgY: this.trgY,\n };\n }\n\n isPointIn(src: number, trg: number, { offset }: { offset?: number } = {}) {\n const ofst = offset || this.opts.snapOffset || 0;\n return (src >= trg && src <= trg + ofst) || (src <= trg && src >= trg - ofst);\n }\n\n setGuideLock(guide: Guide, value: any) {\n const axis = !isUndefined(guide.x) ? 'X' : 'Y';\n const trgName = `trg${axis}`;\n\n if (value !== null) {\n guide.active = true;\n guide.lock = value;\n // @ts-ignore\n this[trgName] = guide;\n } else {\n delete guide.active;\n delete guide.lock;\n // @ts-ignore\n delete this[trgName];\n }\n\n return guide;\n }\n\n /**\n * Stop dragging\n */\n stop(ev: Event, opts: { cancel?: boolean } = {}) {\n const { delta } = this;\n const cancelled = !!opts.cancel;\n const x = cancelled ? 0 : delta.x;\n const y = cancelled ? 0 : delta.y;\n this.toggleDrag();\n this.lockedAxis = null;\n this.move(x, y, true);\n const { onEnd } = this.opts;\n isFunction(onEnd) && onEnd(ev, this, { cancelled });\n }\n\n keyHandle(ev: Event) {\n if (isEscKey(ev as KeyboardEvent)) {\n this.stop(ev, { cancel: true });\n }\n }\n\n /**\n * Move the element\n * @param {integer} x\n * @param {integer} y\n */\n move(x: number, y: number, end?: boolean) {\n const { el, opts } = this;\n const pos = this.startPosition;\n if (!pos) return;\n const { setPosition } = opts;\n const xPos = pos.x + x;\n const yPos = pos.y + y;\n this.position = {\n x: xPos,\n y: yPos,\n end,\n };\n\n isFunction(setPosition) && setPosition(this.position);\n\n if (el) {\n el.style.left = `${xPos}px`;\n el.style.top = `${yPos}px`;\n }\n }\n\n getContainerEl() {\n const { container } = this.opts;\n return container ? [container] : this.getDocumentEl();\n }\n\n getWindowEl() {\n const cont = this.getContainerEl();\n return cont.map(item => {\n const doc = item.ownerDocument || item;\n // @ts-ignore\n return doc.defaultView || doc.parentWindow;\n });\n }\n\n /**\n * Returns documents\n */\n getDocumentEl(el?: HTMLElement): Document[] {\n const { doc } = this.opts;\n el = el || this.el;\n\n if (!this.docs.length) {\n const docs = [document];\n el && docs.push(el.ownerDocument);\n doc && docs.push(doc);\n this.docs = docs;\n }\n\n return this.docs;\n }\n\n /**\n * Get mouse coordinates\n * @param {Event} event\n * @return {Object}\n */\n getPointerPos(ev: Event) {\n const getPos = this.opts.getPointerPosition;\n const pEv = getPointerEvent(ev);\n\n return getPos\n ? getPos(ev)\n : {\n x: pEv.clientX,\n y: pEv.clientY,\n };\n }\n\n getStartPosition() {\n const { el, opts } = this;\n const getPos = opts.getPosition;\n let result = resetPos();\n\n if (isFunction(getPos)) {\n result = getPos();\n } else if (el) {\n result = {\n x: parseFloat(el.style.left),\n y: parseFloat(el.style.top),\n };\n }\n\n return result;\n }\n\n getScrollInfo() {\n const { doc } = this.opts;\n const body = doc && doc.body;\n\n return {\n y: body ? body.scrollTop : 0,\n x: body ? body.scrollLeft : 0,\n };\n }\n\n detectAxisLock(x: number, y: number) {\n const relX = x;\n const relY = y;\n const absX = Math.abs(relX);\n const absY = Math.abs(relY);\n\n // Vertical or Horizontal lock\n if (relY >= absX || relY <= -absX) {\n return 'x';\n } else if (relX > absY || relX < -absY) {\n return 'y';\n }\n }\n}\n","// @ts-nocheck\n/* Adapted for headless */\n/* MIT https://github.com/kenwheeler/cash */\n'use strict';\n\nvar doc = typeof document !== 'undefined' ? document : null,\n win = typeof window !== 'undefined' ? window : null,\n _Array$prototype = Array.prototype,\n filter = _Array$prototype.filter,\n indexOf = _Array$prototype.indexOf,\n map = _Array$prototype.map,\n push = _Array$prototype.push,\n reverse = _Array$prototype.reverse,\n slice = _Array$prototype.slice,\n splice = _Array$prototype.splice;\nvar idRe = /^#[\\w-]*$/,\n classRe = /^\\.[\\w-]*$/,\n htmlRe = /<.+>/,\n tagRe = /^\\w+$/; // @require ./variables.js\n\nfunction find(selector, context) {\n if (context === void 0) {\n context = doc;\n }\n\n return classRe.test(selector)\n ? context.getElementsByClassName(selector.slice(1))\n : tagRe.test(selector)\n ? context.getElementsByTagName(selector)\n : context.querySelectorAll(selector);\n} // @require ./find.js\n// @require ./variables.js\n\nfunction Cash(selector, context) {\n if (context === void 0) {\n context = doc;\n }\n\n if (!selector) return;\n if (selector.__cash) return selector;\n var eles = selector;\n\n if (isString(selector)) {\n if (context.__cash) context = context[0];\n eles = idRe.test(selector)\n ? context.getElementById(selector.slice(1))\n : htmlRe.test(selector)\n ? parseHTML(selector)\n : find(selector, context);\n if (!eles) return;\n } else if (isFunction(selector)) {\n return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality\n }\n\n if (eles.nodeType || eles === win) eles = [eles];\n this.length = eles.length;\n\n for (var i = 0, l = this.length; i < l; i++) {\n this[i] = eles[i];\n }\n}\n\nfunction cash(selector, context) {\n return new Cash(selector, context);\n}\n/* PROTOTYPE */\n\nvar fn =\n (cash.fn =\n cash.prototype =\n Cash.prototype =\n {\n constructor: cash,\n __cash: true,\n length: 0,\n splice: splice, // Ensures a cash collection gets printed as array-like in Chrome\n }); // @require core/cash.js\n// @require core/variables.js\n\nfn.get = function (index) {\n if (index === undefined) return slice.call(this);\n return this[index < 0 ? index + this.length : index];\n}; // @require core/cash.js\n// @require ./get.js\n\nfn.eq = function (index) {\n return cash(this.get(index));\n}; // @require core/cash.js\n// @require ./eq.js\n\nfn.first = function () {\n return this.eq(0);\n}; // @require core/cash.js\n// @require ./eq.js\n\nfn.last = function () {\n return this.eq(-1);\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.map = function (callback) {\n return cash(\n map.call(this, function (ele, i) {\n return callback.call(ele, i, ele);\n })\n );\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.slice = function () {\n return cash(slice.apply(this, arguments));\n}; // @require ./cash.js\n\nvar camelCaseRe = /(?:^\\w|[A-Z]|\\b\\w)/g,\n camelCaseWhitespaceRe = /[\\s-_]+/g;\n\nfunction camelCase(str) {\n return str\n .replace(camelCaseRe, function (letter, index) {\n return letter[!index ? 'toLowerCase' : 'toUpperCase']();\n })\n .replace(camelCaseWhitespaceRe, '');\n}\n\ncash.camelCase = camelCase; // @require ./cash.js\n\nfunction each(arr, callback) {\n for (var i = 0, l = arr.length; i < l; i++) {\n if (callback.call(arr[i], arr[i], i, arr) === false) break;\n }\n}\n\ncash.each = each; // @require core/cash.js\n// @require core/each.js\n\nfn.each = function (callback) {\n each(this, function (ele, i) {\n return callback.call(ele, i, ele);\n });\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.removeProp = function (prop) {\n return this.each(function (i, ele) {\n delete ele[prop];\n });\n}; // @require ./cash.js\n\nfunction extend(target) {\n if (target === void 0) {\n target = this;\n }\n\n var args = arguments,\n length = args.length;\n\n for (var i = length < 2 ? 0 : 1; i < length; i++) {\n for (var key in args[i]) {\n target[key] = args[i][key];\n }\n }\n\n return target;\n}\n\ncash.extend = fn.extend = extend; // @require ./cash.js\n\nvar guid = 1;\ncash.guid = guid; // @require ./cash.js\n\nfunction matches(ele, selector) {\n var matches =\n ele &&\n (ele.matches ||\n ele.webkitMatchesSelector ||\n ele.mozMatchesSelector ||\n ele.msMatchesSelector ||\n ele.oMatchesSelector);\n return !!matches && matches.call(ele, selector);\n}\n\ncash.matches = matches; // @require ./cash.js\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\ncash.isFunction = isFunction;\n\nfunction isString(x) {\n return typeof x === 'string';\n}\n\ncash.isString = isString;\n\nfunction isNumeric(x) {\n return !isNaN(parseFloat(x)) && isFinite(x);\n}\n\ncash.isNumeric = isNumeric;\nvar isArray = Array.isArray;\ncash.isArray = isArray; // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n\nfn.prop = function (prop, value) {\n if (!prop) return;\n\n if (isString(prop)) {\n if (arguments.length < 2) return this[0] && this[0][prop];\n return this.each(function (i, ele) {\n ele[prop] = value;\n });\n }\n\n for (var key in prop) {\n this.prop(key, prop[key]);\n }\n\n return this;\n}; // @require ./matches.js\n// @require ./type_checking.js\n\nfunction getCompareFunction(selector) {\n return isString(selector)\n ? function (i, ele) {\n return matches(ele, selector);\n }\n : selector.__cash\n ? function (i, ele) {\n return selector.is(ele);\n }\n : function (i, ele, selector) {\n return ele === selector;\n };\n} // @require core/cash.js\n// @require core/get_compare_function.js\n// @require core/type_checking.js\n// @require core/variables.js\n// @require collection/get.js\n\nfn.filter = function (selector) {\n if (!selector) return cash();\n var comparator = isFunction(selector) ? selector : getCompareFunction(selector);\n return cash(\n filter.call(this, function (ele, i) {\n return comparator.call(ele, i, ele, selector);\n })\n );\n}; // @require ./type_checking.js\n\nvar splitValuesRe = /\\S+/g;\n\nfunction getSplitValues(str) {\n return isString(str) ? str.match(splitValuesRe) || [] : [];\n} // @require core/cash.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.hasClass = function (cls) {\n var classes = getSplitValues(cls);\n var check = false;\n\n if (classes.length) {\n this.each(function (i, ele) {\n check = ele.classList.contains(classes[0]);\n return !check;\n });\n }\n\n return check;\n}; // @require core/cash.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.removeAttr = function (attr) {\n var attrs = getSplitValues(attr);\n if (!attrs.length) return this;\n return this.each(function (i, ele) {\n each(attrs, function (a) {\n ele.removeAttribute(a);\n });\n });\n}; // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./remove_attr.js\n\nfn.attr = function (attr, value) {\n if (!attr) return;\n\n if (isString(attr)) {\n if (arguments.length < 2) {\n if (!this[0]) return;\n\n var _value = this[0].getAttribute(attr);\n\n return _value === null ? undefined : _value;\n }\n\n if (value === null) return this.removeAttr(attr);\n return this.each(function (i, ele) {\n ele.setAttribute(attr, value);\n });\n }\n\n for (var key in attr) {\n this.attr(key, attr[key]);\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.toggleClass = function (cls, force) {\n var classes = getSplitValues(cls),\n isForce = force !== undefined;\n if (!classes.length) return this;\n return this.each(function (i, ele) {\n each(classes, function (c) {\n if (isForce) {\n force ? ele.classList.add(c) : ele.classList.remove(c);\n } else {\n ele.classList.toggle(c);\n }\n });\n });\n}; // @require core/cash.js\n// @require ./toggle_class.js\n\nfn.addClass = function (cls) {\n return this.toggleClass(cls, true);\n}; // @require core/cash.js\n// @require ./attr.js\n// @require ./toggle_class.js\n\nfn.removeClass = function (cls) {\n return !arguments.length ? this.attr('class', '') : this.toggleClass(cls, false);\n}; // @optional ./add_class.js\n// @optional ./attr.js\n// @optional ./has_class.js\n// @optional ./prop.js\n// @optional ./remove_attr.js\n// @optional ./remove_class.js\n// @optional ./remove_prop.js\n// @optional ./toggle_class.js\n// @require ./cash.js\n\nfunction unique(arr) {\n return arr.filter(function (item, index, self) {\n return self.indexOf(item) === index;\n });\n}\n\ncash.unique = unique; // @require core/cash.js\n// @require core/unique.js\n// @require ./get.js\n\nfn.add = function (selector, context) {\n return cash(unique(this.get().concat(cash(selector, context).get())));\n}; // @require core/variables.js\n\nfunction computeStyle(ele, prop, isVariable) {\n if (ele.nodeType !== 1) return;\n var style = win.getComputedStyle(ele, null);\n return prop ? (isVariable ? style.getPropertyValue(prop) : style[prop]) : style;\n} // @require ./compute_style.js\n\nfunction computeStyleInt(ele, prop) {\n return parseInt(computeStyle(ele, prop), 10) || 0;\n}\n\nvar cssVariableRe = /^--/; // @require ./variables.js\n\nfunction isCSSVariable(prop) {\n return cssVariableRe.test(prop);\n} // @require core/camel_case.js\n// @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require ./is_css_variable.js\n\nvar prefixedProps = {},\n docEl = doc && doc.createElement('div'),\n style = docEl ? docEl.style : {},\n vendorsPrefixes = ['webkit', 'moz', 'ms', 'o'];\n\nfunction getPrefixedProp(prop, isVariable) {\n if (isVariable === void 0) {\n isVariable = isCSSVariable(prop);\n }\n\n if (isVariable) return prop;\n\n if (!prefixedProps[prop]) {\n var propCC = camelCase(prop),\n propUC = '' + propCC.charAt(0).toUpperCase() + propCC.slice(1),\n props = (propCC + ' ' + vendorsPrefixes.join(propUC + ' ') + propUC).split(' ');\n each(props, function (p) {\n if (p in style) {\n prefixedProps[prop] = p;\n return false;\n }\n });\n }\n\n return prefixedProps[prop];\n}\n\ncash.prefixedProp = getPrefixedProp; // @require core/type_checking.js\n// @require ./is_css_variable.js\n\nvar numericProps = {\n animationIterationCount: true,\n columnCount: true,\n flexGrow: true,\n flexShrink: true,\n fontWeight: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n widows: true,\n zIndex: true,\n};\n\nfunction getSuffixedValue(prop, value, isVariable) {\n if (isVariable === void 0) {\n isVariable = isCSSVariable(prop);\n }\n\n return !isVariable && !numericProps[prop] && isNumeric(value) ? value + 'px' : value;\n} // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/compute_style.js\n// @require ./helpers/get_prefixed_prop.js\n// @require ./helpers/get_suffixed_value.js\n// @require ./helpers/is_css_variable.js\n\nfn.css = function (prop, value) {\n if (isString(prop)) {\n var isVariable = isCSSVariable(prop);\n prop = getPrefixedProp(prop, isVariable);\n if (arguments.length < 2) return this[0] && computeStyle(this[0], prop, isVariable);\n if (!prop) return this;\n value = getSuffixedValue(prop, value, isVariable);\n return this.each(function (i, ele) {\n if (ele.nodeType !== 1) return;\n\n if (isVariable) {\n ele.style.setProperty(prop, value);\n } else {\n ele.style[prop] = value;\n }\n });\n }\n\n for (var key in prop) {\n this.css(key, prop[key]);\n }\n\n return this;\n}; // @optional ./css.js\n\nvar dataNamespace = '__cashData',\n dataAttributeRe = /^data-(.*)/; // @require core/cash.js\n// @require ./helpers/variables.js\n\ncash.hasData = function (ele) {\n return dataNamespace in ele;\n}; // @require ./variables.js\n\nfunction getDataCache(ele) {\n return (ele[dataNamespace] = ele[dataNamespace] || {});\n} // @require attributes/attr.js\n// @require ./get_data_cache.js\n\nfunction getData(ele, key) {\n var cache = getDataCache(ele);\n\n if (key) {\n if (!(key in cache)) {\n var value = ele.dataset ? ele.dataset[key] || ele.dataset[camelCase(key)] : cash(ele).attr('data-' + key);\n\n if (value !== undefined) {\n try {\n value = JSON.parse(value);\n } catch (e) {}\n\n cache[key] = value;\n }\n }\n\n return cache[key];\n }\n\n return cache;\n} // @require ./variables.js\n// @require ./get_data_cache.js\n\nfunction removeData(ele, key) {\n if (key === undefined) {\n delete ele[dataNamespace];\n } else {\n delete getDataCache(ele)[key];\n }\n} // @require ./get_data_cache.js\n\nfunction setData(ele, key, value) {\n getDataCache(ele)[key] = value;\n} // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/get_data.js\n// @require ./helpers/set_data.js\n// @require ./helpers/variables.js\n\nfn.data = function (name, value) {\n var _this = this;\n\n if (!name) {\n if (!this[0]) return;\n each(this[0].attributes, function (attr) {\n var match = attr.name.match(dataAttributeRe);\n if (!match) return;\n\n _this.data(match[1]);\n });\n return getData(this[0]);\n }\n\n if (isString(name)) {\n if (value === undefined) return this[0] && getData(this[0], name);\n return this.each(function (i, ele) {\n return setData(ele, name, value);\n });\n }\n\n for (var key in name) {\n this.data(key, name[key]);\n }\n\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n// @require ./helpers/remove_data.js\n\nfn.removeData = function (key) {\n return this.each(function (i, ele) {\n return removeData(ele, key);\n });\n}; // @optional ./data.js\n// @optional ./remove_data.js\n// @require css/helpers/compute_style_int.js\n\nfunction getExtraSpace(ele, xAxis) {\n return (\n computeStyleInt(ele, 'border' + (xAxis ? 'Left' : 'Top') + 'Width') +\n computeStyleInt(ele, 'padding' + (xAxis ? 'Left' : 'Top')) +\n computeStyleInt(ele, 'padding' + (xAxis ? 'Right' : 'Bottom')) +\n computeStyleInt(ele, 'border' + (xAxis ? 'Right' : 'Bottom') + 'Width')\n );\n} // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n\neach(['Width', 'Height'], function (prop) {\n fn['inner' + prop] = function () {\n if (!this[0]) return;\n if (this[0] === win) return win['inner' + prop];\n return this[0]['client' + prop];\n };\n}); // @require core/camel_case.js\n// @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require css/helpers/compute_style.js\n// @require css/helpers/get_suffixed_value.js\n// @require ./helpers/get_extra_space.js\n\neach(['width', 'height'], function (prop, index) {\n fn[prop] = function (value) {\n if (!this[0]) return value === undefined ? undefined : this;\n\n if (!arguments.length) {\n if (this[0] === win) return this[0][camelCase('outer-' + prop)];\n return this[0].getBoundingClientRect()[prop] - getExtraSpace(this[0], !index);\n }\n\n value = parseInt(value, 10);\n return this.each(function (i, ele) {\n if (ele.nodeType !== 1) return;\n var boxSizing = computeStyle(ele, 'boxSizing');\n ele.style[prop] = getSuffixedValue(prop, value + (boxSizing === 'border-box' ? getExtraSpace(ele, !index) : 0));\n });\n };\n}); // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require css/helpers/compute_style_int.js\n\neach(['Width', 'Height'], function (prop, index) {\n fn['outer' + prop] = function (includeMargins) {\n if (!this[0]) return;\n if (this[0] === win) return win['outer' + prop];\n return (\n this[0]['offset' + prop] +\n (includeMargins\n ? computeStyleInt(this[0], 'margin' + (!index ? 'Left' : 'Top')) +\n computeStyleInt(this[0], 'margin' + (!index ? 'Right' : 'Bottom'))\n : 0)\n );\n };\n}); // @optional ./inner.js\n// @optional ./normal.js\n// @optional ./outer.js\n\nfunction hasNamespaces(ns1, ns2) {\n for (var i = 0, l = ns2.length; i < l; i++) {\n if (ns1.indexOf(ns2[i]) < 0) return false;\n }\n\n return true;\n} // @require core/each.js\n\nfunction removeEventListeners(cache, ele, name) {\n each(cache[name], function (_ref) {\n var namespaces = _ref[0],\n callback = _ref[1];\n ele.removeEventListener(name, callback);\n });\n delete cache[name];\n}\n\nvar eventsNamespace = '__cashEvents',\n eventsNamespacesSeparator = '.'; // @require ./variables.js\n\nfunction getEventsCache(ele) {\n return (ele[eventsNamespace] = ele[eventsNamespace] || {});\n} // @require core/guid.js\n// @require events/helpers/get_events_cache.js\n\nfunction addEvent(ele, name, namespaces, callback) {\n callback.guid = callback.guid || guid++;\n var eventCache = getEventsCache(ele);\n eventCache[name] = eventCache[name] || [];\n eventCache[name].push([namespaces, callback]);\n ele.addEventListener(name, callback);\n} // @require ./variables.js\n\nfunction parseEventName(eventName) {\n var parts = eventName.split(eventsNamespacesSeparator);\n return [parts[0], parts.slice(1).sort()]; // [name, namespaces]\n} // @require core/guid.js\n// @require ./get_events_cache.js\n// @require ./has_namespaces.js\n// @require ./parse_event_name.js\n// @require ./remove_event_listeners.js\n\nfunction removeEvent(ele, name, namespaces, callback) {\n var cache = getEventsCache(ele);\n\n if (!name) {\n if (!namespaces || !namespaces.length) {\n for (name in cache) {\n removeEventListeners(cache, ele, name);\n }\n } else {\n for (name in cache) {\n removeEvent(ele, name, namespaces, callback);\n }\n }\n } else {\n var eventCache = cache[name];\n if (!eventCache) return;\n if (callback) callback.guid = callback.guid || guid++;\n cache[name] = eventCache.filter(function (_ref2) {\n var ns = _ref2[0],\n cb = _ref2[1];\n if ((callback && cb.guid !== callback.guid) || !hasNamespaces(ns, namespaces)) return true;\n ele.removeEventListener(name, cb);\n });\n }\n} // @require core/cash.js\n// @require core/each.js\n// @require collection/each.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/remove_event.js\n\nfn.off = function (eventFullName, callback) {\n var _this2 = this;\n\n if (eventFullName === undefined) {\n this.each(function (i, ele) {\n return removeEvent(ele);\n });\n } else {\n each(getSplitValues(eventFullName), function (eventFullName) {\n var _parseEventName = parseEventName(eventFullName),\n name = _parseEventName[0],\n namespaces = _parseEventName[1];\n\n _this2.each(function (i, ele) {\n return removeEvent(ele, name, namespaces, callback);\n });\n });\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/get_split_values.js\n// @require core/guid.js\n// @require core/matches.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/variables.js\n// @require ./helpers/add_event.js\n// @require ./helpers/has_namespaces.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/remove_event.js\n\nfn.on = function (eventFullName, selector, callback, _one) {\n var _this3 = this;\n\n if (!isString(eventFullName)) {\n for (var key in eventFullName) {\n this.on(key, selector, eventFullName[key]);\n }\n\n return this;\n }\n\n if (isFunction(selector)) {\n callback = selector;\n selector = false;\n }\n\n each(getSplitValues(eventFullName), function (eventFullName) {\n var _parseEventName2 = parseEventName(eventFullName),\n name = _parseEventName2[0],\n namespaces = _parseEventName2[1];\n\n _this3.each(function (i, ele) {\n var finalCallback = function finalCallback(event) {\n if (event.namespace && !hasNamespaces(namespaces, event.namespace.split(eventsNamespacesSeparator))) return;\n var thisArg = ele;\n\n if (selector) {\n var target = event.target;\n\n while (!matches(target, selector)) {\n if (target === ele) return;\n target = target.parentNode;\n if (!target) return;\n }\n\n thisArg = target;\n }\n\n event.namespace = event.namespace || '';\n var returnValue = callback.call(thisArg, event, event.data);\n\n if (_one) {\n removeEvent(ele, name, namespaces, finalCallback);\n }\n\n if (returnValue === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n finalCallback.guid = callback.guid = callback.guid || guid++;\n addEvent(ele, name, namespaces, finalCallback);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require ./on.js\n\nfn.one = function (eventFullName, delegate, callback) {\n return this.on(eventFullName, delegate, callback, true);\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.ready = function (callback) {\n var finalCallback = function finalCallback() {\n return callback(cash);\n };\n\n if (doc.readyState !== 'loading') {\n setTimeout(finalCallback);\n } else {\n doc.addEventListener('DOMContentLoaded', finalCallback);\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/type_checking.js\n// @require core/variables.js\n// @require collection/each.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/variables.js\n\nfn.trigger = function (eventFullName, data) {\n var evt = eventFullName;\n\n if (isString(eventFullName)) {\n var _parseEventName3 = parseEventName(eventFullName),\n name = _parseEventName3[0],\n namespaces = _parseEventName3[1];\n\n evt = doc.createEvent('HTMLEvents');\n evt.initEvent(name, true, true);\n evt.namespace = namespaces.join(eventsNamespacesSeparator);\n }\n\n evt.data = data;\n return this.each(function (i, ele) {\n ele.dispatchEvent(evt);\n });\n}; // @optional ./off.js\n// @optional ./on.js\n// @optional ./one.js\n// @optional ./ready.js\n// @optional ./trigger.js\n// @require core/each.js\n\nfunction getValueSelectMultiple(ele) {\n var values = [];\n each(ele.options, function (option) {\n if (option.selected && !option.disabled && !option.parentNode.disabled) {\n values.push(option.value);\n }\n });\n return values;\n}\n\nfunction getValueSelectSingle(ele) {\n return ele.selectedIndex < 0 ? null : ele.options[ele.selectedIndex].value;\n} // @require ./get_value_select_single.js\n// @require ./get_value_select_multiple.js\n\nvar selectOneRe = /select-one/i,\n selectMultipleRe = /select-multiple/i;\n\nfunction getValue(ele) {\n var type = ele.type;\n if (selectOneRe.test(type)) return getValueSelectSingle(ele);\n if (selectMultipleRe.test(type)) return getValueSelectMultiple(ele);\n return ele.value;\n}\n\nvar queryEncodeSpaceRe = /%20/g;\n\nfunction queryEncode(prop, value) {\n return '&' + encodeURIComponent(prop) + '=' + encodeURIComponent(value).replace(queryEncodeSpaceRe, '+');\n} // @require core/cash.js\n// @require core/each.js\n// @require core/type_checking.js\n// @require ./helpers/get_value.js\n// @require ./helpers/query_encode.js\n\nvar skippableRe = /file|reset|submit|button|image/i,\n checkableRe = /radio|checkbox/i;\n\nfn.serialize = function () {\n var query = '';\n this.each(function (i, ele) {\n each(ele.elements || [ele], function (ele) {\n if (ele.disabled || !ele.name || ele.tagName === 'FIELDSET') return;\n if (skippableRe.test(ele.type)) return;\n if (checkableRe.test(ele.type) && !ele.checked) return;\n var value = getValue(ele);\n if (value === undefined) return;\n var values = isArray(value) ? value : [value];\n each(values, function (value) {\n query += queryEncode(ele.name, value);\n });\n });\n });\n return query.substr(1);\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/get_value.js\n\nfn.val = function (value) {\n if (value === undefined) return this[0] && getValue(this[0]);\n return this.each(function (i, ele) {\n var isMultiple = selectMultipleRe.test(ele.type),\n eleValue = value === null ? (isMultiple ? [] : '') : value;\n\n if (isMultiple && isArray(eleValue)) {\n each(ele.options, function (option) {\n option.selected = eleValue.indexOf(option.value) >= 0;\n });\n } else {\n ele.value = eleValue;\n }\n });\n}; // @optional ./serialize.js\n// @optional ./val.js\n// @require core/cash.js\n// @require collection/map.js\n\nfn.clone = function () {\n return this.map(function (i, ele) {\n return ele.cloneNode(true);\n });\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.detach = function () {\n return this.each(function (i, ele) {\n if (ele.parentNode) {\n ele.parentNode.removeChild(ele);\n }\n });\n}; // @require ./cash.js\n// @require ./variables.js\n// @require ./type_checking.js\n// @require collection/get.js\n// @require manipulation/detach.js\n\nvar fragmentRe = /^\\s*<(\\w+)[^>]*>/,\n singleTagRe = /^\\s*<(\\w+)\\s*\\/?>(?:<\\/\\1>)?\\s*$/;\nvar containers;\n\nfunction initContainers() {\n if (containers) return;\n var table = doc.createElement('table'),\n tr = doc.createElement('tr');\n containers = {\n '*': doc.createElement('div'),\n tr: doc.createElement('tbody'),\n td: tr,\n th: tr,\n thead: table,\n tbody: table,\n tfoot: table,\n };\n}\n\nfunction parseHTML(html) {\n initContainers();\n if (!isString(html)) return [];\n if (singleTagRe.test(html)) return [doc.createElement(RegExp.$1)];\n var fragment = fragmentRe.test(html) && RegExp.$1,\n container = containers[fragment] || containers['*'];\n container.innerHTML = html;\n return cash(container.childNodes).detach().get();\n}\n\ncash.parseHTML = parseHTML; // @optional ./camel_case.js\n// @optional ./each.js\n// @optional ./export.js\n// @optional ./extend.js\n// @optional ./find.js\n// @optional ./get_compare_function.js\n// @optional ./get_split_values.js\n// @optional ./guid.js\n// @optional ./matches.js\n// @optional ./parse_html.js\n// @optional ./unique.js\n// @optional ./variables.js\n// @require ./cash.js\n// @require ./type_checking.js\n// @require core/cash.js\n\nfn.empty = function () {\n var ele = this[0];\n\n if (ele) {\n while (ele.firstChild) {\n ele.removeChild(ele.firstChild);\n }\n }\n\n return this;\n};\n\nfunction insertElement(ele, child, prepend) {\n if (prepend) {\n ele.insertBefore(child, ele.childNodes[0]);\n } else {\n ele.appendChild(child);\n }\n} // @require core/each.js\n// @require core/type_checking.js\n// @require ./insert_element.js\n\nfunction insertContent(parent, child, prepend) {\n if (child === undefined) return;\n var isStr = isString(child);\n\n if (!isStr && child.length) {\n each(child, function (ele) {\n return insertContent(parent, ele, prepend);\n });\n } else {\n each(\n parent,\n isStr\n ? function (ele) {\n ele.insertAdjacentHTML(prepend ? 'afterbegin' : 'beforeend', child);\n }\n : function (ele, index) {\n return insertElement(ele, !index ? child : child.cloneNode(true), prepend);\n }\n );\n }\n} // @require core/cash.js\n// @require core/each.js\n// @require ./helpers/insert_content.js\n\nfn.append = function () {\n var _this4 = this;\n\n each(arguments, function (content) {\n insertContent(_this4, content);\n });\n return this;\n}; // @require core/cash.js\n// @require ./helpers/insert_content.js\n\nfn.appendTo = function (parent) {\n insertContent(cash(parent), this);\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.html = function (content) {\n if (content === undefined) return this[0] && this[0].innerHTML;\n var source = content.nodeType ? content[0].outerHTML : content;\n return this.each(function (i, ele) {\n ele.innerHTML = source;\n });\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.insertAfter = function (content) {\n var _this5 = this;\n\n cash(content).each(function (index, ele) {\n var parent = ele.parentNode;\n\n _this5.each(function (i, e) {\n parent.insertBefore(!index ? e : e.cloneNode(true), ele.nextSibling);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require collection/slice.js\n// @require ./insert_after.js\n\nfn.after = function () {\n var _this6 = this;\n\n each(reverse.apply(arguments), function (content) {\n reverse.apply(cash(content).slice()).insertAfter(_this6);\n });\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.insertBefore = function (selector) {\n var _this7 = this;\n\n cash(selector).each(function (index, ele) {\n var parent = ele.parentNode;\n\n _this7.each(function (i, e) {\n parent.insertBefore(!index ? e : e.cloneNode(true), ele);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require ./insert_before.js\n\nfn.before = function () {\n var _this8 = this;\n\n each(arguments, function (content) {\n cash(content).insertBefore(_this8);\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require ./helpers/insert_content.js\n\nfn.prepend = function () {\n var _this9 = this;\n\n each(arguments, function (content) {\n insertContent(_this9, content, true);\n });\n return this;\n}; // @require core/cash.js\n// @require core/variables.js\n// @require collection/slice.js\n// @require ./helpers/insert_content.js\n\nfn.prependTo = function (parent) {\n insertContent(cash(parent), reverse.apply(this.slice()), true);\n return this;\n}; // @require core/cash.js\n// @require events/off.js\n// @require ./detach.js\n\nfn.remove = function () {\n return this.detach().off();\n}; // @require core/cash.js\n// @require collection/each.js\n// @require collection/slice.js\n// @require ./after.js\n// @require ./remove.js\n\nfn.replaceWith = function (content) {\n var _this10 = this;\n\n return this.each(function (i, ele) {\n var parent = ele.parentNode;\n if (!parent) return;\n var $eles = i ? cash(content).clone() : cash(content);\n\n if (!$eles[0]) {\n _this10.remove();\n\n return false;\n }\n\n parent.replaceChild($eles[0], ele);\n cash($eles[0]).after($eles.slice(1));\n });\n}; // @require core/cash.js\n// @require ./replace_with.js\n\nfn.replaceAll = function (content) {\n cash(content).replaceWith(this);\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.text = function (content) {\n if (content === undefined) return this[0] ? this[0].textContent : '';\n return this.each(function (i, ele) {\n ele.textContent = content;\n });\n}; // @optional ./after.js\n// @optional ./append.js\n// @optional ./append_to.js\n// @optional ./before.js\n// @optional ./clone.js\n// @optional ./detach.js\n// @optional ./empty.js\n// @optional ./html.js\n// @optional ./insert_after.js\n// @optional ./insert_before.js\n// @optional ./prepend.js\n// @optional ./prepend_to.js\n// @optional ./remove.js\n// @optional ./replace_all.js\n// @optional ./replace_with.js\n// @optional ./text.js\n// @require core/cash.js\n// @require core/variables.js\n\nvar docEle = doc && doc.documentElement;\n\nfn.offset = function () {\n var ele = this[0];\n if (!ele) return;\n var rect = ele.getBoundingClientRect();\n return {\n top: rect.top + win.pageYOffset - docEle.clientTop,\n left: rect.left + win.pageXOffset - docEle.clientLeft,\n };\n}; // @require core/cash.js\n\nfn.offsetParent = function () {\n return cash(this[0] && this[0].offsetParent);\n}; // @require core/cash.js\n\nfn.position = function () {\n var ele = this[0];\n if (!ele) return;\n return {\n left: ele.offsetLeft,\n top: ele.offsetTop,\n };\n}; // @optional ./offset.js\n// @optional ./offset_parent.js\n// @optional ./position.js\n// @require core/cash.js\n// @require core/matches.js\n// @require core/unique.js\n// @require collection/each.js\n// @require collection/filter.js\n\nfn.children = function (selector) {\n var result = [];\n this.each(function (i, ele) {\n push.apply(result, ele.children);\n });\n result = cash(unique(result));\n if (!selector) return result;\n return result.filter(function (i, ele) {\n return matches(ele, selector);\n });\n}; // @require core/cash.js\n// @require core/unique.js\n// @require collection/each.js\n\nfn.contents = function () {\n var result = [];\n this.each(function (i, ele) {\n push.apply(result, ele.tagName === 'IFRAME' ? [ele.contentDocument] : ele.childNodes);\n });\n return cash(result.length && unique(result));\n}; // @require core/cash.js\n// @require core/unique.js\n// @require core/find.js\n// @require core/variables.js\n\nfn.find = function (selector) {\n var result = [];\n\n for (var i = 0, l = this.length; i < l; i++) {\n var found = find(selector, this[i]);\n\n if (found.length) {\n push.apply(result, found);\n }\n }\n\n return cash(result.length && unique(result));\n}; // @require core/cash.js\n// @require core/find.js\n// @require core/type_checking.js\n// @require collection/filter.js\n\nfn.has = function (selector) {\n var comparator = isString(selector)\n ? function (i, ele) {\n return !!find(selector, ele).length;\n }\n : function (i, ele) {\n return ele.contains(selector);\n };\n return this.filter(comparator);\n}; // @require core/cash.js\n// @require core/get_compare_function.js\n// @require collection/each.js\n\nfn.is = function (selector) {\n if (!selector || !this[0]) return false;\n var comparator = getCompareFunction(selector);\n var check = false;\n this.each(function (i, ele) {\n check = comparator(i, ele, selector);\n return !check;\n });\n return check;\n}; // @require core/cash.js\n\nfn.next = function () {\n return cash(this[0] && this[0].nextElementSibling);\n}; // @require core/cash.js\n// @require core/get_compare_function.js\n// @require collection/filter.js\n\nfn.not = function (selector) {\n if (!selector || !this[0]) return this;\n var comparator = getCompareFunction(selector);\n return this.filter(function (i, ele) {\n return !comparator(i, ele, selector);\n });\n}; // @require core/cash.js\n// @require core/unique.js\n// @require collection/each.js\n\nfn.parent = function () {\n var result = [];\n this.each(function (i, ele) {\n if (ele && ele.parentNode) {\n result.push(ele.parentNode);\n }\n });\n return cash(unique(result));\n}; // @require core/cash.js\n// @require core/variables.js\n// @require traversal/children.js\n// @require traversal/parent.js\n// @require ./get.js\n//FIXME Ugly file name, is there a better option?\n\nfn.index = function (ele) {\n var child = ele ? cash(ele)[0] : this[0],\n collection = ele ? this : cash(child).parent().children();\n return indexOf.call(collection, child);\n}; // @optional ./add.js\n// @optional ./each.js\n// @optional ./eq.js\n// @optional ./filter.js\n// @optional ./first.js\n// @optional ./get.js\n// @optional ./indexFn.js\n// @optional ./last.js\n// @optional ./map.js\n// @optional ./slice.js\n// @require core/cash.js\n// @require collection/filter.js\n// @require ./is.js\n// @require ./parent.js\n\nfn.closest = function (selector) {\n if (!selector || !this[0]) return cash();\n if (this.is(selector)) return this.filter(selector);\n return this.parent().closest(selector);\n}; // @require core/cash.js\n// @require core/matches.js\n// @require core/unique.js\n// @require core/variables.js\n// @require collection/each.js\n\nfn.parents = function (selector) {\n var result = [];\n var last;\n this.each(function (i, ele) {\n last = ele;\n\n while (last && last.parentNode && last !== doc.body.parentNode) {\n last = last.parentNode;\n\n if (!selector || (selector && matches(last, selector))) {\n result.push(last);\n }\n }\n });\n return cash(unique(result));\n}; // @require core/cash.js\n\nfn.prev = function () {\n return cash(this[0] && this[0].previousElementSibling);\n}; // @require core/cash.js\n// @require collection/filter.js\n// @require ./children.js\n// @require ./parent.js\n\nfn.siblings = function () {\n var ele = this[0];\n return this.parent()\n .children()\n .filter(function (i, child) {\n return child !== ele;\n });\n}; // @optional ./children.js\n// @optional ./closest.js\n// @optional ./contents.js\n// @optional ./find.js\n// @optional ./has.js\n// @optional ./is.js\n// @optional ./next.js\n// @optional ./not.js\n// @optional ./parent.js\n// @optional ./parents.js\n// @optional ./prev.js\n// @optional ./siblings.js\n// @optional attributes/index.js\n// @optional collection/index.js\n// @optional css/index.js\n// @optional data/index.js\n// @optional dimensions/index.js\n// @optional events/index.js\n// @optional forms/index.js\n// @optional manipulation/index.js\n// @optional offset/index.js\n// @optional traversal/index.js\n// @require core/index.js\nexport default cash as any;\n","import { each, isArray, isString, isUndefined } from 'underscore';\nimport { ObjectAny } from '../common';\n\ntype vNode = {\n tag?: string;\n attributes?: ObjectAny;\n children?: vNode[];\n};\n\ntype ChildHTML = HTMLElement | string;\n\ntype ClassNameInputType = string | number | boolean | null | undefined;\n\ntype ClassNameInput = ClassNameInputType | Array;\n\nconst KEY_TAG = 'tag';\nconst KEY_ATTR = 'attributes';\nconst KEY_CHILD = 'children';\n\nexport const motionsEv = 'transitionend oTransitionEnd transitionend webkitTransitionEnd';\n\nexport const isDoc = (el?: Node): el is Document => el?.nodeType === Node.DOCUMENT_NODE;\n\nexport const removeEl = (el?: HTMLElement) => {\n const parent = el && el.parentNode;\n parent && parent.removeChild(el);\n};\n\nexport function cx(...inputs: ClassNameInput[]): string {\n const inp = Array.isArray(inputs[0]) ? inputs[0] : [...inputs];\n return inp.filter(Boolean).join(' ');\n}\n\nexport const find = (el: HTMLElement, query: string) => el.querySelectorAll(query);\n\nexport const attrUp = (el?: HTMLElement, attrs: ObjectAny = {}) =>\n el && el.setAttribute && each(attrs, (value, key) => el.setAttribute(key, value));\n\nexport const isVisible = (el?: HTMLElement) => {\n return el && !!(el.offsetWidth || el.offsetHeight || el.getClientRects?.().length);\n};\n\nexport const empty = (node: HTMLElement) => {\n while (node.firstChild) node.removeChild(node.firstChild);\n};\n\nexport const replaceWith = (oldEl: HTMLElement, newEl: HTMLElement) => {\n oldEl.parentNode?.replaceChild(newEl, oldEl);\n};\n\nexport const appendAtIndex = (parent: HTMLElement | DocumentFragment, child: ChildHTML, index?: number) => {\n const { childNodes } = parent;\n const total = childNodes.length;\n const at = isUndefined(index) ? total : index;\n\n if (isString(child)) {\n // @ts-ignore\n parent.insertAdjacentHTML('beforeEnd', child);\n child = parent.lastChild as HTMLElement;\n parent.removeChild(child);\n }\n\n if (at >= total) {\n parent.appendChild(child);\n } else {\n parent.insertBefore(child, childNodes[at]);\n }\n};\n\nexport const append = (parent: HTMLElement, child: ChildHTML) => appendAtIndex(parent, child);\n\nexport const createEl = (tag: string, attrs: ObjectAny = {}, child?: ChildHTML) => {\n const el = document.createElement(tag);\n attrs && each(attrs, (value, key) => el.setAttribute(key, value));\n\n if (child) {\n if (isString(child)) el.innerHTML = child;\n else el.appendChild(child);\n }\n\n return el;\n};\n\nexport const createText = (str: string) => document.createTextNode(str);\n\n// Unfortunately just creating `KeyboardEvent(e.type, e)` is not enough,\n// the keyCode/which will be always `0`. Even if it's an old/deprecated\n// property keymaster (and many others) still use it... using `defineProperty`\n// hack seems the only way\nexport const createCustomEvent = (e: any, cls: any) => {\n let oEvent: any;\n const { type } = e;\n try {\n // @ts-ignore\n oEvent = new window[cls](type, e);\n } catch (err) {\n oEvent = document.createEvent(cls);\n oEvent.initEvent(type, true, true);\n }\n oEvent._parentEvent = e;\n if (type.indexOf('key') === 0) {\n oEvent.keyCodeVal = e.keyCode;\n ['keyCode', 'which'].forEach(prop => {\n Object.defineProperty(oEvent, prop, {\n get() {\n return this.keyCodeVal;\n },\n });\n });\n }\n return oEvent;\n};\n\n/**\n * Append an array of vNodes to an element\n * @param {HTMLElement} node HTML element\n * @param {Array} vNodes Array of node objects\n */\nexport const appendVNodes = (node: HTMLElement, vNodes: vNode | vNode[] = []) => {\n const vNodesArr = Array.isArray(vNodes) ? vNodes : [vNodes];\n vNodesArr.forEach(vnode => {\n const tag = vnode[KEY_TAG] || 'div';\n const attr = vnode[KEY_ATTR] || {};\n const el = document.createElement(tag);\n\n each(attr, (value, key) => {\n el.setAttribute(key, value);\n });\n\n node.appendChild(el);\n });\n};\n\n/**\n * Check if element is a text node\n * @param {Node} el\n * @return {Boolean}\n */\nexport const isTextNode = (el?: Node): el is Text => el?.nodeType === Node.TEXT_NODE;\n\n/**\n * Check if element is a comment node\n * @param {Node} el\n * @return {Boolean}\n */\nexport const isCommentNode = (el?: Node): el is Comment => el?.nodeType === Node.COMMENT_NODE;\n\n/**\n * Check if taggable node\n * @param {Node} el\n * @return {Boolean}\n */\nexport const isTaggableNode = (el?: Node) => el && !isTextNode(el) && !isCommentNode(el);\n\n/**\n * Get DOMRect of the element.\n * @param el\n * @returns {DOMRect}\n */\nexport const getElRect = (el?: Element) => {\n const def = {\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n };\n if (!el) return def;\n let rectText;\n\n if (isTextNode(el)) {\n const range = document.createRange();\n range.selectNode(el);\n rectText = range.getBoundingClientRect();\n range.detach();\n }\n\n return rectText || (el.getBoundingClientRect ? el.getBoundingClientRect() : def);\n};\n\n/**\n * Get document scroll coordinates\n */\nexport const getDocumentScroll = (el?: HTMLElement) => {\n const doc = el?.ownerDocument || document;\n const docEl = doc.documentElement;\n const win = doc.defaultView || window;\n\n return {\n x: (win.pageXOffset || docEl.scrollLeft || 0) - (docEl.clientLeft || 0),\n y: (win.pageYOffset || docEl.scrollTop || 0) - (docEl.clientTop || 0),\n };\n};\n\nexport const getKeyCode = (ev: KeyboardEvent) => ev.which || ev.keyCode;\n\nexport const getKeyChar = (ev: KeyboardEvent) => String.fromCharCode(getKeyCode(ev));\n\nexport const getPointerEvent = (ev: any): PointerEvent => (ev.touches && ev.touches[0] ? ev.touches[0] : ev);\n\nexport const isEscKey = (ev: KeyboardEvent) => getKeyCode(ev) === 27;\n\nexport const isEnterKey = (ev: KeyboardEvent) => getKeyCode(ev) === 13;\n\nexport const hasCtrlKey = (ev: WheelEvent) => ev.ctrlKey;\n\nexport const hasModifierKey = (ev: WheelEvent) => hasCtrlKey(ev) || ev.metaKey;\n\n// Ref: https://stackoverflow.com/a/10162353\nexport const doctypeToString = (dt?: DocumentType | null) => {\n if (!dt) return '';\n const { name, publicId, systemId } = dt;\n const pubId = publicId ? ` PUBLIC \"${publicId}\"` : '';\n const sysId = !publicId && systemId ? ` SYSTEM \"${systemId}\"` : '';\n return ``;\n};\n\nexport const attrToString = (attrs: ObjectAny = {}) => {\n const res: string[] = [];\n each(attrs, (value, key) => res.push(`${key}=\"${value}\"`));\n return res.join(' ');\n};\n\nexport const on = (\n el: EventTarget | EventTarget[],\n ev: string,\n fn: (ev: E) => void,\n opts?: boolean | AddEventListenerOptions\n) => {\n const evs = ev.split(/\\s+/);\n const els = isArray(el) ? el : [el];\n\n evs.forEach(ev => {\n els.forEach(el => el?.addEventListener(ev, fn as EventListener, opts));\n });\n};\n\nexport const off = (\n el: EventTarget | EventTarget[],\n ev: string,\n fn: (ev: E) => void,\n opts?: boolean | AddEventListenerOptions\n) => {\n const evs = ev.split(/\\s+/);\n const els = isArray(el) ? el : [el];\n\n evs.forEach(ev => {\n els.forEach(el => el?.removeEventListener(ev, fn as EventListener, opts));\n });\n};\n","import { isArray, isElement, isFunction, isUndefined, keys } from 'underscore';\nimport ComponentView from '../dom_components/view/ComponentView';\nimport EditorModel from '../editor/model/Editor';\nimport { isTextNode } from './dom';\nimport Component from '../dom_components/model/Component';\nimport { ObjectAny } from '../common';\n\nconst obj: ObjectAny = {};\n\nexport const isBultInMethod = (key: string) => isFunction(obj[key]);\n\nexport const normalizeKey = (key: string) => (isBultInMethod(key) ? `_${key}` : key);\n\nexport const wait = (mls: number = 0) => new Promise(res => setTimeout(res, mls));\n\nexport const isDef = (value: any) => typeof value !== 'undefined';\n\nexport const hasWin = () => typeof window !== 'undefined';\n\nexport const getGlobal = () =>\n typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : global;\n\nexport const toLowerCase = (str: string) => (str || '').toLowerCase();\n\nconst elProt = hasWin() ? window.Element.prototype : {};\n// @ts-ignore\nconst matches = elProt.matches || elProt.webkitMatchesSelector || elProt.mozMatchesSelector || elProt.msMatchesSelector;\n\nexport const getUiClass = (em: EditorModel, defCls: string) => {\n const { stylePrefix, customUI } = em.getConfig();\n return [customUI && `${stylePrefix}cui`, defCls].filter(i => i).join(' ');\n};\n\n/**\n * Import styles asynchronously\n * @param {String|Array} styles\n */\nconst appendStyles = (styles: {}, opts: { unique?: boolean; prepand?: boolean } = {}) => {\n const stls = isArray(styles) ? [...styles] : [styles];\n\n if (stls.length) {\n const href = stls.shift();\n\n if (href && (!opts.unique || !document.querySelector(`link[href=\"${href}\"]`))) {\n const { head } = document;\n const link = document.createElement('link');\n link.href = href;\n link.rel = 'stylesheet';\n\n if (opts.prepand) {\n head.insertBefore(link, head.firstChild);\n } else {\n head.appendChild(link);\n }\n }\n\n appendStyles(stls);\n }\n};\n\n/**\n * Returns shallow diff between 2 objects\n * @param {Object} objOrig\n * @param {Objec} objNew\n * @return {Object}\n * @example\n * var a = {foo: 'bar', baz: 1, faz: 'sop'};\n * var b = {foo: 'bar', baz: 2, bar: ''};\n * shallowDiff(a, b);\n * // -> {baz: 2, faz: null, bar: ''};\n */\nconst shallowDiff = (objOrig: ObjectAny, objNew: ObjectAny) => {\n const result: ObjectAny = {};\n const keysNew = keys(objNew);\n\n for (let prop in objOrig) {\n if (objOrig.hasOwnProperty(prop)) {\n const origValue = objOrig[prop];\n const newValue = objNew[prop];\n\n if (keysNew.indexOf(prop) >= 0) {\n if (origValue !== newValue) {\n result[prop] = newValue;\n }\n } else {\n result[prop] = null;\n }\n }\n }\n\n for (let prop in objNew) {\n if (objNew.hasOwnProperty(prop)) {\n if (isUndefined(objOrig[prop])) {\n result[prop] = objNew[prop];\n }\n }\n }\n\n return result;\n};\n\nconst getUnitFromValue = (value: any) => {\n return value.replace(parseFloat(value), '');\n};\n\nconst upFirst = (value: string) => value[0].toUpperCase() + value.toLowerCase().slice(1);\n\nconst camelCase = (value: string) => {\n return value.replace(/-./g, x => x[1].toUpperCase());\n};\n\nconst normalizeFloat = (value: any, step = 1, valueDef = 0) => {\n let stepDecimals = 0;\n if (isNaN(value)) return valueDef;\n value = parseFloat(value);\n\n if (Math.floor(value) !== value) {\n const side = step.toString().split('.')[1];\n stepDecimals = side ? side.length : 0;\n }\n\n return stepDecimals ? parseFloat(value.toFixed(stepDecimals)) : value;\n};\n\nconst hasDnd = (em: EditorModel) => {\n return 'draggable' in document.createElement('i') && (em ? em.config.nativeDnD! : true);\n};\n\n/**\n * Ensure to fetch the element from the input argument\n * @param {HTMLElement|Component} el Component or HTML element\n * @return {HTMLElement}\n */\nconst getElement = (el: HTMLElement) => {\n if (isElement(el) || isTextNode(el)) {\n return el;\n // @ts-ignore\n } else if (el && el.getEl) {\n // @ts-ignore\n return el.getEl();\n }\n};\n\nexport const find = (arr: any[], test: (item: any, i: number, arr: any[]) => boolean) => {\n let result = null;\n arr.some((el, i) => (test(el, i, arr) ? ((result = el), 1) : 0));\n return result;\n};\n\nexport const escape = (str = '') => {\n return `${str}`\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/`/g, '`');\n};\n\nexport const escapeNodeContent = (str = '') => {\n return `${str}`.replace(/&/g, '&').replace(//g, '>');\n};\n\nexport const deepMerge = (...args: ObjectAny[]) => {\n const target = { ...args[0] };\n\n for (let i = 1; i < args.length; i++) {\n const source = { ...args[i] };\n\n for (let key in source) {\n const targValue = target[key];\n const srcValue = source[key];\n\n if (isObject(targValue) && isObject(srcValue)) {\n target[key] = deepMerge(targValue, srcValue);\n } else {\n target[key] = srcValue;\n }\n }\n }\n\n return target;\n};\n\n/**\n * Ensure to fetch the model from the input argument\n * @param {HTMLElement|Component} el Component or HTML element\n * @return {Component}\n */\nconst getModel = (el: HTMLElement & { __cashData?: any }, $?: any): Component | undefined => {\n let model;\n if (!$ && el && el.__cashData) {\n model = el.__cashData.model;\n } else if ($ && isElement(el)) {\n model = $(el).data('model');\n }\n return model;\n};\n\nconst isObject = (val: any): val is ObjectAny => val && !Array.isArray(val) && typeof val === 'object';\nconst isEmptyObj = (val: ObjectAny) => Object.keys(val).length <= 0;\n\nconst capitalize = (str: string = '') => str && str.charAt(0).toUpperCase() + str.substring(1);\nconst isRule = (obj: any) => obj && obj.toCSS;\n\nconst getViewEl = (el?: Node): T | undefined => (el as any)?.__gjsv;\n\nexport const isComponent = (obj: any): obj is Component => !!obj?.toHTML;\n\nexport const getComponentView = (el?: Node) => getViewEl(el);\n\nexport const getComponentModel = (el?: Node) => getComponentView(el)?.model;\n\nconst setViewEl = (el: any, view: any) => {\n el.__gjsv = view;\n};\n\nconst createId = (length = 16) => {\n let result = '';\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const len = chars.length;\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * len));\n }\n return result;\n};\n\nexport const buildBase64UrlFromSvg = (svg: string) => {\n if (svg && svg.substr(0, 4) === '= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n }\n}\n","// Internal helper to generate a function to obtain property `key` from `obj`.\nexport default function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n}\n","import shallowProperty from './_shallowProperty.js';\n\n// Internal helper to obtain the `byteLength` property of an object.\nexport default shallowProperty('byteLength');\n","import createSizePropertyCheck from './_createSizePropertyCheck.js';\nimport getByteLength from './_getByteLength.js';\n\n// Internal helper to determine whether we should spend extensive checks against\n// `ArrayBuffer` et al.\nexport default createSizePropertyCheck(getByteLength);\n","import { supportsArrayBuffer, nativeIsView, toString } from './_setup.js';\nimport isDataView from './isDataView.js';\nimport constant from './constant.js';\nimport isBufferLike from './_isBufferLike.js';\n\n// Is a given value a typed array?\nvar typedArrayPattern = /\\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\\]/;\nfunction isTypedArray(obj) {\n // `ArrayBuffer.isView` is the most future-proof, so use it when available.\n // Otherwise, fall back on the above regular expression.\n return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) :\n isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));\n}\n\nexport default supportsArrayBuffer ? isTypedArray : constant(false);\n","import shallowProperty from './_shallowProperty.js';\n\n// Internal helper to obtain the `length` property of an object.\nexport default shallowProperty('length');\n","import { nonEnumerableProps, ObjProto } from './_setup.js';\nimport isFunction from './isFunction.js';\nimport has from './_has.js';\n\n// Internal helper to create a simple lookup structure.\n// `collectNonEnumProps` used to depend on `_.contains`, but this led to\n// circular imports. `emulatedSet` is a one-off solution that only works for\n// arrays of strings.\nfunction emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key] === true; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n}\n\n// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't\n// be iterated by `for key in ...` and thus missed. Extends `keys` in place if\n// needed.\nexport default function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = (isFunction(constructor) && constructor.prototype) || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n}\n","import isObject from './isObject.js';\nimport { nativeKeys, hasEnumBug } from './_setup.js';\nimport has from './_has.js';\nimport collectNonEnumProps from './_collectNonEnumProps.js';\n\n// Retrieve the names of an object's own properties.\n// Delegates to **ECMAScript 5**'s native `Object.keys`.\nexport default function keys(obj) {\n if (!isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n","import getLength from './_getLength.js';\nimport isArray from './isArray.js';\nimport isString from './isString.js';\nimport isArguments from './isArguments.js';\nimport keys from './keys.js';\n\n// Is a given array, string, or object empty?\n// An \"empty\" object has no enumerable own-properties.\nexport default function isEmpty(obj) {\n if (obj == null) return true;\n // Skip the more expensive `toString`-based type checks if `obj` has no\n // `.length`.\n var length = getLength(obj);\n if (typeof length == 'number' && (\n isArray(obj) || isString(obj) || isArguments(obj)\n )) return length === 0;\n return getLength(keys(obj)) === 0;\n}\n","import keys from './keys.js';\n\n// Returns whether an object has a given set of `key:value` pairs.\nexport default function isMatch(object, attrs) {\n var _keys = keys(attrs), length = _keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n}\n","import { VERSION } from './_setup.js';\n\n// If Underscore is called as a function, it returns a wrapped object that can\n// be used OO-style. This wrapper holds altered versions of all functions added\n// through `_.mixin`. Wrapped objects may be chained.\nexport default function _(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n}\n\n_.VERSION = VERSION;\n\n// Extracts the result from a wrapped and chained object.\n_.prototype.value = function() {\n return this._wrapped;\n};\n\n// Provide unwrapping proxies for some methods used in engine operations\n// such as arithmetic and JSON stringification.\n_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n_.prototype.toString = function() {\n return String(this._wrapped);\n};\n","import getByteLength from './_getByteLength.js';\n\n// Internal function to wrap or shallow-copy an ArrayBuffer,\n// typed array or DataView to a new view, reusing the buffer.\nexport default function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n getByteLength(bufferSource)\n );\n}\n","import _ from './underscore.js';\nimport { toString, SymbolProto } from './_setup.js';\nimport getByteLength from './_getByteLength.js';\nimport isTypedArray from './isTypedArray.js';\nimport isFunction from './isFunction.js';\nimport { hasStringTagBug } from './_stringTagBug.js';\nimport isDataView from './isDataView.js';\nimport keys from './keys.js';\nimport has from './_has.js';\nimport toBufferView from './_toBufferView.js';\n\n// We use this string twice, so give it a name for minification.\nvar tagDataView = '[object DataView]';\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction eq(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\n return deepEq(a, b, aStack, bStack);\n}\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView(a)) {\n if (!isDataView(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&\n isFunction(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\n\n// Perform a deep comparison to check if two objects are equal.\nexport default function isEqual(a, b) {\n return eq(a, b);\n}\n","import isObject from './isObject.js';\nimport { hasEnumBug } from './_setup.js';\nimport collectNonEnumProps from './_collectNonEnumProps.js';\n\n// Retrieve all the enumerable property names of an object.\nexport default function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n","import getLength from './_getLength.js';\nimport isFunction from './isFunction.js';\nimport allKeys from './allKeys.js';\n\n// Since the regular `Object.prototype.toString` type tests don't work for\n// some types in IE 11, we use a fingerprinting heuristic instead, based\n// on the methods. It's not great, but it's the best we got.\n// The fingerprint method lists are defined below.\nexport function ie11fingerprint(methods) {\n var length = getLength(methods);\n return function(obj) {\n if (obj == null) return false;\n // `Map`, `WeakMap` and `Set` have no enumerable keys.\n var keys = allKeys(obj);\n if (getLength(keys)) return false;\n for (var i = 0; i < length; i++) {\n if (!isFunction(obj[methods[i]])) return false;\n }\n // If we are testing against `WeakMap`, we need to ensure that\n // `obj` doesn't have a `forEach` method in order to distinguish\n // it from a regular `Map`.\n return methods !== weakMapMethods || !isFunction(obj[forEachName]);\n };\n}\n\n// In the interest of compact minification, we write\n// each string in the fingerprints only once.\nvar forEachName = 'forEach',\n hasName = 'has',\n commonInit = ['clear', 'delete'],\n mapTail = ['get', hasName, 'set'];\n\n// `Map`, `WeakMap` and `Set` each have slightly different\n// combinations of the above sublists.\nexport var mapMethods = commonInit.concat(forEachName, mapTail),\n weakMapMethods = commonInit.concat(mapTail),\n setMethods = ['add'].concat(commonInit, forEachName, hasName);\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, mapMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, weakMapMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap');\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, setMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('WeakSet');\n","import keys from './keys.js';\n\n// Retrieve the values of an object's properties.\nexport default function values(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[_keys[i]];\n }\n return values;\n}\n","import keys from './keys.js';\n\n// Convert an object into a list of `[key, value]` pairs.\n// The opposite of `_.object` with one argument.\nexport default function pairs(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [_keys[i], obj[_keys[i]]];\n }\n return pairs;\n}\n","import keys from './keys.js';\n\n// Invert the keys and values of an object. The values must be serializable.\nexport default function invert(obj) {\n var result = {};\n var _keys = keys(obj);\n for (var i = 0, length = _keys.length; i < length; i++) {\n result[obj[_keys[i]]] = _keys[i];\n }\n return result;\n}\n","import isFunction from './isFunction.js';\n\n// Return a sorted list of the function names available on the object.\nexport default function functions(obj) {\n var names = [];\n for (var key in obj) {\n if (isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n}\n","// An internal function for creating assigner functions.\nexport default function createAssigner(keysFunc, defaults) {\n return function(obj) {\n var length = arguments.length;\n if (defaults) obj = Object(obj);\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n keys = keysFunc(source),\n l = keys.length;\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n if (!defaults || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n}\n","import createAssigner from './_createAssigner.js';\nimport allKeys from './allKeys.js';\n\n// Extend a given object with all the properties in passed-in object(s).\nexport default createAssigner(allKeys);\n","import createAssigner from './_createAssigner.js';\nimport keys from './keys.js';\n\n// Assigns a given object with all the own properties in the passed-in\n// object(s).\n// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\nexport default createAssigner(keys);\n","import createAssigner from './_createAssigner.js';\nimport allKeys from './allKeys.js';\n\n// Fill in a given object with default properties.\nexport default createAssigner(allKeys, true);\n","import isObject from './isObject.js';\nimport { nativeCreate } from './_setup.js';\n\n// Create a naked function reference for surrogate-prototype-swapping.\nfunction ctor() {\n return function(){};\n}\n\n// An internal function for creating a new object that inherits from another.\nexport default function baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n var Ctor = ctor();\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}\n","import baseCreate from './_baseCreate.js';\nimport extendOwn from './extendOwn.js';\n\n// Creates an object that inherits from the given prototype object.\n// If additional properties are provided then they will be added to the\n// created object.\nexport default function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n}\n","import isObject from './isObject.js';\nimport isArray from './isArray.js';\nimport extend from './extend.js';\n\n// Create a (shallow-cloned) duplicate of an object.\nexport default function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n}\n","// Invokes `interceptor` with the `obj` and then returns `obj`.\n// The primary purpose of this method is to \"tap into\" a method chain, in\n// order to perform operations on intermediate results within the chain.\nexport default function tap(obj, interceptor) {\n interceptor(obj);\n return obj;\n}\n","import _ from './underscore.js';\nimport isArray from './isArray.js';\n\n// Normalize a (deep) property `path` to array.\n// Like `_.iteratee`, this function can be customized.\nexport default function toPath(path) {\n return isArray(path) ? path : [path];\n}\n_.toPath = toPath;\n","import _ from './underscore.js';\nimport './toPath.js';\n\n// Internal wrapper for `_.toPath` to enable minification.\n// Similar to `cb` for `_.iteratee`.\nexport default function toPath(path) {\n return _.toPath(path);\n}\n","// Internal function to obtain a nested property in `obj` along `path`.\nexport default function deepGet(obj, path) {\n var length = path.length;\n for (var i = 0; i < length; i++) {\n if (obj == null) return void 0;\n obj = obj[path[i]];\n }\n return length ? obj : void 0;\n}\n","import toPath from './_toPath.js';\nimport deepGet from './_deepGet.js';\nimport isUndefined from './isUndefined.js';\n\n// Get the value of the (deep) property on `path` from `object`.\n// If any property in `path` does not exist or if the value is\n// `undefined`, return `defaultValue` instead.\n// The `path` is normalized through `_.toPath`.\nexport default function get(object, path, defaultValue) {\n var value = deepGet(object, toPath(path));\n return isUndefined(value) ? defaultValue : value;\n}\n","import _has from './_has.js';\nimport toPath from './_toPath.js';\n\n// Shortcut function for checking if an object has a given property directly on\n// itself (in other words, not on a prototype). Unlike the internal `has`\n// function, this public version can also traverse nested properties.\nexport default function has(obj, path) {\n path = toPath(path);\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (!_has(obj, key)) return false;\n obj = obj[key];\n }\n return !!length;\n}\n","// Keep the identity function around for default iteratees.\nexport default function identity(value) {\n return value;\n}\n","import extendOwn from './extendOwn.js';\nimport isMatch from './isMatch.js';\n\n// Returns a predicate for checking whether an object has a given set of\n// `key:value` pairs.\nexport default function matcher(attrs) {\n attrs = extendOwn({}, attrs);\n return function(obj) {\n return isMatch(obj, attrs);\n };\n}\n","import deepGet from './_deepGet.js';\nimport toPath from './_toPath.js';\n\n// Creates a function that, when passed an object, will traverse that object’s\n// properties down the given `path`, specified as an array of keys or indices.\nexport default function property(path) {\n path = toPath(path);\n return function(obj) {\n return deepGet(obj, path);\n };\n}\n","// Internal function that returns an efficient (for current engines) version\n// of the passed-in callback, to be repeatedly applied in other Underscore\n// functions.\nexport default function optimizeCb(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n}\n","import identity from './identity.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isArray from './isArray.js';\nimport matcher from './matcher.js';\nimport property from './property.js';\nimport optimizeCb from './_optimizeCb.js';\n\n// An internal function to generate callbacks that can be applied to each\n// element in a collection, returning the desired result — either `_.identity`,\n// an arbitrary callback, a property matcher, or a property accessor.\nexport default function baseIteratee(value, context, argCount) {\n if (value == null) return identity;\n if (isFunction(value)) return optimizeCb(value, context, argCount);\n if (isObject(value) && !isArray(value)) return matcher(value);\n return property(value);\n}\n","import _ from './underscore.js';\nimport baseIteratee from './_baseIteratee.js';\n\n// External wrapper for our callback generator. Users may customize\n// `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n// This abstraction hides the internal-only `argCount` argument.\nexport default function iteratee(value, context) {\n return baseIteratee(value, context, Infinity);\n}\n_.iteratee = iteratee;\n","import _ from './underscore.js';\nimport baseIteratee from './_baseIteratee.js';\nimport iteratee from './iteratee.js';\n\n// The function we call internally to generate a callback. It invokes\n// `_.iteratee` if overridden, otherwise `baseIteratee`.\nexport default function cb(value, context, argCount) {\n if (_.iteratee !== iteratee) return _.iteratee(value, context);\n return baseIteratee(value, context, argCount);\n}\n","import cb from './_cb.js';\nimport keys from './keys.js';\n\n// Returns the results of applying the `iteratee` to each element of `obj`.\n// In contrast to `_.map` it returns an object.\nexport default function mapObject(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = keys(obj),\n length = _keys.length,\n results = {};\n for (var index = 0; index < length; index++) {\n var currentKey = _keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n","// Predicate-generating function. Often useful outside of Underscore.\nexport default function noop(){}\n","import noop from './noop.js';\nimport get from './get.js';\n\n// Generates a function for a given object that returns a given property.\nexport default function propertyOf(obj) {\n if (obj == null) return noop;\n return function(path) {\n return get(obj, path);\n };\n}\n","import optimizeCb from './_optimizeCb.js';\n\n// Run a function **n** times.\nexport default function times(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n}\n","// Return a random integer between `min` and `max` (inclusive).\nexport default function random(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n}\n","// A (possibly faster) way to get the current timestamp as an integer.\nexport default Date.now || function() {\n return new Date().getTime();\n};\n","import keys from './keys.js';\n\n// Internal helper to generate functions for escaping and unescaping strings\n// to/from HTML interpolation.\nexport default function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n}\n","// Internal list of HTML entities for escaping.\nexport default {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n","import createEscaper from './_createEscaper.js';\nimport escapeMap from './_escapeMap.js';\n\n// Function for escaping strings to HTML interpolation.\nexport default createEscaper(escapeMap);\n","import createEscaper from './_createEscaper.js';\nimport unescapeMap from './_unescapeMap.js';\n\n// Function for unescaping strings from HTML interpolation.\nexport default createEscaper(unescapeMap);\n","import invert from './invert.js';\nimport escapeMap from './_escapeMap.js';\n\n// Internal list of HTML entities for unescaping.\nexport default invert(escapeMap);\n","import _ from './underscore.js';\n\n// By default, Underscore uses ERB-style template delimiters. Change the\n// following template settings to use alternative delimiters.\nexport default _.templateSettings = {\n evaluate: /<%([\\s\\S]+?)%>/g,\n interpolate: /<%=([\\s\\S]+?)%>/g,\n escape: /<%-([\\s\\S]+?)%>/g\n};\n","import defaults from './defaults.js';\nimport _ from './underscore.js';\nimport './templateSettings.js';\n\n// When customizing `_.templateSettings`, if you don't want to define an\n// interpolation, evaluation or escaping regex, we need one that is\n// guaranteed not to match.\nvar noMatch = /(.)^/;\n\n// Certain characters need to be escaped so that they can be put into a\n// string literal.\nvar escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n};\n\nvar escapeRegExp = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\nfunction escapeChar(match) {\n return '\\\\' + escapes[match];\n}\n\n// In order to prevent third-party code injection through\n// `_.templateSettings.variable`, we test it against the following regular\n// expression. It is intentionally a bit more liberal than just matching valid\n// identifiers, but still prevents possible loopholes through defaults or\n// destructuring assignment.\nvar bareIdentifier = /^\\s*(\\w|\\$)+\\s*$/;\n\n// JavaScript micro-templating, similar to John Resig's implementation.\n// Underscore templating handles arbitrary delimiters, preserves whitespace,\n// and correctly escapes quotes within interpolated code.\n// NB: `oldSettings` only exists for backwards compatibility.\nexport default function template(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n } else if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n } else if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n\n // Adobe VMs need the match returned to produce the correct offset.\n return match;\n });\n source += \"';\\n\";\n\n var argument = settings.variable;\n if (argument) {\n // Insure against third-party code injection. (CVE-2021-23358)\n if (!bareIdentifier.test(argument)) throw new Error(\n 'variable is not a bare identifier: ' + argument\n );\n } else {\n // If a variable is not specified, place data values in local scope.\n source = 'with(obj||{}){\\n' + source + '}\\n';\n argument = 'obj';\n }\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + 'return __p;\\n';\n\n var render;\n try {\n render = new Function(argument, '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n template.source = 'function(' + argument + '){\\n' + source + '}';\n\n return template;\n}\n","import isFunction from './isFunction.js';\nimport toPath from './_toPath.js';\n\n// Traverses the children of `obj` along `path`. If a child is a function, it\n// is invoked with its parent as context. Returns the value of the final\n// child, or `fallback` if any child is undefined.\nexport default function result(obj, path, fallback) {\n path = toPath(path);\n var length = path.length;\n if (!length) {\n return isFunction(fallback) ? fallback.call(obj) : fallback;\n }\n for (var i = 0; i < length; i++) {\n var prop = obj == null ? void 0 : obj[path[i]];\n if (prop === void 0) {\n prop = fallback;\n i = length; // Ensure we don't continue iterating.\n }\n obj = isFunction(prop) ? prop.call(obj) : prop;\n }\n return obj;\n}\n","// Generate a unique integer id (unique within the entire client session).\n// Useful for temporary DOM ids.\nvar idCounter = 0;\nexport default function uniqueId(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n","import _ from './underscore.js';\n\n// Start chaining a wrapped Underscore object.\nexport default function chain(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n}\n","import baseCreate from './_baseCreate.js';\nimport isObject from './isObject.js';\n\n// Internal function to execute `sourceFunc` bound to `context` with optional\n// `args`. Determines whether to execute a function as a constructor or as a\n// normal function.\nexport default function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}\n","import restArguments from './restArguments.js';\nimport executeBound from './_executeBound.js';\nimport _ from './underscore.js';\n\n// Partially apply a function by creating a version that has had some of its\n// arguments pre-filled, without changing its dynamic `this` context. `_` acts\n// as a placeholder by default, allowing any combination of arguments to be\n// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.\nvar partial = restArguments(function(func, boundArgs) {\n var placeholder = partial.placeholder;\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n});\n\npartial.placeholder = _;\nexport default partial;\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport executeBound from './_executeBound.js';\n\n// Create a function bound to a given object (assigning `this`, and arguments,\n// optionally).\nexport default restArguments(function(func, context, args) {\n if (!isFunction(func)) throw new TypeError('Bind must be called on a function');\n var bound = restArguments(function(callArgs) {\n return executeBound(func, bound, context, this, args.concat(callArgs));\n });\n return bound;\n});\n","import createSizePropertyCheck from './_createSizePropertyCheck.js';\nimport getLength from './_getLength.js';\n\n// Internal helper for collection methods to determine whether a collection\n// should be iterated as an array or as an object.\n// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\nexport default createSizePropertyCheck(getLength);\n","import getLength from './_getLength.js';\nimport isArrayLike from './_isArrayLike.js';\nimport isArray from './isArray.js';\nimport isArguments from './isArguments.js';\n\n// Internal implementation of a recursive `flatten` function.\nexport default function flatten(input, depth, strict, output) {\n output = output || [];\n if (!depth && depth !== 0) {\n depth = Infinity;\n } else if (depth <= 0) {\n return output.concat(input);\n }\n var idx = output.length;\n for (var i = 0, length = getLength(input); i < length; i++) {\n var value = input[i];\n if (isArrayLike(value) && (isArray(value) || isArguments(value))) {\n // Flatten current level of array or arguments object.\n if (depth > 1) {\n flatten(value, depth - 1, strict, output);\n idx = output.length;\n } else {\n var j = 0, len = value.length;\n while (j < len) output[idx++] = value[j++];\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n}\n","import restArguments from './restArguments.js';\nimport flatten from './_flatten.js';\nimport bind from './bind.js';\n\n// Bind a number of an object's methods to that object. Remaining arguments\n// are the method names to be bound. Useful for ensuring that all callbacks\n// defined on an object belong to it.\nexport default restArguments(function(obj, keys) {\n keys = flatten(keys, false, false);\n var index = keys.length;\n if (index < 1) throw new Error('bindAll must be passed function names');\n while (index--) {\n var key = keys[index];\n obj[key] = bind(obj[key], obj);\n }\n return obj;\n});\n","import has from './_has.js';\n\n// Memoize an expensive function by storing its results.\nexport default function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}\n","import restArguments from './restArguments.js';\n\n// Delays a function for the given number of milliseconds, and then calls\n// it with the arguments supplied.\nexport default restArguments(function(func, wait, args) {\n return setTimeout(function() {\n return func.apply(null, args);\n }, wait);\n});\n","import partial from './partial.js';\nimport delay from './delay.js';\nimport _ from './underscore.js';\n\n// Defers a function, scheduling it to run after the current call stack has\n// cleared.\nexport default partial(delay, _, 1);\n","import now from './now.js';\n\n// Returns a function, that, when invoked, will only be triggered at most once\n// during a given window of time. Normally, the throttled function will run\n// as much as it can, without ever going more than once per `wait` duration;\n// but if you'd like to disable the execution on the leading edge, pass\n// `{leading: false}`. To disable execution on the trailing edge, ditto.\nexport default function throttle(func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function() {\n previous = options.leading === false ? 0 : now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function() {\n var _now = now();\n if (!previous && options.leading === false) previous = _now;\n var remaining = wait - (_now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = _now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function() {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n}\n","import restArguments from './restArguments.js';\nimport now from './now.js';\n\n// When a sequence of calls of the returned function ends, the argument\n// function is triggered. The end of a sequence is defined by the `wait`\n// parameter. If `immediate` is passed, the argument function will be\n// triggered at the beginning of the sequence instead of at the end.\nexport default function debounce(func, wait, immediate) {\n var timeout, previous, args, result, context;\n\n var later = function() {\n var passed = now() - previous;\n if (wait > passed) {\n timeout = setTimeout(later, wait - passed);\n } else {\n timeout = null;\n if (!immediate) result = func.apply(context, args);\n // This check is needed because `func` can recursively invoke `debounced`.\n if (!timeout) args = context = null;\n }\n };\n\n var debounced = restArguments(function(_args) {\n context = this;\n args = _args;\n previous = now();\n if (!timeout) {\n timeout = setTimeout(later, wait);\n if (immediate) result = func.apply(context, args);\n }\n return result;\n });\n\n debounced.cancel = function() {\n clearTimeout(timeout);\n timeout = args = context = null;\n };\n\n return debounced;\n}\n","import partial from './partial.js';\n\n// Returns the first function passed as an argument to the second,\n// allowing you to adjust arguments, run code before and after, and\n// conditionally execute the original function.\nexport default function wrap(func, wrapper) {\n return partial(wrapper, func);\n}\n","// Returns a negated version of the passed-in predicate.\nexport default function negate(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n}\n","// Returns a function that is the composition of a list of functions, each\n// consuming the return value of the function that follows.\nexport default function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}\n","// Returns a function that will only be executed on and after the Nth call.\nexport default function after(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n","// Returns a function that will only be executed up to (but not including) the\n// Nth call.\nexport default function before(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n}\n","import partial from './partial.js';\nimport before from './before.js';\n\n// Returns a function that will be executed at most one time, no matter how\n// often you call it. Useful for lazy initialization.\nexport default partial(before, 2);\n","import cb from './_cb.js';\nimport keys from './keys.js';\n\n// Returns the first key on an object that passes a truth test.\nexport default function findKey(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = keys(obj), key;\n for (var i = 0, length = _keys.length; i < length; i++) {\n key = _keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n}\n","import cb from './_cb.js';\nimport getLength from './_getLength.js';\n\n// Internal function to generate `_.findIndex` and `_.findLastIndex`.\nexport default function createPredicateIndexFinder(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n}\n","import createPredicateIndexFinder from './_createPredicateIndexFinder.js';\n\n// Returns the first index on an array-like that passes a truth test.\nexport default createPredicateIndexFinder(1);\n","import createPredicateIndexFinder from './_createPredicateIndexFinder.js';\n\n// Returns the last index on an array-like that passes a truth test.\nexport default createPredicateIndexFinder(-1);\n","import cb from './_cb.js';\nimport getLength from './_getLength.js';\n\n// Use a comparator function to figure out the smallest index at which\n// an object should be inserted so as to maintain order. Uses binary search.\nexport default function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n}\n","import getLength from './_getLength.js';\nimport { slice } from './_setup.js';\nimport isNaN from './isNaN.js';\n\n// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.\nexport default function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n}\n","import sortedIndex from './sortedIndex.js';\nimport findIndex from './findIndex.js';\nimport createIndexFinder from './_createIndexFinder.js';\n\n// Return the position of the first occurrence of an item in an array,\n// or -1 if the item is not included in the array.\n// If the array is large and already in sort order, pass `true`\n// for **isSorted** to use binary search.\nexport default createIndexFinder(1, findIndex, sortedIndex);\n","import findLastIndex from './findLastIndex.js';\nimport createIndexFinder from './_createIndexFinder.js';\n\n// Return the position of the last occurrence of an item in an array,\n// or -1 if the item is not included in the array.\nexport default createIndexFinder(-1, findLastIndex);\n","import isArrayLike from './_isArrayLike.js';\nimport findIndex from './findIndex.js';\nimport findKey from './findKey.js';\n\n// Return the first value which passes a truth test.\nexport default function find(obj, predicate, context) {\n var keyFinder = isArrayLike(obj) ? findIndex : findKey;\n var key = keyFinder(obj, predicate, context);\n if (key !== void 0 && key !== -1) return obj[key];\n}\n","import find from './find.js';\nimport matcher from './matcher.js';\n\n// Convenience version of a common use case of `_.find`: getting the first\n// object containing specific `key:value` pairs.\nexport default function findWhere(obj, attrs) {\n return find(obj, matcher(attrs));\n}\n","import optimizeCb from './_optimizeCb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// The cornerstone for collection functions, an `each`\n// implementation, aka `forEach`.\n// Handles raw objects in addition to array-likes. Treats all\n// sparse array-likes as if they were dense.\nexport default function each(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var _keys = keys(obj);\n for (i = 0, length = _keys.length; i < length; i++) {\n iteratee(obj[_keys[i]], _keys[i], obj);\n }\n }\n return obj;\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Return the results of applying the iteratee to each element.\nexport default function map(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\nimport optimizeCb from './_optimizeCb.js';\n\n// Internal helper to create a reducing function, iterating left or right.\nexport default function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n}\n","import createReduce from './_createReduce.js';\n\n// **Reduce** builds up a single result from a list of values, aka `inject`,\n// or `foldl`.\nexport default createReduce(1);\n","import createReduce from './_createReduce.js';\n\n// The right-associative version of reduce, also known as `foldr`.\nexport default createReduce(-1);\n","import cb from './_cb.js';\nimport each from './each.js';\n\n// Return all the elements that pass a truth test.\nexport default function filter(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n}\n","import filter from './filter.js';\nimport negate from './negate.js';\nimport cb from './_cb.js';\n\n// Return all the elements for which a truth test fails.\nexport default function reject(obj, predicate, context) {\n return filter(obj, negate(cb(predicate)), context);\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Determine whether all of the elements pass a truth test.\nexport default function every(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Determine if at least one element in the object passes a truth test.\nexport default function some(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport indexOf from './indexOf.js';\n\n// Determine if the array or object contains a given item (using `===`).\nexport default function contains(obj, item, fromIndex, guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n return indexOf(obj, item, fromIndex) >= 0;\n}\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport map from './map.js';\nimport deepGet from './_deepGet.js';\nimport toPath from './_toPath.js';\n\n// Invoke a method (with arguments) on every item in a collection.\nexport default restArguments(function(obj, path, args) {\n var contextPath, func;\n if (isFunction(path)) {\n func = path;\n } else {\n path = toPath(path);\n contextPath = path.slice(0, -1);\n path = path[path.length - 1];\n }\n return map(obj, function(context) {\n var method = func;\n if (!method) {\n if (contextPath && contextPath.length) {\n context = deepGet(context, contextPath);\n }\n if (context == null) return void 0;\n method = context[path];\n }\n return method == null ? method : method.apply(context, args);\n });\n});\n","import map from './map.js';\nimport property from './property.js';\n\n// Convenience version of a common use case of `_.map`: fetching a property.\nexport default function pluck(obj, key) {\n return map(obj, property(key));\n}\n","import filter from './filter.js';\nimport matcher from './matcher.js';\n\n// Convenience version of a common use case of `_.filter`: selecting only\n// objects containing specific `key:value` pairs.\nexport default function where(obj, attrs) {\n return filter(obj, matcher(attrs));\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport cb from './_cb.js';\nimport each from './each.js';\n\n// Return the maximum element (or element-based computation).\nexport default function max(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport cb from './_cb.js';\nimport each from './each.js';\n\n// Return the minimum element (or element-based computation).\nexport default function min(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed < lastComputed || (computed === Infinity && result === Infinity)) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n","import isArray from './isArray.js';\nimport { slice } from './_setup.js';\nimport isString from './isString.js';\nimport isArrayLike from './_isArrayLike.js';\nimport map from './map.js';\nimport identity from './identity.js';\nimport values from './values.js';\n\n// Safely create a real, live array from anything iterable.\nvar reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\nexport default function toArray(obj) {\n if (!obj) return [];\n if (isArray(obj)) return slice.call(obj);\n if (isString(obj)) {\n // Keep surrogate pair characters together.\n return obj.match(reStrSymbol);\n }\n if (isArrayLike(obj)) return map(obj, identity);\n return values(obj);\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport getLength from './_getLength.js';\nimport random from './random.js';\nimport toArray from './toArray.js';\n\n// Sample **n** random values from a collection using the modern version of the\n// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n// If **n** is not specified, returns a single random element.\n// The internal `guard` argument allows it to work with `_.map`.\nexport default function sample(obj, n, guard) {\n if (n == null || guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n return obj[random(obj.length - 1)];\n }\n var sample = toArray(obj);\n var length = getLength(sample);\n n = Math.max(Math.min(n, length), 0);\n var last = length - 1;\n for (var index = 0; index < n; index++) {\n var rand = random(index, last);\n var temp = sample[index];\n sample[index] = sample[rand];\n sample[rand] = temp;\n }\n return sample.slice(0, n);\n}\n","import sample from './sample.js';\n\n// Shuffle a collection.\nexport default function shuffle(obj) {\n return sample(obj, Infinity);\n}\n","import cb from './_cb.js';\nimport pluck from './pluck.js';\nimport map from './map.js';\n\n// Sort the object's values by a criterion produced by an iteratee.\nexport default function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n}\n","import cb from './_cb.js';\nimport each from './each.js';\n\n// An internal function used for aggregate \"group by\" operations.\nexport default function group(behavior, partition) {\n return function(obj, iteratee, context) {\n var result = partition ? [[], []] : {};\n iteratee = cb(iteratee, context);\n each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n}\n","import group from './_group.js';\nimport has from './_has.js';\n\n// Groups the object's values by a criterion. Pass either a string attribute\n// to group by, or a function that returns the criterion.\nexport default group(function(result, value, key) {\n if (has(result, key)) result[key].push(value); else result[key] = [value];\n});\n","import group from './_group.js';\n\n// Indexes the object's values by a criterion, similar to `_.groupBy`, but for\n// when you know that your index values will be unique.\nexport default group(function(result, value, key) {\n result[key] = value;\n});\n","import group from './_group.js';\nimport has from './_has.js';\n\n// Counts instances of an object that group by a certain criterion. Pass\n// either a string attribute to count by, or a function that returns the\n// criterion.\nexport default group(function(result, value, key) {\n if (has(result, key)) result[key]++; else result[key] = 1;\n});\n","import group from './_group.js';\n\n// Split a collection into two arrays: one whose elements all pass the given\n// truth test, and one whose elements all do not pass the truth test.\nexport default group(function(result, value, pass) {\n result[pass ? 0 : 1].push(value);\n}, true);\n","import isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Return the number of elements in a collection.\nexport default function size(obj) {\n if (obj == null) return 0;\n return isArrayLike(obj) ? obj.length : keys(obj).length;\n}\n","// Internal `_.pick` helper function to determine whether `key` is an enumerable\n// property name of `obj`.\nexport default function keyInObj(value, key, obj) {\n return key in obj;\n}\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport optimizeCb from './_optimizeCb.js';\nimport allKeys from './allKeys.js';\nimport keyInObj from './_keyInObj.js';\nimport flatten from './_flatten.js';\n\n// Return a copy of the object only containing the allowed properties.\nexport default restArguments(function(obj, keys) {\n var result = {}, iteratee = keys[0];\n if (obj == null) return result;\n if (isFunction(iteratee)) {\n if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);\n keys = allKeys(obj);\n } else {\n iteratee = keyInObj;\n keys = flatten(keys, false, false);\n obj = Object(obj);\n }\n for (var i = 0, length = keys.length; i < length; i++) {\n var key = keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n});\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport negate from './negate.js';\nimport map from './map.js';\nimport flatten from './_flatten.js';\nimport contains from './contains.js';\nimport pick from './pick.js';\n\n// Return a copy of the object without the disallowed properties.\nexport default restArguments(function(obj, keys) {\n var iteratee = keys[0], context;\n if (isFunction(iteratee)) {\n iteratee = negate(iteratee);\n if (keys.length > 1) context = keys[1];\n } else {\n keys = map(flatten(keys, false, false), String);\n iteratee = function(value, key) {\n return !contains(keys, key);\n };\n }\n return pick(obj, iteratee, context);\n});\n","import { slice } from './_setup.js';\n\n// Returns everything but the last entry of the array. Especially useful on\n// the arguments object. Passing **n** will return all the values in\n// the array, excluding the last N.\nexport default function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n}\n","import initial from './initial.js';\n\n// Get the first element of an array. Passing **n** will return the first N\n// values in the array. The **guard** check allows it to work with `_.map`.\nexport default function first(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[0];\n return initial(array, array.length - n);\n}\n","import { slice } from './_setup.js';\n\n// Returns everything but the first entry of the `array`. Especially useful on\n// the `arguments` object. Passing an **n** will return the rest N values in the\n// `array`.\nexport default function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}\n","import rest from './rest.js';\n\n// Get the last element of an array. Passing **n** will return the last N\n// values in the array.\nexport default function last(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return rest(array, Math.max(0, array.length - n));\n}\n","import filter from './filter.js';\n\n// Trim out all falsy values from an array.\nexport default function compact(array) {\n return filter(array, Boolean);\n}\n","import _flatten from './_flatten.js';\n\n// Flatten out an array, either recursively (by default), or up to `depth`.\n// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.\nexport default function flatten(array, depth) {\n return _flatten(array, depth, false);\n}\n","import restArguments from './restArguments.js';\nimport flatten from './_flatten.js';\nimport filter from './filter.js';\nimport contains from './contains.js';\n\n// Take the difference between one array and a number of other arrays.\n// Only the elements present in just the first array will remain.\nexport default restArguments(function(array, rest) {\n rest = flatten(rest, true, true);\n return filter(array, function(value){\n return !contains(rest, value);\n });\n});\n","import restArguments from './restArguments.js';\nimport difference from './difference.js';\n\n// Return a version of the array that does not contain the specified value(s).\nexport default restArguments(function(array, otherArrays) {\n return difference(array, otherArrays);\n});\n","import isBoolean from './isBoolean.js';\nimport cb from './_cb.js';\nimport getLength from './_getLength.js';\nimport contains from './contains.js';\n\n// Produce a duplicate-free version of the array. If the array has already\n// been sorted, you have the option of using a faster algorithm.\n// The faster algorithm will not work with an iteratee if the iteratee\n// is not a one-to-one function, so providing an iteratee will disable\n// the faster algorithm.\nexport default function uniq(array, isSorted, iteratee, context) {\n if (!isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted && !iteratee) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n}\n","import restArguments from './restArguments.js';\nimport uniq from './uniq.js';\nimport flatten from './_flatten.js';\n\n// Produce an array that contains the union: each distinct element from all of\n// the passed-in arrays.\nexport default restArguments(function(arrays) {\n return uniq(flatten(arrays, true, true));\n});\n","import getLength from './_getLength.js';\nimport contains from './contains.js';\n\n// Produce an array that contains every item shared between all the\n// passed-in arrays.\nexport default function intersection(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n}\n","import max from './max.js';\nimport getLength from './_getLength.js';\nimport pluck from './pluck.js';\n\n// Complement of zip. Unzip accepts an array of arrays and groups\n// each array's elements on shared indices.\nexport default function unzip(array) {\n var length = (array && max(array, getLength).length) || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n}\n","import restArguments from './restArguments.js';\nimport unzip from './unzip.js';\n\n// Zip together multiple lists into a single array -- elements that share\n// an index go together.\nexport default restArguments(unzip);\n","import getLength from './_getLength.js';\n\n// Converts lists into objects. Pass either a single array of `[key, value]`\n// pairs, or two parallel arrays of the same length -- one of keys, and one of\n// the corresponding values. Passing by pairs is the reverse of `_.pairs`.\nexport default function object(list, values) {\n var result = {};\n for (var i = 0, length = getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n}\n","// Generate an integer Array containing an arithmetic progression. A port of\n// the native Python `range()` function. See\n// [the Python documentation](https://docs.python.org/library/functions.html#range).\nexport default function range(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n if (!step) {\n step = stop < start ? -1 : 1;\n }\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n}\n","import { slice } from './_setup.js';\n\n// Chunk a single array into multiple arrays, each containing `count` or fewer\n// items.\nexport default function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n}\n","import _ from './underscore.js';\n\n// Helper function to continue chaining intermediate results.\nexport default function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n}\n","import _ from './underscore.js';\nimport each from './each.js';\nimport functions from './functions.js';\nimport { push } from './_setup.js';\nimport chainResult from './_chainResult.js';\n\n// Add your own custom functions to the Underscore object.\nexport default function mixin(obj) {\n each(functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return chainResult(this, func.apply(_, args));\n };\n });\n return _;\n}\n","import _ from './underscore.js';\nimport each from './each.js';\nimport { ArrayProto } from './_setup.js';\nimport chainResult from './_chainResult.js';\n\n// Add all mutator `Array` functions to the wrapper.\neach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) {\n method.apply(obj, arguments);\n if ((name === 'shift' || name === 'splice') && obj.length === 0) {\n delete obj[0];\n }\n }\n return chainResult(this, obj);\n };\n});\n\n// Add all accessor `Array` functions to the wrapper.\neach(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) obj = method.apply(obj, arguments);\n return chainResult(this, obj);\n };\n});\n\nexport default _;\n","// Default Export\n// ==============\n// In this module, we mix our bundled exports into the `_` object and export\n// the result. This is analogous to setting `module.exports = _` in CommonJS.\n// Hence, this module is also the entry point of our UMD bundle and the package\n// entry point for CommonJS and AMD users. In other words, this is (the source\n// of) the module you are interfacing with when you do any of the following:\n//\n// ```js\n// // CommonJS\n// var _ = require('underscore');\n//\n// // AMD\n// define(['underscore'], function(_) {...});\n//\n// // UMD in the browser\n// // _ is available as a global variable\n// ```\nimport * as allExports from './index.js';\nimport { mixin } from './index.js';\n\n// Add all of the Underscore functions to the wrapper object.\nvar _ = mixin(allExports);\n// Legacy Node.js API.\n_._ = _;\n// Export the Underscore API.\nexport default _;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { escape } from './mixins';\n\n/**\n * Safe ES6 tagged template strings\n * @param {Array} literals\n * @param {Array} substs\n * @returns {String}\n * @example\n * const str = 'Hello';\n * const strHtml = html`Escaped ${str}, unescaped $${str}`;\n */\nexport default function html(literals: TemplateStringsArray, ...substs: string[]) {\n const { raw } = literals;\n\n return raw.reduce((acc, lit, i) => {\n let subst = substs[i - 1];\n const last = raw[i - 1];\n\n if (Array.isArray(subst)) {\n subst = subst.join('');\n } else if (last && last.slice(-1) === '$') {\n // If the interpolation is preceded by a dollar sign, it won't be escaped\n acc = acc.slice(0, -1);\n } else {\n subst = escape(subst);\n }\n\n return acc + subst + lit;\n });\n}\n","import { AssetManagerConfig } from '../../asset_manager/config/config';\nimport { BlockManagerConfig } from '../../block_manager/config/config';\nimport { CanvasConfig } from '../../canvas/config/config';\nimport { CodeManagerConfig } from '../../code_manager/config/config';\nimport { CssComposerConfig } from '../../css_composer/config/config';\nimport { DeviceManagerConfig } from '../../device_manager/config/config';\nimport { I18nConfig } from '../../i18n/config';\nimport { ModalConfig } from '../../modal_dialog/config/config';\nimport { LayerManagerConfig } from '../../navigator/config/config';\nimport { KeymapsConfig } from '../../keymaps/config';\nimport { PageManagerConfig } from '../../pages/types';\nimport { PanelsConfig } from '../../panels/config/config';\nimport { ParserConfig } from '../../parser/config/config';\nimport { RichTextEditorConfig } from '../../rich_text_editor/config/config';\nimport { SelectorManagerConfig } from '../../selector_manager/config/config';\nimport { StorageManagerConfig } from '../../storage_manager/config/config';\nimport { UndoManagerConfig } from '../../undo_manager/config';\nimport { Plugin } from '../../plugin_manager';\nimport { TraitManagerConfig } from '../../trait_manager/config/config';\nimport { CommandsConfig } from '../../commands/config/config';\nimport { StyleManagerConfig } from '../../style_manager/config/config';\nimport { DomComponentsConfig } from '../../dom_components/config/config';\nimport { HTMLGeneratorBuildOptions } from '../../code_manager/model/HtmlGenerator';\nimport { CssGeneratorBuildOptions } from '../../code_manager/model/CssGenerator';\nimport { ObjectAny } from '../../common';\nimport { ColorPickerOptions } from '../../utils/ColorPicker';\n\nexport interface EditorConfig {\n /**\n * Style class name prefix.\n * @default 'gjs-'\n */\n stylePrefix?: string;\n\n /**\n * Selector which indicates where render the editor.\n */\n container?: string | HTMLElement;\n\n /**\n * If true, auto-render the content\n * @default true\n */\n autorender?: boolean;\n\n /**\n * Array of plugins to execute on start.\n * @default []\n */\n plugins?: (string | Plugin)[];\n\n /**\n * Custom options for plugins\n * @default {}\n */\n pluginsOpts?: Record;\n\n /**\n * Init headless editor.\n * @default false\n */\n headless?: boolean;\n\n /**\n * Initial project data (JSON containing your components/styles/etc) to load.\n */\n projectData?: ObjectAny;\n\n /**\n * HTML string or object of components\n * @deprecated Rely on `projectData` option\n * @default ''\n */\n components?: string;\n\n /**\n * CSS string or object of rules\n * @deprecated Rely on `projectData` option\n * @default ''\n */\n style?: string;\n\n /**\n * If true, will fetch HTML and CSS from the selected container.\n * @deprecated\n * @default false\n */\n fromElement?: boolean;\n\n /**\n * Show an alert before unload the page with unsaved changes\n * @default true\n */\n noticeOnUnload?: boolean;\n\n /**\n * Show paddings and margins.\n * @default false\n */\n showOffsets?: boolean;\n\n /**\n * Show paddings and margins on selected component\n * @default false\n */\n showOffsetsSelected?: boolean;\n\n /**\n * On creation of a new Component (via object), if the 'style' attribute is not\n * empty, all those roles will be moved in its new class.\n * @default true\n */\n forceClass?: boolean;\n\n /**\n * Height for the editor container\n * @default '900px'\n */\n height?: string;\n\n /**\n * Width for the editor container\n * @default '100%'\n */\n width?: string;\n\n /**\n * Type of logs to print with the logger (by default is used the devtool console).\n * Available by default: debug, info, warning, error.\n * You can use `false` to disable all of them or `true` to print all of them.\n * @default ['warning', 'error']\n */\n log?: ('debug' | 'info' | 'warning' | 'error')[] | boolean;\n\n /**\n * By default Grapes injects base CSS into the canvas. For example, it sets body margin to 0\n * and sets a default background color of white. This CSS is desired in most cases.\n * use this property if you wish to overwrite the base CSS to your own CSS. This is most\n * useful if for example your template is not based off a document with 0 as body margin.\n * @deprecated in favor of `config.canvas.frameStyle`\n * @default ''\n */\n baseCss?: string;\n\n /**\n * CSS that could only be seen (for instance, inside the code viewer)\n * @default '* { box-sizing: border-box; } body {margin: 0;}'\n */\n protectedCss?: string;\n\n /**\n * CSS for the iframe which containing the canvas, useful if you need to customize\n * something inside (eg. the style of the selected component).\n * @default ''\n */\n canvasCss?: string;\n\n /**\n * Default command\n * @default 'select-comp'\n */\n defaultCommand?: string;\n\n /**\n * Show a toolbar when the component is selected\n * @default true\n */\n showToolbar?: boolean;\n\n // Allow script tag importing\n // @deprecated in favor of `config.parser.optionsHtml.allowScripts`\n // allowScripts: 0,\n\n /**\n * If true render a select of available devices\n * @default true\n */\n showDevices?: boolean;\n\n /**\n * When enabled, on device change media rules won't be created\n * @default false\n */\n devicePreviewMode?: boolean;\n\n /**\n * The condition to use for media queries, eg. 'max-width'.\n * Comes handy for mobile-first cases.\n * @default 'max-width'\n */\n mediaCondition?: string;\n\n /**\n * Starting tag for variable inside scripts in Components\n * @deprecated Rely on 'script-props' https://grapesjs.com/docs/modules/Components-js.html#passing-properties-to-scripts\n * @default '{[ '\n */\n tagVarStart?: string;\n\n /**\n * Ending tag for variable inside scripts in Components\n * @deprecated Rely on 'script-props' https://grapesjs.com/docs/modules/Components-js.html#passing-properties-to-scripts\n * @default ' ]}'\n */\n tagVarEnd?: string;\n\n /**\n * When false, removes empty text nodes when parsed, unless they contain a space.\n * @default false\n */\n keepEmptyTextNodes?: boolean;\n\n /**\n * Return JS of components inside HTML from 'editor.getHtml()'.\n * @default true\n */\n jsInHtml?: boolean;\n\n /**\n * Enable native HTML5 drag and drop.\n * @default true\n */\n nativeDnD?: boolean;\n\n /**\n * Enable multiple component selection.\n * @default true\n */\n multipleSelection?: boolean;\n\n /**\n * Pass default available options wherever `editor.getHtml()` is called.\n * @default {}\n */\n optsHtml?: HTMLGeneratorBuildOptions;\n\n /**\n * Pass default available options wherever `editor.getCss()` is called\n * @default {}\n */\n optsCss?: CssGeneratorBuildOptions;\n\n /**\n * Usually when you update the `style` of the component this changes the\n * element's `style` attribute. Unfortunately, inline styling doesn't allow\n * use of media queries (@media) or even pseudo selectors (eg. :hover).\n * When `avoidInlineStyle` is true all styles are inserted inside the css rule\n * @deprecated Don't use this option, we don't support inline styling anymore.\n */\n avoidInlineStyle?: boolean;\n\n /**\n * Avoid default properties from storable JSON data, like `components` and `styles`.\n * With this option enabled your data will be smaller (usefull if need to\n * save some storage space).\n * @default true\n */\n avoidDefaults?: boolean;\n\n /**\n * (experimental)\n * The structure of components is always on the screen but it's not the same\n * for style rules. When you delete a component you might leave a lot of styles\n * which will never be used again, therefore they might be removed.\n * With this option set to true, styles not used from the CSS generator (so in\n * any case where `CssGenerator.build` is used) will be removed automatically.\n * But be careful, not always leaving the style not used mean you wouldn't\n * use it later, but this option comes really handy when deal with big templates.\n * @default false\n */\n clearStyles?: boolean;\n\n /**\n * Specify the global drag mode of components. By default, components are moved\n * following the HTML flow. Two other options are available:\n * 'absolute' - Move components absolutely (design tools way)\n * 'translate' - Use translate CSS from transform property\n * To get more about this feature read: https://github.com/GrapesJS/grapesjs/issues/1936.\n */\n dragMode?: 'translate' | 'absolute';\n\n /**\n * When the editor is placed in a scrollable container (eg. modals) this might\n * cause elements inside the canvas (eg. floating toolbars) to be misaligned.\n * To avoid that, you can specify an array of DOM elements on which their scroll will\n * trigger the canvas update.\n * Be default, if the array is empty, the first parent element will be appended.\n * listenToEl: [document.querySelector('#scrollable-el')],\n * @default []\n * */\n listenToEl?: HTMLElement[];\n\n /**\n * Import asynchronously CSS to use as icons.\n * @default 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'\n * */\n cssIcons?: string;\n\n /**\n * Experimental: don't use.\n * Editor icons\n */\n icons?: ObjectAny;\n\n /**\n * Configurations for I18n.\n */\n i18n?: I18nConfig;\n\n /**\n * Configurations for Undo Manager\n */\n undoManager?: UndoManagerConfig | boolean;\n\n /**\n * Configurations for Asset Manager.\n */\n assetManager?: AssetManagerConfig;\n\n /**\n * Configurations for Canvas.\n */\n canvas?: CanvasConfig;\n\n /**\n * Configurations for Storage Manager.\n */\n storageManager?: StorageManagerConfig | boolean;\n\n /**\n * Configurations for Rich Text Editor.\n */\n richTextEditor?: RichTextEditorConfig;\n\n /**\n * Configurations for DomComponents\n */\n domComponents?: DomComponentsConfig;\n\n /**\n * Configurations for Modal Dialog.\n */\n modal?: ModalConfig;\n\n /**\n * Configurations for Code Manager.\n */\n codeManager?: CodeManagerConfig;\n\n /**\n * Configurations for Panels.\n */\n panels?: PanelsConfig;\n\n /**\n * Configurations for Commands.\n */\n commands?: CommandsConfig;\n\n /**\n * Configurations for keymaps\n */\n keymaps?: KeymapsConfig;\n\n /**\n * Configurations for Css Composer.\n */\n cssComposer?: CssComposerConfig;\n\n /**\n * Configurations for Selector Manager.\n */\n selectorManager?: SelectorManagerConfig;\n\n /**\n * Configurations for Device Manager.\n */\n deviceManager?: DeviceManagerConfig;\n\n /**\n * Configurations for Style Manager.\n */\n styleManager?: StyleManagerConfig;\n\n /**\n * Configurations for Block Manager.\n */\n blockManager?: BlockManagerConfig;\n\n /**\n * Configurations for Trait Manager.\n */\n traitManager?: TraitManagerConfig;\n\n /**\n * Configurations for Page Manager.\n */\n pageManager?: PageManagerConfig;\n\n /**\n * Configurations for Layer Manager.\n */\n layerManager?: LayerManagerConfig;\n\n /**\n * Configurations for Parser module.\n */\n parser?: ParserConfig;\n\n /** Texts **/\n textViewCode?: string;\n\n /**\n * Keep unused styles within the editor.\n * @default false\n */\n keepUnusedStyles?: boolean;\n\n /**\n * Experimental: don't use.\n * Avoid default UI styles.\n */\n customUI?: boolean;\n el?: HTMLElement;\n\n /**\n * Color picker options.\n */\n colorPicker?: ColorPickerOptions;\n pStylePrefix?: string;\n}\n\nexport type EditorConfigKeys = keyof EditorConfig;\n\nconst config: EditorConfig = {\n stylePrefix: 'gjs-',\n components: '',\n style: '',\n fromElement: false,\n projectData: undefined,\n noticeOnUnload: true,\n showOffsets: false,\n showOffsetsSelected: false,\n forceClass: true,\n height: '900px',\n width: '100%',\n log: ['warning', 'error'],\n baseCss: '',\n protectedCss: '* { box-sizing: border-box; } body {margin: 0;}',\n canvasCss: '',\n defaultCommand: 'select-comp',\n showToolbar: true,\n showDevices: true,\n devicePreviewMode: false,\n mediaCondition: 'max-width',\n tagVarStart: '{[ ',\n tagVarEnd: ' ]}',\n keepEmptyTextNodes: false,\n jsInHtml: true,\n nativeDnD: true,\n multipleSelection: true,\n optsHtml: {},\n optsCss: {},\n avoidInlineStyle: true,\n avoidDefaults: true,\n clearStyles: false,\n listenToEl: [],\n cssIcons: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',\n icons: {\n close:\n '',\n move: '',\n plus: '',\n caret: '',\n delete:\n '',\n copy: '',\n arrowUp:\n '',\n chevron:\n '',\n eye: '',\n eyeOff:\n '',\n },\n i18n: {},\n undoManager: {},\n assetManager: {},\n canvas: {},\n layerManager: {},\n storageManager: {},\n richTextEditor: {},\n domComponents: {},\n modal: {},\n codeManager: {},\n panels: {},\n commands: {},\n cssComposer: {},\n selectorManager: {},\n deviceManager: {},\n styleManager: {},\n blockManager: {},\n traitManager: {},\n textViewCode: 'Code',\n keepUnusedStyles: false,\n customUI: false,\n};\n\nexport default config;\n","import { isArray } from 'underscore';\nimport { Collection, Model } from '../../common';\nimport Component from '../../dom_components/model/Component';\n\nexport class Selectable extends Model {}\n\nexport default class Selected extends Collection {\n getByComponent(component: Component) {\n return this.filter(s => this.getComponent(s) === component)[0];\n }\n\n addComponent(component: Component, opts: any) {\n const toAdd = (isArray(component) ? component : [component])\n .filter(c => !this.hasComponent(c))\n .map(component => new Selectable({ component }))[0];\n return this.push(toAdd, opts);\n }\n\n getComponent(model: Selectable): Component {\n return model.get('component');\n }\n\n hasComponent(component: Component) {\n const model = this.getByComponent(component);\n return model && this.contains(model);\n }\n\n lastComponent() {\n const last = this.last();\n return last ? this.getComponent(last) : undefined;\n }\n\n allComponents() {\n return this.map(s => this.getComponent(s)).filter(i => i);\n }\n\n removeComponent(component: Component | Component[], opts: any) {\n const toRemove = (isArray(component) ? component : [component]).map(c => this.getByComponent(c));\n return this.remove(toRemove, opts);\n }\n}\n","import { isElement, isUndefined, isString } from 'underscore';\nimport { Collection, Debounced, Model, View } from '../common';\nimport { EditorConfigKeys } from '../editor/config/config';\nimport EditorModel from '../editor/model/Editor';\nimport { ProjectData } from '../storage_manager/model/IStorage';\nimport { createId, isDef, deepMerge } from '../utils/mixins';\n\nexport interface IModule extends IBaseModule {\n destroy(): void;\n postLoad(key: any): any;\n onLoad?(): void;\n name: string;\n postRender?(view: any): void;\n}\n\nexport interface IBaseModule {\n em: EditorModel;\n config: TConfig;\n}\n\nexport interface ModuleConfig {\n name?: string;\n stylePrefix?: string;\n appendTo?: string | HTMLElement;\n}\n\nexport interface IStorableModule {\n storageKey: string[] | string;\n store(result: any): any;\n load(keys: ProjectData): void;\n clear(): void;\n}\n\nexport interface ILoadableModule {\n onLoad(): void;\n}\n\nexport default abstract class Module implements IModule {\n private _em: EditorModel;\n private _config: T & { pStylePrefix?: string };\n private _name: string;\n debounced: Debounced[] = [];\n collections: Collection[] = [];\n cls: any[] = [];\n state?: Model;\n events: any;\n model?: any;\n view?: any;\n\n constructor(em: EditorModel, moduleName: string, defaults?: T) {\n this._em = em;\n this._name = moduleName;\n const name = (this.name.charAt(0).toLowerCase() + this.name.slice(1)) as EditorConfigKeys;\n const cfgParent = !isUndefined(em.config[name]) ? em.config[name] : em.config[this.name as EditorConfigKeys];\n const cfg = (cfgParent === true ? {} : cfgParent || {}) as Record;\n cfg.pStylePrefix = em.config.pStylePrefix || '';\n\n if (!isUndefined(cfgParent) && !cfgParent) {\n cfg._disable = 1;\n }\n\n cfg.em = em;\n this._config = deepMerge(defaults || {}, cfg) as T;\n }\n\n public get em() {\n return this._em;\n }\n public get config() {\n return this._config;\n }\n\n render(opts?: any): HTMLElement | JQuery | void {}\n postLoad(key: any): void {}\n\n get name(): string {\n return this._name;\n }\n\n getConfig

(\n name?: P\n ): R & { pStylePrefix?: string } {\n // @ts-ignore\n return name ? this.config[name] : this.config;\n }\n\n __logWarn(str: string, opts = {}) {\n this.em.logWarning(`[${this.name}]: ${str}`, opts);\n }\n\n postRender?(view: any): void;\n\n destroy() {\n this.__destroy();\n }\n\n __destroy() {\n this.view?.remove();\n this.state?.stopListening();\n this.state?.clear();\n this.debounced.forEach(d => d.cancel());\n this.collections.forEach(c => {\n c.stopListening();\n c.reset();\n });\n }\n\n /**\n * Move the main DOM element of the module.\n * To execute only post editor render (in postRender)\n */\n __appendTo() {\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n el.appendChild(this.render() as any);\n }\n }\n}\n\nexport abstract class ItemManagerModule<\n TConf extends ModuleConfig = ModuleConfig,\n TCollection extends Collection = Collection\n> extends Module {\n cls: any[] = [];\n protected all: TCollection;\n view?: View;\n\n constructor(\n em: EditorModel,\n moduleName: string,\n all: any,\n events?: any,\n defaults?: TConf,\n opts: { skipListen?: boolean } = {}\n ) {\n super(em, moduleName, defaults);\n this.all = all;\n this.events = events;\n !opts.skipListen && this.__initListen();\n }\n\n private: boolean = false;\n\n abstract storageKey: string;\n abstract destroy(): void;\n postLoad(key: any): void {}\n render(opts?: any) {}\n\n getProjectData(data?: any) {\n const obj: any = {};\n const key = this.storageKey;\n if (key) {\n obj[key] = data || this.getAll();\n }\n return obj;\n }\n\n loadProjectData(data: any = {}, param: { all?: TCollection; onResult?: Function; reset?: boolean } = {}) {\n const { all, onResult, reset } = param;\n const key = this.storageKey;\n const opts: any = { action: 'load' };\n const coll = all || this.all;\n let result = data[key];\n\n if (typeof result == 'string') {\n try {\n result = JSON.parse(result);\n } catch (err) {\n this.__logWarn('Data parsing failed', { input: result });\n }\n }\n\n reset && result && coll.reset(undefined, opts);\n\n if (onResult) {\n result && onResult(result, opts);\n } else if (result && isDef(result.length)) {\n coll.reset(result, opts);\n }\n\n return result;\n }\n\n clear(opts = {}) {\n const { all } = this;\n all && all.reset(undefined, opts);\n return this;\n }\n\n // getAll(): TCollection extends Collection ? C[] : TCollection {\n getAll() {\n return [...this.all.models] as TCollection | any;\n }\n\n getAllMap(): {\n [key: string]: TCollection extends Collection ? C : unknown;\n } {\n return this.getAll().reduce((acc: any, i: any) => {\n acc[i.get(i.idAttribute)] = i;\n return acc;\n }, {} as any);\n }\n\n __initListen(opts: any = {}) {\n const { all, em, events } = this;\n all &&\n em &&\n all\n .on('add', (m: any, c: any, o: any) => em.trigger(events.add, m, o))\n .on('remove', (m: any, c: any, o: any) => em.trigger(events.remove, m, o))\n .on('change', (p: any, c: any) => em.trigger(events.update, p, p.changedAttributes(), c))\n .on('all', this.__catchAllEvent, this);\n // Register collections\n this.cls = [all].concat(opts.collections || []);\n // Propagate events\n ((opts.propagate as any[]) || []).forEach(({ entity, event }) => {\n entity.on('all', (ev: any, model: any, coll: any, opts: any) => {\n const options = opts || coll;\n const opt = { event: ev, ...options };\n [em, all].map(md => md.trigger(event, model, opt));\n });\n });\n }\n\n __remove(model: any, opts: any = {}) {\n const { em } = this;\n //@ts-ignore\n const md = isString(model) ? this.get(model) : model;\n const rm = () => {\n md && this.all.remove(md, opts);\n return md;\n };\n !opts.silent && em?.trigger(this.events.removeBefore, md, rm, opts);\n return !opts.abort && rm();\n }\n\n __catchAllEvent(event: any, model: any, coll: any, opts?: any) {\n const { em, events } = this;\n const options = opts || coll;\n em && events.all && em.trigger(events.all, { event, model, options });\n this.__onAllEvent();\n }\n\n __appendTo(renderProps?: any) {\n //@ts-ignore\n const elTo = this.config.appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n // @ts-ignore\n el.appendChild(this.render(renderProps));\n }\n }\n\n __onAllEvent() {}\n\n _createId(len = 16) {\n const all = this.getAll();\n const ln = all.length + len;\n const allMap = this.getAllMap();\n let id;\n\n do {\n id = createId(ln);\n } while (allMap[id]);\n\n return id;\n }\n\n __listenAdd(model: TCollection, event: string) {\n model.on('add', (m, c, o) => this.em.trigger(event, m, o));\n }\n\n __listenRemove(model: TCollection, event: string) {\n model.on('remove', (m, c, o) => this.em.trigger(event, m, o));\n }\n\n __listenUpdate(model: TCollection, event: string) {\n model.on('change', (p, c) => this.em.trigger(event, p, p.changedAttributes(), c));\n }\n\n __destroy() {\n this.cls.forEach(coll => {\n coll.stopListening();\n coll.reset();\n });\n this.view?.remove();\n this.view = undefined;\n }\n}\n","import Component from '../../dom_components/model/Component';\nimport { CanvasSpotBuiltInTypes } from '../model/CanvasSpot';\n\nexport interface CanvasConfig {\n stylePrefix?: string;\n\n /**\n * Append external scripts to the `` of the iframe.\n * Be aware that these scripts will not be printed in the export code.\n * @default []\n * @example\n * scripts: [ 'https://...1.js', 'https://...2.js' ]\n * // or passing objects as attributes\n * scripts: [ { src: '/file.js', someattr: 'value' }, ... ]\n */\n scripts?: (string | Record)[];\n\n /**\n * Append external styles to the `` of the iframe.\n * Be aware that these scripts will not be printed in the export code.\n * @default []\n * @example\n * styles: [ 'https://...1.css', 'https://...2.css' ]\n * // or passing objects as attributes\n * styles: [ { href: '/style.css', someattr: 'value' }, ... ]\n */\n styles?: (string | Record)[];\n\n /**\n * Add custom badge naming strategy.\n * @example\n * customBadgeLabel: component => component.getName(),\n */\n customBadgeLabel?: (component: Component) => string;\n\n /**\n * Indicate when to start the autoscroll of the canvas on component/block dragging (value in px).\n * @default 50\n */\n autoscrollLimit?: number;\n\n /**\n * Experimental: external highlighter box\n */\n extHl?: boolean;\n\n /**\n * Initial content to load in all frames.\n * The default value enables the standard mode for the iframe.\n * @default ''\n */\n frameContent?: string;\n\n /**\n * Initial style to load in all frames.\n */\n frameStyle?: string;\n\n /**\n * When some textable component is selected and focused (eg. input or text component), the editor\n * stops some commands (eg. disables the copy/paste of components with CTRL+C/V to allow the copy/paste of the text).\n * This option allows to customize, by a selector, which element should not be considered textable.\n */\n notTextable?: string[];\n\n /**\n * By default, the editor allows to drop external elements by relying on the native HTML5\n * drag & drop API (eg. like a D&D of an image file from your desktop).\n * If you want to customize how external elements are interpreted by the editor, you can rely\n * on `canvas:dragdata` event, eg. https://github.com/GrapesJS/grapesjs/discussions/3849\n * @default true\n */\n allowExternalDrop?: boolean;\n\n /**\n * Disable the rendering of built-in canvas spots.\n *\n * Read here for more information about [Canvas Spots](https://grapesjs.com/docs/modules/Canvas.html#canvas-spots).\n * @example\n * // Disable only the hover type spot\n * customSpots: { hover: true },\n *\n * // Disable all built-in spots\n * customSpots: true,\n */\n customSpots?: boolean | Partial>;\n\n /**\n * Experimental: enable infinite canvas.\n */\n infiniteCanvas?: boolean;\n}\n\nconst config: CanvasConfig = {\n stylePrefix: 'cv-',\n scripts: [],\n styles: [],\n customBadgeLabel: undefined,\n autoscrollLimit: 50,\n extHl: false,\n frameContent: '',\n 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 `,\n notTextable: ['button', 'a', 'input[type=checkbox]', 'input[type=radio]'],\n allowExternalDrop: true,\n};\n\nexport default config;\n","import { DeviceProperties } from '../model/Device';\n\nexport interface DeviceManagerConfig {\n /**\n * The device `id` to select on start, if not indicated, the first available from `devices` will be used.\n * @default ''\n */\n default?: string;\n /**\n * Default devices.\n * @example\n * devices: [{\n * id: 'desktop',\n * name: 'Desktop',\n * width: '',\n * }, {\n * id: 'tablet',\n * name: 'Tablet',\n * width: '770px',\n * widthMedia: '992px',\n * },\n * ...\n * ]\n */\n devices?: DeviceProperties[];\n}\n\nconst config: DeviceManagerConfig = {\n default: '',\n devices: [\n {\n id: 'desktop',\n name: 'Desktop',\n width: '',\n },\n {\n id: 'tablet',\n name: 'Tablet',\n width: '770px',\n widthMedia: '992px',\n },\n {\n id: 'mobileLandscape',\n name: 'Mobile landscape',\n width: '568px',\n widthMedia: '768px',\n },\n {\n id: 'mobilePortrait',\n name: 'Mobile portrait',\n width: '320px',\n widthMedia: '480px',\n },\n ],\n};\n\nexport default config;\n","import { Model } from '../../common';\n\n/** @private */\nexport interface DeviceProperties {\n id?: string;\n /**\n * Device name.\n * @example 'Mobile'\n */\n name: string;\n /**\n * Width to set for the editor iframe.\n * @example '900px'\n */\n width: string | null;\n /**\n * Height to set for the editor iframe.\n * @example '600px'\n */\n height?: string;\n /**\n * The width which will be used in media queries, if empty the `width` will be used.\n * @example '900px'\n */\n widthMedia?: string | null;\n /**\n * Setup the order of media queries\n * @example 1\n */\n priority?: number | null;\n}\n\n/**\n * @typedef Device\n * @property {String} [name=''] Device type, eg. `Mobile`\n * @property {String} [width] Width to set for the editor iframe, eg. '900px'\n * @property {String} [height=''] Height to set for the editor iframe, eg. '600px'\n * @property {String} [widthMedia=''] The width which will be used in media queries, If empty the width will be used\n * @property {Number} [priority=null] Setup the order of media queries\n */\nexport default class Device extends Model {\n defaults() {\n return {\n name: '',\n width: null,\n height: '',\n widthMedia: null,\n priority: null,\n };\n }\n\n initialize() {\n this.get('widthMedia') === null && this.set('widthMedia', this.get('width'));\n this.get('width') === null && this.set('width', this.get('widthMedia'));\n !this.get('priority') && this.set('priority', parseFloat(this.get('widthMedia')!) || 0);\n const toCheck: (keyof DeviceProperties)[] = ['width', 'height', 'widthMedia'];\n toCheck.forEach(prop => this.checkUnit(prop));\n }\n\n checkUnit(prop: keyof DeviceProperties) {\n const pr = (this.get(prop) || '') as string;\n const noUnit = (parseFloat(pr) || 0).toString() === pr.toString();\n noUnit && this.set(prop, `${pr}px`);\n }\n\n getName() {\n return this.get('name') || this.get('id');\n }\n\n getWidthMedia() {\n return this.get('widthMedia') || '';\n }\n}\n","import { Collection } from '../../common';\nimport Device from './Device';\n\nexport default class Devices extends Collection {}\n\nDevices.prototype.model = Device;\n","import { View } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport html from '../../utils/html';\nimport Devices from '../model/Devices';\n\nexport interface DevicesViewConfig {\n em: EditorModel;\n pStylePrefix?: string;\n}\n\nexport default class DevicesView extends View {\n em: EditorModel;\n config: DevicesViewConfig;\n ppfx: string;\n devicesEl?: JQuery;\n\n template({ ppfx, label }: { ppfx: string; label: string }) {\n return html`\n

${label}
\n
\n \n \n \n
\n
\n
\n
\n \n `;\n }\n\n events() {\n return {\n change: 'updateDevice',\n 'click [data-add-trasp]': 'startAdd',\n };\n }\n\n constructor(o: { config: DevicesViewConfig; collection: Devices }) {\n super(o);\n this.config = o.config || {};\n this.em = this.config.em;\n this.ppfx = this.config.pStylePrefix || '';\n this.listenTo(this.em, 'change:device', this.updateSelect);\n }\n\n /**\n * Start adding new device\n * @return {[type]} [description]\n * @private\n */\n startAdd() {}\n\n /**\n * Update device of the editor\n * @private\n */\n updateDevice() {\n const { em } = this;\n\n if (em) {\n const devEl = this.devicesEl;\n em.set('device', devEl ? devEl.val() : '');\n }\n }\n\n /**\n * Update select value on device update\n * @private\n */\n updateSelect() {\n const { em, devicesEl } = this;\n\n if (em && em.getDeviceModel && devicesEl) {\n const device = em.getDeviceModel();\n devicesEl.val(device ? device.get('id')! : '');\n }\n }\n\n /**\n * Return devices options\n * @return {string} String of options\n * @private\n */\n getOptions() {\n const { collection, em } = this;\n let result = '';\n\n collection.forEach(device => {\n const { name, id } = device.attributes;\n const label = (em && em.t && em.t(`deviceManager.devices.${id}`)) || name;\n result += ``;\n });\n\n return result;\n }\n\n render() {\n const { em, ppfx, $el, el } = this;\n const label = em && em.t && em.t('deviceManager.device');\n $el.html(this.template({ ppfx, label }));\n this.devicesEl = $el.find(`.${ppfx}devices`);\n this.devicesEl.append(this.getOptions());\n this.devicesEl.val(em.get('device'));\n el.className = `${ppfx}devices-c`;\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/device_manager/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * deviceManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const deviceManager = editor.Devices;\n * ```\n * ## Available Events\n * * `device:add` - Added new device. The [Device] is passed as an argument to the callback\n * * `device:remove` - Device removed. The [Device] is passed as an argument to the callback\n * * `device:select` - New device selected. The newly selected [Device] and the previous one, are passed as arguments to the callback\n * * `device:update` - Device updated. The updated [Device] and the object containing changes are passed as arguments to the callback\n * * `device` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback\n *\n * ## Methods\n * * [add](#add)\n * * [get](#get)\n * * [getDevices](#getdevices)\n * * [remove](#remove)\n * * [select](#select)\n * * [getSelected](#getselected)\n *\n * [Device]: device.html\n *\n * @module Devices\n */\nimport { isString } from 'underscore';\nimport { ItemManagerModule } from '../abstract/Module';\nimport EditorModel from '../editor/model/Editor';\nimport defaults, { DeviceManagerConfig } from './config/config';\nimport Device, { DeviceProperties } from './model/Device';\nimport Devices from './model/Devices';\nimport DevicesView from './view/DevicesView';\n\nexport const evAll = 'device';\nexport const evPfx = `${evAll}:`;\nexport const evSelect = `${evPfx}select`;\nexport const evSelectBefore = `${evSelect}:before`;\nexport const evUpdate = `${evPfx}update`;\nexport const evAdd = `${evPfx}add`;\nexport const evAddBefore = `${evAdd}:before`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nconst chnSel = 'change:device';\nconst deviceEvents = {\n all: evAll,\n select: evSelect,\n update: evUpdate,\n add: evAdd,\n remove: evRemove,\n removeBefore: evRemoveBefore,\n};\n\nexport default class DeviceManager extends ItemManagerModule<\n DeviceManagerConfig & { appendTo?: HTMLElement | string },\n Devices\n> {\n devices: Devices;\n events!: typeof deviceEvents;\n view?: DevicesView;\n\n Device = Device;\n\n Devices = Devices;\n\n storageKey = '';\n\n constructor(em: EditorModel) {\n super(em, 'DeviceManager', new Devices(), deviceEvents, defaults);\n this.devices = this.all;\n this.config.devices?.forEach(device => this.add(device, { silent: true }));\n this.select(this.config.default || this.devices.at(0));\n em.on(chnSel, this._onSelect, this);\n return this;\n }\n\n _onSelect(m: EditorModel, deviceId: string, opts: Record) {\n const { em, events } = this;\n const prevId = m.previous('device');\n const newDevice = this.get(deviceId);\n const ev = events.select;\n em.trigger(ev, newDevice, this.get(prevId));\n this.__catchAllEvent(ev, newDevice, opts);\n }\n\n /**\n * Add new device\n * @param {Object} props Device properties\n * @returns {[Device]} Added device\n * @example\n * const device1 = deviceManager.add({\n * // Without an explicit ID, the `name` will be taken. In case of missing `name`, a random ID will be created.\n * id: 'tablet',\n * name: 'Tablet',\n * width: '900px', // This width will be applied on the canvas frame and for the CSS media\n * });\n * const device2 = deviceManager.add({\n * id: 'tablet2',\n * name: 'Tablet 2',\n * width: '800px', // This width will be applied on the canvas frame\n * widthMedia: '810px', // This width that will be used for the CSS media\n * height: '600px', // Height will be applied on the canvas frame\n * });\n */\n add(props: DeviceProperties, options: Record = {}) {\n let result;\n let opts = options;\n\n // Support old API\n if (isString(props)) {\n const width = options;\n opts = arguments[2] || {};\n result = {\n ...opts,\n id: props,\n name: opts.name || props,\n width,\n };\n } else {\n result = props;\n }\n\n if (!result.id) {\n result.id = result.name || this._createId();\n }\n\n return this.devices.add(result, opts);\n }\n\n /**\n * Return device by ID\n * @param {String} id ID of the device\n * @returns {[Device]|null}\n * @example\n * const device = deviceManager.get('Tablet');\n * console.log(JSON.stringify(device));\n * // {name: 'Tablet', width: '900px'}\n */\n get(id: string): Device | undefined {\n // Support old API\n const byName = this.getAll().filter(d => d.get('name') === id)[0];\n return byName || this.devices.get(id) || null;\n }\n\n /**\n * Remove device\n * @param {String|[Device]} device Device or device id\n * @returns {[Device]} Removed device\n * @example\n * const removed = deviceManager.remove('device-id');\n * // or by passing the Device\n * const device = deviceManager.get('device-id');\n * deviceManager.remove(device);\n */\n remove(device: string | Device, opts = {}) {\n return this.__remove(device, opts);\n }\n\n /**\n * Return all devices\n * @returns {Array<[Device]>}\n * @example\n * const devices = deviceManager.getDevices();\n * console.log(JSON.stringify(devices));\n * // [{name: 'Desktop', width: ''}, ...]\n */\n getDevices() {\n return this.devices.models;\n }\n\n /**\n * Change the selected device. This will update the frame in the canvas\n * @param {String|[Device]} device Device or device id\n * @example\n * deviceManager.select('some-id');\n * // or by passing the page\n * const device = deviceManager.get('some-id');\n * deviceManager.select(device);\n */\n select(device: string | Device, opts = {}) {\n const md = isString(device) ? this.get(device) : device;\n md && this.em.set('device', md.get('id'), opts);\n return this;\n }\n\n /**\n * Get the selected device\n * @returns {[Device]}\n * @example\n * const selected = deviceManager.getSelected();\n */\n getSelected() {\n return this.get(this.em.get('device'));\n }\n\n getAll() {\n return this.devices;\n }\n\n render() {\n const { em } = this;\n this.view?.remove();\n this.view = new DevicesView({\n collection: this.devices,\n config: { em, ...this.config },\n });\n return this.view.render().el;\n }\n\n destroy() {\n this.__destroy();\n }\n}\n","import { ModuleConfig } from '../abstract/Module';\nimport { PageProperties } from './model/Page';\n\nexport interface PageManagerConfig extends ModuleConfig {\n /**\n * Default pages.\n */\n pages?: PageProperties[];\n\n /**\n * ID of the page to select on editor load.\n */\n selected?: string;\n}\n\nexport interface SelectableOption {\n /**\n * Select the page.\n */\n select?: boolean;\n}\n\nexport interface AbortOption {\n abort?: boolean;\n}\n\n/**{START_EVENTS}*/\nexport enum PagesEvents {\n /**\n * @event `page:add` Added new page. The page is passed as an argument to the callback.\n * @example\n * editor.on('page:add', (page) => { ... });\n */\n add = 'page:add',\n addBefore = 'page:add:before',\n\n /**\n * @event `page:remove` Page removed. The page is passed as an argument to the callback.\n * @example\n * editor.on('page:remove', (page) => { ... });\n */\n remove = 'page:remove',\n removeBefore = 'page:remove:before',\n\n /**\n * @event `page:select` New page selected. The newly selected page and the previous one, are passed as arguments to the callback.\n * @example\n * editor.on('page:select', (page, previousPage) => { ... });\n */\n select = 'page:select',\n selectBefore = 'page:select:before',\n\n /**\n * @event `page:update` Page updated. The updated page and the object containing changes are passed as arguments to the callback.\n * @example\n * editor.on('page:update', (page, changes) => { ... });\n */\n update = 'page:update',\n\n /**\n * @event `page` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * @example\n * editor.on('page', ({ event, model, ... }) => { ... });\n */\n all = 'page',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default PagesEvents;\n","import { isArray, isUndefined } from 'underscore';\nimport { AddOptions, Collection } from '../common';\nimport ModuleModel from './ModuleModel';\n\ntype ModuleExt = TModel extends ModuleModel ? M : unknown;\ntype ModelConstructor = { new (mod: ModuleExt, attr: any): TModel };\n\nexport default class ModuleCollection extends Collection {\n module!: ModuleExt;\n private newModel!: ModelConstructor;\n\n add(model: Array> | TModel, options?: AddOptions): TModel;\n add(models: Array> | TModel>, options?: AddOptions): TModel[];\n add(model?: unknown, options?: AddOptions): any {\n //Note: the undefined case needed because backbonejs not handle the reset() correctly\n var models = isArray(model) ? model : !isUndefined(model) ? [model] : undefined;\n\n models = models?.map(m => (m instanceof this.newModel ? m : new this.newModel(this.module, m))) ?? [undefined];\n\n return super.add(isArray(model) ? models : models[0], options);\n }\n\n constructor(\n module: ModuleExt,\n models: TModel[] | Array>,\n modelConstructor: ModelConstructor\n ) {\n super(models, { module, modelConstructor });\n }\n\n preinitialize(models?: TModel[] | Array>, options?: any) {\n this.newModel = options.modelConstructor;\n this.module = options.module;\n }\n}\n","import { forEach, isEmpty, isNumber, isString, keys, result } from 'underscore';\nimport CanvasModule from '..';\nimport { ModuleModel } from '../../abstract';\nimport { BoxRect, PrevToNewIdMap } from '../../common';\nimport ComponentWrapper from '../../dom_components/model/ComponentWrapper';\nimport Page from '../../pages/model/Page';\nimport { createId, isComponent, isObject } from '../../utils/mixins';\nimport FrameView from '../view/FrameView';\nimport Frames from './Frames';\nimport { CssRuleJSON } from '../../css_composer/model/CssRule';\n\nconst keyAutoW = '__aw';\nconst keyAutoH = '__ah';\n\nconst getDimension = (frame: Frame, type: 'width' | 'height') => {\n const dim = frame.get(type);\n const viewDim = frame.view?.el[type === 'width' ? 'offsetWidth' : 'offsetHeight'];\n\n if (isNumber(dim)) {\n return dim;\n } else if (isString(dim) && dim.endsWith('px')) {\n return parseFloat(dim);\n } else if (viewDim) {\n return viewDim;\n } else {\n return 0;\n }\n};\n\n/**\n * @property {Object|String} component Wrapper component definition. You can also pass an HTML string as components of the default wrapper component.\n * @property {String} [width=''] Width of the frame. By default, the canvas width will be taken.\n * @property {String} [height=''] Height of the frame. By default, the canvas height will be taken.\n * @property {Number} [x=0] Horizontal position of the frame in the canvas.\n * @property {Number} [y=0] Vertical position of the frame in the canvas.\n *\n */\nexport default class Frame extends ModuleModel {\n defaults() {\n return {\n x: 0,\n y: 0,\n changesCount: 0,\n attributes: {},\n width: null,\n height: null,\n head: [],\n component: '',\n styles: '',\n refFrame: null,\n _undo: true,\n _undoexc: ['changesCount'],\n };\n }\n view?: FrameView;\n\n /**\n * @hideconstructor\n */\n constructor(module: CanvasModule, attr: any) {\n super(module, attr);\n const { em } = this;\n const { styles, component } = this.attributes;\n const domc = em.Components;\n const conf = domc.getConfig();\n const allRules = em.Css.getAll();\n const idMap: PrevToNewIdMap = {};\n const modOpts = { em, config: conf, frame: this, idMap };\n\n if (!isComponent(component)) {\n const wrp = isObject(component) ? component : { components: component };\n !wrp.type && (wrp.type = 'wrapper');\n const Wrapper = domc.getType('wrapper')!.model;\n this.set('component', new Wrapper(wrp, modOpts));\n }\n\n if (!styles) {\n this.set('styles', allRules);\n } else if (!isObject(styles)) {\n let newStyles = styles as string | CssRuleJSON[];\n\n // Avoid losing styles on remapped components\n if (keys(idMap).length) {\n newStyles = isString(newStyles) ? em.Parser.parseCss(newStyles) : newStyles;\n em.Css.checkId(newStyles, { idMap });\n }\n\n allRules.add(newStyles);\n this.set('styles', allRules);\n }\n\n !attr.width && this.set(keyAutoW, 1);\n !attr.height && this.set(keyAutoH, 1);\n\n !this.id && this.set('id', createId());\n }\n\n get width() {\n return getDimension(this, 'width');\n }\n\n get height() {\n return getDimension(this, 'height');\n }\n\n get head(): { tag: string; attributes: any }[] {\n return this.get('head');\n }\n\n get refFrame(): Frame | undefined {\n return this.get('refFrame');\n }\n\n get root() {\n const { refFrame } = this;\n return refFrame?.getComponent() || this.getComponent();\n }\n\n initRefs() {\n const { refFrame } = this;\n if (isString(refFrame)) {\n const frame = this.module.framesById[refFrame];\n frame && this.set({ refFrame: frame }, { silent: true });\n }\n }\n\n getBoxRect(): BoxRect {\n const { x, y } = this.attributes;\n const { width, height } = this;\n\n return {\n x,\n y,\n width,\n height,\n };\n }\n\n onRemove() {\n !this.refFrame && this.getComponent().remove({ root: 1 });\n }\n\n changesUp(opt: any = {}) {\n if (opt.temporary || opt.noCount || opt.avoidStore) {\n return;\n }\n this.set('changesCount', this.get('changesCount') + 1);\n }\n\n getComponent(): ComponentWrapper {\n return this.get('component');\n }\n\n getStyles() {\n return this.get('styles');\n }\n\n disable() {\n this.trigger('disable');\n }\n\n remove() {\n this.view?.remove();\n this.view = undefined;\n const coll = this.collection;\n return coll && coll.remove(this);\n }\n\n getHead() {\n return [...this.head];\n }\n\n setHead(value: { tag: string; attributes: any }[]) {\n return this.set('head', [...value]);\n }\n\n addHeadItem(item: { tag: string; attributes: any }) {\n this.head.push(item);\n }\n\n getHeadByAttr(attr: string, value: any, tag: string) {\n return this.head.filter(item => item.attributes && item.attributes[attr] == value && (!tag || tag === item.tag))[0];\n }\n\n removeHeadByAttr(attr: string, value: any, tag: string) {\n const item = this.getHeadByAttr(attr, value, tag);\n const index = this.head.indexOf(item);\n\n if (index >= 0) {\n this.head.splice(index, 1);\n }\n }\n\n addLink(href: string) {\n const tag = 'link';\n !this.getHeadByAttr('href', href, tag) &&\n this.addHeadItem({\n tag,\n attributes: {\n href,\n rel: 'stylesheet',\n },\n });\n }\n\n removeLink(href: string) {\n this.removeHeadByAttr('href', href, 'link');\n }\n\n addScript(src: string) {\n const tag = 'script';\n !this.getHeadByAttr('src', src, tag) &&\n this.addHeadItem({\n tag,\n attributes: { src },\n });\n }\n\n removeScript(src: string) {\n this.removeHeadByAttr('src', src, 'script');\n }\n\n getPage(): Page | undefined {\n return (this.collection as unknown as Frames)?.page;\n }\n\n _emitUpdated(data = {}) {\n this.em.trigger('frame:updated', { frame: this, ...data });\n }\n\n hasAutoHeight() {\n const { height } = this.attributes;\n\n if (height === 'auto' || this.config.infiniteCanvas) {\n return true;\n }\n\n return false;\n }\n\n toJSON(opts: any = {}) {\n const obj = ModuleModel.prototype.toJSON.call(this, opts);\n const defaults = result(this, 'defaults');\n\n if (opts.fromUndo) delete obj.component;\n delete obj.styles;\n delete obj.changesCount;\n obj[keyAutoW] && delete obj.width;\n obj[keyAutoH] && delete obj.height;\n\n if (obj.refFrame) {\n obj.refFrame = obj.refFrame.id;\n delete obj.component;\n }\n\n // Remove private keys\n forEach(obj, (value, key) => {\n key.indexOf('_') === 0 && delete obj[key];\n });\n\n forEach(defaults, (value, key) => {\n if (obj[key] === value) delete obj[key];\n });\n\n forEach(['attributes', 'head'], prop => {\n if (isEmpty(obj[prop])) delete obj[prop];\n });\n\n return obj;\n }\n}\n","import { bindAll } from 'underscore';\nimport CanvasModule from '..';\nimport { ModuleCollection } from '../../abstract';\nimport Page from '../../pages/model/Page';\nimport Frame from './Frame';\n\nexport default class Frames extends ModuleCollection {\n loadedItems = 0;\n itemsToLoad = 0;\n page?: Page;\n\n constructor(module: CanvasModule, models: Frame[] | Array> = []) {\n super(module, models, Frame);\n bindAll(this, 'itemLoaded');\n this.on('add', this.onAdd);\n this.on('reset', this.onReset);\n this.on('remove', this.onRemove);\n this.forEach(frame => this.onAdd(frame));\n }\n\n onAdd(frame: Frame) {\n this.module.framesById[frame.id] = frame;\n }\n\n onReset(m: Frame, opts?: { previousModels?: Frame[] }) {\n const prev = opts?.previousModels || [];\n prev.map(p => this.onRemove(p));\n }\n\n onRemove(frame: Frame) {\n frame.onRemove();\n delete this.module.framesById[frame.id];\n }\n\n initRefs() {\n this.forEach(frame => frame.initRefs());\n }\n\n itemLoaded() {\n this.loadedItems++;\n\n if (this.loadedItems >= this.itemsToLoad) {\n this.trigger('loaded:all');\n this.listenToLoadItems(false);\n }\n }\n\n listenToLoad() {\n this.loadedItems = 0;\n this.itemsToLoad = this.length;\n this.listenToLoadItems(true);\n }\n\n listenToLoadItems(on: boolean) {\n this.forEach(item => item[on ? 'on' : 'off']('loaded', this.itemLoaded));\n }\n}\n","import CanvasModule from '..';\nimport { ModuleModel } from '../../abstract';\nimport { Coordinates, CoordinatesTypes, DEFAULT_COORDS } from '../../common';\nimport { evUpdate as evDeviceUpdate } from '../../device_manager';\nimport Page from '../../pages/model/Page';\nimport PagesEvents from '../../pages/types';\nimport Frames from './Frames';\n\nexport default class Canvas extends ModuleModel {\n defaults() {\n return {\n frame: '',\n frames: [],\n rulers: false,\n zoom: 100,\n x: 0,\n y: 0,\n // Scripts to apply on all frames\n scripts: [],\n // Styles to apply on all frames\n styles: [],\n pointer: DEFAULT_COORDS,\n pointerScreen: DEFAULT_COORDS,\n };\n }\n\n constructor(module: CanvasModule) {\n const { em, config } = module;\n const { scripts, styles } = config;\n super(module, { scripts, styles });\n this.set('frames', new Frames(module));\n this.on('change:zoom', this.onZoomChange);\n this.on('change:x change:y', this.onCoordsChange);\n this.on('change:pointer change:pointerScreen', this.onPointerChange);\n this.listenTo(em, `change:device ${evDeviceUpdate}`, this.updateDevice);\n this.listenTo(em, PagesEvents.select, this._pageUpdated);\n }\n\n get frames(): Frames {\n return this.get('frames');\n }\n\n init() {\n const { em } = this;\n const mainPage = em.Pages._initPage();\n this.set('frames', mainPage.getFrames());\n this.updateDevice({ frame: mainPage.getMainFrame() });\n }\n\n _pageUpdated(page: Page, prev?: Page) {\n const { em } = this;\n em.setSelected();\n em.get('readyCanvas') && em.stopDefault(); // We have to stop before changing current frames\n prev?.getFrames().map(frame => frame.disable());\n this.set('frames', page.getFrames());\n this.updateDevice({ frame: page.getMainFrame() });\n }\n\n updateDevice(opts: any = {}) {\n const { em } = this;\n const device = em.getDeviceModel();\n const model = opts.frame || em.getCurrentFrameModel();\n\n if (model && device) {\n const { width, height } = device.attributes;\n model.set({ width, height }, { noUndo: 1 });\n }\n }\n\n onZoomChange() {\n const { em, module } = this;\n const zoom = this.get('zoom');\n zoom < 1 && this.set('zoom', 1);\n em.trigger(module.events.zoom);\n }\n\n onCoordsChange() {\n const { em, module } = this;\n em.trigger(module.events.coords);\n }\n\n onPointerChange() {\n const { em, module } = this;\n em.trigger(module.events.pointer);\n }\n\n getPointerCoords(type: CoordinatesTypes = CoordinatesTypes.World): Coordinates {\n const { pointer, pointerScreen } = this.attributes;\n return type === CoordinatesTypes.World ? pointer : pointerScreen;\n }\n}\n","import { debounce } from 'underscore';\nimport CanvasModule from '..';\nimport { ModuleCollection } from '../../abstract';\nimport { Debounced, ObjectAny } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport CanvasSpot, { CanvasSpotProps } from './CanvasSpot';\nimport { ComponentsEvents } from '../../dom_components/types';\n\nexport default class CanvasSpots extends ModuleCollection {\n refreshDbn: Debounced;\n\n constructor(module: CanvasModule, models: CanvasSpot[] | CanvasSpotProps[] = []) {\n super(module, models, CanvasSpot);\n this.on('add', this.onAdd);\n this.on('change', this.onChange);\n this.on('remove', this.onRemove);\n const { em } = this;\n this.refreshDbn = debounce(() => this.refresh(), 0);\n\n const evToRefreshDbn = `component:resize styleable:change component:input ${ComponentsEvents.update} frame:updated undo redo`;\n this.listenTo(em, evToRefreshDbn, () => this.refreshDbn());\n }\n\n get em(): EditorModel {\n return this.module.em;\n }\n\n get events() {\n return this.module.events;\n }\n\n refresh() {\n const { em, events } = this;\n em.trigger(events.spot);\n }\n\n onAdd(spot: CanvasSpot) {\n this.__trgEvent(this.events.spotAdd, { spot });\n }\n\n onChange(spot: CanvasSpot) {\n this.__trgEvent(this.events.spotUpdate, { spot });\n }\n\n onRemove(spot: CanvasSpot) {\n this.__trgEvent(this.events.spotRemove, { spot });\n }\n\n __trgEvent(event: string, props: ObjectAny) {\n const { module } = this;\n const { em } = module;\n em.trigger(event, props);\n this.refreshDbn();\n }\n}\n","export interface ToScreenOption {\n toScreen?: boolean;\n}\n\nexport interface ToWorldOption {\n toWorld?: boolean;\n}\n\nexport interface GetBoxRectOptions extends ToScreenOption {\n local?: boolean;\n}\n\nexport interface CanvasRefreshOptions {\n /**\n * Refresh canvas spots.\n */\n spots?: boolean;\n all?: boolean;\n}\n\n/**{START_EVENTS}*/\nexport enum CanvasEvents {\n /**\n * @event `canvas:dragenter` Something is dragged inside the canvas, `DataTransfer` instance passed as an argument.\n */\n dragEnter = 'canvas:dragenter',\n\n /**\n * @event `canvas:dragover` Something is dragging on the canvas, `DataTransfer` instance passed as an argument.\n */\n dragOver = 'canvas:dragover',\n\n /**\n * @event `canvas:dragend` When a drag operation is ended, `DataTransfer` instance passed as an argument.\n */\n dragEnd = 'canvas:dragend',\n\n /**\n * @event `canvas:dragdata` On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments.\n * By changing `result.content` you're able to customize what is dropped.\n */\n dragData = 'canvas:dragdata',\n\n /**\n * @event `canvas:drop` Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments.\n */\n drop = 'canvas:drop',\n\n /**\n * @event `canvas:spot` Spots updated.\n * @example\n * editor.on('canvas:spot', () => {\n * console.log('Spots', editor.Canvas.getSpots());\n * });\n */\n spot = 'canvas:spot',\n\n /**\n * @event `canvas:spot:add` New canvas spot added.\n * @example\n * editor.on('canvas:spot:add', ({ spot }) => {\n * console.log('Spot added', spot);\n * });\n */\n spotAdd = 'canvas:spot:add',\n\n /**\n * @event `canvas:spot:update` Canvas spot updated.\n * @example\n * editor.on('canvas:spot:update', ({ spot }) => {\n * console.log('Spot updated', spot);\n * });\n */\n spotUpdate = 'canvas:spot:update',\n\n /**\n * @event `canvas:spot:remove` Canvas spot removed.\n * @example\n * editor.on('canvas:spot:remove', ({ spot }) => {\n * console.log('Spot removed', spot);\n * });\n */\n spotRemove = 'canvas:spot:remove',\n\n /**\n * @event `canvas:coords` Canvas coordinates updated.\n * @example\n * editor.on('canvas:coords', () => {\n * console.log('Canvas coordinates updated:', editor.Canvas.getCoords());\n * });\n */\n coords = 'canvas:coords',\n\n /**\n * @event `canvas:zoom` Canvas zoom updated.\n * @example\n * editor.on('canvas:zoom', () => {\n * console.log('Canvas zoom updated:', editor.Canvas.getZoom());\n * });\n */\n zoom = 'canvas:zoom',\n\n /**\n * @event `canvas:pointer` Canvas pointer updated.\n * @example\n * editor.on('canvas:pointer', () => {\n * console.log('Canvas pointer updated:', editor.Canvas.getPointer());\n * });\n */\n pointer = 'canvas:pointer',\n\n /**\n * @event `canvas:refresh` Canvas was refreshed to update elements on top,\n * like spots/tools (eg. via `editor.Canvas.refresh()` or on frame resize).\n * @example\n * editor.on('canvas:refresh', (canvasRefreshOptions) => {\n * console.log('Canvas refreshed with options:', canvasRefreshOptions);\n * });\n */\n refresh = 'canvas:refresh',\n\n /**\n * @event `canvas:frame:load` Frame loaded in canvas.\n * The event is triggered right after iframe's `onload`.\n * @example\n * editor.on('canvas:frame:load', ({ window }) => {\n * console.log('Frame loaded', window);\n * });\n */\n frameLoad = 'canvas:frame:load',\n\n /**\n * @event `canvas:frame:load:head` Frame head loaded in canvas.\n * The event is triggered right after iframe's finished to load the head elemenets (eg. scripts)\n * @example\n * editor.on('canvas:frame:load:head', ({ window }) => {\n * console.log('Frame head loaded', window);\n * });\n */\n frameLoadHead = 'canvas:frame:load:head',\n\n /**\n * @event `canvas:frame:load:body` Frame body loaded in canvas.\n * The event is triggered when the body is rendered with components.\n * @example\n * editor.on('canvas:frame:load:body', ({ window }) => {\n * console.log('Frame completed the body render', window);\n * });\n */\n frameLoadBody = 'canvas:frame:load:body',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default CanvasEvents;\n","import ModuleCollection from './ModuleCollection';\nimport ModuleModel from './ModuleModel';\nimport { IBaseModule } from './Module';\nimport { View } from '../common';\nimport EditorModel from '../editor/model/Editor';\n\ntype ModuleFromModel = TModel extends ModuleModel ? M : unknown;\ntype ModuleModelExt = TItem extends ModuleCollection\n ? ModuleFromModel\n : TItem extends ModuleModel\n ? M\n : unknown;\n\n// type TCollection = TItem extends ModuleCollection ? TItem : unknown;\n\nexport default class ModuleView<\n TModel extends ModuleModel | ModuleCollection = ModuleModel,\n TElement extends Element = HTMLElement\n> extends View {\n protected get pfx() {\n return this.ppfx + (this.config as any).stylePrefix || '';\n }\n\n protected get ppfx() {\n return this.em.config.stylePrefix || '';\n }\n\n collection!: TModel extends ModuleModel ? ModuleCollection : TModel;\n\n protected get module(): ModuleModelExt {\n return (this.model as any)?.module ?? this.collection.module;\n }\n\n protected get em(): EditorModel {\n return this.module.em;\n }\n\n protected get config(): ModuleModelExt extends IBaseModule ? C : unknown {\n return this.module.config as any;\n }\n\n public className!: string;\n\n preinitialize(options?: any) {\n this.className = '';\n }\n}\n","import ModuleView from './ModuleView';\nimport ModuleCollection from './ModuleCollection';\nimport ModuleModel from './ModuleModel';\nimport { View } from '../common';\n\nexport default abstract class ModuleDomainViews<\n TCollection extends ModuleCollection,\n TItemView extends ModuleView\n> extends ModuleView {\n // Defines the View per type\n itemsView = '';\n\n protected itemType = 'type';\n\n reuseView = false;\n\n viewCollection: TItemView[] = [];\n constructor(opts: any = {}, autoAdd = false) {\n super(opts);\n autoAdd && this.listenTo(this.collection, 'add', this.addTo);\n }\n\n /**\n * Add new model to the collection\n * @param {ModuleModel} model\n * @private\n * */\n private addTo(model: ModuleModel) {\n this.add(model);\n }\n\n private itemViewNotFound(type: string) {\n /*const { em, ns } = this;\n const warn = `${ns ? `[${ns}]: ` : ''}'${type}' type not found`;\n em?.logWarning(warn);*/\n }\n protected abstract renderView(model: ModuleModel, itemType: string): TItemView;\n\n /**\n * Render new model inside the view\n * @param {ModuleModel} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n private add(model: ModuleModel, fragment?: DocumentFragment) {\n const { reuseView, viewCollection } = this;\n var frag = fragment || null;\n var typeField = model.get(this.itemType);\n let view;\n\n //@ts-ignore\n if (model.view && reuseView) {\n //@ts-ignore\n view = model.view;\n } else {\n view = this.renderView(model, typeField);\n }\n\n viewCollection.push(view);\n const rendered = view.render().el;\n\n if (frag) frag.appendChild(rendered);\n else this.$el.append(rendered);\n }\n\n render() {\n const frag = document.createDocumentFragment();\n this.clearItems();\n this.$el.empty();\n\n if (this.collection.length) this.collection.each(model => this.add(model, frag));\n\n this.$el.append(frag);\n this.onRender();\n return this;\n }\n\n onRender() {}\n\n onRemoveBefore(items: TItemView[], opts: any) {}\n onRemove(items: TItemView[], opts: any) {}\n\n remove(opts: any = {}) {\n const { viewCollection } = this;\n this.onRemoveBefore(viewCollection, opts);\n this.clearItems();\n View.prototype.remove.apply(this, opts);\n this.onRemove(viewCollection, opts);\n return this;\n }\n\n clearItems() {\n const items = this.viewCollection || [];\n // TODO Traits do not update the target anymore\n // items.forEach(item => item.remove());\n // this.items = [];\n }\n}\n","import { View } from '../../common';\nimport CssRule from '../model/CssRule';\n\nexport default class CssRuleView extends View {\n config: any;\n\n constructor(o: any = {}) {\n super(o);\n this.config = o.config || {};\n const { model } = this;\n this.listenTo(model, 'change', this.render);\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model.get('selectors'), 'change', this.render);\n }\n\n // @ts-ignore\n tagName() {\n return 'style';\n }\n\n render() {\n const { model, el } = this;\n const important = model.get('important');\n el.innerHTML = model.toCSS({ important });\n return this;\n }\n}\n","import CssRuleView from './CssRuleView';\n\nexport default class CssGroupRuleView extends CssRuleView {\n _createElement() {\n return document.createTextNode('');\n }\n\n render() {\n const model = this.model;\n const important = model.get('important');\n this.el.textContent = model.getDeclaration({ important });\n return this;\n }\n}\n","import { bindAll } from 'underscore';\n\nimport { View } from '../../common';\nimport { createEl } from '../../utils/dom';\nimport CssRuleView from './CssRuleView';\nimport CssGroupRuleView from './CssGroupRuleView';\nimport EditorModel from '../../editor/model/Editor';\nimport CssRule from '../model/CssRule';\n\nconst getBlockId = (pfx: string, order?: string | number) => `${pfx}${order ? `-${parseFloat(order as string)}` : ''}`;\n\nexport default class CssRulesView extends View {\n atRules: Record;\n config: Record;\n em: EditorModel;\n pfx: string;\n renderStarted?: boolean;\n\n constructor(o: any) {\n super(o);\n bindAll(this, 'sortRules');\n\n const config = o.config || {};\n this.atRules = {};\n this.config = config;\n this.em = config.em;\n this.pfx = config.stylePrefix || '';\n this.className = this.pfx + 'rules';\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n }\n\n /**\n * Add to collection\n * @param {Object} model\n * @private\n * */\n addTo(model: CssRule) {\n this.addToCollection(model);\n }\n\n /**\n * Add new object to collection\n * @param {Object} model\n * @param {Object} fragmentEl\n * @return {Object}\n * @private\n * */\n addToCollection(model: CssRule, fragmentEl?: DocumentFragment) {\n // If the render is not yet started\n if (!this.renderStarted) {\n return;\n }\n\n const fragment = fragmentEl || null;\n const { config } = this;\n const opts = { model, config };\n let rendered, view;\n\n // I have to render keyframes of the same name together\n // Unfortunately at the moment I didn't find the way of appending them\n // if not staticly, via appendData\n if (model.get('atRuleType') === 'keyframes') {\n const atRule = model.getAtRule();\n let atRuleEl = this.atRules[atRule];\n\n if (!atRuleEl) {\n const styleEl = document.createElement('style');\n atRuleEl = document.createTextNode('');\n styleEl.appendChild(document.createTextNode(`${atRule}{`));\n styleEl.appendChild(atRuleEl);\n styleEl.appendChild(document.createTextNode('}'));\n this.atRules[atRule] = atRuleEl;\n rendered = styleEl;\n }\n\n view = new CssGroupRuleView(opts);\n atRuleEl.appendData(view.render().el.textContent);\n } else {\n view = new CssRuleView(opts);\n rendered = view.render().el;\n }\n\n const clsName = this.className!;\n const mediaText = model.get('mediaText');\n const defaultBlockId = getBlockId(clsName);\n let blockId = defaultBlockId;\n\n // If the rule contains a media query it might have a different container\n // for it (eg. rules created with Device Manager)\n if (mediaText) {\n blockId = getBlockId(clsName, this.getMediaWidth(mediaText));\n }\n\n if (rendered) {\n const container = fragment || this.el;\n let contRules;\n\n // Try to find a specific container for the rule (if it\n // containes a media query), otherwise get the default one\n try {\n contRules = container.querySelector(`#${blockId}`);\n } catch (e) {}\n\n if (!contRules) {\n contRules = container.querySelector(`#${defaultBlockId}`);\n }\n\n contRules?.appendChild(rendered);\n }\n\n return rendered;\n }\n\n getMediaWidth(mediaText: string) {\n return mediaText && mediaText.replace(`(${this.em.getConfig().mediaCondition}: `, '').replace(')', '');\n }\n\n sortRules(a: number, b: number) {\n const { em } = this;\n const isMobFirst = (em.getConfig().mediaCondition || '').indexOf('min-width') !== -1;\n\n if (!isMobFirst) return 0;\n\n const left = isMobFirst ? a : b;\n const right = isMobFirst ? b : a;\n\n return left - right;\n }\n\n render() {\n this.renderStarted = true;\n this.atRules = {};\n const { em, $el, collection } = this;\n const cls = this.className!;\n const frag = document.createDocumentFragment();\n $el.empty();\n\n // Create devices related DOM structure, ensure also to have a default container\n const prs = em.Devices.getAll().pluck('priority').sort(this.sortRules) as number[];\n prs.every(pr => pr) && prs.unshift(0);\n prs.forEach(pr => frag.appendChild(createEl('div', { id: getBlockId(cls, pr) })));\n\n collection.each(model => this.addToCollection(model, frag));\n $el.append(frag);\n $el.attr('class', cls);\n return this;\n }\n}\n","import { each } from 'underscore';\nimport { HTMLParserOptions } from '../config/config';\n\nconst htmlType = 'text/html';\nconst defaultType = htmlType; // 'application/xml';\n\nexport default (str: string, config: HTMLParserOptions = {}) => {\n const parser = new DOMParser();\n const mimeType = config.htmlType || defaultType;\n const toHTML = mimeType === htmlType;\n const strF = toHTML ? str : `
${str}
`;\n const doc = parser.parseFromString(strF, mimeType);\n let res: HTMLElement;\n\n if (toHTML) {\n if (config.asDocument) return doc;\n\n // Replicate the old parser in order to avoid breaking changes\n const { head, body } = doc;\n // Move all scripts at the bottom of the page\n const scripts = head.querySelectorAll('script');\n each(scripts, node => body.appendChild(node));\n // Move inside body all head children\n const hEls: Element[] = [];\n each(head.children, n => hEls.push(n));\n each(hEls, (node, i) => body.insertBefore(node, body.children[i]));\n res = body;\n } else {\n res = doc.firstChild as HTMLElement;\n }\n\n return res;\n};\n\n/**\n * POC, custom html parser specs\n * Parse an HTML string to an array of nodes\n * example\n * parse(`
Hello
World example`)\n * // result\n * [\n * {\n * tagName: 'div',\n * attributes: { class: 'mycls', 'data-test': '' },\n * childNodes: ['Hello'],\n * },{\n * tagName: 'span',\n * childNodes: [\n * 'World ',\n * {\n * tagName: 'b',\n * childNodes: ['example'],\n * }\n * ],\n * }\n * ]\n *\n\nexport const parseNodes = nodes => {\n const result = [];\n\n for (let i = 0; i < nodes.length; i++) {\n result.push(parseNode(nodes[i]));\n }\n\n return result;\n};\n\nexport const parseAttributes = attrs => {\n const result = {};\n\n for (let j = 0; j < attrs.length; j++) {\n const attr = attrs[j];\n const nodeName = attr.nodeName;\n const nodeValue = attr.nodeValue;\n result[nodeName] = nodeValue;\n }\n\n return result;\n};\n\nexport const parseNode = el => {\n // Return the string of the textnode element\n if (el.nodeType === 3) {\n return el.nodeValue;\n }\n\n const tagName = node.tagName ? node.tagName.toLowerCase() : '';\n const attrs = el.attributes || [];\n const nodes = el.childNodes || [];\n\n return {\n ...(tagName && { tagName }),\n ...(attrs.length && {\n attributes: parseAttributes(attrs)\n }),\n ...(nodes.length && {\n childNodes: parseNodes(nodes)\n })\n };\n};\n\nexport default (str, config = {}) => {\n const result = [];\n const el = document.createElement('div');\n el.innerHTML = str;\n const nodes = el.childNodes;\n const len = nodes.length;\n\n for (let i = 0; i < len; i++) {\n result.push(parseNode(nodes[i]));\n }\n\n return result;\n};\n */\n","import { each, isArray, isFunction, isUndefined } from 'underscore';\nimport { ObjectAny, ObjectStrings } from '../../common';\nimport { ComponentDefinitionDefined, ComponentStackItem } from '../../dom_components/model/types';\nimport EditorModel from '../../editor/model/Editor';\nimport { HTMLParseResult, HTMLParserOptions, ParseNodeOptions, ParserConfig } from '../config/config';\nimport BrowserParserHtml from './BrowserParserHtml';\nimport { doctypeToString } from '../../utils/dom';\n\nconst modelAttrStart = 'data-gjs-';\nconst event = 'parse:html';\n\nconst ParserHtml = (em?: EditorModel, config: ParserConfig & { returnArray?: boolean } = {}) => {\n return {\n compTypes: [] as ComponentStackItem[],\n\n modelAttrStart,\n\n getPropAttribute(attrName: string, attrValue?: string) {\n const name = attrName.replace(this.modelAttrStart, '');\n const valueLen = attrValue?.length || 0;\n const firstChar = attrValue?.substring(0, 1);\n const lastChar = attrValue?.substring(valueLen - 1);\n let value: any = attrValue === 'true' ? true : attrValue === 'false' ? false : attrValue;\n\n // Try to parse JSON where it's possible\n // I can get false positive here (eg. a selector '[data-attr]')\n // so put it under try/catch and let fail silently\n try {\n value =\n (firstChar == '{' && lastChar == '}') || (firstChar == '[' && lastChar == ']') ? JSON.parse(value) : value;\n } catch (e) {}\n\n return {\n name,\n value,\n };\n },\n\n /**\n * Extract component props from an attribute object\n * @param {Object} attr\n * @returns {Object} An object containing props and attributes without them\n */\n splitPropsFromAttr(attr: ObjectAny = {}) {\n const props: ObjectAny = {};\n const attrs: ObjectStrings = {};\n\n each(attr, (value, key) => {\n if (key.indexOf(this.modelAttrStart) === 0) {\n const propsResult = this.getPropAttribute(key, value);\n props[propsResult.name] = propsResult.value;\n } else {\n attrs[key] = value;\n }\n });\n\n return {\n props,\n attrs,\n };\n },\n\n /**\n * Parse style string to object\n * @param {string} str\n * @return {Object}\n * @example\n * var stl = ParserHtml.parseStyle('color:black; width:100px; test:value;');\n * console.log(stl);\n * // {color: 'black', width: '100px', test: 'value'}\n */\n parseStyle(str: string) {\n const result: Record = {};\n\n while (str.indexOf('/*') >= 0) {\n const start = str.indexOf('/*');\n const end = str.indexOf('*/') + 2;\n str = str.replace(str.slice(start, end), '');\n }\n\n const decls = str.split(';');\n\n for (let i = 0, len = decls.length; i < len; i++) {\n const decl = decls[i].trim();\n if (!decl) continue;\n const prop = decl.split(':');\n const key = prop[0].trim();\n const value = prop.slice(1).join(':').trim();\n\n // Support multiple values for the same key\n if (result[key]) {\n if (!isArray(result[key])) {\n result[key] = [result[key] as string];\n }\n\n (result[key] as string[]).push(value);\n } else {\n result[key] = value;\n }\n }\n\n return result;\n },\n\n /**\n * Parse class string to array\n * @param {string} str\n * @return {Array}\n * @example\n * var res = ParserHtml.parseClass('test1 test2 test3');\n * console.log(res);\n * // ['test1', 'test2', 'test3']\n */\n parseClass(str: string) {\n const result = [];\n const cls = str.split(' ');\n\n for (let i = 0, len = cls.length; i < len; i++) {\n const cl = cls[i].trim();\n if (!cl) continue;\n result.push(cl);\n }\n\n return result;\n },\n\n parseNodeAttr(node: HTMLElement, result?: ComponentDefinitionDefined) {\n const model = result || {};\n const attrs = node.attributes || [];\n const attrsLen = attrs.length;\n\n for (let i = 0; i < attrsLen; i++) {\n const nodeName = attrs[i].nodeName;\n let nodeValue: string | boolean = attrs[i].nodeValue!;\n\n if (nodeName == 'style') {\n model.style = this.parseStyle(nodeValue);\n } else if (nodeName == 'class') {\n model.classes = this.parseClass(nodeValue);\n } else if (nodeName == 'contenteditable') {\n continue;\n } else if (nodeName.indexOf(this.modelAttrStart) === 0) {\n const propsResult = this.getPropAttribute(nodeName, nodeValue);\n model[propsResult.name] = propsResult.value;\n } else {\n // @ts-ignore Check for attributes from props (eg. required, disabled)\n if (nodeValue === '' && node[nodeName] === true) {\n nodeValue = true;\n }\n\n if (!model.attributes) {\n model.attributes = {};\n }\n\n model.attributes[nodeName] = nodeValue;\n }\n }\n\n return model;\n },\n\n detectNode(node: HTMLElement, opts: ParseNodeOptions = {}) {\n const { compTypes } = this;\n let result: ComponentDefinitionDefined = {};\n\n if (compTypes) {\n const type = node.getAttribute?.(`${this.modelAttrStart}type`);\n\n // If the type is already defined, use it\n if (type) {\n result = { type };\n } else {\n // Find the component type\n for (let i = 0; i < compTypes.length; i++) {\n const compType = compTypes[i];\n let obj = compType.model.isComponent(node, opts);\n\n if (obj) {\n if (typeof obj !== 'object') {\n obj = { type: compType.id };\n }\n result = obj\n break;\n }\n }\n }\n }\n\n return result;\n },\n\n parseNode(node: HTMLElement, opts: ParseNodeOptions = {}) {\n const nodes = (node as HTMLTemplateElement).content?.childNodes || node.childNodes;\n const nodesLen = nodes.length;\n let model = this.detectNode(node, opts);\n\n if (!model.tagName) {\n const tag = node.tagName || '';\n const ns = node.namespaceURI || '';\n model.tagName = tag && ns === 'http://www.w3.org/1999/xhtml' ? tag.toLowerCase() : tag;\n }\n\n model = this.parseNodeAttr(node, model);\n\n // Check for custom void elements (valid in XML)\n if (!nodesLen && `${node.outerHTML}`.slice(-2) === '/>') {\n model.void = true;\n }\n\n // Check for nested elements but avoid it if already provided\n if (nodesLen && !model.components && !opts.skipChildren) {\n // Avoid infinite nested text nodes\n const firstChild = nodes[0];\n\n // If there is only one child and it's a TEXTNODE\n // just make it content of the current node\n if (nodesLen === 1 && firstChild.nodeType === 3) {\n !model.type && (model.type = 'text');\n model.components = {\n type: 'textnode',\n content: firstChild.nodeValue,\n };\n } else {\n model.components = this.parseNodes(node, {\n ...opts,\n inSvg: opts.inSvg || model.type === 'svg',\n });\n }\n }\n\n // If all children are texts and there is any textnode inside, the parent should\n // be text too otherwise it won't be possible to edit texnodes.\n const comps = model.components;\n if (!model.type && comps?.length) {\n const { textTypes = [], textTags = [] } = config;\n let allTxt = true;\n let foundTextNode = false;\n\n for (let i = 0; i < comps.length; i++) {\n const comp = comps[i];\n const cType = comp.type;\n\n if (!textTypes.includes(cType) && !textTags.includes(comp.tagName)) {\n allTxt = false;\n break;\n }\n\n if (cType === 'textnode') {\n foundTextNode = true;\n }\n }\n\n if (allTxt && foundTextNode) {\n model.type = 'text';\n }\n }\n\n return model;\n },\n\n /**\n * Get data from the node element\n * @param {HTMLElement} el DOM element to traverse\n * @return {Array}\n */\n parseNodes(el: HTMLElement, opts: ParseNodeOptions = {}) {\n const result: ComponentDefinitionDefined[] = [];\n const nodes = (el as HTMLTemplateElement).content?.childNodes || el.childNodes;\n const nodesLen = nodes.length;\n\n for (let i = 0; i < nodesLen; i++) {\n const node = nodes[i] as HTMLElement;\n const nodePrev = result[result.length - 1];\n const model = this.parseNode(node, opts);\n\n // Check if it's a text node and if it could be moved to the prevous one\n if (model.type === 'textnode') {\n if (nodePrev?.type === 'textnode') {\n nodePrev.content += model.content;\n continue;\n }\n\n // Throw away empty nodes (keep spaces)\n if (!opts.keepEmptyTextNodes) {\n const content = node.nodeValue;\n if (content != ' ' && !content!.trim()) {\n continue;\n }\n }\n }\n\n // If the tagName is empty and it's not a textnode, skip it\n if (!model.tagName && isUndefined(model.content)) {\n continue;\n }\n\n result.push(model);\n }\n\n return result;\n },\n\n /**\n * Parse HTML string to a desired model object\n * @param {string} str HTML string\n * @param {ParserCss} parserCss In case there is style tags inside HTML\n * @return {Object}\n */\n parse(str: string, parserCss?: any, opts: HTMLParserOptions = {}) {\n const conf = em?.get('Config') || {};\n const res: HTMLParseResult = { html: [] };\n const cf = { ...config, ...opts };\n const options = {\n ...config.optionsHtml,\n // @ts-ignore Support previous `configParser.htmlType` option\n htmlType: config.optionsHtml?.htmlType || config.htmlType,\n ...opts,\n };\n const { preParser, asDocument } = options;\n const input = isFunction(preParser) ? preParser(str, { editor: em?.getEditor()! }) : str;\n const parseRes = isFunction(cf.parserHtml) ? cf.parserHtml(input, options) : BrowserParserHtml(input, options);\n let root = parseRes as HTMLElement;\n const docEl = parseRes as Document;\n\n if (asDocument) {\n root = docEl.documentElement;\n res.doctype = doctypeToString(docEl.doctype);\n }\n\n const scripts = root.querySelectorAll('script');\n let i = scripts.length;\n\n // Support previous `configMain.allowScripts` option\n const allowScripts = !isUndefined(conf.allowScripts) ? conf.allowScripts : options.allowScripts;\n\n // Remove script tags\n if (!allowScripts) {\n while (i--) scripts[i].parentNode?.removeChild(scripts[i]);\n }\n\n // Remove unsafe attributes\n if (!options.allowUnsafeAttr || !options.allowUnsafeAttrValue) {\n this.__sanitizeNode(root, options);\n }\n\n // Detach style tags and parse them\n if (parserCss) {\n const styles = root.querySelectorAll('style');\n let j = styles.length;\n let styleStr = '';\n\n while (j--) {\n styleStr = styles[j].innerHTML + styleStr;\n styles[j].parentNode?.removeChild(styles[j]);\n }\n\n if (styleStr) res.css = parserCss.parse(styleStr);\n }\n\n em?.trigger(`${event}:root`, { input, root: root });\n let resHtml: HTMLParseResult['html'] = [];\n\n if (asDocument) {\n res.head = this.parseNode(docEl.head, cf);\n res.root = this.parseNodeAttr(root);\n resHtml = this.parseNode(docEl.body, cf);\n } else {\n const result = this.parseNodes(root, cf);\n // I have to keep it otherwise it breaks the DomComponents.addComponent (returns always array)\n resHtml = result.length === 1 && !cf.returnArray ? result[0] : result;\n }\n\n res.html = resHtml;\n em?.trigger(event, { input, output: res });\n\n return res;\n },\n\n __sanitizeNode(node: HTMLElement, opts: HTMLParserOptions) {\n const attrs = node.attributes || [];\n const nodes = node.childNodes || [];\n const toRemove: string[] = [];\n each(attrs, attr => {\n const name = attr.nodeName || '';\n const value = attr.nodeValue || '';\n !opts.allowUnsafeAttr && name.startsWith('on') && toRemove.push(name);\n !opts.allowUnsafeAttrValue && value.startsWith('javascript:') && toRemove.push(name);\n });\n toRemove.map(name => node.removeAttribute(name));\n each(nodes, node => this.__sanitizeNode(node as HTMLElement, opts));\n },\n };\n};\n\nexport default ParserHtml;\n","import { isArray, isString, keys } from 'underscore';\nimport { Model, ObjectAny, ObjectHash, SetOptions } from '../../common';\nimport ParserHtml from '../../parser/model/ParserHtml';\nimport Selectors from '../../selector_manager/model/Selectors';\nimport { shallowDiff } from '../../utils/mixins';\n\nexport type StyleProps = Record;\n\nexport type UpdateStyleOptions = SetOptions & {\n partial?: boolean;\n addStyle?: StyleProps;\n inline?: boolean;\n noEvent?: boolean;\n};\n\nconst parserHtml = ParserHtml();\n\nexport const getLastStyleValue = (value: string | string[]) => {\n return isArray(value) ? value[value.length - 1] : value;\n};\n\nexport default class StyleableModel extends Model {\n /**\n * Forward style string to `parseStyle` to be parse to an object\n * @param {string} str\n * @returns\n */\n parseStyle(str: string) {\n return parserHtml.parseStyle(str);\n }\n\n /**\n * To trigger the style change event on models I have to\n * pass a new object instance\n * @param {Object} prop\n * @return {Object}\n */\n extendStyle(prop: ObjectAny): ObjectAny {\n return { ...this.getStyle(), ...prop };\n }\n\n /**\n * Get style object\n * @return {Object}\n */\n getStyle(prop?: string | ObjectAny): StyleProps {\n const style = this.get('style') || {};\n const result: ObjectAny = { ...style };\n return prop && isString(prop) ? result[prop] : result;\n }\n\n /**\n * Set new style object\n * @param {Object|string} prop\n * @param {Object} opts\n * @return {Object} Applied properties\n */\n setStyle(prop: string | ObjectAny = {}, opts: UpdateStyleOptions = {}) {\n if (isString(prop)) {\n prop = this.parseStyle(prop);\n }\n\n const propOrig = this.getStyle(opts);\n\n if (opts.partial || opts.avoidStore) {\n opts.avoidStore = true;\n prop.__p = true;\n } else {\n delete prop.__p;\n }\n\n const propNew = { ...prop };\n const newStyle = { ...propNew };\n // Remove empty style properties\n keys(newStyle).forEach(prop => {\n if (newStyle[prop] === '') {\n delete newStyle[prop];\n }\n });\n this.set('style', newStyle, opts as any);\n const diff = shallowDiff(propOrig, propNew);\n // Delete the property used for partial updates\n delete diff.__p;\n keys(diff).forEach(pr => {\n // @ts-ignore\n const { em } = this;\n if (opts.noEvent) return;\n this.trigger(`change:style:${pr}`);\n if (em) {\n em.trigger('styleable:change', this, pr, opts);\n em.trigger(`styleable:change:${pr}`, this, pr, opts);\n }\n });\n\n return propNew;\n }\n\n /**\n * Add style property\n * @param {Object|string} prop\n * @param {string} value\n * @example\n * this.addStyle({color: 'red'});\n * this.addStyle('color', 'blue');\n */\n addStyle(prop: string | ObjectAny, value: any = '', opts: UpdateStyleOptions = {}) {\n if (typeof prop == 'string') {\n prop = {\n [prop]: value,\n };\n } else {\n opts = value || {};\n }\n\n opts.addStyle = prop;\n prop = this.extendStyle(prop);\n this.setStyle(prop, opts);\n }\n\n /**\n * Remove style property\n * @param {string} prop\n */\n removeStyle(prop: string) {\n let style = this.getStyle();\n delete style[prop];\n this.setStyle(style);\n }\n\n /**\n * Returns string of style properties\n * @param {Object} [opts={}] Options\n * @return {String}\n */\n styleToString(opts: ObjectAny = {}) {\n const result: string[] = [];\n const style = this.getStyle(opts);\n const imp = opts.important;\n\n for (let prop in style) {\n const important = isArray(imp) ? imp.indexOf(prop) >= 0 : imp;\n const firstChars = prop.substring(0, 2);\n const isPrivate = firstChars === '__';\n\n if (isPrivate) continue;\n\n const value = style[prop];\n const values = isArray(value) ? (value as string[]) : [value];\n\n values.forEach((val: string) => {\n const value = `${val}${important ? ' !important' : ''}`;\n value && result.push(`${prop}:${value};`);\n });\n }\n\n return result.join('');\n }\n\n getSelectors() {\n return (this.get('selectors') || this.get('classes')) as Selectors;\n }\n\n getSelectorsString(opts?: ObjectAny) {\n // @ts-ignore\n return this.selectorsToString ? this.selectorsToString(opts) : this.getSelectors().getFullString();\n }\n\n // @ts-ignore\n // _validate(attr, opts) {\n // return true;\n // }\n}\n","import { isArray, isString, keys } from 'underscore';\nimport Component, { keySymbol, keySymbolOvrd, keySymbols } from './Component';\nimport { SymbolToUpOptions } from './types';\nimport { isEmptyObj } from '../../utils/mixins';\nimport Components from './Components';\n\nexport const isSymbolMain = (cmp: Component) => isArray(cmp.get(keySymbols));\n\nexport const isSymbolInstance = (cmp: Component) => !!cmp.get(keySymbol);\n\nexport const isSymbol = (cmp: Component) => !!(isSymbolMain(cmp) || isSymbolInstance(cmp));\n\nexport const isSymbolRoot = (symbol: Component) => {\n const parent = symbol.parent();\n return isSymbol(symbol) && (!parent || !isSymbol(parent));\n};\n\nexport const isSymbolNested = (symbol: Component) => {\n if (!isSymbol(symbol)) return false;\n const symbTopSelf = getSymbolTop(isSymbolMain(symbol) ? symbol : getSymbolMain(symbol)!);\n const symbTop = getSymbolTop(symbol);\n const symbTopMain = isSymbolMain(symbTop) ? symbTop : getSymbolMain(symbTop);\n return symbTopMain !== symbTopSelf;\n};\n\nexport const initSymbol = (symbol: Component) => {\n if (symbol.__symbReady) return;\n symbol.on('change', symbol.__upSymbProps);\n symbol.__symbReady = true;\n};\n\nexport const getSymbolMain = (symbol: Component): Component | undefined => {\n let result = symbol.get(keySymbol);\n\n if (result && isString(result)) {\n const ref = symbol.__getAllById()[result];\n if (ref) {\n result = ref;\n symbol.set(keySymbol, ref);\n } else {\n result = 0;\n }\n }\n\n return result || undefined;\n};\n\nexport const getSymbolInstances = (symbol?: Component): Component[] | undefined => {\n let symbs = symbol?.get(keySymbols);\n\n if (symbs && isArray(symbs)) {\n symbs.forEach((symb, idx) => {\n if (symb && isString(symb)) {\n symbs[idx] = symbol!.__getAllById()[symb];\n }\n });\n symbs = symbs.filter(symb => symb && !isString(symb));\n }\n\n return symbs || undefined;\n};\n\nexport const isSymbolOverride = (symbol?: Component, prop = '') => {\n const ovrd = symbol?.get(keySymbolOvrd);\n const [prp] = prop.split(':');\n const props = prop !== prp ? [prop, prp] : [prop];\n return ovrd === true || (isArray(ovrd) && props.some(p => ovrd.indexOf(p) >= 0));\n};\n\nexport const getSymbolsToUpdate = (symb: Component, opts: SymbolToUpOptions = {}) => {\n let result: Component[] = [];\n const { changed } = opts;\n\n if (\n opts.fromInstance ||\n opts.noPropagate ||\n opts.fromUndo ||\n // Avoid updating others if the current component has override\n (changed && isSymbolOverride(symb, changed))\n ) {\n return result;\n }\n\n const symbols = getSymbolInstances(symb) || [];\n const symbol = getSymbolMain(symb);\n const all = symbol ? [symbol, ...(getSymbolInstances(symbol) || [])] : symbols;\n result = all\n .filter(s => s !== symb)\n // Avoid updating those with override\n .filter(s => !(changed && isSymbolOverride(s, changed)));\n\n return result;\n};\n\nexport const getSymbolTop = (symbol: Component, opts?: any) => {\n let result = symbol;\n let parent = symbol.parent(opts);\n\n // while (parent && (isSymbolMain(parent) || getSymbol(parent))) {\n while (parent && isSymbol(parent)) {\n result = parent;\n parent = parent.parent(opts);\n }\n\n return result;\n};\n\nexport const detachSymbolInstance = (symbol: Component, opts: { skipRefs?: boolean } = {}) => {\n const symbolMain = getSymbolMain(symbol);\n const symbs = symbolMain && getSymbolInstances(symbolMain);\n !opts.skipRefs &&\n symbs &&\n symbolMain.set(\n keySymbols,\n symbs.filter(s => s !== symbol)\n );\n symbol.set(keySymbol, 0);\n symbol.components().forEach(s => detachSymbolInstance(s, opts));\n};\n\nexport const logSymbol = (symb: Component, type: string, toUp: Component[], opts: any = {}) => {\n const symbol = getSymbolMain(symb);\n const symbols = getSymbolInstances(symb);\n\n if (!symbol && !symbols) {\n return;\n }\n\n symb.em.log(type, { model: symb, toUp, context: 'symbols', opts });\n};\n\nexport const updateSymbolProps = (symbol: Component, opts: SymbolToUpOptions = {}) => {\n const changed = symbol.changedAttributes() || {};\n const attrs = changed.attributes || {};\n delete changed.status;\n delete changed.open;\n delete changed[keySymbols];\n delete changed[keySymbol];\n delete changed[keySymbolOvrd];\n delete changed.attributes;\n delete attrs.id;\n\n if (!isEmptyObj(attrs)) {\n changed.attributes = attrs;\n }\n\n if (!isEmptyObj(changed)) {\n const toUp = getSymbolsToUpdate(symbol, opts);\n // Avoid propagating overrides to other symbols\n keys(changed).map(prop => {\n if (isSymbolOverride(symbol, prop)) delete changed[prop];\n });\n\n logSymbol(symbol, 'props', toUp, { opts, changed });\n toUp.forEach(child => {\n const propsChanged = { ...changed };\n // Avoid updating those with override\n keys(propsChanged).map(prop => {\n if (isSymbolOverride(child, prop)) delete propsChanged[prop];\n });\n child.set(propsChanged, { fromInstance: symbol, ...opts });\n });\n }\n};\n\nexport const updateSymbolCls = (symbol: Component, opts: any = {}) => {\n const toUp = getSymbolsToUpdate(symbol, opts);\n logSymbol(symbol, 'classes', toUp, { opts });\n toUp.forEach(child => {\n // @ts-ignore This will propagate the change up to __upSymbProps\n child.set('classes', symbol.get('classes'), { fromInstance: symbol });\n });\n symbol.__changesUp(opts);\n};\n\nexport const updateSymbolComps = (symbol: Component, m: Component, c: Components, o: any) => {\n const optUp = o || c || {};\n const { fromInstance, fromUndo } = optUp;\n const toUpOpts = { fromInstance, fromUndo };\n const isTemp = m.opt.temporary;\n\n // Reset\n if (!o) {\n const toUp = getSymbolsToUpdate(symbol, {\n ...toUpOpts,\n changed: 'components:reset',\n });\n // @ts-ignore\n const cmps = m.models as Component[];\n logSymbol(symbol, 'reset', toUp, { components: cmps });\n toUp.forEach(symb => {\n const newMods = cmps.map(mod => mod.clone({ symbol: true }));\n // @ts-ignore\n symb.components().reset(newMods, { fromInstance: symbol, ...c });\n });\n // Add\n } else if (o.add) {\n let addedInstances: Component[] = [];\n const isMainSymb = !!getSymbolInstances(symbol);\n const toUp = getSymbolsToUpdate(symbol, {\n ...toUpOpts,\n changed: 'components:add',\n });\n if (toUp.length) {\n const addSymb = getSymbolMain(m);\n addedInstances = (addSymb ? getSymbolInstances(addSymb) : getSymbolInstances(m)) || [];\n addedInstances = [...addedInstances];\n addedInstances.push(addSymb ? addSymb : m);\n }\n !isTemp &&\n logSymbol(symbol, 'add', toUp, {\n opts: o,\n addedInstances: addedInstances.map(c => c.cid),\n added: m.cid,\n });\n // Here, before appending a new symbol, I have to ensure there are no previously\n // created symbols (eg. used mainly when drag components around)\n toUp.forEach(symb => {\n const symbTop = getSymbolTop(symb);\n const symbPrev = addedInstances.filter(addedInst => {\n const addedTop = getSymbolTop(addedInst, { prev: 1 });\n return symbTop && addedTop && addedTop === symbTop;\n })[0];\n const toAppend = symbPrev || m.clone({ symbol: true, symbolInv: isMainSymb });\n symb.append(toAppend, { fromInstance: symbol, ...o });\n });\n // Remove\n } else {\n // Remove instance reference from the symbol\n const symb = getSymbolMain(m);\n symb &&\n !o.temporary &&\n symb.set(\n keySymbols,\n getSymbolInstances(symb)!.filter(i => i !== m)\n );\n\n // Propagate remove only if the component is an inner symbol\n if (!isSymbolRoot(m)) {\n const changed = 'components:remove';\n const { index } = o;\n const parent = m.parent();\n const opts = { fromInstance: m, ...o };\n const isSymbNested = isSymbolRoot(m);\n let toUpFn = (symb: Component) => {\n const symbPrnt = symb.parent();\n symbPrnt && !isSymbolOverride(symbPrnt, changed) && symb.remove(opts);\n };\n // Check if the parent allows the removing\n let toUp = !isSymbolOverride(parent, changed) ? getSymbolsToUpdate(m, toUpOpts) : [];\n\n if (isSymbNested) {\n toUp = parent! && getSymbolsToUpdate(parent, { ...toUpOpts, changed })!;\n toUpFn = symb => {\n const toRemove = symb.components().at(index);\n toRemove && toRemove.remove({ fromInstance: parent, ...opts });\n };\n }\n\n !isTemp &&\n logSymbol(symbol, 'remove', toUp, {\n opts: o,\n removed: m.cid,\n isSymbNested,\n });\n toUp.forEach(toUpFn);\n }\n }\n\n symbol.__changesUp(optUp);\n};\n","import { isEmpty, isArray, isString, isFunction, each, includes, extend, flatten, keys } from 'underscore';\nimport Component from './Component';\nimport { AddOptions, Collection, OptionAsDocument } from '../../common';\nimport { DomComponentsConfig } from '../config/config';\nimport EditorModel from '../../editor/model/Editor';\nimport ComponentManager from '..';\nimport CssRule from '../../css_composer/model/CssRule';\n\nimport {\n ComponentAdd,\n ComponentAddType,\n ComponentDefinition,\n ComponentDefinitionDefined,\n ComponentProperties,\n} from './types';\nimport ComponentText from './ComponentText';\nimport ComponentWrapper from './ComponentWrapper';\nimport { ComponentsEvents } from '../types';\nimport { isSymbolInstance, isSymbolRoot } from './SymbolUtils';\n\nexport const getComponentIds = (cmp?: Component | Component[] | Components, res: string[] = []) => {\n if (!cmp) return [];\n const cmps = (isArray(cmp) || isFunction((cmp as Components).map) ? cmp : [cmp]) as Component[];\n cmps.map(cmp => {\n res.push(cmp.getId());\n getComponentIds(cmp.components().models, res);\n });\n return res;\n};\n\nconst getComponentsFromDefs = (\n items: ReturnType,\n all: ReturnType = {},\n opts: any = {}\n) => {\n opts.visitedCmps = opts.visitedCmps || {};\n const { visitedCmps } = opts;\n const itms = isArray(items) ? items : [items];\n\n return itms.map(item => {\n const { attributes = {}, components, tagName, style } = item;\n let { id, draggable, ...restAttr } = attributes;\n let result = item;\n\n if (id) {\n // Detect components with the same ID\n if (!visitedCmps[id]) {\n visitedCmps[id] = [];\n\n // Update the component if exists already\n if (all[id]) {\n result = all[id] as any;\n const cmp = result as unknown as Component;\n tagName && cmp.set({ tagName }, { ...opts, silent: true });\n keys(restAttr).length && cmp.addAttributes(restAttr, { ...opts });\n keys(style).length && cmp.addStyle(style, opts);\n }\n } else {\n // Found another component with the same ID, treat it as a new component\n visitedCmps[id].push(result);\n id = Component.getNewId(all);\n result.attributes.id = id;\n }\n }\n\n if (components) {\n const newComponents = getComponentsFromDefs(components, all);\n\n if (isFunction(result.components)) {\n const cmps = result.components();\n cmps.length > 0 && cmps.reset(newComponents, opts);\n } else {\n result.components = newComponents;\n }\n }\n\n return result;\n });\n};\n\nexport interface ComponentsOptions {\n em: EditorModel;\n config?: DomComponentsConfig;\n domc?: ComponentManager;\n}\n\ninterface AddComponentOptions extends AddOptions {\n previousModels?: Component[];\n keepIds?: string[];\n}\n\nexport default class Components extends Collection {\n opt!: ComponentsOptions;\n config?: DomComponentsConfig;\n em: EditorModel;\n domc?: ComponentManager;\n parent?: Component;\n\n constructor(models: any, opt: ComponentsOptions) {\n super(models, opt);\n this.opt = opt;\n this.listenTo(this, 'add', this.onAdd);\n this.listenTo(this, 'remove', this.removeChildren);\n this.listenTo(this, 'reset', this.resetChildren);\n const { em, config } = opt;\n this.config = config;\n this.em = em;\n this.domc = opt.domc || em?.Components;\n }\n\n get events() {\n return this.domc?.events!;\n }\n\n resetChildren(models: Components, opts: { previousModels?: Component[]; keepIds?: string[] } = {}) {\n const coll = this;\n const prev = opts.previousModels || [];\n const toRemove = prev.filter(prev => !models.get(prev.cid));\n const newIds = getComponentIds(models);\n const idsToKeep = getComponentIds(prev).filter(pr => newIds.indexOf(pr) >= 0);\n opts.keepIds = (opts.keepIds || []).concat(idsToKeep);\n toRemove.forEach(md => this.removeChildren(md, coll, opts));\n models.each(model => this.onAdd(model));\n }\n\n resetFromString(input = '', opts: { visitedCmps?: Record; keepIds?: string[] } = {}) {\n opts.keepIds = getComponentIds(this);\n const { domc, em, parent } = this;\n const cssc = em?.Css;\n const allByID = domc?.allById() || {};\n const parsed = this.parseString(input, opts);\n const newCmps = getComponentsFromDefs(parsed, allByID, opts);\n const { visitedCmps = {} } = opts;\n\n // Clone styles for duplicated components\n Object.keys(visitedCmps).forEach(id => {\n const cmps = visitedCmps[id];\n if (cmps.length) {\n // Get all available rules of the component\n const rulesToClone = cssc?.getRules(`#${id}`) || [];\n\n if (rulesToClone.length) {\n cmps.forEach(cmp => {\n rulesToClone.forEach(rule => {\n const newRule = rule.clone();\n // @ts-ignore\n newRule.set('selectors', [`#${cmp.attributes.id}`]);\n cssc!.getAll().add(newRule);\n });\n });\n }\n }\n });\n\n this.reset(newCmps, opts as any);\n em?.trigger('component:content', parent, opts, input);\n (parent as ComponentText).__checkInnerChilds?.();\n }\n\n removeChildren(removed: Component, coll?: Components, opts: any = {}) {\n // Removing a parent component can cause this function\n // to be called with an already removed child element\n if (!removed) {\n return;\n }\n\n const { domc, em } = this;\n const isTemp = opts.temporary || opts.fromUndo;\n removed.prevColl = this; // This one is required for symbols\n\n if (!isTemp) {\n // Remove the component from the global list\n const id = removed.getId();\n const sels = em.Selectors.getAll();\n const rules = em.Css.getAll();\n const canRemoveStyle = (opts.keepIds || []).indexOf(id) < 0;\n const allByID = domc ? domc.allById() : {};\n delete allByID[id];\n\n // Remove all component related styles\n const rulesRemoved = (\n canRemoveStyle\n ? rules.remove(\n rules.filter(r => r.getSelectors().getFullString() === `#${id}`),\n opts\n )\n : []\n ) as CssRule[];\n\n // Clean selectors\n sels.remove(rulesRemoved.map(rule => rule.getSelectors().at(0)));\n\n if (!removed.opt.temporary) {\n em.Commands.run('core:component-style-clear', { target: removed });\n removed.removed();\n removed.trigger('removed');\n em.trigger(ComponentsEvents.remove, removed);\n\n if (domc && isSymbolInstance(removed) && isSymbolRoot(removed)) {\n domc.symbols.__trgEvent(domc.events.symbolInstanceRemove, { component: removed }, true);\n }\n }\n\n const inner = removed.components();\n inner.forEach(it => this.removeChildren(it, coll, opts));\n }\n\n // Remove stuff registered in DomComponents.handleChanges\n const inner = removed.components();\n em.stopListening(inner);\n em.stopListening(removed);\n em.stopListening(removed.get('classes'));\n removed.__postRemove();\n }\n\n /** @ts-ignore */\n model(attrs: Partial, options: any) {\n const { opt } = options.collection;\n const em = opt.em as EditorModel;\n let model;\n const df = em.Components.componentTypes;\n options.em = em;\n options.config = opt.config;\n options.componentTypes = df;\n options.domc = opt.domc;\n\n for (let it = 0; it < df.length; it++) {\n const dfId = df[it].id;\n if (dfId == attrs.type) {\n model = df[it].model;\n break;\n }\n }\n\n // If no model found, get the default one\n if (!model) {\n model = df[df.length - 1].model;\n em &&\n attrs.type &&\n em.logWarning(`Component type '${attrs.type}' not found`, {\n attrs,\n options,\n });\n }\n\n return new model(attrs, options) as Component;\n }\n\n parseString(value: string, opt: AddOptions & OptionAsDocument & { temporary?: boolean; keepIds?: string[] } = {}) {\n const { em, domc, parent } = this;\n const asDocument = opt.asDocument && parent?.is('wrapper');\n const cssc = em.Css;\n const parsed = em.Parser.parseHtml(value, { asDocument });\n let components = parsed.html;\n\n if (asDocument) {\n const root = parent as ComponentWrapper;\n const { components: bodyCmps, ...restBody } = (parsed.html as ComponentDefinitionDefined) || {};\n const { components: headCmps, ...restHead } = parsed.head || {};\n components = bodyCmps!;\n root.set(restBody as any, opt);\n root.head.set(restHead as any, opt);\n root.head.components(headCmps, opt);\n root.docEl.set(parsed.root as any, opt);\n root.set({ doctype: parsed.doctype });\n }\n\n // We need this to avoid duplicate IDs\n Component.checkId(components, parsed.css, domc!.componentsById, opt);\n\n if (parsed.css && cssc && !opt.temporary) {\n const { at, ...optsToPass } = opt;\n cssc.addCollection(parsed.css, {\n ...optsToPass,\n extend: 1,\n });\n }\n\n return components;\n }\n\n add(model: Exclude, opt?: AddComponentOptions): Component;\n add(models: ComponentAddType[], opt?: AddComponentOptions): Component[];\n add(models: ComponentAdd, opt?: AddComponentOptions): Component | Component[];\n add(models: unknown, opt: AddComponentOptions = {}): unknown {\n if (models == undefined) return;\n\n opt.keepIds = [...(opt.keepIds || []), ...getComponentIds(opt.previousModels)];\n\n if (isString(models)) {\n models = this.parseString(models, opt)!;\n } else if (isArray(models)) {\n models.forEach((item: string, index: number) => {\n if (isString(item)) {\n const nodes = this.parseString(item, opt);\n (models as any)[index] = isArray(nodes) && !nodes.length ? null : nodes;\n }\n });\n }\n\n const processedModels = (isArray(models) ? models : [models])\n .filter(Boolean)\n .map((model: any) => this.processDef(model));\n\n models = isArray(models) ? flatten(processedModels as any, 1) : processedModels[0];\n\n return super.add(models as any, opt);\n }\n\n /**\n * Process component definition.\n */\n processDef(mdl: Component | ComponentDefinition | ComponentDefinitionDefined) {\n // Avoid processing Models\n if (mdl.cid && mdl.ccid) return mdl;\n const { em, config = {} } = this;\n const { processor } = config;\n let model = mdl;\n\n if (processor) {\n model = { ...model }; // Avoid 'Cannot delete property ...'\n const modelPr = processor(model);\n if (modelPr) {\n //@ts-ignore\n each(model, (val, key) => delete model[key]);\n extend(model, modelPr);\n }\n }\n\n // React JSX preset\n //@ts-ignore\n if (model.$$typeof && typeof model.props == 'object') {\n model = { ...model };\n model.props = { ...model.props };\n const domc = em.Components;\n const parser = em.Parser;\n const { parserHtml } = parser;\n\n each(model, (value, key) => {\n //@ts-ignore\n if (!includes(['props', 'type'], key)) delete model[key];\n });\n const { props } = model;\n const comps = props.children;\n delete props.children;\n delete model.props;\n const res = parserHtml.splitPropsFromAttr(props);\n model.attributes = res.attrs;\n\n if (comps) {\n model.components = comps;\n }\n if (!model.type) {\n model.type = 'textnode';\n } else if (!domc.getType(model.type)) {\n model.tagName = model.type;\n delete model.type;\n }\n\n extend(model, res.props);\n }\n\n return model;\n }\n\n onAdd(model: Component, c?: any, opts: { temporary?: boolean } = {}) {\n const { domc, em } = this;\n const style = model.getStyle();\n const avoidInline = em && em.getConfig().avoidInlineStyle;\n domc && domc.Component.ensureInList(model);\n\n if (!isEmpty(style) && !avoidInline && em && em.getConfig().forceClass && !opts.temporary) {\n const name = model.cid;\n em.Css.setClassRule(name, style);\n model.setStyle({});\n model.addClass(name);\n }\n\n model.__postAdd({ recursive: true });\n\n if (em && !opts.temporary) {\n const triggerAdd = (model: Component) => {\n em.trigger(ComponentsEvents.add, model, opts);\n model.components().forEach(comp => triggerAdd(comp));\n };\n triggerAdd(model);\n\n if (domc && isSymbolInstance(model) && isSymbolRoot(model)) {\n domc.symbols.__trgEvent(domc.events.symbolInstanceAdd, { component: model }, true);\n }\n }\n }\n}\n","import { result, forEach, keys } from 'underscore';\nimport { Model } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\n\nconst TYPE_CLASS = 1;\nconst TYPE_ID = 2;\n\nexport interface SelectorProps {\n name: string;\n label?: string;\n type?: number;\n active?: boolean;\n private?: boolean;\n protected?: boolean;\n}\n\n/**\n * @typedef Selector\n * @property {String} name Selector name, eg. `my-class`\n * @property {String} label Selector label, eg. `My Class`\n * @property {Number} [type=1] Type of the selector. 1 (class) | 2 (id)\n * @property {Boolean} [active=true] If not active, it's not selectable by the Style Manager.\n * @property {Boolean} [private=false] If true, it can't be seen by the Style Manager, but it will be rendered in the canvas and in export code.\n * @property {Boolean} [protected=false] If true, it can't be removed from the attached component.\n */\nexport default class Selector extends Model {\n defaults() {\n return {\n name: '',\n label: '',\n type: TYPE_CLASS,\n active: true,\n private: false,\n protected: false,\n _undo: true,\n };\n }\n\n // Type selectors: https://developer.mozilla.org/it/docs/Web/CSS/CSS_Selectors\n static readonly TYPE_CLASS = TYPE_CLASS;\n static readonly TYPE_ID = TYPE_ID;\n\n em: EditorModel;\n\n /**\n * @hideconstructor\n */\n constructor(props: any, opts: any = {}) {\n super(props, opts);\n const { config = {} } = opts;\n const name = this.get('name');\n const label = this.get('label');\n\n if (!name) {\n this.set('name', label);\n } else if (!label) {\n this.set('label', name);\n }\n\n const namePreEsc = this.get('name')!;\n const { escapeName } = config;\n const nameEsc = escapeName ? escapeName(namePreEsc) : Selector.escapeName(namePreEsc);\n this.set('name', nameEsc);\n this.em = opts.em;\n }\n\n isId() {\n return this.get('type') === TYPE_ID;\n }\n\n isClass() {\n return this.get('type') === TYPE_CLASS;\n }\n\n getFullName(opts: any = {}) {\n const { escape } = opts;\n const name = this.get('name');\n let pfx = '';\n\n switch (this.get('type')) {\n case TYPE_CLASS:\n pfx = '.';\n break;\n case TYPE_ID:\n pfx = '#';\n break;\n }\n\n return pfx + (escape ? escape(name) : name);\n }\n\n /**\n * Get selector as a string.\n * @returns {String}\n * @example\n * // Given such selector: { name: 'my-selector', type: 2 }\n * console.log(selector.toString());\n * // -> `#my-selector`\n */\n toString() {\n return this.getFullName();\n }\n\n /**\n * Get selector name.\n * @returns {String}\n * @example\n * // Given such selector: { name: 'my-selector', label: 'My selector' }\n * console.log(selector.getName());\n * // -> `my-selector`\n */\n getName() {\n return this.get('name') || '';\n }\n\n /**\n * Get selector label.\n * @returns {String}\n * @example\n * // Given such selector: { name: 'my-selector', label: 'My selector' }\n * console.log(selector.getLabel());\n * // -> `My selector`\n */\n getLabel() {\n return this.get('label') || '';\n }\n\n /**\n * Update selector label.\n * @param {String} label New label\n * @example\n * // Given such selector: { name: 'my-selector', label: 'My selector' }\n * selector.setLabel('New Label')\n * console.log(selector.getLabel());\n * // -> `New Label`\n */\n setLabel(label: string) {\n return this.set('label', label);\n }\n\n /**\n * Get selector active state.\n * @returns {Boolean}\n */\n getActive() {\n return !!this.get('active');\n }\n\n /**\n * Update selector active state.\n * @param {Boolean} value New active state\n */\n setActive(value: boolean) {\n return this.set('active', value);\n }\n\n toJSON(opts = {}) {\n const { em } = this;\n let obj = Model.prototype.toJSON.call(this, [opts]);\n const defaults = result(this, 'defaults');\n\n if (em && em.getConfig().avoidDefaults) {\n forEach(defaults, (value, key) => {\n if (obj[key] === value) {\n delete obj[key];\n }\n });\n\n if (obj.label === obj.name) {\n delete obj.label;\n }\n\n const objLen = keys(obj).length;\n\n if (objLen === 1 && obj.name) {\n obj = obj.name;\n }\n\n if (objLen === 2 && obj.name && obj.type) {\n obj = this.getFullName();\n }\n }\n\n return obj;\n }\n\n /**\n * Escape string\n * @param {string} name\n * @return {string}\n * @private\n */\n static escapeName(name: string) {\n return `${name}`.trim().replace(/([^a-z0-9\\w\\-\\\\:@\\\\/#()\\.%\\+\\[\\]]+)/gi, '-');\n }\n}\n\nSelector.prototype.idAttribute = 'name';\n","import { filter } from 'underscore';\nimport { Collection } from '../../common';\nimport Selector from './Selector';\n\nconst combine = (tail: string[], curr: string): string[] => {\n return tail.reduce(\n (acc, item, n) => {\n return acc.concat(combine(tail.slice(n + 1), `${curr}${item}`));\n },\n [curr]\n );\n};\n\nexport interface FullNameOptions {\n combination?: boolean;\n array?: boolean;\n}\n\nexport default class Selectors extends Collection {\n modelId(attr: any) {\n return `${attr.name}_${attr.type || Selector.TYPE_CLASS}`;\n }\n\n getStyleable() {\n return filter(this.models, item => item.getActive() && !item.get('private'));\n }\n\n getValid({ noDisabled }: any = {}) {\n return filter(this.models, item => !item.get('private')).filter(item => (noDisabled ? item.get('active') : 1));\n }\n\n getFullString(collection?: Selector[] | null, opts: { sort?: boolean } = {}) {\n const result: string[] = [];\n const coll = collection || this;\n coll.forEach(selector => result.push(selector.getFullName(opts)));\n opts.sort && result.sort();\n return result.join('').trim();\n }\n\n getFullName(opts: T = {} as T) {\n const { combination, array } = opts;\n let result: string[] = [];\n const sels = this.map(s => s.getFullName(opts)).sort();\n\n if (combination) {\n sels.forEach((sel, n) => {\n result = result.concat(combine(sels.slice(n + 1), sel));\n });\n } else {\n result = sels;\n }\n\n return (array ? result : combination ? result.join(',') : result.join('')) as T['array'] extends true\n ? string[]\n : string;\n }\n}\n\nSelectors.prototype.model = Selector;\n","import { Model } from '../common';\nimport CategoryView from './ModuleCategoryView';\n\nexport interface CategoryProperties {\n /**\n * Category id.\n */\n id: string;\n /**\n * Category label.\n */\n label: string;\n /**\n * Category open state.\n * @default true\n */\n open?: boolean;\n /**\n * Category order.\n */\n order?: string | number;\n /**\n * Category attributes.\n * @default {}\n */\n attributes?: Record;\n}\n\nexport interface ItemsByCategory {\n category?: Category;\n items: T[];\n}\n\nexport interface ModelWithCategory {\n category?: Category;\n}\n\nexport default class Category extends Model {\n view?: CategoryView;\n\n defaults() {\n return {\n id: '',\n label: '',\n open: true,\n attributes: {},\n };\n }\n\n getId() {\n return this.get('id')!;\n }\n\n getLabel() {\n return this.get('label')!;\n }\n}\n\nexport function getItemsByCategory(allItems: T[]) {\n const categorySet = new Set();\n const categoryMap = new Map();\n const emptyItem: ItemsByCategory = { items: [] };\n\n allItems.forEach(item => {\n const { category } = item;\n\n if (category) {\n categorySet.add(category);\n const categoryItems = categoryMap.get(category);\n\n if (categoryItems) {\n categoryItems.push(item);\n } else {\n categoryMap.set(category, [item]);\n }\n } else {\n emptyItem.items.push(item);\n }\n });\n\n const categoryWithItems = Array.from(categorySet).map(category => ({\n category,\n items: categoryMap.get(category) || [],\n }));\n\n return [...categoryWithItems, emptyItem];\n}\n","import { isString } from 'underscore';\nimport { Collection, Model } from '../common';\nimport Categories from './ModuleCategories';\nimport Category, { CategoryProperties } from './ModuleCategory';\nimport { isObject } from '../utils/mixins';\n\ninterface ModelWithCategoryProps {\n category?: string | CategoryProperties;\n}\n\nconst CATEGORY_KEY = 'category';\n\nexport abstract class CollectionWithCategories> extends Collection {\n abstract getCategories(): Categories;\n\n initCategory(model: T) {\n let category = model.get(CATEGORY_KEY);\n const isDefined = category instanceof Category;\n\n // Ensure the category exists and it's not already initialized\n if (category && !isDefined) {\n if (isString(category)) {\n category = { id: category, label: category };\n } else if (isObject(category) && !category.id) {\n category.id = category.label;\n }\n\n const catModel = this.getCategories().add(category);\n model.set(CATEGORY_KEY, catModel as any, { silent: true });\n return catModel;\n } else if (isDefined) {\n const catModel = category as unknown as Category;\n this.getCategories().add(catModel);\n return catModel;\n }\n }\n}\n","import { isArray, isString } from 'underscore';\nimport { AddOptions, Collection } from '../common';\nimport { normalizeKey } from '../utils/mixins';\nimport EditorModel from '../editor/model/Editor';\nimport Category, { CategoryProperties } from './ModuleCategory';\n\ntype CategoryCollectionParams = ConstructorParameters>;\n\ninterface CategoryOptions {\n events?: { update?: string };\n em?: EditorModel;\n}\n\nexport default class Categories extends Collection {\n constructor(models?: CategoryCollectionParams[0], opts: CategoryOptions = {}) {\n super(models, opts);\n const { events, em } = opts;\n const evUpdate = events?.update;\n if (em) {\n evUpdate &&\n this.on('change', (category, options) =>\n em.trigger(evUpdate, { category, changes: category.changedAttributes(), options })\n );\n }\n }\n\n /** @ts-ignore */\n add(model: (CategoryProperties | Category)[] | CategoryProperties | Category, opts?: AddOptions) {\n const models = isArray(model) ? model : [model];\n models.forEach(md => md && (md.id = normalizeKey(`${md.id}`)));\n return super.add(model, opts);\n }\n\n get(id: string | Category) {\n return super.get(isString(id) ? normalizeKey(id) : id);\n }\n}\n\nCategories.prototype.model = Category;\n","import { CategoryProperties, ItemsByCategory } from '../abstract/ModuleCategory';\nimport Component from '../dom_components/model/Component';\nimport Editor from '../editor';\nimport EditorModel from '../editor/model/Editor';\nimport { TraitManagerConfig } from './config/config';\nimport Trait from './model/Trait';\nimport TraitView from './view/TraitView';\n\nexport interface TraitViewTypes {\n [id: string]: { new (o: any): TraitView };\n}\n\nexport interface ITraitView {\n noLabel?: TraitView['noLabel'];\n eventCapture?: TraitView['eventCapture'];\n templateInput?: TraitView['templateInput'];\n onEvent?: TraitView['onEvent'];\n onUpdate?: TraitView['onUpdate'];\n createInput?: TraitView['createInput'];\n createLabel?: TraitView['createLabel'];\n}\n\nexport type CustomTrait = ITraitView & T & ThisType;\n\nexport interface TraitModuleStateProps {\n component?: Component;\n traits: Trait[];\n}\n\nexport interface TraitsByCategory extends ItemsByCategory {}\n\nexport interface TraitManagerConfigModule extends TraitManagerConfig {\n pStylePrefix?: string;\n em: EditorModel;\n}\n\nexport interface TraitCustomData {\n container?: HTMLElement;\n}\n\nexport interface TraitProperties {\n /**\n * Trait type, defines how the trait should be rendered.\n * Possible values: `text` (default), `number`, `select`, `checkbox`, `color`, `button`\n */\n type?: string;\n\n /**\n * The name of the trait used as a key for the attribute/property.\n * By default, the name is used as attribute name or property in case `changeProp` in enabled.\n */\n name?: string;\n\n /**\n * Trait id, eg. `my-trait-id`.\n * If not specified, the `name` will be used as id.\n */\n id?: string | number;\n\n /**\n * Trait category.\n * @default ''\n */\n category?: string | CategoryProperties;\n\n /**\n * The trait label to show for the rendered trait.\n */\n label?: string | false;\n\n /**\n * If `true`, the trait value is applied on the component property, otherwise, on component attributes.\n * @default false\n */\n changeProp?: boolean;\n\n /**\n * Instead of relying on component props/attributes, define your own\n * logic on how to get the trait value.\n */\n getValue?: (props: { editor: Editor; trait: Trait; component: Component }) => any;\n\n /**\n * In conjunction with the `getValue`, define your own logic for updating the trait value.\n */\n setValue?: (props: {\n value: any;\n editor: Editor;\n trait: Trait;\n component: Component;\n partial: boolean;\n options: TraitSetValueOptions;\n emitUpdate: () => void;\n }) => void;\n\n /**\n * Custom true value for checkbox type.\n * @default 'true'\n */\n valueTrue?: string;\n\n /**\n * Custom false value for checkbox type.\n * * @default 'false'\n */\n valueFalse?: string;\n\n /**\n * Minimum number value for number type.\n */\n min?: number;\n\n /**\n * Maximum number value for number type.\n */\n max?: number;\n unit?: string;\n\n /**\n * Number of steps for number type.\n */\n step?: number;\n value?: any;\n target?: Component;\n default?: any;\n\n /**\n * Placeholder to show inside the default input (if the UI type allows it).\n */\n placeholder?: string;\n\n /**\n * Array of options for the select type.\n */\n options?: TraitOption[];\n\n /**\n * Label text to use for the button type.\n */\n text?: string;\n labelButton?: string;\n\n /**\n * Command to use for the button type.\n */\n command?: string | ((editor: Editor, trait: Trait) => any);\n\n full?: boolean;\n attributes?: Record;\n}\n\nexport interface TraitSetValueOptions {\n partial?: boolean;\n [key: string]: unknown;\n}\n\nexport interface TraitGetValueOptions {\n /**\n * Get the value based on type.\n * With this option enabled, the returned value is normalized based on the\n * trait type (eg. the checkbox will always return a boolean).\n * @default false\n */\n useType?: boolean;\n}\n\nexport interface TraitOption {\n id: string;\n label?: string;\n [key: string]: unknown;\n}\n\nexport type TraitsEvent = `${TraitsEvents}`;\n\n/**{START_EVENTS}*/\nexport enum TraitsEvents {\n /**\n * @event `trait:select` New traits selected (eg. by changing a component).\n * @example\n * editor.on('trait:select', ({ traits, component }) => { ... });\n */\n select = 'trait:select',\n\n /**\n * @event `trait:value` Trait value updated.\n * @example\n * editor.on('trait:value', ({ trait, component, value }) => { ... });\n */\n value = 'trait:value',\n\n /**\n * @event `trait:category:update` Trait category updated.\n * @example\n * editor.on('trait:category:update', ({ category, changes }) => { ... });\n */\n categoryUpdate = 'trait:category:update',\n\n /**\n * @event `trait:custom` Event to use in case of [custom Trait Manager UI](https://grapesjs.com/docs/modules/Traits.html#custom-trait-manager).\n * @example\n * editor.on('trait:custom', ({ container }) => { ... });\n */\n custom = 'trait:custom',\n\n /**\n * @event `trait` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * @example\n * editor.on('trait', ({ event, model, ... }) => { ... });\n */\n all = 'trait',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default TraitsEvents;\n","import { isString, isUndefined } from 'underscore';\nimport Category from '../../abstract/ModuleCategory';\nimport { LocaleOptions, Model, SetOptions } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport EditorModel from '../../editor/model/Editor';\nimport { isDef } from '../../utils/mixins';\nimport TraitsEvents, { TraitGetValueOptions, TraitOption, TraitProperties, TraitSetValueOptions } from '../types';\nimport TraitView from '../view/TraitView';\nimport Traits from './Traits';\n\n/**\n * @property {String} id Trait id, eg. `my-trait-id`.\n * @property {String} type Trait type, defines how the trait should be rendered. Possible values: `text` (default), `number`, `select`, `checkbox`, `color`, `button`\n * @property {String} label The trait label to show for the rendered trait.\n * @property {String} name The name of the trait used as a key for the attribute/property. By default, the name is used as attribute name or property in case `changeProp` in enabled.\n * @property {String} default Default value to use in case the value is not defined on the component.\n * @property {String} placeholder Placeholder to show inside the default input (if the UI type allows it).\n * @property {String} [category=''] Trait category.\n * @property {Boolean} changeProp If `true`, the trait value is applied on the component property, otherwise, on component attributes.\n *\n * @module docsjs.Trait\n *\n */\nexport default class Trait extends Model {\n target!: Component;\n em: EditorModel;\n view?: TraitView;\n el?: HTMLElement;\n\n defaults() {\n return {\n type: 'text',\n label: '',\n name: '',\n unit: '',\n step: 1,\n value: '',\n default: '',\n placeholder: '',\n category: '',\n changeProp: false,\n options: [],\n };\n }\n\n constructor(prop: TraitProperties, em: EditorModel) {\n super(prop);\n const { target, name } = this.attributes;\n !this.get('id') && this.set('id', name);\n if (target) {\n this.setTarget(target);\n }\n this.em = em;\n }\n\n get parent() {\n return this.collection as unknown as Traits;\n }\n\n get category(): Category | undefined {\n const cat = this.get('category');\n return cat instanceof Category ? cat : undefined;\n }\n\n get component() {\n return this.target;\n }\n\n get changeProp() {\n return !!this.get('changeProp');\n }\n\n setTarget(component: Component) {\n if (component) {\n const { name, changeProp, value: initValue, getValue } = this.attributes;\n this.target = component;\n this.unset('target');\n const targetEvent = changeProp ? `change:${name}` : `change:attributes:${name}`;\n this.listenTo(component, targetEvent, this.targetUpdated);\n const value =\n initValue ||\n // Avoid the risk of loops in case the trait has a custom getValue\n (!getValue ? this.getValue() : undefined);\n !isUndefined(value) && this.set({ value }, { silent: true });\n }\n }\n\n /**\n * Get the trait id.\n * @returns {String}\n */\n getId() {\n return this.get('id')!;\n }\n\n /**\n * Get the trait type.\n * @returns {String}\n */\n getType() {\n return this.get('type')!;\n }\n\n /**\n * Get the trait name.\n * @returns {String}\n */\n getName() {\n return this.get('name')!;\n }\n\n /**\n * Get the trait label.\n * @param {Object} [opts={}] Options.\n * @param {Boolean} [opts.locale=true] Use the locale string from i18n module.\n * @returns {String}\n */\n getLabel(opts: { locale?: boolean } = {}) {\n const { locale = true } = opts;\n const id = this.getId();\n const name = this.get('label') || this.getName();\n return (locale && this.em?.t(`traitManager.traits.labels.${id}`)) || name;\n }\n\n /**\n * Get the trait value.\n * The value is taken from component attributes by default or from properties if the trait has the `changeProp` enabled.\n * @param {Object} [opts={}] Options.\n * @param {Boolean} [opts.useType=false] Get the value based on type (eg. the checkbox will always return a boolean).\n * @returns {any}\n */\n getValue(opts?: TraitGetValueOptions) {\n return this.getTargetValue(opts);\n }\n\n /**\n * Update the trait value.\n * The value is applied on component attributes by default or on properties if the trait has the `changeProp` enabled.\n * @param {any} value Value of the trait.\n * @param {Object} [opts={}] Options.\n * @param {Boolean} [opts.partial] If `true` the update won't be considered complete (not stored in UndoManager).\n */\n setValue(value: any, opts: TraitSetValueOptions = {}) {\n const { component, em } = this;\n const { partial } = opts;\n const valueOpts: { avoidStore?: boolean } = {};\n const { setValue } = this.attributes;\n\n if (setValue) {\n setValue({\n value,\n component,\n editor: em?.getEditor()!,\n trait: this,\n partial: !!partial,\n options: opts,\n emitUpdate: () => this.targetUpdated(),\n });\n return;\n }\n\n if (partial) {\n valueOpts.avoidStore = true;\n }\n\n this.setTargetValue(value, valueOpts);\n }\n\n /**\n * Get default value.\n */\n getDefault() {\n return this.get('default');\n }\n\n /**\n * Get trait options.\n */\n getOptions(): TraitOption[] {\n return this.get('options') || [];\n }\n\n /**\n * Get current selected option or by id.\n * @param {String} [id] Option id.\n * @returns {Object | null}\n */\n getOption(id?: string): TraitOption | undefined {\n const idSel = isDef(id) ? id : this.getValue();\n return this.getOptions().filter(o => this.getOptionId(o) === idSel)[0];\n }\n\n /**\n * Get the option id from the option object.\n * @param {Object} option Option object\n * @returns {String} Option id\n */\n getOptionId(option: TraitOption): string {\n return option.id || (option.value as string);\n }\n\n /**\n * Get option label.\n * @param {String|Object} id Option id or the option object\n * @param {Object} [opts={}] Options\n * @param {Boolean} [opts.locale=true] Use the locale string from i18n module\n * @returns {String} Option label\n */\n getOptionLabel(id: string | TraitOption, opts: LocaleOptions = {}): string {\n const { locale = true } = opts;\n const option = (isString(id) ? this.getOption(id) : id)!;\n const optId = this.getOptionId(option);\n const label = option.label || (option as any).name || optId;\n const propName = this.getName();\n return (locale && this.em?.t(`traitManager.traits.options.${propName}.${optId}`)) || label;\n }\n\n /**\n * Get category label.\n * @param {Object} [opts={}] Options.\n * @param {Boolean} [opts.locale=true] Use the locale string from i18n module.\n * @returns {String}\n */\n getCategoryLabel(opts: LocaleOptions = {}): string {\n const { em, category } = this;\n const { locale = true } = opts;\n const catId = category?.getId();\n const catLabel = category?.getLabel();\n return (locale && em?.t(`traitManager.categories.${catId}`)) || catLabel || '';\n }\n\n /**\n * Run the trait command (used on the button trait type).\n */\n runCommand() {\n const { em } = this;\n const { command } = this.attributes;\n\n if (command && em) {\n if (isString(command)) {\n return em.Commands.run(command);\n } else {\n return command(em.Editor, this);\n }\n }\n }\n\n props() {\n return this.attributes;\n }\n\n targetUpdated() {\n const { component, em } = this;\n const value = this.getTargetValue({ useType: true });\n this.set({ value }, { fromTarget: 1 });\n const props = { trait: this, component, value };\n component.trigger(TraitsEvents.value, props);\n em?.trigger(TraitsEvents.value, props);\n // This should be triggered for any trait prop change\n em?.trigger('trait:update', props);\n }\n\n getTargetValue(opts: TraitGetValueOptions = {}) {\n const { component, em } = this;\n const name = this.getName();\n const getValue = this.get('getValue');\n let value;\n\n if (getValue) {\n value = getValue({\n editor: em?.getEditor()!,\n trait: this,\n component,\n });\n } else if (this.changeProp) {\n value = component.get(name);\n } else {\n value = component.getAttributes()[name];\n }\n\n if (opts.useType) {\n const type = this.getType();\n if (type === 'checkbox') {\n const { valueTrue, valueFalse } = this.attributes;\n\n if (!isUndefined(valueTrue) && valueTrue === value) {\n value = true;\n } else if (!isUndefined(valueFalse) && valueFalse === value) {\n value = false;\n }\n }\n }\n\n return !isUndefined(value) ? value : '';\n }\n\n setTargetValue(value: any, opts: SetOptions = {}) {\n const { component, attributes } = this;\n const name = this.getName();\n if (isUndefined(value)) return;\n let valueToSet = value;\n\n if (value === 'false') {\n valueToSet = false;\n } else if (value === 'true') {\n valueToSet = true;\n }\n\n if (this.getType() === 'checkbox') {\n const { valueTrue, valueFalse } = attributes;\n\n if (valueToSet && !isUndefined(valueTrue)) {\n valueToSet = valueTrue;\n }\n\n if (!valueToSet && !isUndefined(valueFalse)) {\n valueToSet = valueFalse;\n }\n }\n\n const props = { [name]: valueToSet };\n // This is required for the UndoManager to properly detect changes\n props.__p = opts.avoidStore ? null : undefined;\n\n if (this.changeProp) {\n component.set(props, opts);\n } else {\n component.addAttributes(props, opts);\n }\n }\n\n setValueFromInput(value: any, final = true, opts: SetOptions = {}) {\n const toSet = { value };\n this.set(toSet, { ...opts, avoidStore: 1 });\n\n // Have to trigger the change\n if (final) {\n this.set('value', '', opts);\n this.set(toSet, opts);\n }\n }\n\n getInitValue() {\n const { component } = this;\n const name = this.getName();\n let value;\n\n if (component) {\n const attrs = component.get('attributes')!;\n value = this.changeProp ? component.get(name) : attrs[name];\n }\n\n return value || this.get('value') || this.get('default');\n }\n}\n","import { isString } from 'underscore';\nimport EditorModel from '../../editor/model/Editor';\nimport { TraitManagerConfig } from '../config/config';\nimport { TraitProperties } from '../types';\nimport Trait from './Trait';\n\nexport default class TraitFactory {\n config: Partial;\n\n constructor(config: Partial = {}) {\n this.config = config;\n }\n\n /**\n * Build props object by their name\n */\n build(prop: string | TraitProperties, em: EditorModel): Trait {\n return isString(prop) ? this.buildFromString(prop, em) : new Trait(prop, em);\n }\n\n private buildFromString(name: string, em: EditorModel): Trait {\n const obj: TraitProperties = {\n name: name,\n type: 'text',\n };\n\n switch (name) {\n case 'target':\n obj.type = 'select';\n obj.default = false;\n obj.options = this.config.optionsTarget as any;\n break;\n }\n return new Trait(obj, em);\n }\n}\n","import { isArray } from 'underscore';\nimport TraitManager from '..';\nimport { CollectionWithCategories } from '../../abstract/CollectionWithCategories';\nimport Categories from '../../abstract/ModuleCategories';\nimport { AddOptions } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport EditorModel from '../../editor/model/Editor';\nimport TraitsEvents, { TraitProperties } from '../types';\nimport Trait from './Trait';\nimport TraitFactory from './TraitFactory';\n\nexport default class Traits extends CollectionWithCategories {\n em: EditorModel;\n target!: Component;\n tf: TraitFactory;\n categories = new Categories();\n\n constructor(coll: TraitProperties[], options: { em: EditorModel }) {\n super(coll);\n const { em } = options;\n this.em = em;\n this.categories = new Categories([], {\n em,\n events: { update: TraitsEvents.categoryUpdate },\n });\n this.on('add', this.handleAdd);\n this.on('reset', this.handleReset);\n const tm = this.module;\n const tmOpts = tm?.getConfig();\n this.tf = new TraitFactory(tmOpts);\n }\n\n get module(): TraitManager {\n return this.em.Traits;\n }\n\n getCategories() {\n return this.categories;\n }\n\n handleReset(coll: TraitProperties[], { previousModels = [] }: { previousModels?: Trait[] } = {}) {\n previousModels.forEach(model => model.trigger('remove'));\n }\n\n handleAdd(model: Trait) {\n model.em = this.em;\n const target = this.target;\n\n if (target) {\n model.target = target;\n }\n\n this.initCategory(model);\n }\n\n setTarget(target: Component) {\n this.target = target;\n this.models.forEach(trait => trait.setTarget(target));\n }\n\n add(model: string | TraitProperties | Trait, options?: AddOptions): Trait;\n add(models: Array, options?: AddOptions): Trait[];\n add(models: unknown, opt?: AddOptions): any {\n if (models == undefined) {\n return undefined;\n }\n const { target, em } = this;\n\n if (isArray(models)) {\n var traits: Trait[] = [];\n for (var i = 0, len = models.length; i < len; i++) {\n const trait = models[i];\n traits[i] = trait instanceof Trait ? trait : this.tf.build(trait, em);\n traits[i].setTarget(target);\n }\n return super.add(traits, opt);\n }\n const trait = models instanceof Trait ? models : this.tf.build(models as any, em);\n trait.setTarget(target);\n\n return super.add(trait, opt);\n }\n}\n","import {\n isUndefined,\n isFunction,\n isArray,\n isEmpty,\n isBoolean,\n has,\n isString,\n forEach,\n result,\n bindAll,\n keys,\n} from 'underscore';\nimport { shallowDiff, capitalize, isEmptyObj, isObject, toLowerCase } from '../../utils/mixins';\nimport StyleableModel, { StyleProps, UpdateStyleOptions } from '../../domain_abstract/model/StyleableModel';\nimport { Model } from 'backbone';\nimport Components from './Components';\nimport Selector from '../../selector_manager/model/Selector';\nimport Selectors from '../../selector_manager/model/Selectors';\nimport Traits from '../../trait_manager/model/Traits';\nimport EditorModel from '../../editor/model/Editor';\nimport {\n AddComponentsOption,\n ComponentAdd,\n ComponentDefinition,\n ComponentDefinitionDefined,\n ComponentOptions,\n ComponentProperties,\n DragMode,\n SymbolToUpOptions,\n ToHTMLOptions,\n} from './types';\nimport Frame from '../../canvas/model/Frame';\nimport { DomComponentsConfig } from '../config/config';\nimport ComponentView from '../view/ComponentView';\nimport { AddOptions, ExtractMethods, ObjectAny, PrevToNewIdMap, SetOptions } from '../../common';\nimport CssRule, { CssRuleJSON } from '../../css_composer/model/CssRule';\nimport Trait from '../../trait_manager/model/Trait';\nimport { ToolbarButtonProps } from './ToolbarButton';\nimport { TraitProperties } from '../../trait_manager/types';\nimport { ActionLabelComponents, ComponentsEvents } from '../types';\nimport ItemView from '../../navigator/view/ItemView';\nimport {\n getSymbolMain,\n getSymbolInstances,\n initSymbol,\n isSymbol,\n isSymbolMain,\n isSymbolRoot,\n updateSymbolCls,\n updateSymbolComps,\n updateSymbolProps,\n} from './SymbolUtils';\n\nexport interface IComponent extends ExtractMethods {}\n\nexport interface SetAttrOptions extends SetOptions, UpdateStyleOptions {}\n\nconst escapeRegExp = (str: string) => {\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n};\n\nexport const avoidInline = (em: EditorModel) => !!em?.getConfig().avoidInlineStyle;\n\nexport const eventDrag = 'component:drag';\nexport const keySymbols = '__symbols';\nexport const keySymbol = '__symbol';\nexport const keySymbolOvrd = '__symbol_ovrd';\nexport const keyUpdate = ComponentsEvents.update;\nexport const keyUpdateInside = ComponentsEvents.updateInside;\n\n/**\n * The Component object represents a single node of our template structure, so when you update its properties the changes are\n * immediately reflected on the canvas and in the code to export (indeed, when you ask to export the code we just go through all\n * the tree of nodes).\n * An example on how to update properties:\n * ```js\n * component.set({\n * tagName: 'span',\n * attributes: { ... },\n * removable: false,\n * });\n * component.get('tagName');\n * // -> 'span'\n * ```\n *\n * [Component]: component.html\n *\n * @property {String} [type=''] Component type, eg. `text`, `image`, `video`, etc.\n * @property {String} [tagName='div'] HTML tag of the component, eg. `span`. Default: `div`\n * @property {Object} [attributes={}] Key-value object of the component's attributes, eg. `{ title: 'Hello' }` Default: `{}`\n * @property {String} [name=''] Name of the component. Will be used, for example, in Layers and badges\n * @property {Boolean} [removable=true] When `true` the component is removable from the canvas, default: `true`\n * @property {Boolean|String|Function} [draggable=true] Indicates if it's possible to drag the component inside others.\n * You can also specify a query string to indentify elements,\n * eg. `'.some-class[title=Hello], [data-gjs-type=column]'` means you can drag the component only inside elements\n * containing `some-class` class and `Hello` title, and `column` components. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drag is possible. Default: `true`\n * @property {Boolean|String|Function} [droppable=true] Indicates if it's possible to drop other components inside. You can use\n * a query string as with `draggable`. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drop is possible. Default: `true`\n * @property {Boolean} [badgable=true] Set to false if you don't want to see the badge (with the name) over the component. Default: `true`\n * @property {Boolean|Array} [stylable=true] True if it's possible to style the component.\n * You can also indicate an array of CSS properties which is possible to style, eg. `['color', 'width']`, all other properties\n * will be hidden from the style manager. Default: `true`\n * @property {Array} [stylable-require=[]] Indicate an array of style properties to show up which has been marked as `toRequire`. Default: `[]`\n * @property {Array} [unstylable=[]] Indicate an array of style properties which should be hidden from the style manager. Default: `[]`\n * @property {Boolean} [highlightable=true] It can be highlighted with 'dotted' borders if true. Default: `true`\n * @property {Boolean} [copyable=true] True if it's possible to clone the component. Default: `true`\n * @property {Boolean} [resizable=false] Indicates if it's possible to resize the component. It's also possible to pass an object as [options for the Resizer](https://github.com/GrapesJS/grapesjs/blob/master/src/utils/Resizer.ts). Default: `false`\n * @property {Boolean} [editable=false] Allow to edit the content of the component (used on Text components). Default: `false`\n * @property {Boolean} [layerable=true] Set to `false` if you need to hide the component inside Layers. Default: `true`\n * @property {Boolean} [selectable=true] Allow component to be selected when clicked. Default: `true`\n * @property {Boolean} [hoverable=true] Shows a highlight outline when hovering on the element if `true`. Default: `true`\n * @property {Boolean} [locked] Disable the selection of the component and its children in the canvas. You can unlock a children by setting its locked property to `false`. Default: `undefined`\n * @property {Boolean} [void=false] This property is used by the HTML exporter as void elements don't have closing tags, eg. `
`, `
`, etc. Default: `false`\n * @property {Object} [style={}] Component default style, eg. `{ width: '100px', height: '100px', 'background-color': 'red' }`\n * @property {String} [styles=''] Component related styles, eg. `.my-component-class { color: red }`\n * @property {String} [content=''] Content of the component (not escaped) which will be appended before children rendering. Default: `''`\n * @property {String} [icon=''] Component's icon, this string will be inserted before the name (in Layers and badge), eg. it can be an HTML string ''. Default: `''`\n * @property {String|Function} [script=''] Component's javascript. More about it [here](/modules/Components-js.html). Default: `''`\n * @property {String|Function} [script-export=''] You can specify javascript available only in export functions (eg. when you get the HTML).\n * If this property is defined it will overwrite the `script` one (in export functions). Default: `''`\n * @property {Array} [traits=''] Component's traits. More about it [here](/modules/Traits.html). Default: `['id', 'title']`\n * @property {Array} [propagate=[]] Indicates an array of properties which will be inhereted by all NEW appended children.\n * For example if you create a component likes this: `{ removable: false, draggable: false, propagate: ['removable', 'draggable'] }`\n * and append some new component inside, the new added component will get the exact same properties indicated in the `propagate` array (and the `propagate` property itself). Default: `[]`\n * @property {Array} [toolbar=null] Set an array of items to show up inside the toolbar when the component is selected (move, clone, delete).\n * Eg. `toolbar: [ { attributes: {class: 'fa fa-arrows'}, command: 'tlb-move' }, ... ]`.\n * By default, when `toolbar` property is falsy the editor will add automatically commands `core:component-exit` (select parent component, added if there is one), `tlb-move` (added if `draggable`) , `tlb-clone` (added if `copyable`), `tlb-delete` (added if `removable`).\n * @property {Collection} [components=null] Children components. Default: `null`\n * @property {Object} [delegate=null] Delegate commands to other components. Available commands `remove` | `move` | `copy` | `select`. eg. `{ remove: (cmp) => cmp.closestType('other-type') }`\n *\n * @module docsjs.Component\n */\nexport default class Component extends StyleableModel {\n /**\n * @private\n * @ts-ignore */\n get defaults(): ComponentDefinitionDefined {\n return {\n tagName: 'div',\n type: '',\n name: '',\n removable: true,\n draggable: true,\n droppable: true,\n badgable: true,\n stylable: true,\n 'stylable-require': '',\n 'style-signature': '',\n unstylable: '',\n highlightable: true,\n copyable: true,\n resizable: false,\n editable: false,\n layerable: true,\n selectable: true,\n hoverable: true,\n void: false,\n state: '', // Indicates if the component is in some CSS state like ':hover', ':active', etc.\n status: '', // State, eg. 'selected'\n content: '',\n icon: '',\n style: '',\n styles: '', // Component related styles\n classes: '', // Array of classes\n script: '',\n 'script-props': '',\n 'script-export': '',\n attributes: {},\n traits: ['id', 'title'],\n propagate: '',\n dmode: '',\n toolbar: null,\n delegate: null,\n [keySymbol]: 0,\n [keySymbols]: 0,\n [keySymbolOvrd]: 0,\n _undo: true,\n _undoexc: ['status', 'open'],\n };\n }\n\n get tagName() {\n return this.get('tagName')!;\n }\n\n get classes() {\n return this.get('classes')!;\n }\n\n get traits() {\n return this.get('traits')!;\n }\n\n get content() {\n return this.get('content') ?? '';\n }\n\n get toolbar() {\n return this.get('toolbar') || [];\n }\n\n get resizable() {\n return this.get('resizable')!;\n }\n\n get delegate() {\n return this.get('delegate');\n }\n\n get locked() {\n return this.get('locked');\n }\n\n /**\n * Hook method, called once the model is created\n */\n init() {}\n\n /**\n * Hook method, called when the model has been updated (eg. updated some model's property)\n * @param {String} property Property name, if triggered after some property update\n * @param {*} value Property value, if triggered after some property update\n * @param {*} previous Property previous value, if triggered after some property update\n */\n updated(property: string, value: any, previous: any) {}\n\n /**\n * Hook method, called once the model has been removed\n */\n removed() {}\n\n em!: EditorModel;\n opt!: ComponentOptions;\n config!: DomComponentsConfig;\n ccid!: string;\n views!: ComponentView[];\n view?: ComponentView;\n viewLayer?: ItemView;\n frame?: Frame;\n rule?: CssRule;\n prevColl?: Components;\n __hasUm?: boolean;\n __symbReady?: boolean;\n /**\n * @private\n * @ts-ignore */\n collection!: Components;\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n bindAll(this, '__upSymbProps', '__upSymbCls', '__upSymbComps');\n const em = opt.em;\n\n // Propagate properties from parent if indicated\n const parent = this.parent();\n const parentAttr = parent?.attributes;\n const propagate = this.get('propagate');\n propagate && this.set('propagate', isArray(propagate) ? propagate : [propagate]);\n\n if (parentAttr && parentAttr.propagate && !propagate) {\n const newAttr: Partial = {};\n const toPropagate = parentAttr.propagate;\n toPropagate.forEach(prop => (newAttr[prop] = parent.get(prop as string)));\n newAttr.propagate = toPropagate;\n this.set({ ...newAttr, ...props });\n }\n\n // Check void elements\n if (opt && opt.config && opt.config.voidElements!.indexOf(this.get('tagName')!) >= 0) {\n this.set('void', true);\n }\n\n opt.em = em;\n this.opt = opt;\n this.em = em!;\n this.frame = opt.frame;\n this.config = opt.config || {};\n this.set('attributes', {\n ...(result(this, 'defaults').attributes || {}),\n ...(this.get('attributes') || {}),\n });\n this.ccid = Component.createId(this, opt);\n this.initClasses();\n this.initComponents();\n this.initTraits();\n this.initToolbar();\n this.initScriptProps();\n this.listenTo(this, 'change:script', this.scriptUpdated);\n this.listenTo(this, 'change:tagName', this.tagUpdated);\n this.listenTo(this, 'change:attributes', this.attrUpdated);\n this.listenTo(this, 'change:attributes:id', this._idUpdated);\n this.on('change:toolbar', this.__emitUpdateTlb);\n this.on('change', this.__onChange);\n this.on(keyUpdateInside, this.__propToParent);\n this.set('status', '');\n this.views = [];\n\n // Register global updates for collection properties\n ['classes', 'traits', 'components'].forEach(name => {\n const events = `add remove ${name !== 'components' ? 'change' : ''}`;\n this.listenTo(this.get(name), events.trim(), (...args) => this.emitUpdate(name, ...args));\n });\n\n if (!opt.temporary) {\n // Add component styles\n const cssc = em && em.Css;\n const { styles, type } = this.attributes;\n if (styles && cssc) {\n cssc.addCollection(styles, { avoidUpdateStyle: true }, { group: `cmp:${type}` });\n }\n\n this.__postAdd();\n this.init();\n isSymbol(this) && initSymbol(this);\n em?.trigger(ComponentsEvents.create, this, opt);\n }\n }\n\n __postAdd(opts: { recursive?: boolean } = {}) {\n const { em } = this;\n const um = em?.UndoManager;\n const comps = this.components();\n if (um && !this.__hasUm) {\n um.add(comps);\n um.add(this.getSelectors());\n this.__hasUm = true;\n }\n opts.recursive && comps.map(c => c.__postAdd(opts));\n }\n\n __postRemove() {\n const { em } = this;\n const um = em?.get('UndoManager');\n if (um) {\n um.remove(this.components());\n um.remove(this.getSelectors());\n delete this.__hasUm;\n }\n }\n\n __onChange(m: any, opts: any) {\n const changed = this.changedAttributes() || {};\n keys(changed).forEach(prop => this.emitUpdate(prop));\n ['status', 'open', 'toolbar', 'traits'].forEach(name => delete changed[name]);\n // Propagate component prop changes\n if (!isEmptyObj(changed)) {\n this.__changesUp(opts);\n this.__propSelfToParent({ component: this, changed, options: opts });\n }\n }\n\n __onStyleChange(newStyles: StyleProps) {\n const { em } = this;\n if (!em) return;\n\n const event = 'component:styleUpdate';\n const styleKeys = keys(newStyles);\n const pros = { style: newStyles };\n\n em.trigger(event, this, pros);\n styleKeys.forEach(key => em.trigger(`${event}:${key}`, this, pros));\n }\n\n __changesUp(opts: any) {\n const { em, frame } = this;\n [frame, em].forEach(md => md && md.changesUp(opts));\n }\n\n __propSelfToParent(props: any) {\n this.trigger(keyUpdate, props);\n this.__propToParent(props);\n }\n\n __propToParent(props: any) {\n const parent = this.parent();\n parent && parent.trigger(keyUpdateInside, props);\n }\n\n __emitUpdateTlb() {\n this.emitUpdate('toolbar');\n }\n\n __getAllById() {\n const { em } = this;\n return em ? em.Components.allById() : {};\n }\n\n __upSymbProps(m: any, opts: SymbolToUpOptions = {}) {\n updateSymbolProps(this, opts);\n }\n\n __upSymbCls(m: any, c: any, opts = {}) {\n updateSymbolCls(this, opts);\n }\n\n __upSymbComps(m: Component, c: Components, o: any) {\n updateSymbolComps(this, m, c, o);\n }\n\n /**\n * Check component's type\n * @param {string} type Component type\n * @return {Boolean}\n * @example\n * component.is('image')\n * // -> false\n */\n is(type: string) {\n return !!(this.get('type') == type);\n }\n\n /**\n * Return all the propeties\n * @returns {Object}\n */\n props() {\n return this.attributes;\n }\n\n /**\n * Get the index of the component in the parent collection.\n * @return {Number}\n */\n index() {\n const { collection } = this;\n return collection ? collection.indexOf(this) : 0;\n }\n\n /**\n * Change the drag mode of the component.\n * To get more about this feature read: https://github.com/GrapesJS/grapesjs/issues/1936\n * @param {String} value Drag mode, options: `'absolute'` | `'translate'` | `''`\n * @returns {this}\n */\n setDragMode(value?: DragMode) {\n return this.set('dmode', value);\n }\n\n /**\n * Get the drag mode of the component.\n * @returns {String} Drag mode value, options: `'absolute'` | `'translate'` | `''`\n */\n getDragMode(): DragMode {\n return this.get('dmode') || '';\n }\n\n /**\n * Set symbol override.\n * By setting override to `true`, none of its property changes will be propagated to relative symbols.\n * By setting override to specific properties, changes of those properties will be skipped from propagation.\n * @param {Boolean|String|Array} value\n * @example\n * component.setSymbolOverride(['children', 'classes']);\n */\n setSymbolOverride(value?: boolean | string | string[]) {\n this.set(keySymbolOvrd, (isString(value) ? [value] : value) ?? 0);\n }\n\n /**\n * Get symbol override value.\n * @returns {Boolean|Array}\n */\n getSymbolOverride(): boolean | string[] | undefined {\n return this.get(keySymbolOvrd);\n }\n\n /**\n * Find inner components by query string.\n * **ATTENTION**: this method works only with already rendered component\n * @param {String} query Query string\n * @return {Array} Array of components\n * @example\n * component.find('div > .class');\n * // -> [Component, Component, ...]\n */\n find(query: string) {\n const result: Component[] = [];\n const $els = this.view?.$el.find(query);\n $els?.each(i => {\n const $el = $els.eq(i);\n const model = $el.data('model');\n model && result.push(model);\n });\n\n return result;\n }\n\n /**\n * Find all inner components by component type.\n * The advantage of this method over `find` is that you can use it\n * also before rendering the component\n * @param {String} type Component type\n * @returns {Array}\n * @example\n * const allImages = component.findType('image');\n * console.log(allImages[0]) // prints the first found component\n */\n findType(type: string) {\n const result: Component[] = [];\n const find = (components: Components) =>\n components.forEach(item => {\n item.is(type) && result.push(item);\n find(item.components());\n });\n find(this.components());\n return result;\n }\n\n /**\n * Find the closest parent component by query string.\n * **ATTENTION**: this method works only with already rendered component\n * @param {string} query Query string\n * @return {Component}\n * @example\n * component.closest('div.some-class');\n * // -> Component\n */\n closest(query: string) {\n const result = this.view?.$el.closest(query);\n return result?.length ? (result.data('model') as Component) : undefined;\n }\n\n /**\n * Find the closest parent component by its type.\n * The advantage of this method over `closest` is that you can use it\n * also before rendering the component\n * @param {String} type Component type\n * @returns {Component} Found component, otherwise `undefined`\n * @example\n * const Section = component.closestType('section');\n * console.log(Section);\n */\n closestType(type: string) {\n let parent = this.parent();\n\n while (parent && !parent.is(type)) {\n parent = parent.parent();\n }\n\n return parent;\n }\n\n /**\n * The method returns a Boolean value indicating whether the passed\n * component is a descendant of a given component\n * @param {Component} component Component to check\n * @returns {Boolean}\n */\n contains(component: Component) {\n let result = !1;\n if (!component) return result;\n const contains = (components: Components) => {\n !result &&\n components.forEach(item => {\n if (item === component) result = !0;\n !result && contains(item.components());\n });\n };\n contains(this.components());\n return result;\n }\n\n /**\n * Once the tag is updated I have to rerender the element\n * @private\n */\n tagUpdated() {\n this.trigger('rerender');\n }\n\n /**\n * Replace a component with another one\n * @param {String|Component} el Component or HTML string\n * @param {Object} [opts={}] Options for the append action\n * @returns {Array} New replaced components\n * @example\n * const result = component.replaceWith('
Some new content
');\n * // result -> [Component]\n */\n replaceWith(el: ComponentAdd, opts: AddOptions = {}): C[] {\n const coll = this.collection;\n const at = coll.indexOf(this);\n coll.remove(this);\n const result = coll.add(el, { ...opts, at }) as C | C[];\n return isArray(result) ? result : [result];\n }\n\n /**\n * Emit changes for each updated attribute\n * @private\n */\n attrUpdated(m: any, v: any, opts: SetAttrOptions = {}) {\n const attrs = this.get('attributes')!;\n // Handle classes\n const classes = attrs.class;\n classes && this.setClass(classes);\n delete attrs.class;\n\n // Handle style\n const style = attrs.style;\n style && this.setStyle(style, opts);\n delete attrs.style;\n\n const attrPrev = { ...this.previous('attributes') };\n const diff = shallowDiff(attrPrev, this.get('attributes')!);\n keys(diff).forEach(pr => {\n const attrKey = `attributes:${pr}`;\n this.trigger(`change:${attrKey}`, this, diff[pr], opts);\n this.em?.trigger(`${keyUpdate}:${attrKey}`, this, diff[pr], opts);\n });\n }\n\n /**\n * Update attributes of the component\n * @param {Object} attrs Key value attributes\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.setAttributes({ id: 'test', 'data-key': 'value' });\n */\n setAttributes(attrs: ObjectAny, opts: SetAttrOptions = {}) {\n this.set('attributes', { ...attrs }, opts);\n return this;\n }\n\n /**\n * Add attributes to the component\n * @param {Object} attrs Key value attributes\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.addAttributes({ 'data-key': 'value' });\n */\n addAttributes(attrs: ObjectAny, opts: SetAttrOptions = {}) {\n return this.setAttributes(\n {\n ...this.getAttributes({ noClass: true }),\n ...attrs,\n },\n opts\n );\n }\n\n /**\n * Remove attributes from the component\n * @param {String|Array} attrs Array of attributes to remove\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.removeAttributes('some-attr');\n * component.removeAttributes(['some-attr1', 'some-attr2']);\n */\n removeAttributes(attrs: string | string[] = [], opts: SetOptions = {}) {\n const attrArr = Array.isArray(attrs) ? attrs : [attrs];\n const compAttr = this.getAttributes();\n attrArr.map(i => delete compAttr[i]);\n return this.setAttributes(compAttr, opts);\n }\n\n /**\n * Get the style of the component\n * @return {Object}\n */\n getStyle(options: any = {}, optsAdd: any = {}) {\n const { em } = this;\n const prop = isString(options) ? options : '';\n const opts = prop ? optsAdd : options;\n\n if (avoidInline(em) && !opts.inline) {\n const state = em.get('state');\n const cc = em.Css;\n const rule = cc.getIdRule(this.getId(), { state, ...opts });\n this.rule = rule;\n\n if (rule) {\n return rule.getStyle(prop);\n }\n\n // Return empty style if not rule have been found. We cannot return inline style with the next return\n // because else on load inline style is set a #id or .class style\n return {};\n }\n\n return super.getStyle.call(this, prop);\n }\n\n /**\n * Set the style on the component\n * @param {Object} prop Key value style object\n * @return {Object}\n * @example\n * component.setStyle({ color: 'red' });\n */\n setStyle(prop: StyleProps = {}, opts: UpdateStyleOptions = {}) {\n const { opt, em } = this;\n\n if (avoidInline(em) && !opt.temporary && !opts.inline) {\n const style = this.get('style') || {};\n prop = isString(prop) ? this.parseStyle(prop) : prop;\n prop = { ...prop, ...style };\n const state = em.get('state');\n const cc = em.Css;\n const propOrig = this.getStyle(opts);\n this.rule = cc.setIdRule(this.getId(), prop, { state, ...opts });\n const diff = shallowDiff(propOrig, prop);\n this.set('style', '', { silent: true });\n keys(diff).forEach(pr => this.trigger(`change:style:${pr}`));\n } else {\n prop = super.setStyle.apply(this, arguments as any);\n }\n\n if (!opt.temporary) {\n this.__onStyleChange(opts.addStyle || prop);\n }\n\n return prop;\n }\n\n /**\n * Return all component's attributes\n * @return {Object}\n */\n getAttributes(opts: { noClass?: boolean; noStyle?: boolean } = {}) {\n const { em } = this;\n const classes: string[] = [];\n const attributes = { ...this.get('attributes') };\n const sm = em?.Selectors;\n const id = this.getId();\n\n // Add classes\n if (opts.noClass) {\n delete attributes.class;\n } else {\n this.classes.forEach(cls => classes.push(isString(cls) ? cls : cls.getName()));\n classes.length && (attributes.class = classes.join(' '));\n }\n\n // Add style\n if (!opts.noStyle) {\n const style = this.getStyle({ inline: true });\n if (isObject(style) && !isEmptyObj(style)) {\n attributes.style = this.styleToString({ inline: true });\n }\n }\n\n // Check if we need an ID on the component\n if (!has(attributes, 'id')) {\n let addId = false;\n\n // If we don't rely on inline styling we have to check\n // for the ID selector\n if (avoidInline(em) || !isEmpty(this.getStyle())) {\n addId = !!sm?.get(id, sm.Selector.TYPE_ID);\n }\n\n if (\n // Symbols should always have an id\n isSymbol(this) ||\n // Components with script should always have an id\n this.get('script-export') ||\n this.get('script')\n ) {\n addId = true;\n }\n\n if (addId) {\n attributes.id = id;\n }\n }\n\n return attributes;\n }\n\n /**\n * Add classes\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of added selectors\n * @example\n * model.addClass('class1');\n * model.addClass('class1 class2');\n * model.addClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n addClass(classes: string | string[]) {\n const added = this.em.Selectors.addClass(classes);\n return this.classes.add(added);\n }\n\n /**\n * Set classes (resets current collection)\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of added selectors\n * @example\n * model.setClass('class1');\n * model.setClass('class1 class2');\n * model.setClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n setClass(classes: string | string[]) {\n this.classes.reset();\n return this.addClass(classes);\n }\n\n /**\n * Remove classes\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of removed selectors\n * @example\n * model.removeClass('class1');\n * model.removeClass('class1 class2');\n * model.removeClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n removeClass(classes: string | string[]) {\n const removed: Selector[] = [];\n classes = isArray(classes) ? classes : [classes];\n const selectors = this.classes;\n const type = Selector.TYPE_CLASS;\n\n classes.forEach(classe => {\n const classes = classe.split(' ');\n classes.forEach(name => {\n const selector = selectors.where({ name, type })[0];\n selector && removed.push(selectors.remove(selector));\n });\n });\n\n return removed;\n }\n\n /**\n * Returns component's classes as an array of strings\n * @return {Array}\n */\n getClasses() {\n const attr = this.getAttributes();\n const classStr = attr.class;\n return classStr ? classStr.split(' ') : [];\n }\n\n initClasses(m?: any, c?: any, opts: any = {}) {\n const event = 'change:classes';\n const { class: attrCls, ...restAttr } = this.get('attributes') || {};\n const toListen = [this, event, this.initClasses];\n const cls = this.get('classes') || attrCls || [];\n const clsArr = isString(cls) ? cls.split(' ') : cls;\n this.stopListening(...toListen);\n const classes = this.normalizeClasses(clsArr);\n const selectors = new Selectors([]);\n this.set('classes', selectors, opts);\n selectors.add(classes);\n selectors.on('add remove reset', this.__upSymbCls);\n // Clear attributes from classes\n attrCls && classes.length && this.set('attributes', restAttr);\n // @ts-ignore\n this.listenTo(...toListen);\n return this;\n }\n\n initComponents() {\n const event = 'change:components';\n const toListen = [this, event, this.initComponents];\n this.stopListening(...toListen);\n // Have to add components after the init, otherwise the parent\n // is not visible\n const comps = new Components([], this.opt);\n comps.parent = this;\n const components = this.get('components');\n const addChild = !this.opt.avoidChildren;\n this.set('components', comps);\n addChild && components && comps.add(isFunction(components) ? components(this) : components, this.opt as any);\n comps.on('add remove reset', this.__upSymbComps);\n // @ts-ignore\n this.listenTo(...toListen);\n return this;\n }\n\n initTraits(changed?: any) {\n const { em } = this;\n const event = 'change:traits';\n this.off(event, this.initTraits);\n this.__loadTraits();\n const attrs = { ...this.get('attributes') };\n const traits = this.traits;\n traits.each(trait => {\n if (!trait.changeProp) {\n const name = trait.getName();\n const value = trait.getInitValue();\n if (name && value) attrs[name] = value;\n }\n });\n traits.length && this.set('attributes', attrs);\n this.on(event, this.initTraits);\n changed && em && em.trigger('component:toggled');\n return this;\n }\n\n initScriptProps() {\n if (this.opt.temporary) return;\n const prop = 'script-props';\n const toListen: any = [`change:${prop}`, this.initScriptProps];\n this.off(...toListen);\n const prevProps = this.previous(prop) || [];\n const newProps = this.get(prop) || [];\n const prevPropsEv = prevProps.map(e => `change:${e}`).join(' ');\n const newPropsEv = newProps.map(e => `change:${e}`).join(' ');\n prevPropsEv && this.off(prevPropsEv, this.__scriptPropsChange);\n newPropsEv && this.on(newPropsEv, this.__scriptPropsChange);\n // @ts-ignore\n this.on(...toListen);\n }\n\n __scriptPropsChange(m: any, v: any, opts: any = {}) {\n if (opts.avoidStore) return;\n this.trigger('rerender');\n }\n\n /**\n * Add new component children\n * @param {Component|String} components Component to add\n * @param {Object} [opts={}] Options for the append action\n * @return {Array} Array of appended components\n * @example\n * someComponent.get('components').length // -> 0\n * const videoComponent = someComponent.append('
')[0];\n * // This will add 2 components (`video` and `div`) to your `someComponent`\n * someComponent.get('components').length // -> 2\n * // You can pass components directly\n * otherComponent.append(otherComponent2);\n * otherComponent.append([otherComponent3, otherComponent4]);\n * // append at specific index (eg. at the beginning)\n * someComponent.append(otherComponent, { at: 0 });\n */\n append(components: ComponentAdd, opts: AddOptions = {}): Component[] {\n const compArr = isArray(components) ? [...components] : [components];\n const toAppend = compArr.map(comp => {\n if (isString(comp)) {\n return comp;\n } else {\n // I have to remove components from the old container before adding them to a new one\n comp.collection && (comp as Component).collection.remove(comp, { temporary: true } as any);\n return comp;\n }\n });\n const result = this.components().add(toAppend, {\n action: ActionLabelComponents.add,\n ...opts,\n });\n return isArray(result) ? result : [result];\n }\n\n /**\n * Set new collection if `components` are provided, otherwise the\n * current collection is returned\n * @param {Component|Component[]|String} [components] Component Definitions or HTML string\n * @param {Object} [opts={}] Options, same as in `Component.append()`\n * @returns {Collection|Array<[Component]>}\n * @example\n * // Set new collection\n * component.components('
');\n * // Get current collection\n * const collection = component.components();\n * console.log(collection.length);\n * // -> 2\n */\n components(\n components?: T,\n opts: AddComponentsOption = {}\n ): undefined extends T ? Components : Component[] {\n const coll = this.get('components')!;\n\n if (isUndefined(components)) {\n return coll as any;\n } else {\n coll.reset(undefined, opts);\n return components ? this.append(components, opts) : ([] as any);\n }\n }\n\n /**\n * If exists, returns the child component at specific index.\n * @param {Number} index Index of the component to return\n * @returns {[Component]|null}\n * @example\n * // Return first child\n * component.getChildAt(0);\n * // Return second child\n * component.getChildAt(1);\n */\n getChildAt(index: number) {\n return this.components().at(index || 0) || undefined;\n }\n\n /**\n * If exists, returns the last child component.\n * @returns {[Component]|null}\n * @example\n * const lastChild = component.getLastChild();\n */\n getLastChild() {\n const children = this.components();\n return children.at(children.length - 1) || null;\n }\n\n /**\n * Remove all inner components\n * * @return {this}\n */\n empty(opts = {}) {\n this.components().reset(undefined, opts);\n return this;\n }\n\n /**\n * Get the parent component, if exists\n * @return {Component|null}\n * @example\n * component.parent();\n * // -> Component\n */\n parent(opts: any = {}): Component | undefined {\n const coll = this.collection || (opts.prev && this.prevColl);\n return coll ? coll.parent : undefined;\n }\n\n /**\n * Return all parents of the component.\n * @returns {Array}\n */\n parents(): Component[] {\n const parent = this.parent();\n return parent ? [parent].concat(parent.parents()) : [];\n }\n\n /**\n * Script updated\n * @private\n */\n scriptUpdated() {\n this.set('scriptUpdated', 1);\n }\n\n /**\n * Init toolbar\n * @private\n */\n initToolbar() {\n const { em } = this;\n const model = this;\n const ppfx = (em && em.getConfig().stylePrefix) || '';\n\n if (!model.get('toolbar') && em) {\n const tb: ToolbarButtonProps[] = [];\n model.collection &&\n tb.push({\n label: em.getIcon('arrowUp'),\n command: (ed: any) => ed.runCommand('core:component-exit', { force: 1 }),\n });\n model.get('draggable') &&\n tb.push({\n attributes: { class: `${ppfx}no-touch-actions`, draggable: true },\n label: em.getIcon('move'),\n command: 'tlb-move',\n });\n model.get('copyable') &&\n tb.push({\n label: em.getIcon('copy'),\n command: 'tlb-clone',\n });\n model.get('removable') &&\n tb.push({\n label: em.getIcon('delete'),\n command: 'tlb-delete',\n });\n model.set('toolbar', tb);\n }\n }\n\n __loadTraits(tr?: Traits | TraitProperties[], opts = {}) {\n let traitsI = tr || this.traits;\n\n if (!(traitsI instanceof Traits)) {\n traitsI = (isFunction(traitsI) ? traitsI(this) : traitsI) as TraitProperties[];\n const traits = new Traits([], this.opt as any);\n traits.setTarget(this);\n\n if (traitsI.length) {\n traitsI.forEach(tr => tr.attributes && delete tr.attributes.value);\n traits.add(traitsI);\n }\n\n this.set({ traits }, opts);\n }\n\n return this;\n }\n\n /**\n * Get traits.\n * @returns {Array}\n * @example\n * const traits = component.getTraits();\n * console.log(traits);\n * // [Trait, Trait, Trait, ...]\n */\n getTraits(): Trait[] {\n this.__loadTraits();\n return [...this.traits.models];\n }\n\n /**\n * Replace current collection of traits with a new one.\n * @param {Array} traits Array of trait definitions\n * @returns {Array}\n * @example\n * const traits = component.setTraits([{ type: 'checkbox', name: 'disabled'}, ...]);\n * console.log(traits);\n * // [Trait, ...]\n */\n setTraits(traits: TraitProperties[]) {\n const tr = isArray(traits) ? traits : [traits];\n // @ts-ignore\n this.set({ traits: tr });\n return this.getTraits();\n }\n\n /**\n * Get the trait by id/name.\n * @param {String} id The `id` or `name` of the trait\n * @return {Trait|null} Trait getModelToStyle\n * @example\n * const traitTitle = component.getTrait('title');\n * traitTitle && traitTitle.set('label', 'New label');\n */\n getTrait(id: string) {\n return (\n this.getTraits().filter(trait => {\n return trait.get('id') === id || trait.get('name') === id;\n })[0] || null\n );\n }\n\n /**\n * Update a trait.\n * @param {String} id The `id` or `name` of the trait\n * @param {Object} props Object with the props to update\n * @return {this}\n * @example\n * component.updateTrait('title', {\n * type: 'select',\n * options: [ 'Option 1', 'Option 2' ],\n * });\n */\n updateTrait(id: string, props: Partial) {\n const trait = this.getTrait(id);\n trait && trait.set(props);\n this.em?.trigger('component:toggled');\n return this;\n }\n\n /**\n * Get the trait position index by id/name. Useful in case you want to\n * replace some trait, at runtime, with something else.\n * @param {String} id The `id` or `name` of the trait\n * @return {Number} Index position of the current trait\n * @example\n * const traitTitle = component.getTraitIndex('title');\n * console.log(traitTitle); // 1\n */\n getTraitIndex(id: string) {\n const trait = this.getTrait(id);\n return trait ? this.traits.indexOf(trait) : -1;\n }\n\n /**\n * Remove trait/s by id/s.\n * @param {String|Array} id The `id`/`name` of the trait (or an array)\n * @return {Array} Array of removed traits\n * @example\n * component.removeTrait('title');\n * component.removeTrait(['title', 'id']);\n */\n removeTrait(id: string | string[]) {\n const ids = isArray(id) ? id : [id];\n const toRemove = ids.map(id => this.getTrait(id));\n const { traits } = this;\n const removed = toRemove.length ? traits.remove(toRemove) : [];\n this.em?.trigger('component:toggled');\n return isArray(removed) ? removed : [removed];\n }\n\n /**\n * Add new trait/s.\n * @param {String|Object|Array} trait Trait to add (or an array of traits)\n * @param {Options} opts Options for the add\n * @return {Array} Array of added traits\n * @example\n * component.addTrait('title', { at: 1 }); // Add title trait (`at` option is the position index)\n * component.addTrait({\n * type: 'checkbox',\n * name: 'disabled',\n * });\n * component.addTrait(['title', {...}, ...]);\n */\n addTrait(trait: Parameters[0], opts: AddOptions = {}) {\n this.__loadTraits();\n const added = this.traits.add(trait, opts);\n this.em?.trigger('component:toggled');\n return isArray(added) ? added : [added];\n }\n\n /**\n * Normalize input classes from array to array of objects\n * @param {Array} arr\n * @return {Array}\n * @private\n */\n normalizeClasses(arr: string[]): Selector[] {\n const res: Selector[] = [];\n const { em } = this;\n const clm = em?.Selectors;\n if (!clm) return [];\n // @ts-ignore\n if (arr.models) return [...arr.models];\n arr.forEach(val => res.push(clm.add(val) as Selector));\n return res;\n }\n\n /**\n * Override original clone method\n * @private\n */\n /** @ts-ignore */\n clone(opt: { symbol?: boolean; symbolInv?: boolean } = {}): this {\n const em = this.em;\n const attr = { ...this.attributes };\n const opts = { ...this.opt };\n const id = this.getId();\n const cssc = em?.Css;\n attr.attributes = { ...attr.attributes };\n delete attr.attributes.id;\n // @ts-ignore\n attr.components = [];\n // @ts-ignore\n attr.classes = [];\n // @ts-ignore\n attr.traits = [];\n\n if (isSymbolRoot(this)) {\n opt.symbol = true;\n }\n\n this.get('components')!.each((md, i) => {\n // @ts-ignore\n attr.components[i] = md.clone({ ...opt, _inner: 1 });\n });\n this.get('traits')!.each((md, i) => {\n // @ts-ignore\n attr.traits[i] = md.clone();\n });\n this.get('classes')!.each((md, i) => {\n // @ts-ignore\n attr.classes[i] = md.get('name');\n });\n\n attr.status = '';\n // @ts-ignore\n opts.collection = null;\n // @ts-ignore\n const cloned = new this.constructor(attr, opts);\n\n // Clone component specific rules\n const newId = `#${cloned.getId()}`;\n const rulesToClone = cssc ? cssc.getRules(`#${id}`) : [];\n rulesToClone.forEach(rule => {\n const newRule = rule.clone();\n // @ts-ignore\n newRule.set('selectors', [newId]);\n cssc.getAll().add(newRule);\n });\n\n // Symbols\n // If I clone an inner symbol, I have to reset it\n cloned.set(keySymbols, 0);\n const symbol = getSymbolMain(this);\n const symbols = getSymbolInstances(this);\n\n if (!opt.symbol && (symbol || symbols)) {\n cloned.set(keySymbol, 0);\n cloned.set(keySymbols, 0);\n } else if (symbol) {\n // Contains already a reference to a symbol\n symbol.set(keySymbols, [...getSymbolInstances(symbol)!, cloned]);\n initSymbol(cloned);\n } else if (opt.symbol) {\n // Request to create a symbol\n if (isSymbolMain(this)) {\n // Already a symbol, cloned should be an instance\n this.set(keySymbols, [...symbols!, cloned]);\n cloned.set(keySymbol, this);\n initSymbol(cloned);\n } else if (opt.symbolInv) {\n // Inverted, cloned is the instance, the origin is the main symbol\n this.set(keySymbols, [cloned]);\n cloned.set(keySymbol, this);\n [this, cloned].map(i => initSymbol(i));\n } else {\n // Cloned becomes the main symbol\n cloned.set(keySymbols, [this]);\n [this, cloned].map(i => initSymbol(i));\n this.set(keySymbol, cloned);\n }\n }\n\n const event = 'component:clone';\n em && em.trigger(event, cloned);\n this.trigger(event, cloned);\n\n return cloned;\n }\n\n /**\n * Get the name of the component.\n * @param {Object} [opts={}] Options\n * @param {Boolean} [opts.noCustom] Avoid custom name assigned to the component.\n * @returns {String}\n * */\n getName(opts: { noCustom?: boolean } = {}) {\n const { em } = this;\n const { type, tagName, name } = this.attributes;\n const defName = type || tagName;\n const nameTag = !type ? tagName : '';\n const i18nPfx = 'domComponents.names.';\n const i18nName = name && em?.t(`${i18nPfx}${name}`);\n const i18nNameTag = nameTag && em?.t(`${i18nPfx}${nameTag}`);\n const i18nDefName = em && (em.t(`${i18nPfx}${type}`) || em.t(`${i18nPfx}${tagName}`));\n const customName = this.get('custom-name');\n\n return (\n (!opts.noCustom ? customName : '') || // Used in Layers (when the user changes the name)\n i18nName || // Use local component `name` key (eg. `domComponents.names.myComponentName`)\n name || // Use component `name` key\n i18nNameTag || // Use local component `tagName` key (eg. `domComponents.names.div`)\n capitalize(nameTag) || // Use component `tagName` key\n i18nDefName || // Use local component `type` key (eg. `domComponents.names.image`)\n capitalize(defName) // Use component `type` key\n );\n }\n\n /**\n * Get the icon string\n * @return {String}\n */\n getIcon() {\n let icon = this.get('icon');\n return icon ? icon + ' ' : '';\n }\n\n /**\n * Return HTML string of the component\n * @param {Object} [opts={}] Options\n * @param {String} [opts.tag] Custom tagName\n * @param {Object|Function} [opts.attributes=null] You can pass an object of custom attributes to replace with the current ones or you can even pass a function to generate attributes dynamically.\n * @param {Boolean} [opts.withProps] Include component properties as `data-gjs-*` attributes. This allows you to have re-importable HTML.\n * @param {Boolean} [opts.altQuoteAttr] In case the attribute value contains a `\"` char, instead of escaping it (`attr=\"value "\"`), the attribute will be quoted using single quotes (`attr='value \"'`).\n * @return {String} HTML string\n * @example\n * // Simple HTML return\n * component.set({ tagName: 'span' });\n * component.setAttributes({ title: 'Hello' });\n * component.toHTML();\n * // -> \n *\n * // Custom attributes\n * component.toHTML({ attributes: { 'data-test': 'Hello' } });\n * // -> \n *\n * // Custom dynamic attributes\n * component.toHTML({\n * attributes(component, attributes) {\n * if (component.get('tagName') == 'span') {\n * attributes.title = 'Custom attribute';\n * }\n * return attributes;\n * },\n * });\n * // -> \n */\n toHTML(opts: ToHTMLOptions = {}): string {\n const model = this;\n const attrs = [];\n const customTag = opts.tag;\n const tag = customTag || model.get('tagName');\n const sTag = model.get('void');\n const customAttr = opts.attributes;\n let attributes = this.getAttrToHTML(opts);\n delete opts.tag;\n\n // Get custom attributes if requested\n if (customAttr) {\n if (isFunction(customAttr)) {\n attributes = customAttr(model, attributes) || {};\n } else if (isObject(customAttr)) {\n attributes = customAttr;\n }\n }\n\n if (opts.withProps) {\n const props = this.toJSON();\n\n forEach(props, (value, key) => {\n const skipProps = ['classes', 'attributes', 'components'];\n if (key[0] !== '_' && skipProps.indexOf(key) < 0) {\n attributes[`data-gjs-${key}`] =\n isArray(value) || isObject(value) ? JSON.stringify(value) : isBoolean(value) ? `${value}` : value;\n }\n });\n }\n\n for (let attr in attributes) {\n const val = attributes[attr];\n\n if (!isUndefined(val) && val !== null) {\n if (isBoolean(val)) {\n val && attrs.push(attr);\n } else {\n let valueRes = '';\n if (opts.altQuoteAttr && isString(val) && val.indexOf('\"') >= 0) {\n valueRes = `'${val.replace(/'/g, ''')}'`;\n } else {\n const value = isString(val) ? val.replace(/\"/g, '"') : val;\n valueRes = `\"${value}\"`;\n }\n\n attrs.push(`${attr}=${valueRes}`);\n }\n }\n }\n\n const attrString = attrs.length ? ` ${attrs.join(' ')}` : '';\n const inner = model.getInnerHTML(opts);\n let code = `<${tag}${attrString}${sTag ? '/' : ''}>${inner}`;\n !sTag && (code += ``);\n\n return code;\n }\n\n /**\n * Get inner HTML of the component\n * @param {Object} [opts={}] Same options of `toHTML`\n * @returns {String} HTML string\n */\n getInnerHTML(opts?: ToHTMLOptions) {\n return this.__innerHTML(opts);\n }\n\n __innerHTML(opts: ToHTMLOptions = {}) {\n const cmps = this.components();\n return !cmps.length ? this.content : cmps.map(c => c.toHTML(opts)).join('');\n }\n\n /**\n * Returns object of attributes for HTML\n * @return {Object}\n * @private\n */\n getAttrToHTML(opts?: ToHTMLOptions) {\n const attrs = this.getAttributes();\n\n if (avoidInline(this.em) && opts?.keepInlineStyle !== true) {\n delete attrs.style;\n }\n\n return attrs;\n }\n\n /**\n * Return a shallow copy of the model's attributes for JSON\n * stringification.\n * @return {Object}\n * @private\n */\n toJSON(opts: ObjectAny = {}): ComponentDefinition {\n const obj = Model.prototype.toJSON.call(this, opts);\n obj.attributes = this.getAttributes();\n delete obj.attributes.class;\n delete obj.toolbar;\n delete obj.traits;\n delete obj.status;\n delete obj.open; // used in Layers\n delete obj._undoexc;\n delete obj.delegate;\n\n if (!opts.fromUndo) {\n const symbol = obj[keySymbol];\n const symbols = obj[keySymbols];\n if (symbols && isArray(symbols)) {\n obj[keySymbols] = symbols.filter(i => i).map(i => (i.getId ? i.getId() : i));\n }\n if (symbol && !isString(symbol)) {\n obj[keySymbol] = symbol.getId();\n }\n }\n\n if (this.em.getConfig().avoidDefaults) {\n this.getChangedProps(obj);\n }\n\n return obj;\n }\n\n /**\n * Return an object containing only changed props\n */\n getChangedProps(res: Partial): Partial {\n const obj: any = res || Model.prototype.toJSON.apply(this);\n const defaults = result(this, 'defaults');\n\n forEach(defaults, (value, key) => {\n if (['type'].indexOf(key) === -1 && obj[key] === value) {\n delete obj[key];\n }\n });\n\n if (isEmpty(obj.type)) {\n delete obj.type;\n }\n\n forEach(['attributes', 'style'], prop => {\n if (isEmpty(defaults[prop]) && isEmpty(obj[prop])) {\n delete obj[prop];\n }\n });\n\n forEach(['classes', 'components'], prop => {\n if (!obj[prop] || (isEmpty(defaults[prop]) && !obj[prop].length)) {\n delete obj[prop];\n }\n });\n\n return obj;\n }\n\n /**\n * Return the component id\n * @return {String}\n */\n getId(): string {\n let attrs = this.get('attributes') || {};\n return attrs.id || this.ccid || this.cid;\n }\n\n /**\n * Set new id on the component\n * @param {String} id\n * @return {this}\n */\n setId(id: string, opts?: SetOptions & { idUpdate?: boolean }) {\n const attrs = { ...this.get('attributes') };\n attrs.id = id;\n this.set('attributes', attrs, opts);\n return this;\n }\n\n /**\n * Get the DOM element of the component.\n * This works only if the component is already rendered\n * @param {Frame} frame Specific frame from which taking the element\n * @return {HTMLElement}\n */\n getEl(frame?: Frame) {\n const view = this.getView(frame);\n return view && view.el;\n }\n\n /**\n * Get the View of the component.\n * This works only if the component is already rendered\n * @param {Frame} frame Get View of a specific frame\n * @return {ComponentView}\n */\n getView(frame?: Frame) {\n let { view, views, em } = this;\n const frm = frame || em?.getCurrentFrameModel();\n\n if (frm) {\n view = views.filter(view => view.frameView === frm.view)[0];\n }\n\n return view;\n }\n\n getCurrentView() {\n const frameView = this.em.getCurrentFrame();\n const frame = frameView?.model;\n return this.getView(frame);\n }\n\n __getScriptProps() {\n const modelProps = this.props();\n const scrProps = this.get('script-props') || [];\n return scrProps.reduce((acc, prop) => {\n acc[prop] = modelProps[prop];\n return acc;\n }, {} as Partial);\n }\n\n /**\n * Return script in string format, cleans 'function() {..' from scripts\n * if it's a function\n * @param {string|Function} script\n * @return {string}\n * @private\n */\n getScriptString(script?: string | Function) {\n let scr = script || this.get('script') || '';\n\n if (!scr) {\n return scr;\n }\n\n if (this.get('script-props')) {\n scr = scr.toString().trim();\n } else {\n // Deprecated\n // Need to convert script functions to strings\n if (isFunction(scr)) {\n let scrStr = scr.toString().trim();\n scrStr = scrStr.slice(scrStr.indexOf('{') + 1, scrStr.lastIndexOf('}'));\n scr = scrStr.trim();\n }\n\n const config = this.em.getConfig();\n const tagVarStart = escapeRegExp(config.tagVarStart || '{[ ');\n const tagVarEnd = escapeRegExp(config.tagVarEnd || ' ]}');\n const reg = new RegExp(`${tagVarStart}([\\\\w\\\\d-]*)${tagVarEnd}`, 'g');\n scr = scr.replace(reg, (match, v) => {\n // If at least one match is found I have to track this change for a\n // better optimization inside JS generator\n this.scriptUpdated();\n const result = this.attributes[v] || '';\n return isArray(result) || typeof result == 'object' ? JSON.stringify(result) : result;\n });\n }\n return scr;\n }\n\n emitUpdate(property?: string, ...args: any[]) {\n const { em } = this;\n const event = keyUpdate + (property ? `:${property}` : '');\n const item = property && this.get(property);\n // @ts-ignore\n property && this.updated(property, item, property && this.previous(property), ...args);\n this.trigger(event, ...args);\n em && em.trigger(event, this, ...args);\n ['components', 'classes'].indexOf(property!) >= 0 &&\n this.__propSelfToParent({\n component: this,\n changed: { [property!]: item },\n options: args[2] || args[1] || {},\n });\n }\n\n /**\n * Execute callback function on itself and all inner components\n * @param {Function} clb Callback function, the model is passed as an argument\n * @return {this}\n * @example\n * component.onAll(component => {\n * // do something with component\n * })\n */\n onAll(clb: (cmp: Component) => void) {\n if (isFunction(clb)) {\n clb(this);\n this.components().forEach(model => model.onAll(clb));\n }\n return this;\n }\n\n /**\n * Execute a callback function on all inner child components.\n * @param {Function} clb Callback function, the child component is passed as an argument\n * @example\n * component.forEachChild(child => {\n * console.log(child)\n * })\n */\n forEachChild(clb: (child: Component) => void) {\n if (isFunction(clb)) {\n this.components().forEach(child => {\n clb(child);\n child.forEachChild(clb);\n });\n }\n }\n\n /**\n * Remove the component\n * @return {this}\n */\n remove(opts: any = {}) {\n const { em } = this;\n const coll = this.collection;\n const remove = () => {\n coll && coll.remove(this, { action: ActionLabelComponents.remove, ...opts });\n // Component without parent\n if (!coll) {\n this.components('', opts);\n this.components().removeChildren(this, undefined, opts);\n }\n };\n const rmOpts = { ...opts };\n [this, em].map(i => i.trigger(ComponentsEvents.removeBefore, this, remove, rmOpts));\n !rmOpts.abort && remove();\n return this;\n }\n\n /**\n * Move the component to another destination component\n * @param {Component} component Destination component (so the current one will be appended as a child)\n * @param {Object} opts Options for the append action\n * @returns {this}\n * @example\n * // Move the selected component on top of the wrapper\n * const dest = editor.getWrapper();\n * editor.getSelected().move(dest, { at: 0 });\n */\n move(component: Component, opts: AddOptions = {}) {\n if (component) {\n const { at } = opts;\n const index = this.index();\n const sameParent = component === this.parent();\n const sameIndex = index === at || index === at! - 1;\n\n if (!sameParent || !sameIndex) {\n if (sameParent && at && at > index) {\n opts.at = at - 1;\n }\n const action = ActionLabelComponents.move;\n this.remove({ action, temporary: 1 });\n component.append(this, { action, ...opts });\n this.emitUpdate();\n }\n }\n return this;\n }\n\n /**\n * Check if the component is an instance of some component type.\n * @param {String} type Component type\n * @returns {Boolean}\n * @example\n * // Add a new component type by extending an existing one\n * editor.Components.addType('text-ext', { extend: 'text' });\n * // Append a new component somewhere\n * const newTextExt = editor.getSelected().append({ type: 'text-ext' })[0];\n * newTextExt.isInstanceOf('text-ext'); // true\n * newTextExt.isInstanceOf('text'); // true\n */\n isInstanceOf(type: string) {\n const cmp = this.em?.Components.getType(type)?.model;\n\n if (!cmp) return false;\n\n return this instanceof cmp;\n }\n\n /**\n * Check if the component is a child of some other component (or component type)\n * @param {[Component]|String} component Component parent to check. In case a string is passed,\n * the check will be performed on the component type.\n * @returns {Boolean}\n * @example\n * const newTextComponent = editor.getSelected().append({\n * type: 'text',\n * components: 'My text here',\n * })[0];\n * const innerComponent = newTextComponent.find('b')[0];\n * innerComponent.isChildOf(newTextComponent); // true\n * innerComponent.isChildOf('text'); // true\n */\n isChildOf(component: string | Component) {\n const byType = isString(component);\n let parent = this.parent();\n\n while (parent) {\n if (byType) {\n if (parent.isInstanceOf(component)) {\n return true;\n }\n } else {\n if (parent === component) {\n return true;\n }\n }\n\n parent = parent.parent();\n }\n\n return false;\n }\n\n /**\n * Reset id of the component and any of its style rule\n * @param {Object} [opts={}] Options\n * @return {this}\n * @private\n */\n resetId(opts = {}) {\n const { em } = this;\n const oldId = this.getId();\n if (!oldId) return this;\n const newId = Component.createId(this);\n this.setId(newId);\n const rule = em?.Css.getIdRule(oldId);\n const selector = rule?.get('selectors')!.at(0);\n selector?.set('name', newId);\n return this;\n }\n\n _getStyleRule({ id }: { id?: string } = {}) {\n const { em } = this;\n const idS = id || this.getId();\n return em?.Css.getIdRule(idS);\n }\n\n _getStyleSelector(opts?: { id?: string }) {\n const rule = this._getStyleRule(opts);\n return rule?.get('selectors')!.at(0);\n }\n\n _idUpdated(m: any, v: any, opts: { idUpdate?: boolean } = {}) {\n if (opts.idUpdate) return;\n\n const { ccid } = this;\n const { id } = this.get('attributes') || {};\n const idPrev = (this.previous('attributes') || {}).id || ccid;\n const list = Component.getList(this);\n\n // If the ID already exists I need to rollback to the old one\n if (list[id] || (!id && idPrev)) {\n return this.setId(idPrev, { idUpdate: true });\n }\n\n // Remove the old ID reference and add the new one\n delete list[idPrev];\n list[id] = this;\n this.ccid = id;\n\n // Update the style selector name\n const selector = this._getStyleSelector({ id: idPrev });\n selector && selector.set({ name: id, label: id });\n }\n\n static getDefaults() {\n return result(this.prototype, 'defaults');\n }\n\n static isComponent(el: HTMLElement, opts?: any): ComponentDefinitionDefined | boolean | undefined {\n return { tagName: toLowerCase(el.tagName) };\n }\n\n static ensureInList(model: Component) {\n const list = Component.getList(model);\n const id = model.getId();\n const current = list[id];\n\n if (!current) {\n // Insert in list\n list[id] = model;\n } else if (current !== model) {\n // Create new ID\n const nextId = Component.getIncrementId(id, list);\n model.setId(nextId);\n list[nextId] = model;\n }\n\n model.components().forEach(i => Component.ensureInList(i));\n }\n\n static createId(model: Component, opts: any = {}) {\n const list = Component.getList(model);\n const { idMap = {} } = opts;\n let { id } = model.get('attributes')!;\n let nextId;\n\n if (id) {\n nextId = Component.getIncrementId(id, list, opts);\n model.setId(nextId);\n if (id !== nextId) idMap[id] = nextId;\n } else {\n nextId = Component.getNewId(list);\n }\n\n list[nextId] = model;\n return nextId;\n }\n\n static getNewId(list: ObjectAny) {\n const count = Object.keys(list).length;\n // Testing 1000000 components with `+ 2` returns 0 collisions\n const ilen = count.toString().length + 2;\n const uid = (Math.random() + 1.1).toString(36).slice(-ilen);\n let newId = `i${uid}`;\n\n while (list[newId]) {\n newId = Component.getNewId(list);\n }\n\n return newId;\n }\n\n static getIncrementId(id: string, list: ObjectAny, opts: { keepIds?: string[] } = {}) {\n const { keepIds = [] } = opts;\n let counter = 1;\n let newId = id;\n\n if (keepIds.indexOf(id) < 0) {\n while (list[newId]) {\n counter++;\n newId = `${id}-${counter}`;\n }\n }\n\n return newId;\n }\n\n static getList(model: Component) {\n const { em } = model;\n const dm = em?.Components;\n return dm?.componentsById ?? {};\n }\n\n static checkId(\n components: ComponentDefinitionDefined | ComponentDefinitionDefined[],\n styles: CssRuleJSON[] = [],\n list: ObjectAny = {},\n opts: { keepIds?: string[]; idMap?: PrevToNewIdMap } = {}\n ) {\n const comps = isArray(components) ? components : [components];\n const { keepIds = [], idMap = {} } = opts;\n comps.forEach(comp => {\n comp.attributes;\n const { attributes = {}, components } = comp;\n const { id } = attributes;\n\n // Check if we have collisions with current components\n if (id && list[id] && keepIds.indexOf(id) < 0) {\n const newId = Component.getIncrementId(id, list);\n idMap[id] = newId;\n attributes.id = newId;\n // Update passed styles\n isArray(styles) &&\n styles.forEach(style => {\n const { selectors } = style;\n selectors.forEach((sel, idx) => {\n if (sel === `#${id}`) selectors[idx] = `#${newId}`;\n });\n });\n }\n\n components && Component.checkId(components, styles, list, opts);\n });\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\nimport { DraggableDroppableFn } from './types';\n\nexport const type = 'head';\nconst droppable = ['title', 'style', 'base', 'link', 'meta', 'script', 'noscript'];\n\nexport default class ComponentHead extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n draggable: false,\n highlightable: false,\n droppable: (({ tagName }) => !tagName || droppable.includes(toLowerCase(tagName))) as DraggableDroppableFn,\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import { bindAll, indexOf } from 'underscore';\nimport CanvasModule from '../canvas';\nimport { ObjectStrings } from '../common';\nimport EditorModel from '../editor/model/Editor';\nimport { getDocumentScroll, off, on } from './dom';\n\n// TODO move in sorter\ntype SorterOptions = {\n sorter: any;\n event: any;\n};\n\ntype DragStop = (cancel?: boolean) => void;\n\ntype DragContent = (content: any) => void;\n\n/**\n * This class makes the canvas droppable\n */\nexport default class Droppable {\n em: EditorModel;\n canvas: CanvasModule;\n el: HTMLElement;\n counter: number;\n sortOpts?: Record | null;\n over?: boolean;\n dragStop?: DragStop;\n dragContent?: DragContent;\n sorter?: any;\n\n constructor(em: EditorModel, rootEl?: HTMLElement) {\n this.em = em;\n this.canvas = em.Canvas;\n const el = rootEl || this.canvas.getFrames().map(frame => frame.getComponent().getEl()!);\n const els = Array.isArray(el) ? el : [el];\n this.el = els[0];\n this.counter = 0;\n bindAll(this, 'handleDragEnter', 'handleDragOver', 'handleDrop', 'handleDragLeave');\n els.forEach(el => this.toggleEffects(el, true));\n }\n\n toggleEffects(el: HTMLElement, enable: boolean) {\n const methods = { on, off };\n const method = enable ? 'on' : 'off';\n methods[method](el, 'dragenter', this.handleDragEnter);\n methods[method](el, 'dragover', this.handleDragOver);\n methods[method](el, 'drop', this.handleDrop);\n methods[method](el, 'dragleave', this.handleDragLeave);\n }\n\n __customTglEff(enable: boolean) {\n const method = enable ? on : off;\n const doc = this.el.ownerDocument;\n const frameEl = doc.defaultView?.frameElement as HTMLIFrameElement;\n this.sortOpts = enable\n ? {\n onStart({ sorter }: SorterOptions) {\n on(frameEl, 'pointermove', sorter.onMove);\n },\n onEnd({ sorter }: SorterOptions) {\n off(frameEl, 'pointermove', sorter.onMove);\n },\n customTarget({ event }: SorterOptions) {\n return doc.elementFromPoint(event.clientX, event.clientY);\n },\n }\n : null;\n method(frameEl, 'pointerenter', this.handleDragEnter);\n method(frameEl, 'pointermove', this.handleDragOver);\n method(document, 'pointerup', this.handleDrop);\n method(frameEl, 'pointerout', this.handleDragLeave);\n\n // Test with touch devices (seems like frameEl is not capturing pointer events).\n // on/off(document, 'pointermove', sorter.onMove); // for the sorter\n // enable && this.handleDragEnter({}); // no way to use pointerenter/pointerout\n }\n\n startCustom() {\n this.__customTglEff(true);\n }\n\n endCustom(cancel?: boolean) {\n this.over ? this.endDrop(cancel) : this.__customTglEff(false);\n }\n\n /**\n * This function is expected to be always executed at the end of d&d.\n */\n endDrop(cancel?: boolean, ev?: Event) {\n const { em, dragStop } = this;\n this.counter = 0;\n dragStop && dragStop(cancel || !this.over);\n this.__customTglEff(false);\n em.trigger('canvas:dragend', ev);\n }\n\n handleDragLeave(ev: Event) {\n this.updateCounter(-1, ev);\n }\n\n updateCounter(value: number, ev: Event) {\n this.counter += value;\n this.counter === 0 && this.endDrop(true, ev);\n }\n\n handleDragEnter(ev: DragEvent | Event) {\n const { em, canvas } = this;\n const dt = (ev as DragEvent).dataTransfer;\n const dragContentOrigin = em.get('dragContent');\n\n if (!dragContentOrigin && !canvas.getConfig().allowExternalDrop) {\n return;\n }\n\n this.updateCounter(1, ev);\n if (this.over) return;\n this.over = true;\n const utils = em.Utils;\n // For security reason I can't read the drag data on dragenter, but\n // as I need it for the Sorter context I will use `dragContent` or just\n // any not empty element\n let content = dragContentOrigin || '
';\n let dragStop: DragStop;\n let dragContent;\n em.stopDefault();\n\n // Select the right drag provider\n if (em.inAbsoluteMode()) {\n const wrapper = em.Components.getWrapper()!;\n const target = wrapper.append({})[0];\n const dragger = em.Commands.run('core:component-drag', {\n event: ev,\n guidesInfo: 1,\n center: 1,\n target,\n onEnd: (ev: any, dragger: any, { cancelled }: any) => {\n let comp;\n if (!cancelled) {\n comp = wrapper.append(content)[0];\n const canvasOffset = canvas.getOffset();\n const { top, left, position } = target.getStyle() as ObjectStrings;\n const scroll = getDocumentScroll(ev.target);\n const postLeft = parseInt(`${parseFloat(left) + scroll.x - canvasOffset.left}`, 10);\n const posTop = parseInt(`${parseFloat(top) + scroll.y - canvasOffset.top}`, 10);\n\n comp.addStyle({\n left: postLeft + 'px',\n top: posTop + 'px',\n position,\n });\n }\n this.handleDragEnd(comp, dt);\n target.remove();\n },\n });\n dragStop = (cancel?: boolean) => dragger.stop(ev, { cancel });\n dragContent = (cnt: any) => (content = cnt);\n } else {\n const sorter = new utils.Sorter({\n // @ts-ignore\n em,\n wmargin: 1,\n nested: 1,\n canvasRelative: 1,\n direction: 'a',\n container: this.el,\n placer: canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: 'gjs-',\n onEndMove: (model: any) => this.handleDragEnd(model, dt),\n document: this.el.ownerDocument,\n ...(this.sortOpts || {}),\n });\n sorter.setDropContent(content);\n sorter.startSort();\n this.sorter = sorter;\n dragStop = (cancel?: boolean) => {\n cancel && (sorter.moved = false);\n sorter.endMove();\n };\n dragContent = (content: any) => sorter.setDropContent(content);\n }\n\n this.dragStop = dragStop;\n this.dragContent = dragContent;\n em.trigger('canvas:dragenter', dt, content);\n }\n\n handleDragEnd(model: any, dt: any) {\n const { em } = this;\n this.over = false;\n if (model) {\n em.set('dragResult', model);\n em.trigger('canvas:drop', dt, model);\n }\n em.runDefault({ preserveSelected: 1 });\n }\n\n /**\n * Always need to have this handler active for enabling the drop\n * @param {Event} ev\n */\n handleDragOver(ev: Event) {\n ev.preventDefault();\n this.em.trigger('canvas:dragover', ev);\n }\n\n /**\n * WARNING: This function might fail to run on drop, for example, when the\n * drop, accidentally, happens on some external element (DOM not inside the iframe)\n */\n handleDrop(ev: Event | DragEvent) {\n ev.preventDefault();\n const { dragContent } = this;\n const dt = (ev as DragEvent).dataTransfer;\n const content = this.getContentByData(dt).content;\n (ev.target as HTMLElement).style.border = '';\n content && dragContent && dragContent(content);\n this.endDrop(!content, ev);\n }\n\n getContentByData(dt: any) {\n const em = this.em;\n const types = dt && dt.types;\n const files = (dt && dt.files) || [];\n const dragContent = em.get('dragContent');\n let content = dt && dt.getData('text');\n\n if (files.length) {\n content = [];\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const type = file.type.split('/')[0];\n\n if (type == 'image') {\n content.push({\n type,\n file,\n attributes: { alt: file.name },\n });\n }\n }\n } else if (dragContent) {\n content = dragContent;\n } else if (indexOf(types, 'text/html') >= 0) {\n content = dt && dt.getData('text/html').replace(/<\\/?meta[^>]*>/g, '');\n } else if (indexOf(types, 'text/uri-list') >= 0) {\n content = {\n type: 'link',\n attributes: { href: content },\n content: content,\n };\n } else if (indexOf(types, 'text/json') >= 0) {\n const json = dt && dt.getData('text/json');\n json && (content = JSON.parse(json));\n } else if (types.length === 1 && types[0] === 'text/plain') {\n // Avoid dropping non-selectable and non-editable text nodes inside the editor\n content = `
${content}
`;\n }\n\n const result = { content };\n em.trigger('canvas:dragdata', dt, result);\n\n return result;\n }\n}\n","import { bindAll, debounce, isString, isUndefined } from 'underscore';\nimport { ModuleView } from '../../abstract';\nimport { BoxRect, ObjectAny } from '../../common';\nimport CssRulesView from '../../css_composer/view/CssRulesView';\nimport ComponentWrapperView from '../../dom_components/view/ComponentWrapperView';\nimport ComponentView from '../../dom_components/view/ComponentView';\nimport { type as typeHead } from '../../dom_components/model/ComponentHead';\nimport Droppable from '../../utils/Droppable';\nimport {\n append,\n appendVNodes,\n createCustomEvent,\n createEl,\n getPointerEvent,\n motionsEv,\n off,\n on,\n} from '../../utils/dom';\nimport { hasDnd, setViewEl } from '../../utils/mixins';\nimport Canvas from '../model/Canvas';\nimport Frame from '../model/Frame';\nimport FrameWrapView from './FrameWrapView';\nimport CanvasEvents from '../types';\n\nexport default class FrameView extends ModuleView {\n /** @ts-ignore */\n get tagName() {\n return 'iframe';\n }\n /** @ts-ignore */\n get attributes() {\n return { allowfullscreen: 'allowfullscreen' };\n }\n\n dragging = false;\n loaded = false;\n droppable?: Droppable;\n rect?: DOMRect;\n\n lastClientY?: number;\n lastMaxHeight = 0;\n private jsContainer?: HTMLElement;\n private tools: { [key: string]: HTMLElement } = {};\n private wrapper?: ComponentWrapperView;\n private headView?: ComponentView;\n private frameWrapView?: FrameWrapView;\n\n constructor(model: Frame, view?: FrameWrapView) {\n super({ model });\n bindAll(this, 'updateClientY', 'stopAutoscroll', 'autoscroll', '_emitUpdate');\n const { el } = this;\n //@ts-ignore\n this.module._config = {\n ...(this.config || {}),\n //@ts-ignore\n frameView: this,\n //canvasView: view?.cv\n };\n this.frameWrapView = view;\n this.showGlobalTools = debounce(this.showGlobalTools.bind(this), 50);\n const cvModel = this.getCanvasModel();\n this.listenTo(model, 'change:head', this.updateHead);\n this.listenTo(cvModel, 'change:styles', this.renderStyles);\n model.view = this;\n setViewEl(el, this);\n }\n\n getBoxRect(): BoxRect {\n const { el, module } = this;\n const canvasView = module.getCanvasView();\n const coords = module.getCoords();\n const frameRect = el.getBoundingClientRect();\n const canvasRect = canvasView.getCanvasOffset();\n const vwDelta = canvasView.getViewportDelta();\n const zoomM = module.getZoomMultiplier();\n const x = (frameRect.x - canvasRect.left - vwDelta.x - coords.x) * zoomM;\n const y = (frameRect.y - canvasRect.top - vwDelta.y - coords.y) * zoomM;\n const width = frameRect.width * zoomM;\n const height = frameRect.height * zoomM;\n\n return {\n x,\n y,\n width,\n height,\n };\n }\n\n /**\n * Update `` content of the frame\n */\n updateHead() {\n const { model } = this;\n const headEl = this.getHead();\n const toRemove: any[] = [];\n const toAdd: any[] = [];\n const current = model.head;\n const prev = model.previous('head');\n const attrStr = (attr: any = {}) =>\n Object.keys(attr)\n .sort()\n .map(i => `[${i}=\"${attr[i]}\"]`)\n .join('');\n const find = (items: any[], stack: any[], res: any[]) => {\n items.forEach(item => {\n const { tag, attributes } = item;\n const has = stack.some(s => s.tag === tag && attrStr(s.attributes) === attrStr(attributes));\n !has && res.push(item);\n });\n };\n find(current, prev, toAdd);\n find(prev, current, toRemove);\n toRemove.forEach(stl => {\n const el = headEl.querySelector(`${stl.tag}${attrStr(stl.attributes)}`);\n el?.parentNode?.removeChild(el);\n });\n appendVNodes(headEl, toAdd);\n }\n\n getEl() {\n return this.el;\n }\n\n getCanvasModel(): Canvas {\n return this.em.Canvas.getModel();\n }\n\n getWindow() {\n return this.getEl().contentWindow as Window;\n }\n\n getDoc() {\n return this.getEl().contentDocument as Document;\n }\n\n getHead() {\n return this.getDoc().querySelector('head') as HTMLHeadElement;\n }\n\n getBody() {\n return this.getDoc().querySelector('body') as HTMLBodyElement;\n }\n\n getWrapper() {\n return this.getBody().querySelector('[data-gjs-type=wrapper]') as HTMLElement;\n }\n\n getJsContainer() {\n if (!this.jsContainer) {\n this.jsContainer = createEl('div', { class: `${this.ppfx}js-cont` });\n }\n\n return this.jsContainer;\n }\n\n getToolsEl() {\n return this.frameWrapView?.elTools as HTMLElement;\n }\n\n getGlobalToolsEl() {\n return this.em.Canvas.getGlobalToolsEl()!;\n }\n\n getHighlighter() {\n return this._getTool('[data-hl]');\n }\n\n getBadgeEl() {\n return this._getTool('[data-badge]');\n }\n\n getOffsetViewerEl() {\n return this._getTool('[data-offset]');\n }\n\n getRect() {\n if (!this.rect) {\n this.rect = this.el.getBoundingClientRect();\n }\n\n return this.rect;\n }\n\n /**\n * Get rect data, not affected by the canvas zoom\n */\n getOffsetRect() {\n const { el } = this;\n const { scrollTop, scrollLeft } = this.getBody();\n const height = el.offsetHeight;\n const width = el.offsetWidth;\n\n return {\n top: el.offsetTop,\n left: el.offsetLeft,\n height,\n width,\n scrollTop,\n scrollLeft,\n scrollBottom: scrollTop + height,\n scrollRight: scrollLeft + width,\n };\n }\n\n _getTool(name: string) {\n const { tools } = this;\n const toolsEl = this.getToolsEl();\n\n if (!tools[name]) {\n tools[name] = toolsEl.querySelector(name) as HTMLElement;\n }\n\n return tools[name];\n }\n\n remove(...args: any) {\n this._toggleEffects(false);\n this.tools = {};\n this.wrapper?.remove();\n ModuleView.prototype.remove.apply(this, args);\n return this;\n }\n\n startAutoscroll() {\n this.lastMaxHeight = this.getWrapper().offsetHeight - this.el.offsetHeight;\n\n // By detaching those from the stack avoid browsers lags\n // Noticeable with \"fast\" drag of blocks\n setTimeout(() => {\n this._toggleAutoscrollFx(true);\n requestAnimationFrame(this.autoscroll);\n }, 0);\n }\n\n autoscroll() {\n if (this.dragging) {\n const { lastClientY } = this;\n const canvas = this.em.Canvas;\n const win = this.getWindow();\n const actualTop = win.pageYOffset;\n const clientY = lastClientY || 0;\n const limitTop = canvas.getConfig().autoscrollLimit!;\n const limitBottom = this.getRect().height - limitTop;\n let nextTop = actualTop;\n\n if (clientY < limitTop) {\n nextTop -= limitTop - clientY;\n }\n\n if (clientY > limitBottom) {\n nextTop += clientY - limitBottom;\n }\n\n if (\n !isUndefined(lastClientY) && // Fixes #3134\n nextTop !== actualTop &&\n nextTop > 0 &&\n nextTop < this.lastMaxHeight\n ) {\n const toolsEl = this.getGlobalToolsEl();\n toolsEl.style.opacity = '0';\n this.showGlobalTools();\n win.scrollTo(0, nextTop);\n canvas.spots.refreshDbn();\n }\n\n requestAnimationFrame(this.autoscroll);\n }\n }\n\n updateClientY(ev: Event) {\n ev.preventDefault();\n this.lastClientY = getPointerEvent(ev).clientY * this.em.getZoomDecimal();\n }\n\n showGlobalTools() {\n this.getGlobalToolsEl().style.opacity = '';\n }\n\n stopAutoscroll() {\n this.dragging && this._toggleAutoscrollFx(false);\n }\n\n _toggleAutoscrollFx(enable: boolean) {\n this.dragging = enable;\n const win = this.getWindow();\n const method = enable ? 'on' : 'off';\n const mt = { on, off };\n mt[method](win, 'mousemove dragover', this.updateClientY);\n mt[method](win, 'mouseup', this.stopAutoscroll);\n }\n\n render() {\n const { $el, ppfx, em } = this;\n $el.attr({ class: `${ppfx}frame` });\n this.renderScripts();\n em.trigger('frame:render', this); // deprecated\n return this;\n }\n\n renderScripts() {\n const { el, model, em } = this;\n const evLoad = 'frame:load';\n const evOpts: ObjectAny = { el, model, view: this };\n const canvas = this.getCanvasModel();\n const appendScript = (scripts: any[]) => {\n if (scripts.length > 0) {\n const src = scripts.shift();\n const scriptEl = createEl('script', {\n type: 'text/javascript',\n ...(isString(src) ? { src } : src),\n });\n el.contentDocument?.head.appendChild(scriptEl);\n\n if (scriptEl.hasAttribute('nomodule') && 'noModule' in HTMLScriptElement.prototype) {\n appendScript(scripts);\n } else {\n scriptEl.onerror = scriptEl.onload = appendScript.bind(null, scripts);\n }\n } else {\n em?.trigger(CanvasEvents.frameLoadHead, evOpts);\n this.renderBody();\n em?.trigger(CanvasEvents.frameLoadBody, evOpts);\n em?.trigger(evLoad, evOpts); // deprecated\n }\n };\n\n el.onload = () => {\n const { frameContent } = this.config;\n if (frameContent) {\n const doc = this.getDoc();\n doc.open();\n doc.write(frameContent);\n doc.close();\n }\n evOpts.window = this.getWindow();\n em?.trigger(`${evLoad}:before`, evOpts); // deprecated\n em?.trigger(CanvasEvents.frameLoad, evOpts);\n this.renderHead();\n appendScript([...canvas.get('scripts')]);\n };\n }\n\n renderStyles(opts: any = {}) {\n const head = this.getHead();\n const canvas = this.getCanvasModel();\n const normalize = (stls: any[]) =>\n stls.map(href => ({\n tag: 'link',\n attributes: {\n rel: 'stylesheet',\n ...(isString(href) ? { href } : href),\n },\n }));\n const prevStyles = normalize(opts.prev || canvas.previous('styles'));\n const styles = normalize(canvas.get('styles'));\n const toRemove: any[] = [];\n const toAdd: any[] = [];\n const find = (items: any[], stack: any[], res: any[]) => {\n items.forEach(item => {\n const { href } = item.attributes;\n const has = stack.some(s => s.attributes.href === href);\n !has && res.push(item);\n });\n };\n find(styles, prevStyles, toAdd);\n find(prevStyles, styles, toRemove);\n toRemove.forEach(stl => {\n const el = head.querySelector(`link[href=\"${stl.attributes.href}\"]`);\n el?.parentNode?.removeChild(el);\n });\n appendVNodes(head, toAdd);\n }\n\n renderHead() {\n const { model, em } = this;\n const { root } = model;\n const HeadView = em.Components.getType(typeHead)!.view;\n this.headView = new HeadView({\n el: this.getHead(),\n model: root.head,\n config: {\n ...root.config,\n frameView: this,\n },\n }).render();\n }\n\n renderBody() {\n const { config, em, model, ppfx } = this;\n const doc = this.getDoc();\n const body = this.getBody();\n const win = this.getWindow();\n const hasAutoHeight = model.hasAutoHeight();\n const conf = em.config;\n //@ts-ignore This could be used inside component-related scripts to check if the\n // script is executed inside the editor.\n win._isEditor = true;\n this.renderStyles({ prev: [] });\n\n const colorWarn = '#ffca6f';\n\n append(\n body,\n ``\n );\n const { root } = model;\n const { view } = em.Components.getType('wrapper')!;\n this.wrapper = new view({\n model: root,\n config: {\n ...root.config,\n em,\n frameView: this,\n },\n }).render();\n append(body, this.wrapper?.el!);\n append(\n body,\n new CssRulesView({\n collection: model.getStyles(),\n //@ts-ignore\n config: {\n ...em.Css.getConfig(),\n frameView: this,\n },\n }).render().el\n );\n append(body, this.getJsContainer());\n // em.trigger('loaded'); // I need to manage only the first one maybe\n //this.updateOffset(); // TOFIX (check if I need it)\n\n // Avoid some default behaviours\n //@ts-ignore\n on(body, 'click', ev => ev && ev.target?.tagName == 'A' && ev.preventDefault());\n on(body, 'submit', ev => ev && ev.preventDefault());\n\n // When the iframe is focused the event dispatcher is not the same so\n // I need to delegate all events to the parent document\n [\n { event: 'keydown keyup keypress', class: 'KeyboardEvent' },\n { event: 'mousedown mousemove mouseup', class: 'MouseEvent' },\n { event: 'pointerdown pointermove pointerup', class: 'PointerEvent' },\n { event: 'wheel', class: 'WheelEvent', opts: { passive: !config.infiniteCanvas } },\n ].forEach(obj =>\n obj.event.split(' ').forEach(event => {\n doc.addEventListener(event, ev => this.el.dispatchEvent(createCustomEvent(ev, obj.class)), obj.opts);\n })\n );\n\n this._toggleEffects(true);\n\n if (hasDnd(em)) {\n this.droppable = new Droppable(em, this.wrapper?.el);\n }\n\n this.loaded = true;\n model.trigger('loaded');\n }\n\n _toggleEffects(enable: boolean) {\n const method = enable ? on : off;\n const win = this.getWindow();\n win && method(win, `${motionsEv} resize`, this._emitUpdate);\n }\n\n _emitUpdate() {\n this.model._emitUpdated();\n }\n}\n","import { bindAll, isNumber, isNull, debounce } from 'underscore';\nimport { ModuleView } from '../../abstract';\nimport FrameView from './FrameView';\nimport { createEl, removeEl } from '../../utils/dom';\nimport Dragger from '../../utils/Dragger';\nimport CanvasView from './CanvasView';\nimport Frame from '../model/Frame';\n\nexport default class FrameWrapView extends ModuleView {\n events() {\n return {\n 'click [data-action-remove]': 'remove',\n 'mousedown [data-action-move]': 'startDrag',\n };\n }\n elTools?: HTMLElement;\n frame: FrameView;\n dragger?: Dragger;\n cv: CanvasView;\n classAnim: string;\n sizeObserver?: ResizeObserver;\n\n constructor(model: Frame, canvasView: CanvasView) {\n super({ model });\n bindAll(this, 'onScroll', 'frameLoaded', 'updateOffset', 'remove', 'startDrag');\n const config = {\n ...model.config,\n frameWrapView: this,\n };\n this.cv = canvasView;\n this.frame = new FrameView(model, this);\n this.classAnim = `${this.ppfx}frame-wrapper--anim`;\n this.updateOffset = debounce(this.updateOffset.bind(this), 0);\n this.updateSize = debounce(this.updateSize.bind(this), 0);\n this.listenTo(model, 'loaded', this.frameLoaded);\n this.listenTo(model, 'change:x change:y', this.updatePos);\n this.listenTo(model, 'change:width change:height', this.updateSize);\n this.listenTo(model, 'destroy remove', this.remove);\n this.updatePos();\n this.setupDragger();\n }\n\n setupDragger() {\n const { module, model } = this;\n let dragX: number, dragY: number, zoom: number;\n const toggleEffects = (on: boolean) => {\n module.toggleFramesEvents(on);\n };\n\n this.dragger = new Dragger({\n onStart: () => {\n const { x, y } = model.attributes;\n zoom = this.em.getZoomMultiplier();\n dragX = x;\n dragY = y;\n toggleEffects(false);\n },\n onEnd: () => toggleEffects(true),\n setPosition: (posOpts: any) => {\n model.set({\n x: dragX + posOpts.x * zoom,\n y: dragY + posOpts.y * zoom,\n });\n },\n });\n }\n\n startDrag(ev?: Event) {\n ev && this.dragger?.start(ev);\n }\n\n __clear(opts?: any) {\n const { frame } = this;\n frame && frame.remove(opts);\n removeEl(this.elTools);\n }\n\n remove(opts?: any) {\n this.__clear(opts);\n ModuleView.prototype.remove.apply(this, opts);\n //@ts-ignore\n ['frame', 'dragger', 'cv', 'elTools'].forEach(i => (this[i] = 0));\n return this;\n }\n\n updateOffset() {\n const { em, $el, frame } = this;\n if (!em || em.destroyed) return;\n em.runDefault({ preserveSelected: 1 });\n $el.removeClass(this.classAnim);\n frame?.model?._emitUpdated();\n }\n\n updatePos(md?: boolean) {\n const { model, el } = this;\n const { x, y } = model.attributes;\n const { style } = el;\n this.frame.rect = undefined;\n style.left = isNaN(x) ? x : `${x}px`;\n style.top = isNaN(y) ? y : `${y}px`;\n md && this.updateOffset();\n }\n\n updateSize() {\n this.updateDim();\n }\n\n /**\n * Update dimensions of the frame\n * @private\n */\n updateDim() {\n const { em, el, $el, model, classAnim, frame } = this;\n if (!frame) return;\n frame.rect = undefined;\n $el.addClass(classAnim);\n const { noChanges, width, height } = this.__handleSize();\n\n // Set width and height from DOM (should be done only once)\n if (isNull(width) || isNull(height)) {\n model.set(\n {\n ...(!width ? { width: el.offsetWidth } : {}),\n ...(!height ? { height: el.offsetHeight } : {}),\n },\n { silent: 1 }\n );\n }\n\n // Prevent fixed highlighting box which appears when on\n // component hover during the animation\n em.stopDefault({ preserveSelected: 1 });\n noChanges ? this.updateOffset() : setTimeout(this.updateOffset, 350);\n }\n\n onScroll() {\n const { frame, em } = this;\n em.trigger('frame:scroll', {\n frame,\n body: frame.getBody(),\n target: frame.getWindow(),\n });\n }\n\n frameLoaded() {\n const { frame, config } = this;\n frame.getWindow().onscroll = this.onScroll;\n this.updateDim();\n }\n\n __handleSize() {\n const un = 'px';\n const { model, el } = this;\n const { style } = el;\n const { width, height } = model.attributes;\n const currW = style.width || '';\n const currH = style.height || '';\n const newW = width || '';\n const newH = height || '';\n const noChanges = currW == newW && currH == newH;\n const newWidth = isNumber(newW) ? `${newW}${un}` : newW;\n const newHeight = isNumber(newH) ? `${newH}${un}` : newH;\n style.width = newWidth;\n\n if (model.hasAutoHeight()) {\n const iframe = this.frame.el;\n\n if (\n iframe.contentDocument\n // this doesn't work always\n // && !this.sizeObserver\n ) {\n const { contentDocument } = iframe;\n const observer = new ResizeObserver(() => {\n style.height = `${contentDocument.body.scrollHeight}px`;\n });\n observer.observe(contentDocument.body);\n this.sizeObserver?.disconnect();\n this.sizeObserver = observer;\n }\n } else {\n style.height = newHeight;\n this.sizeObserver?.disconnect();\n delete this.sizeObserver;\n }\n\n return { noChanges, width, height, newW, newH };\n }\n\n render() {\n const { frame, $el, ppfx, cv, model, el } = this;\n const { onRender } = model.attributes;\n this.__clear();\n this.__handleSize();\n frame.render();\n $el\n .empty()\n .attr({ class: `${ppfx}frame-wrapper` })\n .append(\n `\n
\n
\n ${model.get('name') || ''}\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n `\n )\n .append(frame.el);\n const elTools = createEl(\n 'div',\n {\n class: `${ppfx}tools`,\n style: 'pointer-events:none; display: none',\n },\n `\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n `\n );\n this.elTools = elTools;\n const twrp = cv?.toolsWrapper;\n twrp && twrp.appendChild(elTools); // TODO remove on frame remove\n onRender &&\n onRender({\n el,\n elTop: el.querySelector('[data-frame-top]'),\n elRight: el.querySelector('[data-frame-right]'),\n elBottom: el.querySelector('[data-frame-bottom]'),\n elLeft: el.querySelector('[data-frame-left]'),\n frame: model,\n frameWrapperView: this,\n remove: this.remove,\n startDrag: this.startDrag,\n });\n return this;\n }\n}\n","import CanvasModule from '..';\nimport ModuleDomainViews from '../../abstract/ModuleDomainViews';\nimport Frames from '../model/Frames';\nimport CanvasView from './CanvasView';\nimport FrameWrapView from './FrameWrapView';\n\nexport default class FramesView extends ModuleDomainViews {\n canvasView: CanvasView;\n private _module: CanvasModule;\n\n constructor(opts = {}, config: any) {\n super(opts, true);\n this.listenTo(this.collection, 'reset', this.render);\n this.canvasView = config.canvasView;\n this._module = config.module;\n }\n\n onRemoveBefore(items: FrameWrapView[], opts = {}) {\n items.forEach(item => item.remove(opts));\n }\n\n onRender() {\n const { $el, ppfx } = this;\n $el.attr({ class: `${ppfx}frames` });\n }\n\n clearItems() {\n const items = this.viewCollection || [];\n items.forEach(item => item.remove());\n this.viewCollection = [];\n }\n\n protected renderView(item: any, type: string) {\n return new FrameWrapView(item, this.canvasView);\n }\n}\n","import { bindAll, isNumber } from 'underscore';\nimport { ModuleView } from '../../abstract';\nimport { BoxRect, Coordinates, CoordinatesTypes, ElementRect } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport ComponentView from '../../dom_components/view/ComponentView';\nimport {\n createEl,\n getDocumentScroll,\n getElRect,\n getKeyChar,\n hasModifierKey,\n isTextNode,\n off,\n on,\n} from '../../utils/dom';\nimport { getComponentView, getElement, getUiClass } from '../../utils/mixins';\nimport Canvas from '../model/Canvas';\nimport Frame from '../model/Frame';\nimport { GetBoxRectOptions, ToWorldOption } from '../types';\nimport FrameView from './FrameView';\nimport FramesView from './FramesView';\n\nexport interface MarginPaddingOffsets {\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n paddingTop?: number;\n paddingRight?: number;\n paddingBottom?: number;\n paddingLeft?: number;\n borderTopWidth?: number;\n borderRightWidth?: number;\n borderBottomWidth?: number;\n borderLeftWidth?: number;\n}\n\nexport type ElementPosOpts = {\n avoidFrameOffset?: boolean;\n avoidFrameZoom?: boolean;\n noScroll?: boolean;\n};\n\nexport interface FitViewportOptions {\n frame?: Frame;\n gap?: number | { x: number; y: number };\n ignoreHeight?: boolean;\n el?: HTMLElement;\n}\n\nexport default class CanvasView extends ModuleView {\n template() {\n const { pfx } = this;\n return `\n
\n
\n
\n
\n \n `;\n }\n /*get className(){\n return this.pfx + 'canvas':\n }*/\n hlEl?: HTMLElement;\n badgeEl?: HTMLElement;\n placerEl?: HTMLElement;\n ghostEl?: HTMLElement;\n toolbarEl?: HTMLElement;\n resizerEl?: HTMLElement;\n offsetEl?: HTMLElement;\n fixedOffsetEl?: HTMLElement;\n toolsGlobEl?: HTMLElement;\n toolsEl?: HTMLElement;\n framesArea?: HTMLElement;\n toolsWrapper?: HTMLElement;\n spotsEl?: HTMLElement;\n cvStyle?: HTMLElement;\n clsUnscale: string;\n ready = false;\n\n frames!: FramesView;\n frame?: FrameView;\n\n private timerZoom?: number;\n\n private frmOff?: { top: number; left: number; width: number; height: number };\n private cvsOff?: { top: number; left: number; width: number; height: number };\n\n constructor(model: Canvas) {\n super({ model });\n bindAll(this, 'clearOff', 'onKeyPress', 'onWheel', 'onPointer');\n const { em, pfx, ppfx } = this;\n const { events } = this.module;\n this.className = `${pfx}canvas ${ppfx}no-touch-actions${!em.config.customUI ? ` ${pfx}canvas-bg` : ''}`;\n this.clsUnscale = `${pfx}unscale`;\n this._initFrames();\n this.listenTo(em, events.refresh, this.clearOff);\n this.listenTo(em, 'component:selected', this.checkSelected);\n this.listenTo(em, `${events.coords} ${events.zoom}`, this.updateFrames);\n this.listenTo(model, 'change:frames', this._onFramesUpdate);\n this.toggleListeners(true);\n }\n\n _onFramesUpdate() {\n this._initFrames();\n this._renderFrames();\n }\n\n _initFrames() {\n const { frames, model, config, em } = this;\n const collection = model.frames;\n em.set('readyCanvas', 0);\n collection.once('loaded:all', () => em.set('readyCanvas', 1));\n frames?.remove();\n this.frames = new FramesView(\n { collection },\n {\n ...config,\n canvasView: this,\n }\n );\n }\n\n checkSelected(component: Component, opts: { scroll?: ScrollIntoViewOptions } = {}) {\n const { scroll } = opts;\n const currFrame = this.em.getCurrentFrame();\n\n scroll &&\n component.views?.forEach(view => {\n view.frameView === currFrame && view.scrollIntoView(scroll);\n });\n }\n\n remove(...args: any) {\n this.frames?.remove();\n //@ts-ignore\n this.frames = undefined;\n ModuleView.prototype.remove.apply(this, args);\n this.toggleListeners(false);\n return this;\n }\n\n preventDefault(ev: Event) {\n if (ev) {\n ev.preventDefault();\n (ev as any)._parentEvent?.preventDefault();\n }\n }\n\n toggleListeners(enable: boolean) {\n const { el, config } = this;\n const fn = enable ? on : off;\n fn(document, 'keypress', this.onKeyPress);\n fn(window, 'scroll resize', this.clearOff);\n fn(el, 'wheel', this.onWheel, { passive: !config.infiniteCanvas });\n fn(el, 'pointermove', this.onPointer);\n }\n\n screenToWorld(x: number, y: number): Coordinates {\n const { module } = this;\n const coords = module.getCoords();\n const zoom = module.getZoomMultiplier();\n const vwDelta = this.getViewportDelta();\n\n return {\n x: (x - coords.x - vwDelta.x) * zoom,\n y: (y - coords.y - vwDelta.y) * zoom,\n };\n }\n\n onPointer(ev: WheelEvent) {\n if (!this.config.infiniteCanvas) return;\n\n const canvasRect = this.getCanvasOffset();\n const docScroll = getDocumentScroll();\n const screenCoords: Coordinates = {\n x: ev.clientX - canvasRect.left + docScroll.x,\n y: ev.clientY - canvasRect.top + docScroll.y,\n };\n\n if ((ev as any)._parentEvent) {\n // with _parentEvent means was triggered from the iframe\n const frameRect = (ev.target as HTMLElement).getBoundingClientRect();\n const zoom = this.module.getZoomDecimal();\n screenCoords.x = frameRect.left - canvasRect.left + docScroll.x + ev.clientX * zoom;\n screenCoords.y = frameRect.top - canvasRect.top + docScroll.y + ev.clientY * zoom;\n }\n\n this.model.set({\n pointerScreen: screenCoords,\n pointer: this.screenToWorld(screenCoords.x, screenCoords.y),\n });\n }\n\n onKeyPress(ev: KeyboardEvent) {\n const { em } = this;\n const key = getKeyChar(ev);\n\n if (key === ' ' && em.getZoomDecimal() !== 1 && !em.Canvas.isInputFocused()) {\n this.preventDefault(ev);\n em.Editor.runCommand('core:canvas-move');\n }\n }\n\n onWheel(ev: WheelEvent) {\n const { module, config } = this;\n if (config.infiniteCanvas) {\n this.preventDefault(ev);\n const { deltaX, deltaY } = ev;\n const zoom = module.getZoomDecimal();\n const isZooming = hasModifierKey(ev);\n const coords = module.getCoords();\n\n if (isZooming) {\n const newZoom = zoom - deltaY * zoom * 0.01;\n module.setZoom(newZoom * 100);\n\n // Update coordinates based on pointer\n const pointer = this.model.getPointerCoords(CoordinatesTypes.Screen);\n const canvasRect = this.getCanvasOffset();\n const pointerX = pointer.x - canvasRect.width / 2;\n const pointerY = pointer.y - canvasRect.height / 2;\n const zoomDelta = newZoom / zoom;\n const x = pointerX - (pointerX - coords.x) * zoomDelta;\n const y = pointerY - (pointerY - coords.y) * zoomDelta;\n module.setCoords(x, y);\n } else {\n this.onPointer(ev);\n module.setCoords(coords.x - deltaX, coords.y - deltaY);\n }\n }\n }\n\n updateFrames(ev: Event) {\n const { em } = this;\n const toolsWrpEl = this.toolsWrapper!;\n const defOpts = { preserveSelected: 1 };\n this.updateFramesArea();\n this.clearOff();\n toolsWrpEl.style.display = 'none';\n em.trigger('canvas:update', ev);\n this.timerZoom && clearTimeout(this.timerZoom);\n this.timerZoom = setTimeout(() => {\n em.stopDefault(defOpts);\n em.runDefault(defOpts);\n toolsWrpEl.style.display = '';\n }, 300) as any;\n }\n\n updateFramesArea() {\n const { framesArea, model, module, cvStyle, clsUnscale } = this;\n const mpl = module.getZoomMultiplier();\n\n if (framesArea) {\n const { x, y } = model.attributes;\n const zoomDc = module.getZoomDecimal();\n\n framesArea.style.transform = `scale(${zoomDc}) translate(${x * mpl}px, ${y * mpl}px)`;\n }\n\n if (cvStyle) {\n cvStyle.innerHTML = `\n .${clsUnscale} { scale: ${mpl} }\n `;\n }\n }\n\n fitViewport(opts: FitViewportOptions = {}) {\n const { em, module, model } = this;\n const canvasRect = this.getCanvasOffset();\n const { el } = opts;\n const elFrame = el && getComponentView(el)?.frameView;\n const frame = elFrame ? elFrame.model : opts.frame || em.getCurrentFrameModel() || model.frames.at(0);\n const { x, y } = frame.attributes;\n const boxRect: BoxRect = {\n x: x ?? 0,\n y: y ?? 0,\n width: frame.width,\n height: frame.height,\n };\n\n if (el) {\n const elRect = this.getElBoxRect(el);\n boxRect.x = boxRect.x + elRect.x;\n boxRect.y = boxRect.y + elRect.y;\n boxRect.width = elRect.width;\n boxRect.height = elRect.height;\n }\n\n const noHeight = opts.ignoreHeight;\n const gap = opts.gap ?? 0;\n const gapIsNum = isNumber(gap);\n const gapX = gapIsNum ? gap : gap.x;\n const gapY = gapIsNum ? gap : gap.y;\n const boxWidth = boxRect.width + gapX * 2;\n const boxHeight = boxRect.height + gapY * 2;\n const canvasWidth = canvasRect.width;\n const canvasHeight = canvasRect.height;\n const widthRatio = canvasWidth / boxWidth;\n const heightRatio = canvasHeight / boxHeight;\n\n const zoomRatio = noHeight ? widthRatio : Math.min(widthRatio, heightRatio);\n const zoom = zoomRatio * 100;\n module.setZoom(zoom);\n\n // check for the frame witdh is necessary as we're centering the frame via CSS\n const coordX = -boxRect.x + (frame.width >= canvasWidth ? canvasWidth / 2 - boxWidth / 2 : -gapX);\n const coordY = -boxRect.y + canvasHeight / 2 - boxHeight / 2;\n\n const coords = {\n x: (coordX + gapX) * zoomRatio,\n y: (coordY + gapY) * zoomRatio,\n };\n\n if (noHeight) {\n const zoomMltp = module.getZoomMultiplier();\n const canvasWorldHeight = canvasHeight * zoomMltp;\n const canvasHeightDiff = canvasWorldHeight - canvasHeight;\n const yDelta = canvasHeightDiff / 2;\n coords.y = (-boxRect.y + gapY) * zoomRatio - yDelta / zoomMltp;\n }\n\n module.setCoords(coords.x, coords.y);\n }\n\n /**\n * Checks if the element is visible in the canvas's viewport\n * @param {HTMLElement} el\n * @return {Boolean}\n */\n isElInViewport(el: HTMLElement) {\n const elem = getElement(el);\n const rect = getElRect(elem);\n const frameRect = this.getFrameOffset(elem);\n const rTop = rect.top;\n const rLeft = rect.left;\n return rTop >= 0 && rLeft >= 0 && rTop <= frameRect.height && rLeft <= frameRect.width;\n }\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return { {top: number, left: number, width: number, height: number} }\n */\n offset(el?: HTMLElement, opts: ElementPosOpts = {}) {\n const { noScroll } = opts;\n const rect = getElRect(el);\n const scroll = noScroll ? { x: 0, y: 0 } : getDocumentScroll(el);\n\n return {\n top: rect.top + scroll.y,\n left: rect.left + scroll.x,\n width: rect.width,\n height: rect.height,\n };\n }\n\n getRectToScreen(boxRect: Partial): BoxRect {\n const zoom = this.module.getZoomDecimal();\n const coords = this.module.getCoords();\n const vwDelta = this.getViewportDelta();\n const x = (boxRect.x ?? 0) * zoom + coords.x + vwDelta.x || 0;\n const y = (boxRect.y ?? 0) * zoom + coords.y + vwDelta.y || 0;\n\n return {\n x,\n y,\n width: (boxRect.width ?? 0) * zoom,\n height: (boxRect.height ?? 0) * zoom,\n };\n }\n\n getElBoxRect(el: HTMLElement, opts: GetBoxRectOptions = {}): BoxRect {\n const { module } = this;\n const { width, height, left, top } = getElRect(el);\n const frameView = getComponentView(el)?.frameView;\n const frameRect = frameView?.getBoxRect();\n const zoomMlt = module.getZoomMultiplier();\n const frameX = frameRect?.x ?? 0;\n const frameY = frameRect?.y ?? 0;\n const canvasEl = this.el;\n const docScroll = getDocumentScroll();\n const xWithFrame = left + frameX + (canvasEl.scrollLeft + docScroll.x) * zoomMlt;\n const yWithFrame = top + frameY + (canvasEl.scrollTop + docScroll.y) * zoomMlt;\n const boxRect = {\n x: xWithFrame,\n y: yWithFrame,\n width,\n height,\n };\n\n if (opts.local) {\n boxRect.x = left;\n boxRect.y = top;\n }\n\n return opts.toScreen ? this.getRectToScreen(boxRect) : boxRect;\n }\n\n getViewportRect(opts: ToWorldOption = {}): BoxRect {\n const { top, left, width, height } = this.getCanvasOffset();\n const { module } = this;\n\n if (opts.toWorld) {\n const zoom = module.getZoomMultiplier();\n const coords = module.getCoords();\n const vwDelta = this.getViewportDelta();\n const x = -coords.x - vwDelta.x || 0;\n const y = -coords.y - vwDelta.y || 0;\n\n return {\n x: x * zoom,\n y: y * zoom,\n width: width * zoom,\n height: height * zoom,\n };\n } else {\n return {\n x: left,\n y: top,\n width,\n height,\n };\n }\n }\n\n getViewportDelta(opts: { withZoom?: number } = {}): Coordinates {\n const zoom = this.module.getZoomMultiplier();\n const { width, height } = this.getCanvasOffset();\n const worldWidth = width * zoom;\n const worldHeight = height * zoom;\n const widthDelta = worldWidth - width;\n const heightDelta = worldHeight - height;\n\n return {\n x: widthDelta / 2 / zoom,\n y: heightDelta / 2 / zoom,\n };\n }\n\n /**\n * Cleare cached offsets\n * @private\n */\n clearOff() {\n this.frmOff = undefined;\n this.cvsOff = undefined;\n }\n\n /**\n * Return frame offset\n * @return { {top: number, left: number, width: number, height: number} }\n * @public\n */\n getFrameOffset(el?: HTMLElement) {\n if (!this.frmOff || el) {\n const frame = this.frame?.el;\n const winEl = el?.ownerDocument.defaultView;\n const frEl = winEl ? (winEl.frameElement as HTMLElement) : frame;\n this.frmOff = this.offset(frEl || frame);\n }\n return this.frmOff;\n }\n\n /**\n * Return canvas offset\n * @return { {top: number, left: number, width: number, height: number} }\n * @public\n */\n getCanvasOffset() {\n if (!this.cvsOff) this.cvsOff = this.offset(this.el);\n return this.cvsOff;\n }\n\n /**\n * Returns element's rect info\n * @param {HTMLElement} el\n * @param {object} opts\n * @return { {top: number, left: number, width: number, height: number, zoom: number, rect: any} }\n * @public\n */\n getElementPos(el: HTMLElement, opts: ElementPosOpts = {}) {\n const zoom = this.module.getZoomDecimal();\n const frameOffset = this.getFrameOffset(el);\n const canvasEl = this.el;\n const canvasOffset = this.getCanvasOffset();\n const elRect = this.offset(el, opts);\n const frameTop = opts.avoidFrameOffset ? 0 : frameOffset.top;\n const frameLeft = opts.avoidFrameOffset ? 0 : frameOffset.left;\n\n const elTop = opts.avoidFrameZoom ? elRect.top : elRect.top * zoom;\n const elLeft = opts.avoidFrameZoom ? elRect.left : elRect.left * zoom;\n\n const top = opts.avoidFrameOffset ? elTop : elTop + frameTop - canvasOffset.top + canvasEl.scrollTop;\n const left = opts.avoidFrameOffset ? elLeft : elLeft + frameLeft - canvasOffset.left + canvasEl.scrollLeft;\n const height = opts.avoidFrameZoom ? elRect.height : elRect.height * zoom;\n const width = opts.avoidFrameZoom ? elRect.width : elRect.width * zoom;\n\n return { top, left, height, width, zoom, rect: elRect };\n }\n\n /**\n * Returns element's offsets like margins and paddings\n * @param {HTMLElement} el\n * @return { MarginPaddingOffsets }\n * @public\n */\n getElementOffsets(el: HTMLElement) {\n if (!el || isTextNode(el)) return {};\n const result: MarginPaddingOffsets = {};\n const styles = window.getComputedStyle(el);\n const zoom = this.module.getZoomDecimal();\n const marginPaddingOffsets: (keyof MarginPaddingOffsets)[] = [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n ];\n marginPaddingOffsets.forEach(offset => {\n result[offset] = parseFloat(styles[offset]) * zoom;\n });\n\n return result;\n }\n\n /**\n * Returns position data of the canvas element\n * @return { {top: number, left: number, width: number, height: number} } obj Position object\n * @public\n */\n getPosition(opts: any = {}): ElementRect {\n const doc = this.frame?.el.contentDocument;\n if (!doc) {\n return {\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n };\n }\n const bEl = doc.body;\n const zoom = this.module.getZoomDecimal();\n const fo = this.getFrameOffset();\n const co = this.getCanvasOffset();\n const { noScroll } = opts;\n\n return {\n top: fo.top + (noScroll ? 0 : bEl.scrollTop) * zoom - co.top,\n left: fo.left + (noScroll ? 0 : bEl.scrollLeft) * zoom - co.left,\n width: co.width,\n height: co.height,\n };\n }\n\n /**\n * Update javascript of a specific component passed by its View\n * @param {ModuleView} view Component's View\n * @private\n */\n //TODO change type after the ComponentView was updated to ts\n updateScript(view: any) {\n const model = view.model;\n const id = model.getId();\n\n if (!view.scriptContainer) {\n view.scriptContainer = createEl('div', { 'data-id': id });\n const jsEl = this.getJsContainer();\n jsEl?.appendChild(view.scriptContainer);\n }\n\n view.el.id = id;\n view.scriptContainer.innerHTML = '';\n // In editor, I make use of setTimeout as during the append process of elements\n // those will not be available immediately, therefore 'item' variable\n const script = document.createElement('script');\n const scriptFn = model.getScriptString();\n const scriptFnStr = model.get('script-props') ? scriptFn : `function(){\\n${scriptFn}\\n;}`;\n const scriptProps = JSON.stringify(model.__getScriptProps());\n script.innerHTML = `\n setTimeout(function() {\n var item = document.getElementById('${id}');\n if (!item) return;\n (${scriptFnStr}.bind(item))(${scriptProps})\n }, 1);`;\n // #873\n // Adding setTimeout will make js components work on init of the editor\n setTimeout(() => {\n const scr = view.scriptContainer;\n scr?.appendChild(script);\n }, 0);\n }\n\n /**\n * Get javascript container\n * @private\n */\n getJsContainer(view?: ComponentView) {\n const frameView = this.getFrameView(view);\n return frameView?.getJsContainer();\n }\n\n getFrameView(view?: ComponentView) {\n return view?.frameView || this.em.getCurrentFrame();\n }\n\n _renderFrames() {\n if (!this.ready) return;\n const { model, frames, em, framesArea } = this;\n const frms = model.frames;\n frms.listenToLoad();\n frames.render();\n const mainFrame = frms.at(0);\n const currFrame = mainFrame?.view;\n em.setCurrentFrame(currFrame);\n framesArea?.appendChild(frames.el);\n this.frame = currFrame;\n this.updateFramesArea();\n }\n\n renderFrames() {\n this._renderFrames();\n }\n\n render() {\n const { el, $el, ppfx, config, em } = this;\n $el.html(this.template());\n const $frames = $el.find('[data-frames]');\n this.framesArea = $frames.get(0);\n\n const toolsWrp = $el.find('[data-tools]');\n this.toolsWrapper = toolsWrp.get(0);\n toolsWrp.append(`\n
\n
\n
\n
\n
\n
\n ${config.extHl ? `
` : ''}\n
\n
\n
\n
\n
\n
\n
\n `);\n this.toolsEl = el.querySelector(`#${ppfx}tools`)!;\n this.hlEl = el.querySelector(`.${ppfx}highlighter`)!;\n this.badgeEl = el.querySelector(`.${ppfx}badge`)!;\n this.placerEl = el.querySelector(`.${ppfx}placeholder`)!;\n this.ghostEl = el.querySelector(`.${ppfx}ghost`)!;\n this.toolbarEl = el.querySelector(`.${ppfx}toolbar`)!;\n this.resizerEl = el.querySelector(`.${ppfx}resizer`)!;\n this.offsetEl = el.querySelector(`.${ppfx}offset-v`)!;\n this.fixedOffsetEl = el.querySelector(`.${ppfx}offset-fixed-v`)!;\n this.toolsGlobEl = el.querySelector(`.${ppfx}tools-gl`)!;\n this.spotsEl = el.querySelector('[data-spots]')!;\n this.cvStyle = el.querySelector('[data-canvas-style]')!;\n this.el.className = getUiClass(em, this.className);\n this.ready = true;\n this._renderFrames();\n\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/canvas/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * canvas: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('canvas:drop', () => { ... });\n *\n * // Use the API\n * const canvas = editor.Canvas;\n * canvas.setCoords(...);\n * ```\n *\n * {REPLACE_EVENTS}\n *\n * [Component]: component.html\n * [Frame]: frame.html\n * [CanvasSpot]: canvas_spot.html\n *\n * @module Canvas\n */\n\nimport { isArray, isUndefined } from 'underscore';\nimport { Module } from '../abstract';\nimport { AddOptions, Coordinates } from '../common';\nimport Component from '../dom_components/model/Component';\nimport ComponentView from '../dom_components/view/ComponentView';\nimport EditorModel from '../editor/model/Editor';\nimport { getElement, getViewEl } from '../utils/mixins';\nimport defaults, { CanvasConfig } from './config/config';\nimport Canvas from './model/Canvas';\nimport CanvasSpot, { CanvasSpotBuiltInTypes, CanvasSpotProps } from './model/CanvasSpot';\nimport CanvasSpots from './model/CanvasSpots';\nimport Frame from './model/Frame';\nimport { CanvasEvents, CanvasRefreshOptions, ToWorldOption } from './types';\nimport CanvasView, { FitViewportOptions } from './view/CanvasView';\nimport FrameView from './view/FrameView';\n\nexport type CanvasEvent = `${CanvasEvents}`;\n\nexport default class CanvasModule extends Module {\n /**\n * Get configuration object\n * @name getConfig\n * @function\n * @return {Object}\n */\n\n /**\n * Used inside RTE\n * @private\n */\n getCanvasView(): CanvasView {\n return this.canvasView as any;\n }\n\n canvas: Canvas;\n model: Canvas;\n spots: CanvasSpots;\n events = CanvasEvents;\n framesById: Record = {};\n private canvasView?: CanvasView;\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n constructor(em: EditorModel) {\n super(em, 'Canvas', defaults);\n\n this.canvas = new Canvas(this);\n this.spots = new CanvasSpots(this);\n this.model = this.canvas;\n this.startAutoscroll = this.startAutoscroll.bind(this);\n this.stopAutoscroll = this.stopAutoscroll.bind(this);\n return this;\n }\n\n postLoad() {\n this.model.init();\n }\n\n getModel() {\n return this.canvas;\n }\n\n /**\n * Get the canvas element\n * @returns {HTMLElement}\n */\n getElement() {\n return this.getCanvasView().el;\n }\n\n getFrame(index?: number) {\n return this.getFrames()[index || 0];\n }\n\n /**\n * Get the main frame element of the canvas\n * @returns {HTMLIFrameElement}\n */\n getFrameEl() {\n const { frame } = this.canvasView || {};\n return frame?.el as HTMLIFrameElement;\n }\n\n getFramesEl() {\n return this.canvasView?.framesArea as HTMLElement;\n }\n\n /**\n * Get the main frame window instance\n * @returns {Window}\n */\n getWindow() {\n const { frame } = this.canvasView || {};\n return frame?.getWindow() as Window;\n }\n\n /**\n * Get the main frame document element\n * @returns {HTMLDocument}\n */\n getDocument() {\n const frame = this.getFrameEl();\n return frame?.contentDocument as Document;\n }\n\n /**\n * Get the main frame body element\n * @return {HTMLBodyElement}\n */\n getBody() {\n const doc = this.getDocument();\n return doc?.body as HTMLBodyElement;\n }\n\n _getLocalEl(globalEl: any, compView: ComponentView, method: keyof FrameView) {\n let result = globalEl;\n const frameView = compView?.frameView;\n result = frameView ? (frameView as any)[method]() : result;\n\n return result;\n }\n\n /**\n * Returns element containing all global canvas tools\n * @returns {HTMLElement}\n * @private\n */\n getGlobalToolsEl() {\n return this.canvasView?.toolsGlobEl;\n }\n\n /**\n * Returns element containing all canvas tools\n * @returns {HTMLElement}\n * @private\n */\n getToolsEl(compView?: any) {\n return this._getLocalEl(this.getCanvasView().toolsEl, compView, 'getToolsEl');\n }\n\n /**\n * Returns highlighter element\n * @returns {HTMLElement}\n * @private\n */\n getHighlighter(compView?: any) {\n return this._getLocalEl(this.getCanvasView().hlEl, compView, 'getHighlighter');\n }\n\n /**\n * Returns badge element\n * @returns {HTMLElement}\n * @private\n */\n getBadgeEl(compView: any) {\n return this._getLocalEl(this.getCanvasView().badgeEl, compView, 'getBadgeEl');\n }\n\n /**\n * Returns placer element\n * @returns {HTMLElement}\n * @private\n */\n getPlacerEl() {\n return this.getCanvasView().placerEl;\n }\n\n /**\n * Returns ghost element\n * @returns {HTMLElement}\n * @private\n */\n getGhostEl() {\n return this.getCanvasView().ghostEl;\n }\n\n /**\n * Returns toolbar element\n * @returns {HTMLElement}\n * @private\n */\n getToolbarEl() {\n return this.getCanvasView().toolbarEl;\n }\n\n /**\n * Returns resizer element\n * @returns {HTMLElement}\n * @private\n */\n getResizerEl() {\n return this.getCanvasView().resizerEl;\n }\n\n /**\n * Returns offset viewer element\n * @returns {HTMLElement}\n * @private\n */\n getOffsetViewerEl(compView: any) {\n return this._getLocalEl(this.getCanvasView().offsetEl, compView, 'getOffsetViewerEl');\n }\n\n /**\n * Returns fixed offset viewer element\n * @returns {HTMLElement}\n * @private\n */\n getFixedOffsetViewerEl() {\n return this.getCanvasView().fixedOffsetEl;\n }\n\n getSpotsEl() {\n return this.canvasView?.spotsEl;\n }\n\n render(): HTMLElement {\n this.canvasView?.remove();\n this.canvasView = new CanvasView(this.canvas);\n return this.canvasView.render().el;\n }\n\n /**\n * Get frame position\n * @returns {Object}\n * @private\n */\n getOffset() {\n var frameOff = this.offset(this.getFrameEl());\n var canvasOff = this.offset(this.getElement());\n return {\n top: frameOff.top - canvasOff.top,\n left: frameOff.left - canvasOff.left,\n };\n }\n\n /**\n * Get the offset of the passed component element\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n offset(el: HTMLElement) {\n return this.getCanvasView().offset(el);\n }\n\n /**\n * Set custom badge naming strategy\n * @param {Function} f\n * @example\n * canvas.setCustomBadgeLabel(function(component){\n * return component.getName();\n * });\n */\n setCustomBadgeLabel(f: Function) {\n //@ts-ignore\n this.config.customBadgeLabel = f;\n }\n\n /**\n * Get element position relative to the canvas\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n getElementPos(el: HTMLElement, opts?: any) {\n return this.getCanvasView().getElementPos(el, opts);\n }\n\n /**\n * Returns element's offsets like margins and paddings\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n getElementOffsets(el: HTMLElement) {\n return this.getCanvasView().getElementOffsets(el);\n }\n\n /**\n * Get canvas rectangular data\n * @returns {Object}\n */\n getRect() {\n const { top = 0, left = 0 } = this.getCanvasView().getPosition() ?? {};\n return {\n ...this.getCanvasView().getCanvasOffset(),\n topScroll: top,\n leftScroll: left,\n };\n }\n\n /**\n * This method comes handy when you need to attach something like toolbars\n * to elements inside the canvas, dealing with all relative position,\n * offsets, etc. and returning as result the object with positions which are\n * viewable by the user (when the canvas is scrolled the top edge of the element\n * is not viewable by the user anymore so the new top edge is the one of the canvas)\n *\n * The target should be visible before being passed here as invisible elements\n * return empty string as width\n * @param {HTMLElement} target The target in this case could be the toolbar\n * @param {HTMLElement} element The element on which I'd attach the toolbar\n * @param {Object} options Custom options\n * @param {Boolean} options.toRight Set to true if you want the toolbar attached to the right\n * @return {Object}\n * @private\n */\n getTargetToElementDim(target: HTMLElement, element: HTMLElement, options: any = {}) {\n var opts = options || {};\n var canvasPos = this.getCanvasView().getPosition();\n if (!canvasPos) return;\n var pos = opts.elPos || this.getCanvasView().getElementPos(element);\n var toRight = options.toRight || 0;\n var targetHeight = opts.targetHeight || target.offsetHeight;\n var targetWidth = opts.targetWidth || target.offsetWidth;\n var eventToTrigger = opts.event || null;\n\n var elTop = pos.top - targetHeight;\n var elLeft = pos.left;\n elLeft += toRight ? pos.width : 0;\n elLeft = toRight ? elLeft - targetWidth : elLeft;\n\n var leftPos = elLeft < canvasPos.left ? canvasPos.left : elLeft;\n var topPos = elTop < canvasPos.top ? canvasPos.top : elTop;\n topPos = topPos > pos.top + pos.height ? pos.top + pos.height : topPos;\n\n var result = {\n top: topPos,\n left: leftPos,\n elementTop: pos.top,\n elementLeft: pos.left,\n elementWidth: pos.width,\n elementHeight: pos.height,\n targetWidth: target.offsetWidth,\n targetHeight: target.offsetHeight,\n canvasTop: canvasPos.top,\n canvasLeft: canvasPos.left,\n canvasWidth: canvasPos.width,\n canvasHeight: canvasPos.height,\n };\n\n // In this way I can catch data and also change the position strategy\n if (eventToTrigger && this.em) {\n this.em.trigger(eventToTrigger, result);\n }\n\n return result;\n }\n\n canvasRectOffset(el: HTMLElement, pos: { top: number; left: number }, opts: any = {}) {\n const getFrameElFromDoc = (doc: Document) => {\n const { defaultView } = doc;\n return defaultView?.frameElement as HTMLElement;\n };\n\n const rectOff = (el: HTMLElement, top = 1, pos: { top: number; left: number }) => {\n const zoom = this.em.getZoomDecimal();\n const side = top ? 'top' : 'left';\n const doc = el.ownerDocument;\n const { offsetTop = 0, offsetLeft = 0 } = opts.offset ? getFrameElFromDoc(doc) : {};\n const { scrollTop = 0, scrollLeft = 0 } = doc.body || {};\n const scroll = top ? scrollTop : scrollLeft;\n const offset = top ? offsetTop : offsetLeft;\n\n return pos[side] - (scroll - offset) * zoom;\n };\n\n return {\n top: rectOff(el, 1, pos),\n left: rectOff(el, 0, pos),\n };\n }\n\n /**\n *\n * @param {HTMLElement} el The component element in the canvas\n * @param {HTMLElement} targetEl The target element to position (eg. toolbar)\n * @param {Object} opts\n * @private\n */\n getTargetToElementFixed(el: HTMLElement, targetEl: HTMLElement, opts: any = {}) {\n const elRect = opts.pos || this.getElementPos(el, { noScroll: true });\n const canvasOffset = opts.canvasOff || this.canvasRectOffset(el, elRect);\n const targetHeight = targetEl.offsetHeight || 0;\n const targetWidth = targetEl.offsetWidth || 0;\n const elRight = elRect.left + elRect.width;\n const canvasView = this.getCanvasView();\n const canvasRect = canvasView.getPosition();\n const frameOffset = canvasView.getFrameOffset(el);\n const { event } = opts;\n\n let top = -targetHeight;\n let left = !isUndefined(opts.left) ? opts.left : elRect.width - targetWidth;\n left = elRect.left < -left ? -elRect.left : left;\n left = elRight > canvasRect.width ? left - (elRight - canvasRect.width) : left;\n\n // Check when the target top edge reaches the top of the viewable canvas\n if (canvasOffset.top < targetHeight) {\n const fullHeight = elRect.height + targetHeight;\n const elIsShort = fullHeight < frameOffset.height;\n\n // Scroll with the window if the top edge is reached and the\n // element is bigger than the canvas\n if (elIsShort) {\n top = top + fullHeight;\n } else {\n top = -canvasOffset.top < elRect.height ? -canvasOffset.top : elRect.height;\n }\n }\n\n const result = {\n top,\n left,\n canvasOffsetTop: canvasOffset.top,\n canvasOffsetLeft: canvasOffset.left,\n elRect,\n canvasOffset,\n canvasRect,\n targetWidth,\n targetHeight,\n };\n\n // In this way I can catch data and also change the position strategy\n event && this.em.trigger(event, result);\n\n return result;\n }\n\n /**\n * Instead of simply returning e.clientX and e.clientY this function\n * calculates also the offset based on the canvas. This is helpful when you\n * need to get X and Y position while moving between the editor area and\n * canvas area, which is in the iframe\n * @param {Event} e\n * @return {Object}\n * @private\n */\n getMouseRelativePos(e: any, opts: any = {}) {\n const subWinOffset = opts.subWinOffset;\n const doc = e.target.ownerDocument;\n const win = doc.defaultView || doc.parentWindow;\n const frame = win.frameElement;\n const yOffset = subWinOffset ? win.pageYOffset : 0;\n const xOffset = subWinOffset ? win.pageXOffset : 0;\n const zoomMlt = this.getZoomMultiplier();\n let addTop = 0;\n let addLeft = 0;\n\n if (frame) {\n var frameRect = frame.getBoundingClientRect();\n addTop = frameRect.top || 0;\n addLeft = frameRect.left || 0;\n }\n\n return {\n y: (e.clientY + addTop - yOffset) * zoomMlt,\n x: (e.clientX + addLeft - xOffset) * zoomMlt,\n };\n }\n\n /**\n * X and Y mouse position relative to the canvas\n * @param {Event} ev\n * @return {Object}\n * @private\n */\n getMouseRelativeCanvas(ev: MouseEvent, opts: any) {\n const zoom = this.getZoomDecimal();\n const { top = 0, left = 0 } = this.getCanvasView().getPosition(opts) ?? {};\n\n return {\n y: ev.clientY * zoom + top,\n x: ev.clientX * zoom + left,\n };\n }\n\n /**\n * Check if the canvas is focused\n * @returns {Boolean}\n */\n hasFocus() {\n return this.getDocument().hasFocus();\n }\n\n /**\n * Detects if some input is focused (input elements, text components, etc.)\n * @return {Boolean}\n * @private\n */\n isInputFocused() {\n const doc = this.getDocument();\n const frame = this.getFrameEl();\n const toIgnore = ['body', ...this.config.notTextable!];\n const docActive = frame && document.activeElement === frame;\n const focused = docActive ? doc && doc.activeElement : document.activeElement;\n\n return focused && !toIgnore.some(item => focused.matches(item));\n }\n\n /**\n * Scroll canvas to the element if it's not visible. The scrolling is\n * executed via `scrollIntoView` API and options of this method are\n * passed to it. For instance, you can scroll smoothly by using\n * `{ behavior: 'smooth' }`.\n * @param {HTMLElement|[Component]} el\n * @param {Object} [opts={}] Options, same as options for `scrollIntoView`\n * @param {Boolean} [opts.force=false] Force the scroll, even if the element is already visible\n * @example\n * const selected = editor.getSelected();\n * // Scroll smoothly (this behavior can be polyfilled)\n * canvas.scrollTo(selected, { behavior: 'smooth' });\n * // Force the scroll, even if the element is alredy visible\n * canvas.scrollTo(selected, { force: true });\n */\n scrollTo(el: any, opts = {}) {\n const elem = getElement(el);\n const view = elem && getViewEl(elem);\n view && view.scrollIntoView(opts);\n }\n\n /**\n * Start autoscroll\n * @private\n */\n startAutoscroll(frame?: Frame) {\n const fr = (frame && frame.view) || this.em.getCurrentFrame();\n fr && fr.startAutoscroll();\n }\n\n /**\n * Stop autoscroll\n * @private\n */\n stopAutoscroll(frame?: Frame) {\n const fr = (frame && frame.view) || this.em.getCurrentFrame();\n fr && fr.stopAutoscroll();\n }\n\n /**\n * Set canvas zoom value\n * @param {Number} value The zoom value, from 0 to 100\n * @returns {this}\n * @example\n * canvas.setZoom(50); // set zoom to 50%\n */\n setZoom(value: number | string) {\n this.canvas.set('zoom', typeof value === 'string' ? parseFloat(value) : value);\n return this;\n }\n\n /**\n * Get canvas zoom value\n * @returns {Number}\n * @example\n * canvas.setZoom(50); // set zoom to 50%\n * const zoom = canvas.getZoom(); // 50\n */\n getZoom() {\n return parseFloat(this.canvas.get('zoom'));\n }\n\n /**\n * Set canvas position coordinates\n * @param {Number} x Horizontal position\n * @param {Number} y Vertical position\n * @returns {this}\n * @example\n * canvas.setCoords(100, 100);\n */\n setCoords(x?: string | number, y?: string | number, opts: ToWorldOption = {}) {\n const hasX = x || x === 0;\n const hasY = y || y === 0;\n const coords = {\n x: this.canvas.get('x'),\n y: this.canvas.get('y'),\n };\n\n if (hasX) coords.x = parseFloat(`${x}`);\n if (hasY) coords.y = parseFloat(`${y}`);\n\n if (opts.toWorld) {\n const delta = this.canvasView?.getViewportDelta();\n if (delta) {\n if (hasX) coords.x = coords.x - delta.x;\n if (hasY) coords.y = coords.y - delta.y;\n }\n }\n\n this.canvas.set(coords);\n\n return this;\n }\n\n /**\n * Get canvas position coordinates\n * @returns {Object} Object containing coordinates\n * @example\n * canvas.setCoords(100, 100);\n * const coords = canvas.getCoords();\n * // { x: 100, y: 100 }\n */\n getCoords(): Coordinates {\n const { x, y } = this.canvas.attributes;\n return { x, y };\n }\n\n /**\n * Get canvas pointer position coordinates.\n * @returns {Object} Object containing pointer coordinates\n * @private\n * @example\n * const worldPointer = canvas.getPointer();\n * const screenPointer = canvas.getPointer(true);\n */\n getPointer(screen?: boolean): Coordinates {\n const { pointer, pointerScreen } = this.canvas.attributes;\n return screen ? pointerScreen : pointer;\n }\n\n getZoomDecimal() {\n return this.getZoom() / 100;\n }\n\n getZoomMultiplier() {\n const zoom = this.getZoomDecimal();\n return zoom ? 1 / zoom : 1;\n }\n\n fitViewport(opts?: FitViewportOptions) {\n this.canvasView?.fitViewport(opts);\n }\n\n toggleFramesEvents(on: boolean) {\n const { style } = this.getFramesEl();\n style.pointerEvents = on ? '' : 'none';\n }\n\n getFrames() {\n return this.canvas.frames.map(item => item);\n }\n\n /**\n * Add new frame to the canvas\n * @param {Object} props Frame properties\n * @returns {[Frame]}\n * @private\n * @example\n * canvas.addFrame({\n * name: 'Mobile home page',\n * x: 100, // Position in canvas\n * y: 100,\n * width: 500, // Frame dimensions\n * height: 600,\n * // device: 'DEVICE-ID',\n * components: [\n * '

Title frame

',\n * '

Paragraph frame

',\n * ],\n * styles: `\n * .testh { color: red; }\n * .testp { color: blue; }\n * `,\n * });\n */\n addFrame(props = {}, opts = {}) {\n return this.canvas.frames.add(new Frame(this, { ...props }), opts);\n }\n\n /**\n * Get the last created Component from a drag & drop to the canvas.\n * @returns {[Component]|undefined}\n */\n getLastDragResult(): Component | undefined {\n return this.em.get('dragResult');\n }\n\n /**\n * Add or update canvas spot.\n * @param {Object} props Canvas spot properties.\n * @param opts\n * @returns {[CanvasSpot]}\n * @example\n * // Add new canvas spot\n * const spot = canvas.addSpot({\n * type: 'select', // 'select' is one of the built-in spots\n * component: editor.getSelected(),\n * });\n *\n * // Add custom canvas spot\n * const spot = canvas.addSpot({\n * type: 'my-custom-spot',\n * component: editor.getSelected(),\n * });\n * // Update the same spot by reusing its ID\n * canvas.addSpot({\n * id: spot.id,\n * component: anotherComponent,\n * });\n */\n addSpot(props: Omit & { id?: string }, opts: AddOptions = {}) {\n const spotProps = props as T;\n const spots = this.getSpots(spotProps);\n\n if (spots.length) {\n const spot = spots[0];\n spot.set(spotProps);\n return spot;\n }\n\n const cmpView = spotProps.componentView || spotProps.component?.view;\n const spot = new CanvasSpot(this, {\n ...spotProps,\n id: spotProps.id || `cs_${spotProps.type}_${cmpView?.cid}`,\n type: spotProps.type || '',\n } as T);\n\n this.spots.add(spot, opts);\n\n return spot;\n }\n\n /**\n * Get canvas spots.\n * @param {Object} [spotProps] Canvas spot properties for filtering the result. With no properties, all available spots will be returned.\n * @returns {[CanvasSpot][]}\n * @example\n * canvas.addSpot({ type: 'select', component: cmp1 });\n * canvas.addSpot({ type: 'select', component: cmp2 });\n * canvas.addSpot({ type: 'target', component: cmp3 });\n *\n * // Get all spots\n * const allSpots = canvas.getSpots();\n * allSpots.length; // 3\n *\n * // Get all 'select' spots\n * const allSelectSpots = canvas.getSpots({ type: 'select' });\n * allSelectSpots.length; // 2\n */\n getSpots(spotProps: Partial = {}) {\n return this.spots.where(spotProps.id ? { id: spotProps.id } : spotProps) as CanvasSpot[];\n }\n\n /**\n * Remove canvas spots.\n * @param {Object|[CanvasSpot][]} [spotProps] Canvas spot properties for filtering spots to remove or an array of spots to remove. With no properties, all available spots will be removed.\n * @returns {[CanvasSpot][]}\n * @example\n * canvas.addSpot({ type: 'select', component: cmp1 });\n * canvas.addSpot({ type: 'select', component: cmp2 });\n * canvas.addSpot({ type: 'target', component: cmp3 });\n *\n * // Remove all 'select' spots\n * canvas.removeSpots({ type: 'select' });\n *\n * // Remove spots by an array of canvas spots\n * const filteredSpots = canvas.getSpots().filter(spot => myCustomCondition);\n * canvas.removeSpots(filteredSpots);\n *\n * // Remove all spots\n * canvas.removeSpots();\n */\n removeSpots(spotProps: Partial | CanvasSpot[] = {}) {\n const spots = isArray(spotProps) ? spotProps : this.getSpots(spotProps);\n const removed = this.spots.remove(spots);\n return removed as unknown as CanvasSpot[];\n }\n\n /**\n * Check if the built-in canvas spot has a declared custom rendering.\n * @param {String} type Built-in canvas spot type\n * @returns {Boolean}\n * @example\n * grapesjs.init({\n * // ...\n * canvas: {\n * // avoid rendering the built-in 'target' canvas spot\n * customSpots: { target: true }\n * }\n * });\n * // ...\n * canvas.hasCustomSpot('select'); // false\n * canvas.hasCustomSpot('target'); // true\n */\n hasCustomSpot(type?: CanvasSpotBuiltInTypes) {\n const { customSpots } = this.config;\n\n if (customSpots === true || (customSpots && type && customSpots[type])) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Transform a box rect from the world coordinate system to the screen one.\n * @param {Object} boxRect\n * @returns {Object}\n */\n getWorldRectToScreen(boxRect: Parameters[0]) {\n return this.canvasView?.getRectToScreen(boxRect);\n }\n\n /**\n * Update canvas for spots/tools positioning.\n * @param {Object} [opts] Options.\n * @param {Object} [opts.spots=false] Update the position of spots.\n */\n refresh(opts: CanvasRefreshOptions = {}) {\n const { em, events, canvasView } = this;\n canvasView?.clearOff();\n\n if (opts.spots || opts.all) {\n this.refreshSpots();\n em.trigger('canvas:updateTools'); // this should be deprecated\n }\n\n em.set('canvasOffset', this.getOffset()); // this should be deprecated\n em.trigger(events.refresh, opts);\n }\n\n refreshSpots() {\n this.spots.refresh();\n }\n\n destroy() {\n this.canvas.stopListening();\n this.canvasView?.remove();\n //[this.canvas, this.canvasView].forEach(i => (i = {}));\n //@ts-ignore\n ['model', 'droppable'].forEach(i => (this[i] = {}));\n }\n}\n","import Component from '../model/Component';\n\nexport interface DomComponentsConfig {\n stylePrefix?: string;\n\n /**\n * Could be used for default components.\n */\n components?: Record[];\n\n /**\n * If the component is draggable you can drag the component itself (not only from the toolbar).\n * @default true\n */\n draggableComponents?: boolean;\n\n /**\n * Experimental: Disable text inner components.\n * With this option, you're able to decide which inner component inside text should be\n * disabled (eg. no select, no hover, no layer visibility) once edited.\n * @default false\n * @example\n * // disable all inner childs\n * disableTextInnerChilds: true,\n * // disable all except link components\n * disableTextInnerChilds: (child) => !child.is('link'),\n */\n disableTextInnerChilds?: boolean | ((cmp: Component) => boolean | void);\n\n /**\n * You can setup a custom component definition processor before adding it into the editor.\n * It might be useful to transform custom objects (es. some framework specific JSX) to GrapesJS component one.\n * This custom function will be executed on ANY new added component to the editor so make smart checks/conditions\n * to avoid doing useless executions\n * By default, GrapesJS supports already elements generated from React JSX preset\n * @example\n * processor: (obj) => {\n * if (obj.$$typeof) { // eg. this is a React Element\n * const gjsComponent = {\n * type: obj.type,\n * components: obj.props.children,\n * ...\n * };\n * ...\n * return gjsComponent;\n * }\n * }\n */\n processor?: (obj: any) => Record | undefined;\n\n /**\n * List of HTML void elements.\n * https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#void-elements\n */\n voidElements?: string[];\n\n /**\n * Experimental: Use the frame document for DOM element creation.\n * This option might be useful when elements require the local document context to\n * work properly (eg. Web Components).\n */\n useFrameDoc?: boolean;\n}\n\nexport default {\n stylePrefix: 'comp-',\n components: [],\n draggableComponents: true,\n disableTextInnerChilds: false,\n processor: undefined,\n useFrameDoc: false,\n voidElements: [\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'menuitem',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n ],\n} as DomComponentsConfig;\n","import Component from './Component';\nimport { escapeNodeContent } from '../../utils/mixins';\n\nexport default class ComponentTextNode extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n tagName: '',\n droppable: false,\n layerable: false,\n selectable: false,\n editable: true,\n };\n }\n\n toHTML() {\n const { content } = this;\n const parent = this.parent();\n return parent?.is('script') ? content : this.__escapeContent(content);\n }\n\n __escapeContent(content: string) {\n return escapeNodeContent(content);\n }\n\n static isComponent(el: HTMLElement) {\n if (el.nodeType === 3) {\n return {\n type: 'textnode',\n content: el.textContent ?? '',\n };\n }\n }\n}\n","import ComponentTextNode from './ComponentTextNode';\n\nexport default class ComponentComment extends ComponentTextNode {\n get defaults() {\n // @ts-ignore\n return { ...super.defaults };\n }\n\n toHTML() {\n return ``;\n }\n\n static isComponent(el: HTMLElement) {\n if (el.nodeType == 8) {\n return {\n type: 'comment',\n content: el.textContent ?? '',\n };\n }\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'iframe';\n\nexport default class ComponentFrame extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n droppable: false,\n resizable: true,\n traits: ['id', 'title', 'src'],\n attributes: { frameborder: '0' },\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n\n// ComponentFrame.isComponent = el => toLowerCase(el.tagName) === type;\n","import { result } from 'underscore';\nimport Component from './Component';\nimport { toLowerCase, buildBase64UrlFromSvg, hasWin } from '../../utils/mixins';\nimport { ObjectStrings } from '../../common';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nconst svgAttrs =\n '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)\"';\n\nexport default class ComponentImage extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type: 'image',\n tagName: 'img',\n void: true,\n droppable: 0,\n editable: 1,\n highlightable: 0,\n resizable: { ratioDefault: 1 },\n traits: ['alt'],\n\n src: `\n \n `,\n\n // Fallback image in case the src can't be loaded\n // If you use SVG, xmlns=\"http://www.w3.org/2000/svg\" is required\n fallback: `\n \n `,\n\n // File to load asynchronously once the model is rendered\n file: '',\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n const { src } = this.get('attributes')!;\n if (src && buildBase64UrlFromSvg(result(this, 'defaults').src) !== src) {\n this.set('src', src, { silent: true });\n }\n }\n\n initToolbar() {\n super.initToolbar();\n const { em } = this;\n\n if (em) {\n const cmd = em.Commands;\n const cmdName = 'image-editor';\n\n // Add Image Editor button only if the default command exists\n if (cmd.has(cmdName)) {\n let hasButtonBool = false;\n const tb = this.get('toolbar')!;\n\n for (let i = 0; i < tb.length; i++) {\n if (tb[i].command === 'image-editor') {\n hasButtonBool = true;\n break;\n }\n }\n\n if (!hasButtonBool) {\n tb.push({\n attributes: { class: 'fa fa-pencil' },\n command: cmdName,\n });\n this.set('toolbar', tb);\n }\n }\n }\n }\n\n /**\n * Returns object of attributes for HTML\n * @return {Object}\n * @private\n */\n getAttrToHTML() {\n const attr = super.getAttrToHTML();\n const src = this.getSrcResult();\n if (src) attr.src = src;\n return attr;\n }\n\n getSrcResult(opt: { fallback?: boolean } = {}) {\n const src = this.get(opt.fallback ? 'fallback' : 'src') || '';\n let result = src;\n\n if (src && src.substr(0, 4) === '[0]) {\n const obj = super.toJSON(opts);\n const { attributes } = obj;\n\n if (attributes && obj.src === attributes.src) {\n delete obj.src;\n }\n\n return obj;\n }\n\n /**\n * Parse uri\n * @param {string} uri\n * @return {object}\n * @private\n */\n parseUri(uri: string) {\n let result: HTMLAnchorElement | URL | ObjectStrings = {};\n\n const getQueryObject = (search = '') => {\n const query: ObjectStrings = {};\n const qrs = search.substring(1).split('&');\n\n for (let i = 0; i < qrs.length; i++) {\n const pair = qrs[i].split('=');\n const name = decodeURIComponent(pair[0]);\n if (name) query[name] = decodeURIComponent(pair[1] || '');\n }\n\n return query;\n };\n\n if (hasWin()) {\n result = document.createElement('a');\n result.href = uri;\n } else if (typeof URL !== 'undefined') {\n try {\n result = new URL(uri);\n } catch (e) {}\n }\n\n return {\n hostname: result.hostname || '',\n pathname: result.pathname || '',\n protocol: result.protocol || '',\n search: result.search || '',\n hash: result.hash || '',\n port: result.port || '',\n query: getQueryObject(result.search),\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === 'img';\n }\n}\n","import { isFunction } from 'underscore';\nimport Component from './Component';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nexport default class ComponentText extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type: 'text',\n droppable: false,\n editable: true,\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n this.__checkInnerChilds();\n }\n\n __checkInnerChilds() {\n const { disableTextInnerChilds } = this.em.Components.config;\n if (disableTextInnerChilds) {\n const disableChild = (child: Component) => {\n if (!child.isInstanceOf('textnode')) {\n child.set({\n locked: true,\n layerable: false,\n });\n }\n };\n\n if (isFunction(disableTextInnerChilds)) {\n this.forEachChild(child => {\n disableTextInnerChilds(child) && disableChild(child);\n });\n } else {\n this.forEachChild(disableChild);\n }\n }\n }\n}\n","import ComponentText from './ComponentText';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'label';\n\nexport default class ComponentLabel extends ComponentText {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n traits: ['id', 'title', 'for'],\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import { forEach } from 'underscore';\nimport { toLowerCase } from '../../utils/mixins';\nimport ComponentText from './ComponentText';\n\nconst type = 'link';\n\nexport default class ComponentLink extends ComponentText {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: 'a',\n traits: ['title', 'href', 'target'],\n };\n }\n\n static isComponent(el: HTMLElement, opts: any = {}) {\n let result: any;\n\n if (toLowerCase(el.tagName) === 'a') {\n const textTags = opts.textTags || [];\n result = { type, editable: false };\n\n // The link is editable only if, at least, one of its\n // children is a text node (not empty one)\n const children = el.childNodes;\n const len = children.length;\n if (!len) delete result.editable;\n\n forEach(children, child => {\n const { tagName } = child as HTMLElement;\n if (\n (child.nodeType == 3 && (child as any).textContent.trim() !== '') ||\n (tagName && textTags.indexOf(toLowerCase(tagName)) >= 0)\n ) {\n delete result.editable;\n }\n });\n }\n\n return result;\n }\n}\n","import ComponentImage from './ComponentImage';\nimport { toLowerCase } from '../../utils/mixins';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nexport default class ComponentMap extends ComponentImage {\n /** @ts-ignore */\n get defaults() {\n // @ts-ignore\n const defs = super.defaults;\n\n return {\n ...defs,\n type: 'map',\n src: '',\n void: false,\n mapUrl: 'https://maps.google.com/maps',\n tagName: 'iframe',\n mapType: 'q',\n address: '',\n zoom: '1',\n attributes: { frameborder: 0 },\n // @ts-ignore\n toolbar: defs.toolbar,\n traits: [\n {\n label: 'Address',\n name: 'address',\n placeholder: 'eg. London, UK',\n changeProp: true,\n },\n {\n type: 'select',\n label: 'Map type',\n name: 'mapType',\n changeProp: true,\n options: [\n { id: 'q', label: 'Roadmap' },\n { id: 'w', label: 'Satellite' },\n ],\n },\n {\n label: 'Zoom',\n name: 'zoom',\n type: 'range',\n min: 1,\n max: 20,\n changeProp: true,\n },\n ],\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n if (this.get('src')) this.parseFromSrc();\n else this.updateSrc();\n\n this.listenTo(this, 'change:address change:zoom change:mapType', this.updateSrc);\n }\n\n updateSrc() {\n this.set('src', this.getMapUrl());\n }\n\n /**\n * Returns url of the map\n * @return {string}\n * @private\n */\n getMapUrl() {\n let addr = this.get('address');\n let zoom = this.get('zoom');\n let type = this.get('mapType');\n addr = addr ? '&q=' + addr : '';\n zoom = zoom ? '&z=' + zoom : '';\n type = type ? '&t=' + type : '';\n let result = this.get('mapUrl') + '?' + addr + zoom + type;\n result += '&output=embed';\n return result;\n }\n\n /**\n * Set attributes by src string\n * @private\n */\n parseFromSrc() {\n const uri = this.parseUri(this.get('src'));\n const qr = uri.query;\n if (qr.q) this.set('address', qr.q);\n if (qr.z) this.set('zoom', qr.z);\n if (qr.t) this.set('mapType', qr.t);\n }\n\n static isComponent(el: HTMLIFrameElement) {\n if (toLowerCase(el.tagName) == 'iframe' && /maps\\.google\\.com/.test(el.src)) {\n return { type: 'map', src: el.src };\n }\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'script';\n\nexport default class ComponentScript extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n droppable: false,\n draggable: false,\n layerable: false,\n highlightable: false,\n };\n }\n\n static isComponent(el: HTMLScriptElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'svg';\n\nexport default class ComponentSvg extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n highlightable: false,\n resizable: { ratioDefault: true },\n };\n }\n\n getName() {\n let name = this.get('tagName')!;\n const customName = this.get('custom-name');\n name = name.charAt(0).toUpperCase() + name.slice(1);\n return customName || name;\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import ComponentSvg from './ComponentSvg';\n\n/**\n * Component for inner SVG elements\n */\nexport default class ComponentSvgIn extends ComponentSvg {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n selectable: false,\n hoverable: false,\n layerable: false,\n };\n }\n\n static isComponent(el: any, opts: any = {}) {\n return !!opts.inSvg;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nconst type = 'table';\n\nexport default class ComponentTable extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n droppable: ['tbody', 'thead', 'tfoot'],\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n const components = this.get('components')!;\n !components.length && components.add({ type: 'tbody' });\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nconst type = 'tbody';\n\nexport default class ComponentTableBody extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n draggable: ['table'],\n droppable: ['tr'],\n columns: 1,\n rows: 1,\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n const components = this.get('components')!;\n let columns = this.get('columns');\n let rows = this.get('rows');\n\n // Init components if empty\n if (!components.length) {\n const rowsToAdd = [];\n\n while (rows--) {\n const columnsToAdd = [];\n let clm = columns;\n\n while (clm--) {\n columnsToAdd.push({\n type: 'cell',\n classes: ['cell'],\n });\n }\n\n rowsToAdd.push({\n type: 'row',\n classes: ['row'],\n components: columnsToAdd,\n });\n }\n\n components.add(rowsToAdd);\n }\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nexport default class ComponentTableCell extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type: 'cell',\n tagName: 'td',\n draggable: ['tr'],\n };\n }\n\n static isComponent(el: HTMLElement) {\n return ['td', 'th'].indexOf(toLowerCase(el.tagName)) >= 0;\n }\n}\n","import ComponentTableBody from './ComponentTableBody';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'tfoot';\n\nexport default class ComponentTableFoot extends ComponentTableBody {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import ComponentTableBody from './ComponentTableBody';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'thead';\n\nexport default class ComponentTableHead extends ComponentTableBody {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst tagName = 'tr';\n\nexport default class ComponentTableRow extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n tagName,\n draggable: ['thead', 'tbody', 'tfoot'],\n droppable: ['th', 'td'],\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === tagName;\n }\n}\n","import { ObjectAny } from '../../common';\nimport { isDef, isEmptyObj, toLowerCase } from '../../utils/mixins';\nimport ComponentImage from './ComponentImage';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nconst type = 'video';\nconst yt = 'yt';\nconst vi = 'vi';\nconst ytnc = 'ytnc';\nconst defProvider = 'so';\n\nconst hasParam = (value: string) => value && value !== '0';\n\nexport default class ComponentVideo extends ComponentImage {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n videoId: '',\n void: false,\n provider: defProvider, // on change of provider, traits are switched\n ytUrl: 'https://www.youtube.com/embed/',\n ytncUrl: 'https://www.youtube-nocookie.com/embed/',\n viUrl: 'https://player.vimeo.com/video/',\n loop: false,\n poster: '',\n muted: 0,\n autoplay: false,\n controls: true,\n color: '',\n list: '',\n src: '',\n rel: 1, // YT related videos\n modestbranding: 0, // YT modest branding\n sources: [],\n attributes: { allowfullscreen: 'allowfullscreen' },\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n if (this.get('src')) this.parseFromSrc();\n this.updatePropsFromAttr();\n this.updateTraits();\n this.on('change:provider', this.updateTraits);\n this.on('change:videoId change:provider', this.updateSrc);\n }\n\n updatePropsFromAttr() {\n if (this.get('provider') === defProvider) {\n const { controls, autoplay, loop } = this.get('attributes')!;\n const toUp: ObjectAny = {};\n\n if (isDef(controls)) toUp.controls = !!controls;\n if (isDef(autoplay)) toUp.autoplay = !!autoplay;\n if (isDef(loop)) toUp.loop = !!loop;\n\n if (!isEmptyObj(toUp)) {\n this.set(toUp);\n }\n }\n }\n\n /**\n * Update traits by provider\n * @private\n */\n updateTraits() {\n const { em } = this;\n const prov = this.get('provider');\n let tagName = 'iframe';\n let traits;\n\n switch (prov) {\n case yt:\n case ytnc:\n traits = this.getYoutubeTraits();\n break;\n case vi:\n traits = this.getVimeoTraits();\n break;\n default:\n tagName = 'video';\n traits = this.getSourceTraits();\n }\n\n this.set({ tagName }, { silent: true }); // avoid break in view\n // @ts-ignore\n this.set({ traits });\n em.get('ready') && em.trigger('component:toggled');\n }\n\n /**\n * Set attributes by src string\n */\n parseFromSrc() {\n const prov = this.get('provider');\n const uri = this.parseUri(this.get('src'));\n const qr = uri.query;\n switch (prov) {\n case yt:\n case ytnc:\n case vi:\n this.set('videoId', uri.pathname.split('/').pop());\n qr.list && this.set('list', qr.list);\n hasParam(qr.autoplay) && this.set('autoplay', true);\n hasParam(qr.loop) && this.set('loop', true);\n parseInt(qr.controls) === 0 && this.set('controls', false);\n hasParam(qr.color) && this.set('color', qr.color);\n qr.rel === '0' && this.set('rel', 0);\n qr.modestbranding === '1' && this.set('modestbranding', 1);\n break;\n default:\n }\n }\n\n /**\n * Update src on change of video ID\n * @private\n */\n updateSrc() {\n const prov = this.get('provider');\n let src = '';\n\n switch (prov) {\n case yt:\n src = this.getYoutubeSrc();\n break;\n case ytnc:\n src = this.getYoutubeNoCookieSrc();\n break;\n case vi:\n src = this.getVimeoSrc();\n break;\n }\n\n this.set({ src });\n }\n\n /**\n * Returns object of attributes for HTML\n * @return {Object}\n * @private\n */\n getAttrToHTML() {\n const attr = super.getAttrToHTML();\n const prov = this.get('provider');\n\n switch (prov) {\n case yt:\n case ytnc:\n case vi:\n break;\n default:\n attr.loop = !!this.get('loop');\n attr.autoplay = !!this.get('autoplay');\n attr.controls = !!this.get('controls');\n }\n\n return attr;\n }\n\n // Listen provider change and switch traits, in TraitView listen traits change\n\n /**\n * Return the provider trait\n * @return {Object}\n * @private\n */\n getProviderTrait() {\n return {\n type: 'select',\n label: 'Provider',\n name: 'provider',\n changeProp: true,\n options: [\n { value: 'so', name: 'HTML5 Source' },\n { value: yt, name: 'Youtube' },\n { value: ytnc, name: 'Youtube (no cookie)' },\n { value: vi, name: 'Vimeo' },\n ],\n };\n }\n\n /**\n * Return traits for the source provider\n * @return {Array}\n * @private\n */\n getSourceTraits() {\n return [\n this.getProviderTrait(),\n {\n label: 'Source',\n name: 'src',\n placeholder: 'eg. ./media/video.mp4',\n changeProp: true,\n },\n {\n label: 'Poster',\n name: 'poster',\n placeholder: 'eg. ./media/image.jpg',\n },\n this.getAutoplayTrait(),\n this.getLoopTrait(),\n this.getControlsTrait(),\n ];\n }\n /**\n * Return traits for the source provider\n * @return {Array}\n * @private\n */\n getYoutubeTraits() {\n return [\n this.getProviderTrait(),\n {\n label: 'Video ID',\n name: 'videoId',\n placeholder: 'eg. jNQXAC9IVRw',\n changeProp: true,\n },\n this.getAutoplayTrait(),\n this.getLoopTrait(),\n this.getControlsTrait(),\n {\n type: 'checkbox',\n label: 'Related',\n name: 'rel',\n changeProp: true,\n },\n {\n type: 'checkbox',\n label: 'Modest',\n name: 'modestbranding',\n changeProp: true,\n },\n ];\n }\n\n /**\n * Return traits for the source provider\n * @return {Array}\n * @private\n */\n getVimeoTraits() {\n return [\n this.getProviderTrait(),\n {\n label: 'Video ID',\n name: 'videoId',\n placeholder: 'eg. 123456789',\n changeProp: true,\n },\n {\n label: 'Color',\n name: 'color',\n placeholder: 'eg. FF0000',\n changeProp: true,\n },\n this.getAutoplayTrait(),\n this.getLoopTrait(),\n ];\n }\n\n /**\n * Return object trait\n * @return {Object}\n * @private\n */\n getAutoplayTrait() {\n return {\n type: 'checkbox',\n label: 'Autoplay',\n name: 'autoplay',\n changeProp: true,\n };\n }\n\n /**\n * Return object trait\n * @return {Object}\n * @private\n */\n getLoopTrait() {\n return {\n type: 'checkbox',\n label: 'Loop',\n name: 'loop',\n changeProp: true,\n };\n }\n\n /**\n * Return object trait\n * @return {Object}\n * @private\n */\n getControlsTrait() {\n return {\n type: 'checkbox',\n label: 'Controls',\n name: 'controls',\n changeProp: true,\n };\n }\n\n /**\n * Returns url to youtube video\n * @return {string}\n * @private\n */\n getYoutubeSrc() {\n const id = this.get('videoId');\n let url = this.get('ytUrl') as string;\n const list = this.get('list');\n url += id + (id.indexOf('?') < 0 ? '?' : '');\n url += list ? `&list=${list}` : '';\n url += this.get('autoplay') ? '&autoplay=1&mute=1' : '';\n url += !this.get('controls') ? '&controls=0&showinfo=0' : '';\n // Loop works only with playlist enabled\n // https://stackoverflow.com/questions/25779966/youtube-iframe-loop-doesnt-work\n url += this.get('loop') ? `&loop=1&playlist=${id}` : '';\n url += this.get('rel') ? '' : '&rel=0';\n url += this.get('modestbranding') ? '&modestbranding=1' : '';\n return url;\n }\n\n /**\n * Returns url to youtube no cookie video\n * @return {string}\n * @private\n */\n getYoutubeNoCookieSrc() {\n let url = this.getYoutubeSrc();\n url = url.replace(this.get('ytUrl'), this.get('ytncUrl'));\n return url;\n }\n\n /**\n * Returns url to vimeo video\n * @return {string}\n * @private\n */\n getVimeoSrc() {\n let url = this.get('viUrl') as string;\n url += this.get('videoId') + '?';\n url += this.get('autoplay') ? '&autoplay=1&muted=1' : '';\n url += this.get('loop') ? '&loop=1' : '';\n url += !this.get('controls') ? '&title=0&portrait=0&badge=0' : '';\n url += this.get('color') ? '&color=' + this.get('color') : '';\n return url;\n }\n\n static isComponent(el: HTMLVideoElement) {\n const { tagName, src } = el;\n const isYtProv = /youtube\\.com\\/embed/.test(src);\n const isYtncProv = /youtube-nocookie\\.com\\/embed/.test(src);\n const isViProv = /player\\.vimeo\\.com\\/video/.test(src);\n const isExtProv = isYtProv || isYtncProv || isViProv;\n if (toLowerCase(tagName) == type || (toLowerCase(tagName) == 'iframe' && isExtProv)) {\n const result: any = { type: 'video' };\n if (src) result.src = src;\n if (isExtProv) {\n if (isYtProv) result.provider = yt;\n else if (isYtncProv) result.provider = ytnc;\n else if (isViProv) result.provider = vi;\n }\n return result;\n }\n }\n}\n","import { isUndefined } from 'underscore';\nimport { attrToString } from '../../utils/dom';\nimport Component from './Component';\nimport ComponentHead, { type as typeHead } from './ComponentHead';\nimport { ToHTMLOptions } from './types';\n\nexport default class ComponentWrapper extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n tagName: 'body',\n removable: false,\n copyable: false,\n draggable: false,\n components: [],\n traits: [],\n doctype: '',\n head: null,\n docEl: null,\n stylable: [\n 'background',\n 'background-color',\n 'background-image',\n 'background-repeat',\n 'background-attachment',\n 'background-position',\n 'background-size',\n ],\n };\n }\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n const opts = args[1];\n const cmp = opts?.em?.Components;\n const CmpHead = cmp?.getType(typeHead)?.model;\n const CmpDef = cmp?.getType('default').model;\n if (CmpHead) {\n this.set(\n {\n head: new CmpHead({}, opts),\n docEl: new CmpDef({ tagName: 'html' }, opts),\n },\n { silent: true }\n );\n }\n }\n\n get head(): ComponentHead {\n return this.get('head');\n }\n\n get docEl(): Component {\n return this.get('docEl');\n }\n\n get doctype(): string {\n return this.attributes.doctype || '';\n }\n\n toHTML(opts: ToHTMLOptions = {}) {\n const { doctype } = this;\n const asDoc = !isUndefined(opts.asDocument) ? opts.asDocument : !!doctype;\n const { head, docEl } = this;\n const body = super.toHTML(opts);\n const headStr = (asDoc && head?.toHTML(opts)) || '';\n const docElAttr = (asDoc && attrToString(docEl?.getAttrToHTML())) || '';\n const docElAttrStr = docElAttr ? ` ${docElAttr}` : '';\n return asDoc ? `${doctype}${headStr}${body}` : body;\n }\n\n __postAdd() {\n const um = this.em?.UndoManager;\n !this.__hasUm && um?.add(this);\n return super.__postAdd();\n }\n\n __postRemove() {\n const um = this.em?.UndoManager;\n um?.remove(this);\n return super.__postRemove();\n }\n\n static isComponent() {\n return false;\n }\n}\n","import { isUndefined } from 'underscore';\nimport { removeEl } from '../../utils/dom';\nimport { View } from '../../common';\nimport { DomComponentsConfig } from '../config/config';\nimport EditorModel from '../../editor/model/Editor';\nimport Component from '../model/Component';\nimport ComponentView from './ComponentView';\nimport FrameView from '../../canvas/view/FrameView';\nimport Components from '../model/Components';\n\nexport default class ComponentsView extends View {\n opts!: any;\n config!: DomComponentsConfig & { frameView?: FrameView };\n em!: EditorModel;\n parentEl?: HTMLElement;\n compView = ComponentView;\n\n initialize(o: any) {\n this.opts = o || {};\n this.config = o.config || {};\n // @ts-ignore\n this.em = this.config.em;\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.resetChildren);\n this.listenTo(coll, 'remove', this.removeChildren);\n }\n\n removeChildren(removed: Component, coll: any, opts = {}) {\n removed.views.forEach(view => {\n if (!view) return;\n const { childrenView, scriptContainer } = view;\n childrenView && childrenView.stopListening();\n removeEl(scriptContainer);\n view.remove.apply(view);\n });\n\n const inner = removed.components();\n inner.forEach(it => this.removeChildren(it, coll, opts));\n }\n\n /**\n * Add to collection\n * @param {Model} model\n * @param {Collection} coll\n * @param {Object} opts\n * @private\n * */\n addTo(model: Component) {\n this.addToCollection(model, null, this.collection.indexOf(model));\n }\n\n /**\n * Add new object to collection\n * @param {Object} Model\n * @param {Object} Fragment collection\n * @param {Integer} Index of append\n *\n * @return {Object} Object rendered\n * @private\n * */\n addToCollection(model: Component, fragment?: DocumentFragment | null, index?: number) {\n const { config, opts, em } = this;\n const { frameView } = config;\n const sameFrameView = frameView?.model && model.getView(frameView.model);\n const dt = opts.componentTypes || em?.Components.getTypes();\n const type = model.get('type') || 'default';\n let viewObject = this.compView;\n\n for (let it = 0; it < dt.length; it++) {\n if (dt[it].id == type) {\n viewObject = dt[it].view;\n break;\n }\n }\n const view =\n sameFrameView ||\n new viewObject({\n model,\n // @ts-ignore\n config,\n componentTypes: dt,\n });\n let rendered;\n\n try {\n // Avoid breaking on DOM rendering (eg. invalid attribute name)\n rendered = view.render().el;\n } catch (error) {\n rendered = document.createTextNode('');\n em.logError(error as any);\n }\n\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n const parent = this.parentEl!;\n const children = parent.childNodes;\n\n if (!isUndefined(index)) {\n const lastIndex = children.length == index;\n\n // If the added model is the last of collection\n // need to change the logic of append\n if (lastIndex) {\n index--;\n }\n\n // In case the added is new in the collection index will be -1\n if (lastIndex || !children.length) {\n parent.appendChild(rendered);\n } else {\n parent.insertBefore(rendered, children[index]);\n }\n } else {\n parent.appendChild(rendered);\n }\n }\n\n if (!model.opt.temporary) {\n em?.trigger('component:mount', model);\n }\n\n return rendered;\n }\n\n resetChildren(models: Components, { previousModels = [] } = {}) {\n this.parentEl!.innerHTML = '';\n previousModels.forEach(md => this.removeChildren(md, this.collection));\n models.each(model => this.addToCollection(model));\n }\n\n render(parent?: HTMLElement) {\n const el = this.el;\n const frag = document.createDocumentFragment();\n this.parentEl = parent || this.el;\n this.collection.each(model => this.addToCollection(model, frag));\n el.innerHTML = '';\n el.appendChild(frag);\n return this;\n }\n}\n","import { each, isBoolean, isEmpty, keys, result } from 'underscore';\nimport { CanvasSpotBuiltInTypes } from '../../canvas/model/CanvasSpot';\nimport FrameView from '../../canvas/view/FrameView';\nimport { DisableOptions, ExtractMethods, ObjectAny, View } from '../../common';\nimport { GetSetRuleOptions } from '../../css_composer';\nimport Editor from '../../editor';\nimport EditorModel from '../../editor/model/Editor';\nimport Selectors from '../../selector_manager/model/Selectors';\nimport { replaceWith } from '../../utils/dom';\nimport { setViewEl } from '../../utils/mixins';\nimport { DomComponentsConfig } from '../config/config';\nimport Component, { avoidInline } from '../model/Component';\nimport Components from '../model/Components';\nimport { ComponentOptions } from '../model/types';\nimport ComponentsView from './ComponentsView';\n\ntype ClbObj = ReturnType;\n\nexport interface IComponentView extends ExtractMethods {}\n\nexport default class ComponentView extends View {\n /** @ts-ignore */\n model!: TComp;\n\n /** @ts-ignore */\n className() {\n return this.getClasses();\n }\n\n /** @ts-ignore */\n tagName() {\n return this.model.get('tagName')!;\n }\n\n modelOpt!: ComponentOptions;\n em!: EditorModel;\n opts?: any;\n pfx?: string;\n ppfx?: string;\n attr?: Record;\n classe?: string;\n config!: DomComponentsConfig;\n childrenView?: ComponentsView;\n getChildrenSelector?: Function;\n getTemplate?: Function;\n scriptContainer?: HTMLElement;\n\n preinitialize(opt: any = {}) {\n this.opts = opt;\n }\n\n initialize(opt: any = {}) {\n const model = this.model;\n const config = opt.config || {};\n const em = config.em;\n const modelOpt = model.opt || {};\n const { $el, el } = this;\n this.opts = opt;\n this.modelOpt = modelOpt;\n this.config = config;\n this.em = em;\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.attr = model.get('attributes')!;\n this.classe = this.attr.class || [];\n this.listenTo(model, 'change:style', this.updateStyle);\n this.listenTo(model, 'change:attributes', this.renderAttributes);\n this.listenTo(model, 'change:highlightable', this.updateHighlight);\n this.listenTo(model, 'change:status change:locked', this.updateStatus);\n this.listenTo(model, 'change:script rerender', this.reset);\n this.listenTo(model, 'change:content', this.updateContent);\n this.listenTo(model, 'change', this.handleChange);\n this.listenTo(model, 'active', this.onActive);\n this.listenTo(model, 'disable', this.onDisable);\n $el.data('model', model);\n setViewEl(el, this);\n model.view = this;\n this.frameView && model.views.push(this);\n this.initClasses();\n this.initComponents({ avoidRender: true });\n this.events = {\n ...(this.constructor as typeof ComponentView).getEvents(),\n dragstart: 'handleDragStart',\n };\n this.delegateEvents();\n !modelOpt.temporary && this.init(this._clbObj());\n }\n\n get __cmpStyleOpts(): GetSetRuleOptions {\n return { state: '', mediaText: '' };\n }\n\n get frameView(): FrameView {\n return this.opts.config.frameView;\n }\n\n get createDoc() {\n const doc = this.frameView?.getDoc() || document;\n return this.opts.config?.useFrameDoc ? doc : document;\n }\n\n __isDraggable() {\n const { model, config } = this;\n const { draggable } = model.attributes;\n return config.draggableComponents && draggable;\n }\n\n _clbObj() {\n const { em, model, el } = this;\n return {\n editor: em?.getEditor() as Editor,\n model,\n el,\n };\n }\n\n /**\n * Initialize callback\n */\n init(opts: ClbObj) {}\n\n /**\n * Remove callback\n */\n removed(opts: ClbObj) {}\n\n /**\n * On render callback\n */\n onRender(opts: ClbObj) {}\n\n /**\n * Callback executed when the `active` event is triggered on component\n */\n onActive(ev: Event) {}\n\n /**\n * Callback executed when the `disable` event is triggered on component\n */\n onDisable(opts?: DisableOptions) {}\n\n remove() {\n super.remove();\n const { model, $el } = this;\n const { views } = model;\n const frame = this.frameView || {};\n model.components().forEach(comp => {\n const view = comp.getView(frame.model);\n view?.remove();\n });\n this.childrenView?.remove();\n views.splice(views.indexOf(this), 1);\n this.removed(this._clbObj());\n $el.data({ model: '', collection: '', view: '' });\n // delete model.view; // Sorter relies on this property\n return this;\n }\n\n handleDragStart(event: Event) {\n if (!this.__isDraggable()) return false;\n event.stopPropagation();\n event.preventDefault();\n this.em.Commands.run('tlb-move', {\n target: this.model,\n event,\n });\n }\n\n initClasses() {\n const { model } = this;\n const { classes } = model;\n const event = 'change:classes';\n\n if (classes instanceof Selectors) {\n this.stopListening(model, event, this.initClasses);\n this.listenTo(model, event, this.initClasses);\n this.listenTo(classes, 'add remove change reset', this.updateClasses);\n classes.length && this.importClasses();\n }\n }\n\n initComponents(opts: { avoidRender?: boolean } = {}) {\n const { model, $el, childrenView } = this;\n const event = 'change:components';\n const comps = model.get('components');\n const toListen = [model, event, this.initComponents];\n\n if (comps instanceof Components) {\n $el.data('collection', comps);\n childrenView && childrenView.remove();\n this.stopListening(...toListen);\n !opts.avoidRender && this.renderChildren();\n // @ts-ignore\n this.listenTo(...toListen);\n }\n }\n\n /**\n * Handle any property change\n * @private\n */\n handleChange() {\n const { model } = this;\n const chgArr = keys(model.changed);\n if (chgArr.length === 1 && chgArr[0] === 'status') return;\n model.emitUpdate();\n\n for (let prop in model.changed) {\n model.emitUpdate(prop);\n }\n }\n\n /**\n * Import, if possible, classes inside main container\n * @private\n * */\n importClasses() {\n const { em, model } = this;\n const sm = em.Selectors;\n sm && model.classes.forEach(s => sm.add(s.getName()));\n }\n\n /**\n * Update item on status change\n * @param {Event} e\n * @private\n * */\n updateStatus(opts: { noExtHl?: boolean; avoidHover?: boolean } = {}) {\n const { em, el, ppfx, model } = this;\n const canvas = em?.Canvas;\n const extHl = canvas?.config.extHl;\n const status = model.get('status');\n const selectedCls = `${ppfx}selected`;\n const selectedParentCls = `${selectedCls}-parent`;\n const freezedCls = `${ppfx}freezed`;\n const hoveredCls = `${ppfx}hovered`;\n const noPointerCls = `${ppfx}no-pointer`;\n const pointerInitCls = `${ppfx}pointer-init`;\n const toRemove = [selectedCls, selectedParentCls, freezedCls, hoveredCls, noPointerCls];\n const selCls = extHl && !opts.noExtHl ? '' : selectedCls;\n this.$el.removeClass(toRemove.join(' '));\n const actualCls = el.getAttribute('class') || '';\n const cls = [actualCls];\n const noCustomSpotSelect = !canvas?.hasCustomSpot(CanvasSpotBuiltInTypes.Select);\n const noCustomSpotTarget = !canvas?.hasCustomSpot(CanvasSpotBuiltInTypes.Target);\n\n switch (status) {\n case 'selected':\n noCustomSpotSelect && cls.push(selCls);\n break;\n case 'selected-parent':\n noCustomSpotTarget && cls.push(selectedParentCls);\n break;\n case 'freezed':\n cls.push(freezedCls);\n break;\n case 'freezed-selected':\n cls.push(freezedCls);\n noCustomSpotSelect && cls.push(selCls);\n break;\n case 'hovered':\n !opts.avoidHover && cls.push(hoveredCls);\n break;\n }\n\n if (isBoolean(model.locked)) {\n cls.push(model.locked ? noPointerCls : pointerInitCls);\n }\n\n const clsStr = cls.filter(Boolean).join(' ');\n clsStr && el.setAttribute('class', clsStr);\n }\n\n /**\n * Update highlight attribute\n * @private\n * */\n updateHighlight() {\n const { model } = this;\n const isTextable = model.get('textable');\n const hl = model.get('highlightable') && (isTextable || !model.isChildOf('text'));\n this.setAttribute('data-gjs-highlightable', hl ? true : '');\n }\n\n /**\n * Update style attribute\n * @private\n * */\n updateStyle(m?: any, v?: any, opts: ObjectAny = {}) {\n const { model, em } = this;\n\n if (avoidInline(em) && !opts.inline) {\n // Move inline styles to CSSRule\n const styleOpts = this.__cmpStyleOpts;\n const style = model.getStyle({ inline: true, ...styleOpts });\n !isEmpty(style) && model.setStyle(style, styleOpts);\n } else {\n this.setAttribute('style', model.styleToString(opts));\n }\n }\n\n /**\n * Update classe attribute\n * @private\n * */\n updateClasses() {\n const str = this.model.classes.pluck('name').join(' ');\n this.setAttribute('class', str);\n\n // Regenerate status class\n this.updateStatus();\n this.onAttrUpdate();\n }\n\n /**\n * Update single attribute\n * @param {[type]} name [description]\n * @param {[type]} value [description]\n */\n setAttribute(name: string, value: any) {\n const el = this.$el;\n value ? el.attr(name, value) : el.removeAttr(name);\n }\n\n /**\n * Get classes from attributes.\n * This method is called before initialize\n *\n * @return {Array}|null\n * @private\n * */\n getClasses() {\n return this.model.getClasses().join(' ');\n }\n\n /**\n * Update attributes\n * @private\n * */\n updateAttributes() {\n const attrs: string[] = [];\n const { model, $el, el } = this;\n const { textable, type } = model.attributes;\n\n const defaultAttr = {\n id: model.getId(),\n 'data-gjs-type': type || 'default',\n ...(this.__isDraggable() && { draggable: true }),\n ...(textable && { contenteditable: 'false' }),\n };\n\n // Remove all current attributes\n each(el.attributes, attr => attrs.push(attr.nodeName));\n attrs.forEach(attr => $el.removeAttr(attr));\n this.updateStyle();\n this.updateHighlight();\n const attr = {\n ...defaultAttr,\n ...model.getAttributes(),\n };\n\n // Remove all `false` attributes\n keys(attr).forEach(key => attr[key] === false && delete attr[key]);\n\n $el.attr(attr);\n }\n\n /**\n * Update component content\n * @private\n * */\n updateContent() {\n const { content } = this.model;\n const hasComps = this.model.components().length;\n this.getChildrenContainer().innerHTML = hasComps ? '' : content;\n }\n\n /**\n * Prevent default helper\n * @param {Event} e\n * @private\n */\n prevDef(e: Event) {\n e.preventDefault();\n }\n\n /**\n * Render component's script\n * @private\n */\n updateScript() {\n const { model, em } = this;\n if (!model.get('script')) return;\n em?.Canvas.getCanvasView().updateScript(this);\n }\n\n /**\n * Return children container\n * Differently from a simple component where children container is the\n * component itself\n * \n * \n * \n * You could have the children container more deeper\n * \n *
\n *
\n *
\n *
\n * \n *
\n *
\n *
\n * @return HTMLElement\n * @private\n */\n getChildrenContainer() {\n var container = this.el;\n\n if (typeof this.getChildrenSelector == 'function') {\n container = this.el.querySelector(this.getChildrenSelector());\n } else if (typeof this.getTemplate == 'function') {\n // Need to find deepest first child\n }\n\n return container;\n }\n\n /**\n * This returns rect informations not affected by the canvas zoom.\n * The method `getBoundingClientRect` doesn't work here and we\n * have to take in account offsetParent\n */\n getOffsetRect() {\n const rect = { top: 0, left: 0, bottom: 0, right: 0 };\n const target = this.el;\n let gtop = 0;\n let gleft = 0;\n\n const assignRect = (el: HTMLElement) => {\n const offsetParent = el.offsetParent as HTMLElement;\n\n if (offsetParent) {\n gtop += offsetParent.offsetTop;\n gleft += offsetParent.offsetLeft;\n assignRect(offsetParent);\n } else {\n rect.top = target.offsetTop + gtop;\n rect.left = target.offsetLeft + gleft;\n rect.bottom = rect.top + target.offsetHeight;\n rect.right = rect.left + target.offsetWidth;\n }\n };\n assignRect(target);\n\n return rect;\n }\n\n isInViewport() {\n const { el, em, frameView } = this;\n const canvasView = em.Canvas.getCanvasView();\n const elRect = canvasView.getElBoxRect(el, { local: true });\n const frameEl = frameView.el;\n const frameH = frameEl.clientHeight;\n const frameW = frameEl.clientWidth;\n\n const elTop = elRect.y;\n const elRight = elRect.x;\n const elBottom = elTop + elRect.height;\n const elLeft = elRight + elRect.width;\n const isTopInside = elTop >= 0 && elTop < frameH;\n const isBottomInside = elBottom > 0 && elBottom < frameH;\n const isLeftInside = elLeft >= 0 && elLeft < frameW;\n const isRightInside = elRight > 0 && elRight <= frameW;\n\n const partiallyIn = (isTopInside || isBottomInside) && (isLeftInside || isRightInside);\n\n return partiallyIn;\n }\n\n scrollIntoView(opts: { force?: boolean } & ScrollIntoViewOptions = {}) {\n const isInViewport = this.isInViewport();\n\n if (!isInViewport || opts.force) {\n const { el } = this;\n\n // PATCH: scrollIntoView won't work with multiple requests from iframes\n if (opts.behavior !== 'smooth') {\n const rect = this.getOffsetRect();\n el.ownerDocument.defaultView?.scrollTo(0, rect.top);\n } else {\n el.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n ...opts,\n });\n }\n }\n }\n\n /**\n * Recreate the element of the view\n */\n reset() {\n const { el } = this;\n // @ts-ignore\n this.el = '';\n this._ensureElement();\n this._setData();\n replaceWith(el, this.el);\n this.render();\n }\n\n _setData() {\n const { model } = this;\n const collection = model.components();\n const view = this;\n this.$el.data({ model, collection, view });\n }\n\n _createElement(tagName: string): Node {\n return this.createDoc.createElement(tagName);\n }\n\n /**\n * Render children components\n * @private\n */\n renderChildren() {\n this.updateContent();\n const container = this.getChildrenContainer();\n const view =\n this.childrenView ||\n new ComponentsView({\n // @ts-ignore\n collection: this.model.get('components')!,\n config: this.config,\n componentTypes: this.opts.componentTypes,\n });\n\n view.render(container);\n this.childrenView = view;\n const childNodes = Array.prototype.slice.call(view.el.childNodes);\n\n for (var i = 0, len = childNodes.length; i < len; i++) {\n container.appendChild(childNodes.shift());\n }\n }\n\n renderAttributes() {\n this.updateAttributes();\n this.updateClasses();\n }\n\n onAttrUpdate() {}\n\n render() {\n this.renderAttributes();\n if (this.modelOpt.temporary) return this;\n this.renderChildren();\n this.updateScript();\n setViewEl(this.el, this);\n this.postRender();\n\n return this;\n }\n\n postRender() {\n if (!this.modelOpt.temporary) {\n this.onRender(this._clbObj());\n }\n }\n\n static getEvents() {\n return result(this.prototype, 'events');\n }\n}\n","import ComponentTextNode from '../model/ComponentTextNode';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTextNodeView<\n TComp extends ComponentTextNode = ComponentTextNode\n> extends ComponentView {\n // Clear methods used on Nodes with attributes\n _setAttributes() {}\n renderAttributes() {}\n updateStatus() {}\n updateClasses() {}\n setAttribute() {}\n updateAttributes() {}\n initClasses() {}\n initComponents() {}\n delegateEvents() {\n return this;\n }\n\n _createElement() {\n return document.createTextNode('');\n }\n\n render() {\n const { model, el } = this;\n if (model.opt.temporary) return this;\n el.textContent = model.content;\n return this;\n }\n}\n","import ComponentTextNodeView from './ComponentTextNodeView';\n\nexport default class ComponentCommentView extends ComponentTextNodeView {\n _createElement() {\n return document.createComment(this.model.content) as Text;\n }\n}\n","import ComponentView from './ComponentView';\nimport { createEl, find, attrUp } from '../../utils/dom';\nimport ComponentFrame from '../model/ComponentFrame';\n\nexport default class ComponentFrameView extends ComponentView {\n tagName() {\n return 'div';\n }\n\n initialize(props: any) {\n super.initialize(props);\n this.listenTo(this.model, 'change:attributes:src', this.updateSrc);\n }\n\n updateSrc() {\n const frame = find(this.el, 'iframe')[0] as HTMLElement;\n frame && attrUp(frame, { src: this.__getSrc() });\n }\n\n render() {\n super.render();\n const frame = createEl('iframe', {\n class: `${this.ppfx}no-pointer`,\n style: 'width: 100%; height: 100%; border: none',\n src: this.__getSrc(),\n });\n this.el.appendChild(frame);\n return this;\n }\n\n __getSrc() {\n return this.model.getAttributes().src || '';\n }\n}\n","import { isString } from 'underscore';\nimport { ObjectAny } from '../../common';\nimport ComponentImage from '../model/ComponentImage';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentImageView extends ComponentView {\n classEmpty!: string;\n el!: HTMLImageElement;\n\n tagName() {\n return 'img';\n }\n\n events(): ObjectAny {\n return {\n dblclick: 'onActive',\n click: 'initResize',\n error: 'onError',\n load: 'onLoad',\n dragstart: 'noDrag',\n };\n }\n\n initialize(props: any) {\n super.initialize(props);\n this.listenTo(this.model, 'change:src', this.updateSrc);\n this.classEmpty = `${this.ppfx}plh-image`;\n this.fetchFile();\n }\n\n /**\n * Fetch file if exists\n */\n fetchFile() {\n if (this.modelOpt.temporary) return;\n const { model, em } = this;\n const file = model.get('file');\n\n if (file && em) {\n const fu = em.Assets.FileUploader();\n fu?.uploadFile(\n {\n // @ts-ignore\n dataTransfer: { files: [file] },\n },\n (res: any) => {\n const obj = res && res.data && res.data[0];\n const src = obj && (isString(obj) ? obj : obj.src);\n src && model.set({ src });\n }\n );\n model.set('file', '');\n }\n }\n\n /**\n * Update src attribute\n * @private\n * */\n updateSrc() {\n const { model } = this;\n model.addAttributes({ src: model.getSrcResult() });\n this.updateClasses();\n }\n\n updateClasses() {\n super.updateClasses();\n const { el, classEmpty, model } = this;\n const srcExists = model.getSrcResult() && !model.isDefaultSrc();\n const method = srcExists ? 'remove' : 'add';\n el.classList[method](classEmpty);\n }\n\n /**\n * Open dialog for image changing\n * @param {Object} e Event\n * @private\n * */\n onActive(ev: Event) {\n ev?.stopPropagation();\n const { em, model } = this;\n const am = em?.Assets;\n\n if (am && model.get('editable')) {\n am.open({\n select(asset, complete) {\n model.set({ src: asset.getSrc() });\n complete && am.close();\n },\n target: model,\n types: ['image'],\n accept: 'image/*',\n });\n }\n }\n\n onError() {\n const fallback = this.model.getSrcResult({ fallback: true });\n if (fallback) {\n this.el.src = fallback;\n }\n }\n\n onLoad() {\n // Used to update component tools box (eg. toolbar, resizer) once the image is loaded\n this.em.Canvas.refresh({ all: true });\n }\n\n noDrag(ev: Event) {\n ev.preventDefault();\n return false;\n }\n\n render() {\n this.renderAttributes();\n if (this.modelOpt.temporary) return this;\n this.updateSrc();\n const { $el, model } = this;\n const cls = $el.attr('class') || '';\n !model.get('src') && $el.attr('class', `${cls} ${this.classEmpty}`.trim());\n this.postRender();\n\n return this;\n }\n}\n","import { bindAll } from 'underscore';\nimport { AddOptions, DisableOptions, ObjectAny } from '../../common';\nimport RichTextEditorModule from '../../rich_text_editor';\nimport RichTextEditor from '../../rich_text_editor/model/RichTextEditor';\nimport { off, on } from '../../utils/dom';\nimport { getComponentModel } from '../../utils/mixins';\nimport Component from '../model/Component';\nimport { getComponentIds } from '../model/Components';\nimport ComponentText from '../model/ComponentText';\nimport { ComponentDefinition } from '../model/types';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTextView extends ComponentView {\n rte?: RichTextEditorModule;\n rteEnabled?: boolean;\n activeRte?: RichTextEditor;\n lastContent?: string;\n\n events() {\n return {\n dblclick: 'onActive',\n input: 'onInput',\n };\n }\n\n initialize(props: any) {\n super.initialize(props);\n bindAll(this, 'disableEditing', 'onDisable');\n const model = this.model;\n const em = this.em;\n this.listenTo(model, 'focus', this.onActive);\n this.listenTo(model, 'change:content', this.updateContentText);\n this.listenTo(model, 'sync:content', this.syncContent);\n this.rte = em?.RichTextEditor;\n }\n\n updateContentText(m: any, v: any, opts: { fromDisable?: boolean } = {}) {\n !opts.fromDisable && this.disableEditing();\n }\n\n canActivate() {\n const { model, rteEnabled, em } = this;\n const modelInEdit = em?.getEditing();\n const sameInEdit = modelInEdit === model;\n let result = true;\n let isInnerText = false;\n let delegate;\n\n if (rteEnabled || !model.get('editable') || sameInEdit || (isInnerText = model.isChildOf('text'))) {\n result = false;\n // If the current is inner text, select the closest text\n if (isInnerText && !model.get('textable')) {\n let parent = model.parent();\n\n while (parent && !parent.isInstanceOf('text')) {\n parent = parent.parent();\n }\n\n if (parent && parent.get('editable')) {\n delegate = parent;\n } else {\n result = true;\n }\n }\n }\n\n return { result, delegate };\n }\n\n /**\n * Enable element content editing\n * @private\n * */\n async onActive(ev: Event) {\n const { rte, em } = this;\n const { result, delegate } = this.canActivate();\n\n // We place this before stopPropagation in case of nested\n // text components will not block the editing (#1394)\n if (!result) {\n if (delegate) {\n ev?.stopPropagation?.();\n em.setSelected(delegate);\n delegate.trigger('active', ev);\n }\n return;\n }\n\n ev?.stopPropagation?.();\n this.lastContent = await this.getContent();\n\n if (rte) {\n try {\n this.activeRte = await rte.enable(this, this.activeRte!, { event: ev });\n } catch (err) {\n em.logError(err as any);\n }\n }\n\n this.toggleEvents(true);\n }\n\n onDisable(opts?: DisableOptions) {\n this.disableEditing(opts);\n }\n\n /**\n * Disable element content editing\n * @private\n * */\n async disableEditing(opts: DisableOptions = {}) {\n const { model, rte, activeRte, em } = this;\n // There are rare cases when disableEditing is called when the view is already removed\n // so, we have to check for the model, this will avoid breaking stuff.\n const editable = model && model.get('editable');\n\n if (rte) {\n try {\n await rte.disable(this, activeRte, opts);\n } catch (err) {\n em.logError(err as any);\n }\n\n if (editable && (await this.getContent()) !== this.lastContent) {\n await this.syncContent(opts);\n this.lastContent = '';\n }\n }\n\n this.toggleEvents();\n }\n\n /**\n * get content from RTE\n * @return string\n */\n async getContent() {\n const { rte, activeRte } = this;\n let result = '';\n\n if (rte) {\n result = await rte.getContent(this, activeRte!);\n }\n\n return result;\n }\n\n /**\n * Merge content from the DOM to the model\n */\n async syncContent(opts: ObjectAny = {}) {\n const { model, rte, rteEnabled } = this;\n if (!rteEnabled && !opts.force) return;\n const content = await this.getContent();\n const comps = model.components();\n const contentOpt: ObjectAny = { fromDisable: 1, ...opts };\n model.set('content', '', contentOpt);\n\n // If there is a custom RTE the content is just added staticly\n // inside 'content'\n if (rte?.customRte && !rte.customRte.parseContent) {\n comps.length &&\n comps.reset(undefined, {\n ...opts,\n // @ts-ignore\n keepIds: getComponentIds(comps),\n });\n model.set('content', content, contentOpt);\n } else {\n comps.resetFromString(content, opts);\n }\n }\n\n insertComponent(content: ComponentDefinition, opts: AddOptions & { useDomContent?: boolean } = {}) {\n const { model, el } = this;\n const doc = el.ownerDocument;\n const selection = doc.getSelection();\n\n if (selection?.rangeCount) {\n const range = selection.getRangeAt(0);\n const textNode = range.startContainer;\n const offset = range.startOffset;\n const textModel = getComponentModel(textNode);\n const newCmps: (ComponentDefinition | Component)[] = [];\n\n if (textModel && textModel.is?.('textnode')) {\n const cmps = textModel.collection;\n cmps.forEach(cmp => {\n if (cmp === textModel) {\n const type = 'textnode';\n const cnt = opts.useDomContent ? textNode.textContent || '' : cmp.content;\n newCmps.push({ type, content: cnt.slice(0, offset) });\n newCmps.push(content);\n newCmps.push({ type, content: cnt.slice(offset) });\n } else {\n newCmps.push(cmp);\n }\n });\n\n const result = newCmps.filter(Boolean);\n const index = result.indexOf(content);\n cmps.reset(result, opts);\n\n return cmps.at(index);\n }\n }\n\n return model.append(content, opts);\n }\n\n /**\n * Callback on input event\n * @param {Event} e\n */\n onInput() {\n const { em } = this;\n const evPfx = 'component';\n const ev = [`${evPfx}:update`, `${evPfx}:input`].join(' ');\n\n // Update toolbars\n em && em.trigger(ev, this.model);\n }\n\n /**\n * Isolate disable propagation method\n * @param {Event}\n * @private\n * */\n disablePropagation(e: Event) {\n e.stopPropagation();\n }\n\n /**\n * Enable/Disable events\n * @param {Boolean} enable\n */\n toggleEvents(enable?: boolean) {\n const { em, model, $el } = this;\n const mixins = { on, off };\n const method = enable ? 'on' : 'off';\n em.setEditing(enable ? this : false);\n this.rteEnabled = !!enable;\n\n // The ownerDocument is from the frame\n var elDocs = [this.el.ownerDocument, document];\n mixins.off(elDocs, 'mousedown', this.onDisable as any);\n mixins[method](elDocs, 'mousedown', this.onDisable as any);\n em[method]('toolbar:run:before', this.onDisable);\n if (model) {\n model[method]('removed', this.onDisable);\n model.trigger(`rte:${enable ? 'enable' : 'disable'}`);\n }\n\n // @ts-ignore Avoid closing edit mode on component click\n $el?.off('mousedown', this.disablePropagation);\n // @ts-ignore\n $el && $el[method]('mousedown', this.disablePropagation);\n\n // Fixes #2210 but use this also as a replacement\n // of this fix: bd7b804f3b46eb45b4398304b2345ce870f232d2\n if (this.config.draggableComponents) {\n let { el } = this;\n\n while (el) {\n el.draggable = enable ? !1 : !0;\n // Note: el.parentNode is sometimes null here\n el = el.parentNode as HTMLElement;\n if (el && el.tagName == 'BODY') {\n // @ts-ignore\n el = 0;\n }\n }\n }\n }\n}\n","import ComponentLink from '../model/ComponentLink';\nimport ComponentTextView from './ComponentTextView';\n\nexport default class ComponentLinkView extends ComponentTextView {\n render() {\n super.render();\n // I need capturing instead of bubbling as bubbled clicks from other\n // children will execute the link event\n this.el.addEventListener('click', this.prevDef, true);\n\n return this;\n }\n}\n","import ComponentLabel from '../model/ComponentLabel';\nimport ComponentLinkView from './ComponentLinkView';\n\nexport default class ComponentLabelView extends ComponentLinkView {}\n","import ComponentImageView from './ComponentImageView';\n\nexport default class ComponentMapView extends ComponentImageView {\n iframe?: HTMLIFrameElement;\n\n tagName() {\n return 'div';\n }\n\n events() {\n return {};\n }\n\n initialize(props: any) {\n super.initialize(props);\n this.classEmpty = this.ppfx + 'plh-map';\n }\n\n /**\n * Update the map on the canvas\n * @private\n */\n updateSrc() {\n this.getIframe().src = this.model.get('src');\n }\n\n getIframe() {\n if (!this.iframe) {\n const ifrm = document.createElement('iframe');\n ifrm.src = this.model.get('src');\n ifrm.frameBorder = '0';\n ifrm.style.height = '100%';\n ifrm.style.width = '100%';\n ifrm.className = this.ppfx + 'no-pointer';\n this.iframe = ifrm;\n }\n return this.iframe;\n }\n\n render() {\n super.render();\n this.updateClasses();\n this.el.appendChild(this.getIframe());\n return this;\n }\n}\n","import ComponentScript from '../model/ComponentScript';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentScriptView extends ComponentView {\n tagName() {\n return 'script';\n }\n\n events() {\n return {};\n }\n}\n","import ComponentSvg from '../model/ComponentSvg';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentSvgView extends ComponentView {\n _createElement(tagName: string) {\n return document.createElementNS('http://www.w3.org/2000/svg', tagName);\n }\n}\n","import ComponentTableBody from '../model/ComponentTableBody';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableBodyView extends ComponentView {}\n","import ComponentTableCell from '../model/ComponentTableCell';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableCellView extends ComponentView {}\n","import ComponentTableFoot from '../model/ComponentTableFoot';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableFootView extends ComponentView {}\n","import ComponentTableHead from '../model/ComponentTableHead';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableHeadView extends ComponentView {}\n","import ComponentTableRow from '../model/ComponentTableRow';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableRowView extends ComponentView {}\n","import ComponentTable from '../model/ComponentTable';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableView extends ComponentView {\n events() {\n return {};\n }\n}\n","import ComponentVideo from '../model/ComponentVideo';\nimport ComponentImageView from './ComponentImageView';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentVideoView extends ComponentImageView {\n videoEl?: HTMLVideoElement | HTMLIFrameElement;\n\n tagName() {\n return 'div';\n }\n\n // @ts-ignore\n events() {\n return {};\n }\n\n initialize() {\n // @ts-ignore\n ComponentView.prototype.initialize.apply(this, arguments);\n const { model } = this;\n const props = ['loop', 'autoplay', 'controls', 'color', 'rel', 'modestbranding', 'poster'];\n const events = props.map(p => `change:${p}`).join(' ');\n this.listenTo(model, 'change:provider', this.updateProvider);\n this.listenTo(model, 'change:src', this.updateSrc);\n this.listenTo(model, events, this.updateVideo);\n }\n\n /**\n * Rerender on update of the provider\n * @private\n */\n updateProvider() {\n var prov = this.model.get('provider');\n this.el.innerHTML = '';\n this.el.appendChild(this.renderByProvider(prov));\n }\n\n /**\n * Update the source of the video\n * @private\n */\n updateSrc() {\n const { model, videoEl } = this;\n if (!videoEl) return;\n const prov = model.get('provider');\n let src = model.get('src');\n\n switch (prov) {\n case 'yt':\n src = model.getYoutubeSrc();\n break;\n case 'ytnc':\n src = model.getYoutubeNoCookieSrc();\n break;\n case 'vi':\n src = model.getVimeoSrc();\n break;\n }\n\n videoEl.src = src;\n }\n\n /**\n * Update video parameters\n * @private\n */\n updateVideo() {\n const { model, videoEl } = this;\n const prov = model.get('provider');\n switch (prov) {\n case 'yt':\n case 'ytnc':\n case 'vi':\n model.trigger('change:videoId');\n break;\n default: {\n if (videoEl) {\n const el = videoEl as HTMLVideoElement;\n el.loop = model.get('loop');\n el.autoplay = model.get('autoplay');\n el.controls = model.get('controls');\n el.poster = model.get('poster');\n }\n }\n }\n }\n\n renderByProvider(prov: string) {\n let videoEl;\n\n switch (prov) {\n case 'yt':\n videoEl = this.renderYoutube();\n break;\n case 'ytnc':\n videoEl = this.renderYoutubeNoCookie();\n break;\n case 'vi':\n videoEl = this.renderVimeo();\n break;\n default:\n videoEl = this.renderSource();\n }\n\n this.videoEl = videoEl;\n return videoEl;\n }\n\n renderSource() {\n const el = document.createElement('video');\n el.src = this.model.get('src');\n this.initVideoEl(el);\n return el;\n }\n\n renderYoutube() {\n const el = document.createElement('iframe');\n el.src = this.model.getYoutubeSrc();\n el.frameBorder = '0';\n el.setAttribute('allowfullscreen', 'true');\n this.initVideoEl(el);\n return el;\n }\n\n renderYoutubeNoCookie() {\n var el = document.createElement('iframe');\n el.src = this.model.getYoutubeNoCookieSrc();\n el.frameBorder = '0';\n el.setAttribute('allowfullscreen', 'true');\n this.initVideoEl(el);\n return el;\n }\n\n renderVimeo() {\n var el = document.createElement('iframe');\n el.src = this.model.getVimeoSrc();\n el.frameBorder = '0';\n el.setAttribute('allowfullscreen', 'true');\n this.initVideoEl(el);\n return el;\n }\n\n initVideoEl(el: HTMLElement) {\n el.className = this.ppfx + 'no-pointer';\n el.style.height = '100%';\n el.style.width = '100%';\n }\n\n render() {\n ComponentView.prototype.render.apply(this);\n this.updateClasses();\n var prov = this.model.get('provider');\n this.el.appendChild(this.renderByProvider(prov));\n this.updateVideo();\n return this;\n }\n}\n","import ComponentView from './ComponentView';\n\nexport default class ComponentWrapperView extends ComponentView {\n tagName() {\n return 'div';\n }\n}\n","import { debounce } from 'underscore';\nimport { Debounced, ObjectAny } from '../../common';\nimport Component from './Component';\nimport Components from './Components';\nimport { detachSymbolInstance, getSymbolInstances } from './SymbolUtils';\n\ninterface PropsComponentUpdate {\n component: Component;\n changed: ObjectAny;\n options: ObjectAny;\n}\n\nexport default class Symbols extends Components {\n refreshDbn: Debounced;\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n this.refreshDbn = debounce(() => this.refresh(), 0);\n const { events } = this;\n this.on(events.update, this.onUpdate);\n this.on(events.updateInside, this.onUpdateDeep);\n }\n\n removeChildren(component: Component, coll?: Components, opts: any = {}) {\n super.removeChildren(component, coll, opts);\n getSymbolInstances(component)?.forEach(i => detachSymbolInstance(i, { skipRefs: true }));\n this.__trgEvent(this.events.symbolMainRemove, { component });\n }\n\n onAdd(...args: Parameters) {\n super.onAdd(...args);\n const [component] = args;\n this.__trgEvent(this.events.symbolMainAdd, { component });\n }\n\n onUpdate(props: PropsComponentUpdate) {\n this.__trgEvent(this.events.symbolMainUpdate, props);\n }\n\n onUpdateDeep(props: PropsComponentUpdate) {\n this.__trgEvent(this.events.symbolMainUpdateDeep, props);\n }\n\n refresh() {\n const { em, events } = this;\n em.trigger(events.symbol);\n }\n\n __trgEvent(event: string, props: ObjectAny, isInstance = false) {\n const { em, events } = this;\n const eventType = isInstance ? events.symbolInstance : events.symbolMain;\n em.trigger(event, props);\n em.trigger(eventType, { ...props, event });\n this.refreshDbn();\n }\n}\n","/**\n * With this module is possible to manage components inside the canvas. You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/dom_components/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * domComponents: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('component:create', () => { ... });\n *\n * // Use the API\n * const cmp = editor.Components;\n * cmp.addType(...);\n * ```\n *\n * ## Available Events\n * * `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method\n * * `component:mount` - Component is mounted to an element and rendered in canvas\n * * `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback\n * * `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback\n * * `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback\n * * `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback\n * * `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback\n * * `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback\n * * `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback\n * * `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback\n * * `component:selected` - New component selected, the selected model is passed as an argument to the callback\n * * `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback\n * * `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback\n * * `component:type:add` - New component type added, the new type is passed as an argument to the callback\n * * `component:type:update` - Component type updated, the updated type is passed as an argument to the callback\n * * `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent)\n * * `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer\n * * `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer\n * * `component:resize` - During component resize.\n *\n * ## Methods\n * * [getWrapper](#getwrapper)\n * * [getComponents](#getcomponents)\n * * [addComponent](#addcomponent)\n * * [clear](#clear)\n * * [addType](#addtype)\n * * [getType](#gettype)\n * * [getTypes](#gettypes)\n *\n * * [Component]: component.html\n *\n * @module Components\n */\nimport { debounce, isArray, isEmpty, isFunction, isString, isSymbol, result } from 'underscore';\nimport { ItemManagerModule } from '../abstract/Module';\nimport { AddOptions, ObjectAny } from '../common';\nimport EditorModel from '../editor/model/Editor';\nimport { isComponent } from '../utils/mixins';\nimport defaults, { DomComponentsConfig } from './config/config';\nimport Component, { IComponent, keyUpdate, keyUpdateInside } from './model/Component';\nimport ComponentComment from './model/ComponentComment';\nimport ComponentFrame from './model/ComponentFrame';\nimport ComponentImage from './model/ComponentImage';\nimport ComponentLabel from './model/ComponentLabel';\nimport ComponentLink from './model/ComponentLink';\nimport ComponentMap from './model/ComponentMap';\nimport ComponentScript from './model/ComponentScript';\nimport ComponentSvg from './model/ComponentSvg';\nimport ComponentSvgIn from './model/ComponentSvgIn';\nimport ComponentTable from './model/ComponentTable';\nimport ComponentTableBody from './model/ComponentTableBody';\nimport ComponentTableCell from './model/ComponentTableCell';\nimport ComponentTableFoot from './model/ComponentTableFoot';\nimport ComponentTableHead from './model/ComponentTableHead';\nimport ComponentTableRow from './model/ComponentTableRow';\nimport ComponentText from './model/ComponentText';\nimport ComponentTextNode from './model/ComponentTextNode';\nimport ComponentVideo from './model/ComponentVideo';\nimport ComponentWrapper from './model/ComponentWrapper';\nimport Components from './model/Components';\nimport { ComponentAdd, ComponentDefinition, ComponentDefinitionDefined, ComponentStackItem } from './model/types';\nimport ComponentCommentView from './view/ComponentCommentView';\nimport ComponentFrameView from './view/ComponentFrameView';\nimport ComponentImageView from './view/ComponentImageView';\nimport ComponentLabelView from './view/ComponentLabelView';\nimport ComponentLinkView from './view/ComponentLinkView';\nimport ComponentMapView from './view/ComponentMapView';\nimport ComponentScriptView from './view/ComponentScriptView';\nimport ComponentSvgView from './view/ComponentSvgView';\nimport ComponentTableBodyView from './view/ComponentTableBodyView';\nimport ComponentTableCellView from './view/ComponentTableCellView';\nimport ComponentTableFootView from './view/ComponentTableFootView';\nimport ComponentTableHeadView from './view/ComponentTableHeadView';\nimport ComponentTableRowView from './view/ComponentTableRowView';\nimport ComponentTableView from './view/ComponentTableView';\nimport ComponentTextNodeView from './view/ComponentTextNodeView';\nimport ComponentTextView from './view/ComponentTextView';\nimport ComponentVideoView from './view/ComponentVideoView';\nimport ComponentView, { IComponentView } from './view/ComponentView';\nimport ComponentWrapperView from './view/ComponentWrapperView';\nimport ComponentsView from './view/ComponentsView';\nimport ComponentHead, { type as typeHead } from './model/ComponentHead';\nimport {\n getSymbolMain,\n getSymbolInstances,\n getSymbolsToUpdate,\n isSymbolMain,\n isSymbolInstance,\n detachSymbolInstance,\n isSymbolRoot,\n} from './model/SymbolUtils';\nimport { ComponentsEvents, SymbolInfo } from './types';\nimport Symbols from './model/Symbols';\n\nexport type ComponentEvent =\n | 'component:create'\n | 'component:mount'\n | 'component:add'\n | 'component:remove'\n | 'component:remove:before'\n | 'component:clone'\n | 'component:update'\n | 'component:styleUpdate'\n | 'component:selected'\n | 'component:deselected'\n | 'component:toggled'\n | 'component:type:add'\n | 'component:type:update'\n | 'component:drag:start'\n | 'component:drag'\n | 'component:drag:end'\n | 'component:resize';\n\nexport interface ComponentModelDefinition extends IComponent {\n defaults?: ComponentDefinition | (() => ComponentDefinition);\n [key: string]: any;\n}\n\nexport interface ComponentViewDefinition extends IComponentView {\n [key: string]: any;\n}\n\nexport interface AddComponentTypeOptions {\n isComponent?: (el: HTMLElement) => boolean | ComponentDefinitionDefined | undefined;\n model?: Partial & ThisType;\n view?: Partial & ThisType;\n extend?: string;\n extendView?: string;\n extendFn?: string[];\n extendFnView?: string[];\n}\n\n/** @private */\nexport enum CanMoveReason {\n /**\n * Invalid source. This is a default value and should be ignored in case the `result` is true\n */\n InvalidSource = 0,\n /**\n * Source doesn't accept target as destination.\n */\n SourceReject = 1,\n /**\n * Target doesn't accept source.\n */\n TargetReject = 2,\n}\n\nexport interface CanMoveResult {\n result: boolean;\n reason: CanMoveReason;\n target: Component;\n source?: Component | null;\n}\n\nexport default class ComponentManager extends ItemManagerModule {\n componentTypes: ComponentStackItem[] = [\n {\n id: 'cell',\n model: ComponentTableCell,\n view: ComponentTableCellView,\n },\n {\n id: 'row',\n model: ComponentTableRow,\n view: ComponentTableRowView,\n },\n {\n id: 'table',\n model: ComponentTable,\n view: ComponentTableView,\n },\n {\n id: 'thead',\n model: ComponentTableHead,\n view: ComponentTableHeadView,\n },\n {\n id: 'tbody',\n model: ComponentTableBody,\n view: ComponentTableBodyView,\n },\n {\n id: 'tfoot',\n model: ComponentTableFoot,\n view: ComponentTableFootView,\n },\n {\n id: 'map',\n model: ComponentMap,\n view: ComponentMapView,\n },\n {\n id: 'link',\n model: ComponentLink,\n view: ComponentLinkView,\n },\n {\n id: 'label',\n model: ComponentLabel,\n view: ComponentLabelView,\n },\n {\n id: 'video',\n model: ComponentVideo,\n view: ComponentVideoView,\n },\n {\n id: 'image',\n model: ComponentImage,\n view: ComponentImageView,\n },\n {\n id: 'script',\n model: ComponentScript,\n view: ComponentScriptView,\n },\n {\n id: 'svg-in',\n model: ComponentSvgIn,\n view: ComponentSvgView,\n },\n {\n id: 'svg',\n model: ComponentSvg,\n view: ComponentSvgView,\n },\n {\n id: 'iframe',\n model: ComponentFrame,\n view: ComponentFrameView,\n },\n {\n id: 'comment',\n model: ComponentComment,\n view: ComponentCommentView,\n },\n {\n id: 'textnode',\n model: ComponentTextNode,\n view: ComponentTextNodeView,\n },\n {\n id: typeHead,\n model: ComponentHead,\n view: ComponentView,\n },\n {\n id: 'wrapper',\n model: ComponentWrapper,\n view: ComponentWrapperView,\n },\n {\n id: 'text',\n model: ComponentText,\n view: ComponentTextView,\n },\n {\n id: 'default',\n model: Component,\n view: ComponentView,\n },\n ];\n\n componentsById: { [id: string]: Component } = {};\n componentView?: ComponentWrapperView;\n\n Component = Component;\n\n Components = Components;\n\n ComponentView = ComponentView;\n\n ComponentsView = ComponentsView;\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n //name = \"DomComponents\";\n\n storageKey = 'components';\n keySymbols = 'symbols';\n\n shallow?: Component;\n symbols: Symbols;\n events = ComponentsEvents;\n\n /**\n * Initialize module. Called on a new instance of the editor with configurations passed\n * inside 'domComponents' field\n * @param {Object} config Configurations\n * @private\n */\n constructor(em: EditorModel) {\n super(em, 'DomComponents', new Components(undefined, { em }));\n const { config } = this;\n this.symbols = new Symbols([], { em, config, domc: this });\n\n if (em) {\n //@ts-ignore\n this.config.components = em.config.components || this.config.components;\n }\n\n for (let name in defaults) {\n //@ts-ignore\n if (!(name in this.config)) this.config[name] = defaults[name];\n }\n\n const ppfx = this.config.pStylePrefix;\n if (ppfx) this.config.stylePrefix = ppfx + this.config.stylePrefix;\n\n // Load dependencies\n if (em) {\n em.get('Parser').compTypes = this.componentTypes;\n em.on('change:componentHovered', this.componentHovered, this);\n\n const selected = em.get('selected');\n em.listenTo(selected, 'add', (sel, c, opts) => this.selectAdd(selected.getComponent(sel), opts));\n em.listenTo(selected, 'remove', (sel, c, opts) => this.selectRemove(selected.getComponent(sel), opts));\n }\n\n return this;\n }\n\n postLoad() {\n const { em, symbols } = this;\n const { UndoManager } = em;\n UndoManager.add(symbols);\n }\n\n load(data: any) {\n const result = this.loadProjectData(data, {\n onResult: (result: Component) => {\n let wrapper = this.getWrapper()!;\n\n if (!wrapper) {\n this.em.Pages.add({}, { select: true });\n wrapper = this.getWrapper()!;\n }\n\n if (isArray(result)) {\n result.length && wrapper.components(result);\n } else {\n const { components = [], ...rest } = result;\n wrapper.set(rest);\n //@ts-ignore\n wrapper.components(components);\n }\n },\n });\n\n this.symbols.reset(data[this.keySymbols] || []);\n\n return result;\n }\n\n store() {\n return {\n [this.keySymbols]: this.symbols,\n };\n }\n\n /**\n * Returns the main wrapper.\n * @return {Object}\n * @private\n */\n getComponent() {\n const sel = this.em.Pages.getSelected();\n const frame = sel?.getMainFrame();\n return frame?.getComponent();\n }\n\n /**\n * Returns root component inside the canvas. Something like `` inside HTML page\n * The wrapper doesn't differ from the original Component Model\n * @return {[Component]} Root Component\n * @example\n * // Change background of the wrapper and set some attribute\n * var wrapper = cmp.getWrapper();\n * wrapper.set('style', {'background-color': 'red'});\n * wrapper.set('attributes', {'title': 'Hello!'});\n */\n getWrapper() {\n return this.getComponent();\n }\n\n /**\n * Returns wrapper's children collection. Once you have the collection you can\n * add other Components(Models) inside. Each component can have several nested\n * components inside and you can nest them as more as you wish.\n * @return {Components} Collection of components\n * @example\n * // Let's add some component\n * var wrapperChildren = cmp.getComponents();\n * var comp1 = wrapperChildren.add({\n * style: { 'background-color': 'red'}\n * });\n * var comp2 = wrapperChildren.add({\n * tagName: 'span',\n * attributes: { title: 'Hello!'}\n * });\n * // Now let's add an other one inside first component\n * // First we have to get the collection inside. Each\n * // component has 'components' property\n * var comp1Children = comp1.get('components');\n * // Procede as before. You could also add multiple objects\n * comp1Children.add([\n * { style: { 'background-color': 'blue'}},\n * { style: { height: '100px', width: '100px'}}\n * ]);\n * // Remove comp2\n * wrapperChildren.remove(comp2);\n */\n getComponents(): Components {\n const wrp = this.getWrapper();\n return wrp?.components()!;\n }\n\n /**\n * Add new components to the wrapper's children. It's the same\n * as 'cmp.getComponents().add(...)'\n * @param {Object|[Component]|Array} component Component/s to add\n * @param {string} [component.tagName='div'] Tag name\n * @param {string} [component.type=''] Type of the component. Available: ''(default), 'text', 'image'\n * @param {boolean} [component.removable=true] If component is removable\n * @param {boolean} [component.draggable=true] If is possible to move the component around the structure\n * @param {boolean} [component.droppable=true] If is possible to drop inside other components\n * @param {boolean} [component.badgable=true] If the badge is visible when the component is selected\n * @param {boolean} [component.stylable=true] If is possible to style component\n * @param {boolean} [component.copyable=true] If is possible to copy&paste the component\n * @param {string} [component.content=''] String inside component\n * @param {Object} [component.style={}] Style object\n * @param {Object} [component.attributes={}] Attribute object\n * @param {Object} opt the options object to be used by the [Components.add]{@link getComponents} method\n * @return {[Component]|Array<[Component]>} Component/s added\n * @example\n * // Example of a new component with some extra property\n * var comp1 = cmp.addComponent({\n * tagName: 'div',\n * removable: true, // Can't remove it\n * draggable: true, // Can't move it\n * copyable: true, // Disable copy/past\n * content: 'Content text', // Text inside component\n * style: { color: 'red'},\n * attributes: { title: 'here' }\n * });\n */\n addComponent(component: ComponentAdd, opt: AddOptions = {}): Component | Component[] {\n return this.getComponents().add(component, opt);\n }\n\n /**\n * Render and returns wrapper element with all components inside.\n * Once the wrapper is rendered, and it's what happens when you init the editor,\n * the all new components will be added automatically and property changes are all\n * updated immediately\n * @return {HTMLElement}\n * @private\n */\n render() {\n return this.componentView?.render().el;\n }\n\n /**\n * Remove all components\n * @return {this}\n */\n clear(opts = {}) {\n const components = this.getComponents();\n //@ts-ignore\n components?.filter(Boolean).forEach(i => i.remove(opts));\n return this;\n }\n\n /**\n * Set components\n * @param {Object|string} components HTML string or components model\n * @param {Object} opt the options object to be used by the {@link addComponent} method\n * @return {this}\n * @private\n */\n setComponents(components: ComponentAdd, opt: AddOptions = {}) {\n this.clear(opt).addComponent(components, opt);\n }\n\n /**\n * Add new component type.\n * Read more about this in [Define New Component](https://grapesjs.com/docs/modules/Components.html#define-new-component)\n * @param {string} type Component ID\n * @param {Object} methods Component methods\n * @return {this}\n */\n addType(type: string, methods: AddComponentTypeOptions) {\n const { em } = this;\n const { model = {}, view = {}, isComponent, extend, extendView, extendFn = [], extendFnView = [] } = methods;\n const compType = this.getType(type);\n const extendType = this.getType(extend!);\n const extendViewType = this.getType(extendView!);\n const typeToExtend = extendType ? extendType : compType ? compType : this.getType('default');\n const modelToExt = typeToExtend.model;\n const viewToExt = extendViewType ? extendViewType.view : typeToExtend.view;\n\n // Function for extending source object methods\n const getExtendedObj = (fns: any[], target: any, srcToExt: any) =>\n fns.reduce((res, next) => {\n const fn = target[next];\n const parentFn = srcToExt.prototype[next];\n if (fn && parentFn) {\n res[next] = function (...args: any[]) {\n parentFn.bind(this)(...args);\n fn.bind(this)(...args);\n };\n }\n return res;\n }, {});\n\n // If the model/view is a simple object I need to extend it\n if (typeof model === 'object') {\n const modelDefaults = { defaults: model.defaults };\n delete model.defaults;\n methods.model = modelToExt.extend(\n {\n ...model,\n ...getExtendedObj(extendFn, model, modelToExt),\n },\n {\n isComponent: compType && !extendType && !isComponent ? modelToExt.isComponent : isComponent || (() => 0),\n }\n );\n // Reassign the defaults getter to the model\n Object.defineProperty(methods.model!.prototype, 'defaults', {\n get: () => ({\n ...(result(modelToExt.prototype, 'defaults') || {}),\n ...(result(modelDefaults, 'defaults') || {}),\n }),\n });\n }\n\n if (typeof view === 'object') {\n methods.view = viewToExt.extend({\n ...view,\n ...getExtendedObj(extendFnView, view, viewToExt),\n });\n }\n\n if (compType) {\n compType.model = methods.model;\n compType.view = methods.view;\n } else {\n // @ts-ignore\n methods.id = type;\n this.componentTypes.unshift(methods as any);\n }\n\n const event = `component:type:${compType ? 'update' : 'add'}`;\n em?.trigger(event, compType || methods);\n\n return this;\n }\n\n /**\n * Get component type.\n * Read more about this in [Define New Component](https://grapesjs.com/docs/modules/Components.html#define-new-component)\n * @param {string} type Component ID\n * @return {Object} Component type definition, eg. `{ model: ..., view: ... }`\n */\n getType(type: 'default'): { id: string; model: any; view: any };\n getType(type: string): { id: string; model: any; view: any } | undefined;\n getType(type: string) {\n var df = this.componentTypes;\n\n for (var it = 0; it < df.length; it++) {\n var dfId = df[it].id;\n if (dfId == type) {\n return df[it];\n }\n }\n return;\n }\n\n /**\n * Remove component type\n * @param {string} type Component ID\n * @returns {Object|undefined} Removed component type, undefined otherwise\n */\n removeType(id: string) {\n const df = this.componentTypes;\n const type = this.getType(id);\n if (!type) return;\n const index = df.indexOf(type);\n df.splice(index, 1);\n return type;\n }\n\n /**\n * Return the array of all types\n * @return {Array}\n */\n getTypes() {\n return this.componentTypes;\n }\n\n selectAdd(component: Component, opts = {}) {\n if (component) {\n component.set({\n status: 'selected',\n });\n ['component:selected', 'component:toggled'].forEach(event => this.em.trigger(event, component, opts));\n }\n }\n\n selectRemove(component: Component, opts = {}) {\n if (component) {\n const { em } = this;\n component.set({\n status: '',\n state: '',\n });\n ['component:deselected', 'component:toggled'].forEach(event => this.em.trigger(event, component, opts));\n }\n }\n\n /**\n * Triggered when the component is hovered\n * @private\n */\n componentHovered() {\n const { em } = this;\n const model = em.get('componentHovered');\n const previous = em.previous('componentHovered');\n const state = 'hovered';\n\n // Deselect the previous component\n previous &&\n previous.get('status') == state &&\n previous.set({\n status: '',\n state: '',\n });\n\n model && isEmpty(model.get('status')) && model.set('status', state);\n }\n\n getShallowWrapper() {\n let { shallow, em } = this;\n\n if (!shallow && em) {\n const shallowEm = em.shallow;\n if (!shallowEm) return;\n const domc = shallowEm.Components;\n domc.componentTypes = this.componentTypes;\n shallow = domc.getWrapper();\n if (shallow) {\n const events = [keyUpdate, keyUpdateInside].join(' ');\n shallow.on(\n events,\n debounce(() => shallow?.components(''), 100)\n );\n }\n this.shallow = shallow;\n }\n\n return shallow;\n }\n\n /**\n * Check if the object is a [Component].\n * @param {Object} obj\n * @returns {Boolean}\n * @example\n * cmp.isComponent(editor.getSelected()); // true\n * cmp.isComponent({}); // false\n */\n isComponent(obj?: ObjectAny): obj is Component {\n return isComponent(obj);\n }\n\n /**\n * Add a new symbol from a component.\n * If the passed component is not a symbol, it will be converted to an instance and will return the main symbol.\n * If the passed component is already an instance, a new instance will be created and returned.\n * If the passed component is the main symbol, a new instance will be created and returned.\n * @param {[Component]} component Component from which create a symbol.\n * @returns {[Component]}\n * @example\n * const symbol = cmp.addSymbol(editor.getSelected());\n * // cmp.getSymbolInfo(symbol).isSymbol === true;\n */\n addSymbol(component: Component) {\n if (isSymbol(component) && !isSymbolRoot(component)) {\n return;\n }\n\n const symbol = component.clone({ symbol: true });\n isSymbolMain(symbol) && this.symbols.add(symbol);\n this.em.trigger('component:toggled');\n\n return symbol;\n }\n\n /**\n * Get the array of main symbols.\n * @returns {Array<[Component]>}\n * @example\n * const symbols = cmp.getSymbols();\n * // [Component, Component, ...]\n * // Removing the main symbol will detach all the relative instances.\n * symbols[0].remove();\n */\n getSymbols() {\n return [...this.symbols.models];\n }\n\n /**\n * Detach symbol instance from the main one.\n * The passed symbol instance will become a regular component.\n * @param {[Component]} component The component symbol to detach.\n * @example\n * const cmpInstance = editor.getSelected();\n * // cmp.getSymbolInfo(cmpInstance).isInstance === true;\n * cmp.detachSymbol(cmpInstance);\n * // cmp.getSymbolInfo(cmpInstance).isInstance === false;\n */\n detachSymbol(component: Component) {\n if (isSymbolInstance(component)) {\n detachSymbolInstance(component);\n }\n }\n\n /**\n * Get info about the symbol.\n * @param {[Component]} component Component symbol from which to get the info.\n * @returns {Object} Object containing symbol info.\n * @example\n * cmp.getSymbolInfo(editor.getSelected());\n * // > { isSymbol: true, isMain: false, isInstance: true, ... }\n */\n getSymbolInfo(component: Component, opts: { withChanges?: string } = {}): SymbolInfo {\n const isMain = isSymbolMain(component);\n const mainRef = getSymbolMain(component);\n const isInstance = !!mainRef;\n const instances = (isMain ? getSymbolInstances(component) : getSymbolInstances(mainRef)) || [];\n const main = mainRef || (isMain ? component : undefined);\n const relatives = getSymbolsToUpdate(component, { changed: opts.withChanges });\n const isSymbol = isMain || isInstance;\n const isRoot = isSymbol && isSymbolRoot(component);\n\n return {\n isSymbol,\n isMain,\n isInstance,\n isRoot,\n main,\n instances: instances,\n relatives: relatives || [],\n };\n }\n\n /**\n * Check if a component can be moved inside another one.\n * @param {[Component]} target The target component is the one that is supposed to receive the source one.\n * @param {[Component]|String} source The source can be another component, a component definition or an HTML string.\n * @param {Number} [index] Index position, if not specified, the check will be performed against appending the source to the target.\n * @returns {Object} Object containing the `result` (Boolean), `source`, `target` (as Components), and a `reason` (Number) with these meanings:\n * * `0` - Invalid source. This is a default value and should be ignored in case the `result` is true.\n * * `1` - Source doesn't accept target as destination.\n * * `2` - Target doesn't accept source.\n * @example\n * const rootComponent = editor.getWrapper();\n * const someComponent = editor.getSelected();\n *\n * // Check with two components\n * editor.Components.canMove(rootComponent, someComponent);\n *\n * // Check with component definition\n * editor.Components.canMove(rootComponent, { tagName: 'a', draggable: false });\n *\n * // Check with HTML string\n * editor.Components.canMove(rootComponent, '
...
');\n */\n canMove(target: Component, source?: Component | ComponentDefinition | string, index?: number): CanMoveResult {\n const result: CanMoveResult = {\n result: false,\n reason: CanMoveReason.InvalidSource,\n target,\n source: null,\n };\n\n if (!source || !target) return result;\n\n let srcModel = isComponent(source) ? source : null;\n\n if (!srcModel) {\n const wrapper = this.getShallowWrapper();\n srcModel = wrapper?.append(source)[0] || null;\n }\n\n result.source = srcModel;\n\n if (!srcModel) return result;\n\n // Check if the source is draggable in the target\n let draggable = srcModel.get('draggable');\n\n if (isFunction(draggable)) {\n draggable = !!draggable(srcModel, target, index);\n } else {\n const el = target.getEl();\n draggable = isArray(draggable) ? draggable.join(',') : draggable;\n draggable = isString(draggable) ? el?.matches(draggable) : draggable;\n }\n\n if (!draggable) return { ...result, reason: CanMoveReason.SourceReject };\n\n // Check if the target accepts the source\n let droppable = target.get('droppable');\n\n if (isFunction(droppable)) {\n droppable = !!droppable(srcModel, target, index);\n } else {\n if (droppable === false && target.isInstanceOf('text') && srcModel.get('textable')) {\n droppable = true;\n } else {\n const el = srcModel.getEl();\n droppable = isArray(droppable) ? droppable.join(',') : droppable;\n droppable = isString(droppable) ? el?.matches(droppable) : droppable;\n }\n }\n\n // Ensure the target is not inside the source\n const isTargetInside = [target].concat(target.parents()).indexOf(srcModel) > -1;\n\n if (!droppable || isTargetInside) return { ...result, reason: CanMoveReason.TargetReject };\n\n return { ...result, result: true };\n }\n\n allById() {\n return this.componentsById;\n }\n\n getById(id: string) {\n return this.componentsById[id] || null;\n }\n\n destroy() {\n const all = this.allById();\n Object.keys(all).forEach(id => all[id] && all[id].remove());\n this.componentView?.remove();\n [this.em, this.componentsById, this.componentView].forEach(i => (i = {}));\n }\n}\n","export interface CssComposerConfig {\n /**\n * Style prefix.\n * @default 'css-'\n */\n stylePrefix?: string;\n\n /**\n * Default CSS style rules\n */\n rules?: Array; // TODO\n}\n\nconst config: CssComposerConfig = {\n stylePrefix: 'css-',\n rules: [],\n};\n\nexport default config;\n","import { bindAll, isUndefined, each } from 'underscore';\nimport { Model } from '../../common';\nimport CssComposer from '../../css_composer';\nimport CssRule from '../../css_composer/model/CssRule';\nimport CssRules from '../../css_composer/model/CssRules';\nimport Component from '../../dom_components/model/Component';\nimport EditorModel from '../../editor/model/Editor';\nimport { hasWin } from '../../utils/mixins';\n\nconst maxValue = Number.MAX_VALUE;\n\nexport const getMediaLength = (mediaQuery: string) => {\n const length = /(-?\\d*\\.?\\d+)\\w{0,}/.exec(mediaQuery);\n return !length ? '' : length[0];\n};\n\nexport type CssGeneratorBuildOptions = {\n /**\n * Return an array of CssRules instead of the CSS string.\n */\n json?: boolean;\n\n /**\n * Return only rules matched by the passed component.\n */\n onlyMatched?: boolean;\n\n /**\n * Force keep all defined rules. Toggle on in case output looks different inside/outside of the editor.\n */\n keepUnusedStyles?: boolean;\n rules?: CssRule[];\n clearStyles?: boolean;\n};\n\ntype CssGeneratorBuildOptionsProps = CssGeneratorBuildOptions & {\n em?: EditorModel;\n cssc?: CssComposer;\n};\n\ntype AtRules = Record;\n\nexport default class CssGenerator extends Model {\n compCls: string[];\n ids: string[];\n model?: Component;\n em?: EditorModel;\n\n constructor() {\n super();\n bindAll(this, 'sortRules');\n this.compCls = [];\n this.ids = [];\n }\n\n /**\n * Get CSS from a component\n * @param {Model} model\n * @return {String}\n */\n buildFromModel(model: Component, opts: CssGeneratorBuildOptions = {}) {\n let code = '';\n const em = this.em;\n const avoidInline = em && em.getConfig().avoidInlineStyle;\n const style = model.styleToString();\n const classes = model.classes;\n this.ids.push(`#${model.getId()}`);\n\n // Let's know what classes I've found\n classes.forEach((model: any) => this.compCls.push(model.getFullName()));\n\n if (!avoidInline && style) {\n code = `#${model.getId()}{${style}}`;\n }\n\n const components = model.components();\n components.forEach((model: Component) => (code += this.buildFromModel(model, opts)));\n return code;\n }\n\n build(model: Component, opts: CssGeneratorBuildOptionsProps = {}) {\n const { json } = opts;\n const em = opts.em;\n const cssc = opts.cssc || em?.Css;\n this.em = em;\n this.compCls = [];\n this.ids = [];\n this.model = model;\n const codeJson: CssRule[] = [];\n let code = model ? this.buildFromModel(model, opts) : '';\n const clearStyles = isUndefined(opts.clearStyles) && em ? em.getConfig().clearStyles : opts.clearStyles;\n\n if (cssc) {\n let rules: CssRules | CssRule[] = opts.rules || cssc.getAll();\n const atRules: AtRules = {};\n const dump: CssRule[] = [];\n\n if (opts.onlyMatched && model && hasWin()) {\n rules = this.matchedRules(model, rules);\n }\n\n rules.forEach(rule => {\n const atRule = rule.getAtRule();\n\n if (atRule) {\n const mRules = atRules[atRule];\n if (mRules) {\n mRules.push(rule);\n } else {\n atRules[atRule] = [rule];\n }\n return;\n }\n\n const res = this.buildFromRule(rule, dump, opts);\n\n if (json) {\n codeJson.push(res as CssRule);\n } else {\n code += res;\n }\n });\n\n this.sortMediaObject(atRules).forEach(item => {\n let rulesStr = '';\n const atRule = item.key;\n const mRules = item.value;\n\n mRules.forEach(rule => {\n const ruleStr = this.buildFromRule(rule, dump, opts);\n\n if (rule.get('singleAtRule')) {\n code += `${atRule}{${ruleStr}}`;\n } else {\n rulesStr += ruleStr;\n }\n\n json && codeJson.push(ruleStr as CssRule);\n });\n\n if (rulesStr) {\n code += `${atRule}{${rulesStr}}`;\n }\n });\n\n // @ts-ignore\n em && clearStyles && rules.remove && rules.remove(dump);\n }\n\n return json ? codeJson.filter(r => r) : code;\n }\n\n /**\n * Get CSS from the rule model\n * @param {Model} rule\n * @return {string} CSS string\n */\n buildFromRule(rule: CssRule, dump: CssRule[], opts: CssGeneratorBuildOptions = {}) {\n let result: CssRule | string = '';\n const { model } = this;\n const selectorStrNoAdd = rule.selectorsToString({ skipAdd: 1 });\n const selectorsAdd = rule.get('selectorsAdd');\n const singleAtRule = rule.get('singleAtRule');\n let found;\n\n // This will not render a rule if there is no its component\n rule.get('selectors')?.forEach(selector => {\n const name = selector.getFullName();\n if (this.compCls.indexOf(name) >= 0 || this.ids.indexOf(name) >= 0 || opts.keepUnusedStyles) {\n found = 1;\n }\n });\n\n if ((selectorStrNoAdd && found) || selectorsAdd || singleAtRule || !model) {\n const block = rule.getDeclaration({ body: 1 });\n block && (opts.json ? (result = rule) : (result += block));\n } else {\n dump.push(rule);\n }\n\n return result;\n }\n\n /**\n * Get matched rules of a component\n * @param {Component} component\n * @param {Array} rules\n * @returns {Array}\n */\n matchedRules(component: Component, rules: CssRules | CssRule[]) {\n const el = component.getEl();\n let result: CssRule[] = [];\n\n rules.forEach(rule => {\n try {\n if (\n rule\n .selectorsToString()\n .split(',')\n .some(selector => el?.matches(this.__cleanSelector(selector)))\n ) {\n result.push(rule);\n }\n } catch (err) {}\n });\n\n component.components().forEach((component: Component) => {\n result = result.concat(this.matchedRules(component, rules));\n });\n\n // Remove duplicates\n result = result.filter((rule, i) => result.indexOf(rule) === i);\n\n return result;\n }\n\n /**\n * Get the numeric length of the media query string\n * @param {String} mediaQuery Media query string\n * @return {Number}\n */\n getQueryLength(mediaQuery: string) {\n const length = /(-?\\d*\\.?\\d+)\\w{0,}/.exec(mediaQuery);\n if (!length) return maxValue;\n\n return parseFloat(length[1]);\n }\n\n /**\n * Return a sorted array from media query object\n * @param {Object} items\n * @return {Array}\n */\n sortMediaObject(items: AtRules = {}) {\n const itemsArr: { key: string; value: CssRule[] }[] = [];\n each(items, (value, key) => itemsArr.push({ key, value }));\n return itemsArr.sort((a, b) => {\n const isMobFirst = [a.key, b.key].every(mquery => mquery.indexOf('min-width') !== -1);\n const left = isMobFirst ? a.key : b.key;\n const right = isMobFirst ? b.key : a.key;\n return this.getQueryLength(left) - this.getQueryLength(right);\n });\n }\n\n sortRules(a: CssRule, b: CssRule) {\n const getKey = (rule: CssRule) => rule.get('mediaText') || '';\n const isMobFirst = [getKey(a), getKey(b)].every(q => q.indexOf('min-width') !== -1);\n const left = isMobFirst ? getKey(a) : getKey(b);\n const right = isMobFirst ? getKey(b) : getKey(a);\n return this.getQueryLength(left) - this.getQueryLength(right);\n }\n\n /**\n * Return passed selector without states\n * @param {String} selector\n * @returns {String}\n * @private\n */\n __cleanSelector(selector: string) {\n return selector\n .split(' ')\n .map(item => item.split(':')[0])\n .join(' ');\n }\n}\n","import { isEmpty, forEach, isString, isArray } from 'underscore';\nimport { Model, ObjectAny } from '../../common';\nimport StyleableModel from '../../domain_abstract/model/StyleableModel';\nimport Selectors from '../../selector_manager/model/Selectors';\nimport { getMediaLength } from '../../code_manager/model/CssGenerator';\nimport { isEmptyObj, hasWin } from '../../utils/mixins';\nimport Selector, { SelectorProps } from '../../selector_manager/model/Selector';\nimport EditorModel from '../../editor/model/Editor';\n\n/** @private */\nexport interface CssRuleProperties {\n /**\n * Array of selectors\n */\n selectors: Selector[];\n /**\n * Object containing style definitions\n * @default {}\n */\n style?: Record;\n /**\n * Additional string css selectors\n * @default ''\n */\n selectorsAdd?: string;\n /**\n * Type of at-rule, eg. `media`, 'font-face'\n * @default ''\n */\n atRuleType?: string;\n /**\n * At-rule value, eg. `(max-width: 1000px)`\n * @default ''\n */\n mediaText?: string;\n /**\n * This property is used only on at-rules, like 'page' or 'font-face', where the block containes only style declarations.\n * @default false\n */\n singleAtRule?: boolean;\n /**\n * State of the rule, eg: `hover`, `focused`\n * @default ''\n */\n state?: string;\n /**\n * If true, sets `!important` on all properties. You can also pass an array to specify properties on which to use important.\n * @default false\n */\n important?: boolean | string[];\n /**\n * Indicates if the rule is stylable from the editor.\n * @default true\n */\n stylable?: boolean | string[];\n /**\n * Group for rules.\n * @default ''\n */\n group?: string;\n /**\n * If true, the rule won't be stored in JSON or showed in CSS export.\n * @default false\n */\n shallow?: boolean;\n}\n\nexport interface CssRuleJSON extends Omit {\n selectors: (string | SelectorProps)[];\n}\n\n// @ts-ignore\nconst { CSS } = hasWin() ? window : {};\n\n/**\n * @typedef CssRule\n * @property {Array} selectors Array of selectors\n * @property {Object} style Object containing style definitions\n * @property {String} [selectorsAdd=''] Additional string css selectors\n * @property {String} [atRuleType=''] Type of at-rule, eg. `media`, 'font-face'\n * @property {String} [mediaText=''] At-rule value, eg. `(max-width: 1000px)`\n * @property {Boolean} [singleAtRule=false] This property is used only on at-rules, like 'page' or 'font-face', where the block containes only style declarations\n * @property {String} [state=''] State of the rule, eg: `hover`, `focused`\n * @property {Boolean|Array} [important=false] If true, sets `!important` on all properties. You can also pass an array to specify properties on which use important\n * @property {Boolean} [stylable=true] Indicates if the rule is stylable from the editor\n *\n * [Device]: device.html\n * [State]: state.html\n * [Component]: component.html\n */\nexport default class CssRule extends StyleableModel {\n config: CssRuleProperties;\n em?: EditorModel;\n opt: any;\n\n defaults() {\n return {\n selectors: [],\n selectorsAdd: '',\n style: {},\n mediaText: '',\n state: '',\n stylable: true,\n atRuleType: '',\n singleAtRule: false,\n important: false,\n group: '',\n shallow: false,\n _undo: true,\n };\n }\n\n constructor(props: CssRuleProperties, opt: any = {}) {\n super(props);\n this.config = props || {};\n this.opt = opt;\n this.em = opt.em;\n this.ensureSelectors(null, null, {});\n this.on('change', this.__onChange);\n }\n\n __onChange(m: CssRule, opts: any) {\n const { em } = this;\n const changed = this.changedAttributes();\n changed && !isEmptyObj(changed) && em?.changesUp(opts);\n }\n\n clone(): CssRule {\n const opts = { ...this.opt };\n const attr = { ...this.attributes };\n attr.selectors = this.get('selectors')!.map(s => s.clone()) as Selector[];\n // @ts-ignore\n return new this.constructor(attr, opts);\n }\n\n ensureSelectors(m: any, c: any, opts: any) {\n const { em } = this;\n const sm = em?.get('SelectorManager');\n const toListen = [this, 'change:selectors', this.ensureSelectors];\n let sels = this.getSelectors() as any;\n this.stopListening(...toListen);\n\n if (sels.models) {\n sels = [...sels.models];\n }\n\n sels = isString(sels) ? [sels] : sels;\n\n if (Array.isArray(sels)) {\n const res = sels.filter(i => i).map(i => (sm ? sm.add(i) : i));\n sels = new Selectors(res);\n }\n\n this.set('selectors', sels, opts);\n // @ts-ignore\n this.listenTo(...toListen);\n }\n\n /**\n * Returns the at-rule statement when exists, eg. `@media (...)`, `@keyframes`\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.getAtRule(); // \"@media (min-width: 500px)\"\n */\n getAtRule() {\n const type = this.get('atRuleType');\n const condition = this.get('mediaText');\n // Avoid breaks with the last condition\n const typeStr = type ? `@${type}` : condition ? '@media' : '';\n\n return typeStr + (condition && typeStr ? ` ${condition}` : '');\n }\n\n /**\n * Return selectors of the rule as a string\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.skipState] Skip state from the result\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1:hover', { color: 'red' });\n * cssRule.selectorsToString(); // \".class1:hover\"\n * cssRule.selectorsToString({ skipState: true }); // \".class1\"\n */\n selectorsToString(opts: ObjectAny = {}) {\n const result = [];\n const state = this.get('state');\n const addSelector = this.get('selectorsAdd');\n const selOpts = {\n escape: (str: string) => (CSS && CSS.escape ? CSS.escape(str) : str),\n };\n // @ts-ignore\n const selectors = this.get('selectors').getFullString(0, selOpts);\n const stateStr = state && !opts.skipState ? `:${state}` : '';\n selectors && result.push(`${selectors}${stateStr}`);\n addSelector && !opts.skipAdd && result.push(addSelector);\n return result.join(', ');\n }\n\n /**\n * Get declaration block (without the at-rule statement)\n * @param {Object} [opts={}] Options (same as in `selectorsToString`)\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.getDeclaration() // \".class1{color:red;}\"\n */\n getDeclaration(opts: ObjectAny = {}) {\n let result = '';\n const { important } = this.attributes;\n const selectors = this.selectorsToString(opts);\n const style = this.styleToString({ important, ...opts });\n const singleAtRule = this.get('singleAtRule');\n\n if ((selectors || singleAtRule) && (style || opts.allowEmpty)) {\n result = singleAtRule ? style : `${selectors}{${style}}`;\n }\n\n return result;\n }\n\n /**\n * Get the Device the rule is related to.\n * @returns {[Device]|null}\n * @example\n * const device = rule.getDevice();\n * console.log(device?.getName());\n */\n getDevice() {\n const { em } = this;\n const { atRuleType, mediaText } = this.attributes;\n const devices = em?.get('DeviceManager').getDevices() || [];\n const deviceDefault = devices.filter((d: any) => d.getWidthMedia() === '')[0];\n if (atRuleType !== 'media' || !mediaText) {\n return deviceDefault || null;\n }\n return devices.filter((d: any) => d.getWidthMedia() === getMediaLength(mediaText))[0] || null;\n }\n\n /**\n * Get the State the rule is related to.\n * @returns {[State]|null}\n * @example\n * const state = rule.getState();\n * console.log(state?.getLabel());\n */\n getState() {\n const { em } = this;\n const stateValue = this.get('state');\n const states = em?.get('SelectorManager').getStates() || [];\n return states.filter((s: any) => s.getName() === stateValue)[0] || null;\n }\n\n /**\n * Returns the related Component (valid only for component-specific rules).\n * @returns {[Component]|null}\n * @example\n * const cmp = rule.getComponent();\n * console.log(cmp?.toHTML());\n */\n getComponent() {\n const sel = this.getSelectors() as any;\n const sngl = sel.length == 1 && sel.at(0);\n const cmpId = sngl && sngl.isId() && sngl.get('name');\n return (cmpId && this.em?.Components.getById(cmpId)) || null;\n }\n\n /**\n * Return the CSS string of the rule\n * @param {Object} [opts={}] Options (same as in `getDeclaration`)\n * @return {String} CSS string\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.toCSS() // \"@media (min-width: 500px){.class1{color:red;}}\"\n */\n toCSS(opts: ObjectAny = {}) {\n let result = '';\n const atRule = this.getAtRule();\n const block = this.getDeclaration(opts);\n if (block || opts.allowEmpty) {\n result = block;\n }\n\n if (atRule && result) {\n result = `${atRule}{${result}}`;\n }\n\n return result;\n }\n\n toJSON(...args: any) {\n const obj = Model.prototype.toJSON.apply(this, args);\n\n if (this.em?.getConfig().avoidDefaults) {\n const defaults = this.defaults();\n\n forEach(defaults, (value, key) => {\n if (obj[key] === value) {\n delete obj[key];\n }\n });\n\n // Delete the property used for partial updates\n delete obj.style.__p;\n\n if (isEmpty(obj.selectors)) delete obj.selectors;\n if (isEmpty(obj.style)) delete obj.style;\n }\n\n return obj;\n }\n\n /**\n * Compare the actual model with parameters\n * @param {Object} selectors Collection of selectors\n * @param {String} state Css rule state\n * @param {String} width For which device this style is oriented\n * @param {Object} ruleProps Other rule props\n * @returns {Boolean}\n * @private\n */\n compare(selectors: any, state?: string, width?: string, ruleProps: Partial = {}) {\n const st = state || '';\n const wd = width || '';\n const selAdd = ruleProps.selectorsAdd || '';\n let atRule = ruleProps.atRuleType || '';\n const sel = !isArray(selectors) && !selectors.models ? [selectors] : selectors.models || selectors;\n\n // Fix atRuleType in case is not specified with width\n if (wd && !atRule) atRule = 'media';\n\n const a1: string[] = sel.map((model: any) => model.getFullName());\n const a2: string[] = this.get('selectors')?.map(model => model.getFullName())!;\n\n // Check selectors\n const a1S = a1.slice().sort();\n const a2S = a2.slice().sort();\n if (a1.length !== a2.length || !a1S.every((v, i) => v === a2S[i])) {\n return false;\n }\n\n // Check other properties\n if (\n this.get('state') !== st ||\n this.get('mediaText') !== wd ||\n this.get('selectorsAdd') !== selAdd ||\n this.get('atRuleType') !== atRule\n ) {\n return false;\n }\n\n return true;\n }\n}\n","import { Collection } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport CssRule, { CssRuleProperties } from './CssRule';\n\nexport default class CssRules extends Collection {\n editor: EditorModel;\n\n constructor(props: any, opt: any) {\n super(props);\n // Inject editor\n this.editor = opt?.em;\n\n // This will put the listener post CssComposer.postLoad\n setTimeout(() => {\n this.on('remove', this.onRemove);\n this.on('add', this.onAdd);\n });\n }\n\n toJSON(opts?: any) {\n const result = Collection.prototype.toJSON.call(this, opts);\n return result.filter((rule: CssRuleProperties) => rule.style && !rule.shallow);\n }\n\n onAdd(model: CssRule, c: CssRules, o: any) {\n model.ensureSelectors(model, c, o); // required for undo\n }\n\n onRemove(removed: CssRule) {\n const em = this.editor;\n em.stopListening(removed);\n em.UndoManager.remove(removed);\n }\n\n /** @ts-ignore */\n add(models: any, opt: any = {}) {\n if (typeof models === 'string') {\n models = this.editor.get('Parser').parseCss(models);\n }\n opt.em = this.editor;\n return Collection.prototype.add.apply(this, [models, opt]);\n }\n}\n\nCssRules.prototype.model = CssRule;\n","/**\n * This module manages CSS rules in the canvas.\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/css_composer/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * cssComposer: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const css = editor.Css;\n * ```\n *\n * * [addRules](#addrules)\n * * [setRule](#setrule)\n * * [getRule](#getrule)\n * * [getRules](#getrules)\n * * [remove](#remove)\n * * [clear](#clear)\n *\n * [CssRule]: css_rule.html\n *\n * @module Css\n */\n\nimport { isArray, isString, isUndefined } from 'underscore';\nimport { isObject } from '../utils/mixins';\nimport Selectors from '../selector_manager/model/Selectors';\nimport Selector from '../selector_manager/model/Selector';\nimport defaults, { CssComposerConfig } from './config/config';\nimport CssRule, { CssRuleJSON, CssRuleProperties } from './model/CssRule';\nimport CssRules from './model/CssRules';\nimport CssRulesView from './view/CssRulesView';\nimport { ItemManagerModule } from '../abstract/Module';\nimport EditorModel from '../editor/model/Editor';\nimport Component from '../dom_components/model/Component';\nimport { ObjectAny, PrevToNewIdMap } from '../common';\nimport { UpdateStyleOptions } from '../domain_abstract/model/StyleableModel';\n\n/** @private */\ninterface RuleOptions {\n /**\n * At-rule type, eg. `media`\n */\n atRuleType?: string;\n /**\n * At-rule parameters, eg. `(min-width: 500px)`\n */\n atRuleParams?: string;\n}\n\n/** @private */\ninterface SetRuleOptions extends RuleOptions, UpdateStyleOptions {\n /**\n * If the rule exists already, merge passed styles instead of replacing them.\n */\n addStyles?: boolean;\n}\n\n/** @private */\nexport interface GetSetRuleOptions extends UpdateStyleOptions {\n state?: string;\n mediaText?: string;\n addOpts?: ObjectAny;\n current?: boolean;\n}\n\ntype CssRuleStyle = Required['style'];\n\nexport default class CssComposer extends ItemManagerModule {\n rules: CssRules;\n rulesView?: CssRulesView;\n\n Selectors = Selectors;\n\n storageKey = 'styles';\n\n /**\n * Initializes module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n constructor(em: EditorModel) {\n super(em, 'CssComposer', null, {}, defaults);\n const { config } = this;\n\n const ppfx = config.pStylePrefix;\n if (ppfx) config.stylePrefix = ppfx + config.stylePrefix;\n\n // @ts-ignore\n config.rules = this.em.config.style || config.rules || '';\n\n this.rules = new CssRules([], config);\n }\n\n /**\n * On load callback\n * @private\n */\n onLoad() {\n this.rules.add(this.config.rules, { silent: true });\n }\n\n /**\n * Do stuff after load\n * @param {Editor} em\n * @private\n */\n postLoad() {\n const um = this.em?.get('UndoManager');\n um && um.add(this.getAll());\n }\n\n store() {\n return this.getProjectData();\n }\n\n load(data: any) {\n return this.loadProjectData(data, {\n // @ts-ignore Fix add() first in CssRules\n all: this.rules,\n });\n }\n\n /**\n * Add new rule to the collection, if not yet exists with the same selectors\n * @param {Array} selectors Array of selectors\n * @param {String} state Css rule state\n * @param {String} width For which device this style is oriented\n * @param {Object} props Other props for the rule\n * @param {Object} opts Options for the add of new rule\n * @return {Model}\n * @private\n * @example\n * var sm = editor.SelectorManager;\n * var sel1 = sm.add('myClass1');\n * var sel2 = sm.add('myClass2');\n * var rule = cssComposer.add([sel1, sel2], 'hover');\n * rule.set('style', {\n * width: '100px',\n * color: '#fff',\n * });\n * */\n add(selectors: any, state?: string, width?: string, opts = {}, addOpts = {}) {\n const s = state || '';\n const w = width || '';\n const opt = { ...opts } as CssRuleProperties;\n let rule = this.get(selectors, s, w, opt);\n\n // do not create rules that were found before\n // unless this is a single at-rule, for which multiple declarations\n // make sense (e.g. multiple `@font-type`s)\n if (rule && rule.config && !rule.config.singleAtRule) {\n return rule;\n } else {\n opt.state = s;\n opt.mediaText = w;\n opt.selectors = [];\n // #4727: Prevent updating atRuleType if already defined\n if (w && !opt.atRuleType) {\n opt.atRuleType = 'media';\n }\n rule = new CssRule(opt, this.config);\n // @ts-ignore\n rule.get('selectors').add(selectors, addOpts);\n this.rules.add(rule, addOpts);\n return rule;\n }\n }\n\n /**\n * Get the rule\n * @param {String|Array} selectors Array of selectors or selector string, eg `.myClass1.myClass2`\n * @param {String} state Css rule state, eg. 'hover'\n * @param {String} width Media rule value, eg. '(max-width: 992px)'\n * @param {Object} ruleProps Other rule props\n * @return {Model|null}\n * @private\n * @example\n * const sm = editor.SelectorManager;\n * const sel1 = sm.add('myClass1');\n * const sel2 = sm.add('myClass2');\n * const rule = cssComposer.get([sel1, sel2], 'hover', '(max-width: 992px)');\n * // Update the style\n * rule.set('style', {\n * width: '300px',\n * color: '#000',\n * });\n * */\n get(\n selectors: any,\n state?: string,\n width?: string,\n ruleProps?: Omit\n ): CssRule | undefined {\n let slc = selectors;\n if (isString(selectors)) {\n const sm = this.em.Selectors;\n const singleSel = selectors.split(',')[0].trim();\n const node = this.em.Parser.parserCss.checkNode({ selectors: singleSel } as any)[0];\n slc = sm.get(node.selectors as string[]);\n }\n return this.rules.find(rule => rule.compare(slc, state, width, ruleProps)) || null;\n }\n\n getAll() {\n return this.rules;\n }\n\n /**\n * Add a raw collection of rule objects\n * This method overrides styles, in case, of already defined rule\n * @param {String|Array} data CSS string or an array of rule objects, eg. [{selectors: ['class1'], style: {....}}, ..]\n * @param {Object} opts Options\n * @param {Object} props Additional properties to add on rules\n * @return {Array}\n * @private\n */\n addCollection(data: string | CssRuleJSON[], opts: Record = {}, props = {}) {\n const { em } = this;\n const result: CssRule[] = [];\n\n if (isString(data)) {\n data = em.Parser.parseCss(data);\n }\n\n const d = data instanceof Array ? data : [data];\n\n for (var i = 0, l = d.length; i < l; i++) {\n const rule = (d[i] || {}) as CssRuleJSON;\n if (!rule.selectors) continue;\n\n const sm = em?.Selectors;\n if (!sm) console.warn('Selector Manager not found');\n const sl = rule.selectors;\n const sels = sl instanceof Array ? sl : [sl];\n const newSels = [];\n\n for (let j = 0, le = sels.length; j < le; j++) {\n // @ts-ignore\n const selec = sm.add(sels[j]);\n newSels.push(selec);\n }\n\n const modelExists = this.get(newSels, rule.state, rule.mediaText, rule);\n const model = this.add(newSels, rule.state, rule.mediaText, rule, opts);\n const updateStyle = !modelExists || !opts.avoidUpdateStyle;\n const style = rule.style || {};\n\n isObject(props) && model.set(props, opts);\n\n if (updateStyle) {\n const styleUpdate = opts.extend ? { ...model.get('style'), ...style } : style;\n model.set('style', styleUpdate, opts);\n }\n\n result.push(model);\n }\n\n return result;\n }\n\n /**\n * Add CssRules via CSS string.\n * @param {String} css CSS string of rules to add.\n * @returns {Array<[CssRule]>} Array of rules\n * @example\n * const addedRules = css.addRules('.my-cls{ color: red } @media (max-width: 992px) { .my-cls{ color: darkred } }');\n * // Check rules\n * console.log(addedRules.map(rule => rule.toCSS()));\n */\n addRules(css: string) {\n return this.addCollection(css);\n }\n\n /**\n * Add/update the CssRule.\n * @param {String} selectors Selector string, eg. `.myclass`\n * @param {Object} style Style properties and values. If the rule exists, styles will be replaced unless `addStyles` option is used.\n * @param {Object} [opts={}] Additional properties.\n * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`.\n * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. `(min-width: 500px)`.\n * @param {Boolean} [opts.addStyles=false] If the rule exists already, merge passed styles instead of replacing them.\n * @returns {[CssRule]} The new/updated CssRule.\n * @example\n * // Simple class-based rule\n * const rule = css.setRule('.class1.class2', { color: 'red' });\n * console.log(rule.toCSS()) // output: .class1.class2 { color: red }\n * // With state and other mixed selector\n * const rule = css.setRule('.class1.class2:hover, div#myid', { color: 'red' });\n * // output: .class1.class2:hover, div#myid { color: red }\n * // With media\n * const rule = css.setRule('.class1:hover', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)',\n * });\n * // output: `@media (min-width: 500px) { .class1:hover { color: red } }`\n *\n * // Update styles of existent rule\n * css.setRule('.class1', { color: 'red', background: 'red' });\n * css.setRule('.class1', { color: 'blue' }, { addStyles: true });\n * // output: .class1 { color: blue; background: red }\n */\n setRule(selectors: any, style: CssRuleProperties['style'] = {}, opts: SetRuleOptions = {}) {\n const { atRuleType, atRuleParams } = opts;\n const node = this.em.Parser.parserCss.checkNode({\n selectors,\n style,\n })[0];\n const { state, selectorsAdd } = node;\n const sm = this.em.Selectors;\n const selector = sm.add(node.selectors as any);\n const rule = this.add(selector, state, atRuleParams, {\n selectorsAdd,\n atRule: atRuleType,\n });\n\n if (opts.addStyles) {\n rule.addStyle(style, opts);\n } else {\n rule.setStyle(style, opts);\n }\n\n return rule;\n }\n\n /**\n * Get the CssRule.\n * @param {String} selectors Selector string, eg. `.myclass:hover`\n * @param {Object} [opts={}] Additional properties\n * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`\n * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. '(min-width: 500px)'\n * @returns {[CssRule]}\n * @example\n * const rule = css.getRule('.myclass1:hover');\n * const rule2 = css.getRule('.myclass1:hover, div#myid');\n * const rule3 = css.getRule('.myclass1', {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)',\n * });\n */\n getRule(selectors: any, opts: RuleOptions = {}) {\n const { em } = this;\n const sm = em.Selectors;\n const node = em.Parser.parserCss.checkNode({ selectors })[0];\n // @ts-ignore\n const selector = sm.get(node.selectors);\n const { state, selectorsAdd } = node;\n const { atRuleType, atRuleParams } = opts;\n return selector\n ? this.get(selector, state, atRuleParams, {\n selectorsAdd,\n atRuleType,\n })\n : undefined;\n }\n\n /**\n * Get all rules or filtered by a matching selector.\n * @param {String} [selector=''] Selector, eg. `.myclass`\n * @returns {Array<[CssRule]>}\n * @example\n * // Take all the component specific rules\n * const id = someComponent.getId();\n * const rules = css.getRules(`#${id}`);\n * console.log(rules.map(rule => rule.toCSS()))\n * // All rules in the project\n * console.log(css.getRules())\n */\n getRules(selector?: string) {\n const rules = this.getAll();\n if (!selector) return [...rules.models];\n const optRuleSel = { sort: true };\n const sels = isString(selector) ? selector.split(',').map(s => s.trim()) : selector;\n const result = rules.filter(r => sels.indexOf(r.getSelectors().getFullString(null, optRuleSel)) >= 0);\n return result;\n }\n\n /**\n * Add/update the CSS rule with id selector\n * @param {string} name Id selector name, eg. 'my-id'\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule} The new/updated rule\n * @private\n * @example\n * const rule = css.setIdRule('myid', { color: 'red' });\n * const ruleHover = css.setIdRule('myid', { color: 'blue' }, { state: 'hover' });\n * // This will add current CSS:\n * // #myid { color: red }\n * // #myid:hover { color: blue }\n */\n setIdRule(name: string, style: CssRuleStyle = {}, opts: GetSetRuleOptions = {}) {\n const { addOpts = {}, mediaText } = opts;\n const state = opts.state || '';\n const media = !isUndefined(mediaText) ? mediaText : this.em.getCurrentMedia();\n const sm = this.em.Selectors;\n const selector = sm.add({ name, type: Selector.TYPE_ID }, addOpts);\n const rule = this.add(selector, state, media, {}, addOpts);\n rule.setStyle(style, { ...opts, ...addOpts });\n return rule;\n }\n\n /**\n * Get the CSS rule by id selector\n * @param {string} name Id selector name, eg. 'my-id'\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule}\n * @private\n * @example\n * const rule = css.getIdRule('myid');\n * const ruleHover = css.setIdRule('myid', { state: 'hover' });\n */\n getIdRule(name: string, opts: GetSetRuleOptions = {}) {\n const { mediaText } = opts;\n const state = opts.state || '';\n const media = !isUndefined(mediaText) ? mediaText : this.em.getCurrentMedia();\n const selector = this.em.Selectors.get(name, Selector.TYPE_ID);\n return selector && this.get(selector, state, media);\n }\n\n /**\n * Add/update the CSS rule with class selector\n * @param {string} name Class selector name, eg. 'my-class'\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule} The new/updated rule\n * @private\n * @example\n * const rule = css.setClassRule('myclass', { color: 'red' });\n * const ruleHover = css.setClassRule('myclass', { color: 'blue' }, { state: 'hover' });\n * // This will add current CSS:\n * // .myclass { color: red }\n * // .myclass:hover { color: blue }\n */\n setClassRule(name: string, style: CssRuleStyle = {}, opts: GetSetRuleOptions = {}) {\n const state = opts.state || '';\n const media = opts.mediaText || this.em.getCurrentMedia();\n const sm = this.em.Selectors;\n const selector = sm.add({ name, type: Selector.TYPE_CLASS });\n const rule = this.add(selector, state, media);\n rule.setStyle(style, opts);\n return rule;\n }\n\n /**\n * Get the CSS rule by class selector\n * @param {string} name Class selector name, eg. 'my-class'\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule}\n * @private\n * @example\n * const rule = css.getClassRule('myclass');\n * const ruleHover = css.getClassRule('myclass', { state: 'hover' });\n */\n getClassRule(name: string, opts: GetSetRuleOptions = {}) {\n const state = opts.state || '';\n const media = opts.mediaText || this.em.getCurrentMedia();\n const selector = this.em.Selectors.get(name, Selector.TYPE_CLASS);\n return selector && this.get(selector, state, media);\n }\n\n /**\n * Remove rule, by CssRule or matching selector (eg. the selector will match also at-rules like `@media`)\n * @param {String|[CssRule]|Array<[CssRule]>} rule CssRule or matching selector.\n * @return {Array<[CssRule]>} Removed rules\n * @example\n * // Remove by CssRule\n * const toRemove = css.getRules('.my-cls');\n * css.remove(toRemove);\n * // Remove by selector\n * css.remove('.my-cls-2');\n */\n remove(rule: string | CssRule, opts?: any) {\n const toRemove = isString(rule) ? this.getRules(rule) : rule;\n const result = this.getAll().remove(toRemove, opts);\n return isArray(result) ? result : [result];\n }\n\n /**\n * Remove all rules\n * @return {this}\n */\n clear(opts = {}) {\n this.getAll().reset([], opts);\n return this;\n }\n\n getComponentRules(cmp: Component, opts: GetSetRuleOptions = {}) {\n let { state, mediaText, current } = opts;\n if (current) {\n state = this.em.get('state') || '';\n mediaText = this.em.getCurrentMedia();\n }\n const id = cmp.getId();\n const rules = this.getAll().filter(r => {\n if (!isUndefined(state) && r.get('state') !== state) return false;\n if (!isUndefined(mediaText) && r.get('mediaText') !== mediaText) return false;\n return r.getSelectorsString() === `#${id}`;\n });\n return rules;\n }\n\n /**\n * Render the block of CSS rules\n * @return {HTMLElement}\n * @private\n */\n render() {\n this.rulesView?.remove();\n this.rulesView = new CssRulesView({\n collection: this.rules,\n config: this.config,\n });\n return this.rulesView.render().el;\n }\n\n checkId(rule: CssRuleJSON | CssRuleJSON[], opts: { idMap?: PrevToNewIdMap } = {}) {\n const { idMap = {} } = opts;\n const changed: CssRuleJSON[] = [];\n\n if (!Object.keys(idMap).length) return changed;\n\n const rules = Array.isArray(rule) ? rule : [rule];\n rules.forEach(rule => {\n const sel = rule.selectors;\n\n if (sel && sel.length == 1) {\n const sSel = sel[0];\n\n if (isString(sSel)) {\n if (sSel[0] === '#') {\n const prevId = sSel.substring(1);\n const newId = idMap[prevId];\n if (prevId && newId) {\n sel[0] = `#${newId}`;\n changed.push(rule);\n }\n }\n } else if (sSel.name && sSel.type === Selector.TYPE_ID) {\n const newId = idMap[sSel.name];\n if (newId) {\n sSel.name = newId;\n changed.push(rule);\n }\n }\n }\n });\n\n return changed;\n }\n\n destroy() {\n this.rules.reset();\n this.rules.stopListening();\n this.rulesView?.remove();\n }\n}\n","import Editor from '../../editor';\nimport Block, { BlockProperties } from '../model/Block';\n\nexport interface BlockManagerConfig {\n /**\n * Specify the element to use as a container, string (query) or HTMLElement.\n * With the empty value, nothing will be rendered.\n * @default ''\n */\n appendTo?: HTMLElement | string;\n /**\n * Default blocks.\n * @default []\n */\n blocks?: BlockProperties[];\n /**\n * Append blocks to canvas on click.\n * With the `true` value, it will try to append the block to the selected component\n * If there is no selected component, the block will be appened to the wrapper.\n * You can also pass a function to this option, use it as a catch-all for all block\n * clicks and implement a custom logic for each block.\n * @default false\n * @example\n * // Example with a function\n * appendOnClick: (block, editor) => {\n * if (block.get('id') === 'some-id')\n * editor.getSelected().append(block.get('content'))\n * else\n * editor.getWrapper().append(block.get('content'))\n * }\n */\n appendOnClick?: boolean | ((block: Block, editor: Editor, opts: { event: Event }) => void);\n /**\n * Avoid rendering the default block manager UI.\n * More about it here: https://grapesjs.com/docs/modules/Blocks.html#customization\n * @default false\n */\n custom?: boolean;\n}\n\nconst config: BlockManagerConfig = {\n appendTo: '',\n blocks: [],\n appendOnClick: false,\n custom: false,\n};\n\nexport default config;\n","import { Model } from '../../common';\nimport { isFunction } from 'underscore';\nimport Editor from '../../editor';\nimport Category, { CategoryProperties } from '../../abstract/ModuleCategory';\nimport { ComponentDefinition } from '../../dom_components/model/types';\nimport Blocks from './Blocks';\n\n/** @private */\nexport interface BlockProperties {\n /**\n * Block label, eg. `My block`\n */\n label: string;\n /**\n * The content of the block. Might be an HTML string or a [Component Defintion](/modules/Components.html#component-definition)\n */\n content: string | ComponentDefinition | (string | ComponentDefinition)[];\n /**\n * HTML string for the media/icon of the block, eg. ` editor.getWrapper().append(block.get('content'))\n */\n onClick?: (block: Block, editor: Editor) => void;\n /**\n * Block attributes\n */\n attributes?: Record;\n\n id?: string;\n\n /**\n * @deprecated\n */\n activeOnRender?: boolean;\n}\n\n/**\n * @property {String} label Block label, eg. `My block`\n * @property {String|Object} content The content of the block. Might be an HTML string or a [Component Defintion](/modules/Components.html#component-definition)\n * @property {String} [media=''] HTML string for the media/icon of the block, eg. ` editor.getWrapper().append(block.get('content'))`\n * @property {Object} [attributes={}] Block attributes to apply in the view element\n *\n * @module docsjs.Block\n */\nexport default class Block extends Model {\n defaults() {\n return {\n label: '',\n content: '',\n media: '',\n category: '',\n activate: false,\n select: undefined,\n resetId: false,\n disable: false,\n onClick: undefined,\n attributes: {},\n };\n }\n\n get category(): Category | undefined {\n const cat = this.get('category');\n return cat instanceof Category ? cat : undefined;\n }\n\n get parent() {\n return this.collection as unknown as Blocks;\n }\n\n /**\n * Get block id\n * @returns {String}\n */\n getId() {\n return this.id as string;\n }\n\n /**\n * Get block label\n * @returns {String}\n */\n getLabel() {\n return this.get('label')!;\n }\n\n /**\n * Get block media\n * @returns {String}\n */\n getMedia() {\n return this.get('media');\n }\n\n /**\n * Get block content\n * @returns {Object|String|Array}\n */\n getContent() {\n return this.get('content');\n }\n\n /**\n * Get block category label\n * @returns {String}\n */\n getCategoryLabel(): string {\n const ctg = this.get('category');\n // @ts-ignore\n return isFunction(ctg?.get) ? ctg.get('label') : ctg?.label ? ctg?.label : ctg;\n }\n}\n","import { CollectionWithCategories } from '../../abstract/CollectionWithCategories';\nimport EditorModel from '../../editor/model/Editor';\nimport Block from './Block';\n\nexport default class Blocks extends CollectionWithCategories {\n em: EditorModel;\n\n constructor(coll: any[], options: { em: EditorModel }) {\n super(coll);\n this.em = options.em;\n this.on('add', this.handleAdd);\n }\n\n getCategories() {\n return this.em.Blocks.getCategories();\n }\n\n handleAdd(model: Block) {\n this.initCategory(model);\n }\n}\n\nBlocks.prototype.model = Block;\n","import { ItemsByCategory } from '../abstract/ModuleCategory';\nimport Block from './model/Block';\n\nexport interface BlocksByCategory extends ItemsByCategory {}\n\n/**{START_EVENTS}*/\nexport enum BlocksEvents {\n /**\n * @event `block:add` New block added to the collection. The [Block] is passed as an argument to the callback.\n * @example\n * editor.on('block:add', (block) => { ... });\n */\n add = 'block:add',\n\n /**\n * @event `block:remove` Block removed from the collection. The [Block] is passed as an argument to the callback.\n * @example\n * editor.on('block:remove', (block) => { ... });\n */\n remove = 'block:remove',\n\n /**\n * @event `block:remove:before` Event triggered before Block remove.\n * @example\n * editor.on('block:remove:before', (block, remove, opts) => { ... });\n */\n removeBefore = 'block:remove:before',\n\n /**\n * @event `block:update` Block updated. The [Block] and the object containing changes are passed as arguments to the callback.\n * @example\n * editor.on('block:update', (block, updatedProps) => { ... });\n */\n update = 'block:update',\n\n /**\n * @event `block:drag:start` Started dragging block. The [Block] is passed as an argument.\n * @example\n * editor.on('block:drag:start', (block) => { ... });\n */\n dragStart = 'block:drag:start',\n\n /**\n * @event `block:drag` The block is dragging. The [Block] is passed as an argument.\n * @example\n * editor.on('block:drag', (block) => { ... });\n */\n drag = 'block:drag',\n\n /**\n * @event `block:drag:stop` Dragging of the block is stopped. The dropped [Component] (if dropped successfully) and the [Block] are passed as arguments.\n * @example\n * editor.on('block:drag:stop', (component, block) => { ... });\n */\n dragEnd = 'block:drag:stop',\n\n /**\n * @event `block:category:update` Block category updated.\n * @example\n * editor.on('block:category:update', ({ category, changes }) => { ... });\n */\n categoryUpdate = 'block:category:update',\n\n /**\n * @event `block:custom` Event to use in case of [custom Block Manager UI](https://grapesjs.com/docs/modules/Blocks.html#customization).\n * @example\n * editor.on('block:custom', ({ container, blocks, ... }) => { ... });\n */\n custom = 'block:custom',\n\n /**\n * @event `block` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * @example\n * editor.on('block', ({ event, model, ... }) => { ... });\n */\n all = 'block',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default BlocksEvents;\n","import { isFunction } from 'underscore';\nimport { View } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport { on, off } from '../../utils/dom';\nimport { hasDnd } from '../../utils/mixins';\nimport { BlockManagerConfig } from '../config/config';\nimport Block from '../model/Block';\n\nexport interface BlockViewConfig {\n em?: EditorModel;\n pStylePrefix?: string;\n appendOnClick?: BlockManagerConfig['appendOnClick'];\n getSorter?: any;\n}\n\nexport default class BlockView extends View {\n em: EditorModel;\n config: BlockViewConfig;\n ppfx: string;\n\n events() {\n return {\n click: 'handleClick',\n mousedown: 'startDrag',\n dragstart: 'handleDragStart',\n drag: 'handleDrag',\n dragend: 'handleDragEnd',\n };\n }\n\n constructor(o: any, config: BlockViewConfig = {}) {\n super(o);\n const { model } = this;\n this.em = config.em!;\n this.config = config;\n this.endDrag = this.endDrag.bind(this);\n this.ppfx = config.pStylePrefix || '';\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model, 'change', this.render);\n }\n\n __getModule() {\n return this.em.Blocks;\n }\n\n handleClick(ev: Event) {\n const { config, model, em } = this;\n const onClick = model.get('onClick') || config.appendOnClick;\n em.trigger('block:click', model, ev);\n if (!onClick) {\n return;\n } else if (isFunction(onClick)) {\n return onClick(model, em?.getEditor(), { event: ev });\n }\n const sorter = config.getSorter();\n const content = model.get('content')!;\n const selected = em.getSelected();\n sorter.setDropContent(content);\n let target, valid, insertAt;\n\n // If there is a selected component, try first to append\n // the block inside, otherwise, try to place it as a next sibling\n if (selected) {\n valid = sorter.validTarget(selected.getEl(), content);\n\n if (valid.valid) {\n target = selected;\n } else {\n const parent = selected.parent();\n if (parent) {\n valid = sorter.validTarget(parent.getEl(), content);\n if (valid.valid) {\n target = parent;\n insertAt = parent.components().indexOf(selected) + 1;\n }\n }\n }\n }\n\n // If no target found yet, try to append the block to the wrapper\n if (!target) {\n const wrapper = em.getWrapper()!;\n valid = sorter.validTarget(wrapper.getEl(), content);\n if (valid.valid) target = wrapper;\n }\n\n const result = target && target.append(content, { at: insertAt })[0];\n result && em.setSelected(result, { scroll: 1 });\n }\n\n /**\n * Start block dragging\n * @private\n */\n startDrag(e: MouseEvent) {\n const { config, em, model } = this;\n const disable = model.get('disable');\n //Right or middel click\n if (e.button !== 0 || !config.getSorter || this.el.draggable || disable) return;\n em.refreshCanvas();\n const sorter = config.getSorter();\n sorter.__currentBlock = model;\n sorter.setDragHelper(this.el, e);\n sorter.setDropContent(this.model.get('content'));\n sorter.startSort(this.el);\n on(document, 'mouseup', this.endDrag);\n }\n\n handleDragStart(ev: DragEvent) {\n this.__getModule().__startDrag(this.model, ev);\n }\n\n handleDrag(ev: DragEvent) {\n this.__getModule().__drag(ev);\n }\n\n handleDragEnd() {\n this.__getModule().__endDrag();\n }\n\n /**\n * Drop block\n * @private\n */\n endDrag() {\n off(document, 'mouseup', this.endDrag);\n const sorter = this.config.getSorter();\n\n // After dropping the block in the canvas the mouseup event is not yet\n // triggerd on 'this.doc' and so clicking outside, the sorter, tries to move\n // things (throws false positives). As this method just need to drop away\n // the block helper I use the trick of 'moved = 0' to void those errors.\n sorter.moved = 0;\n sorter.endMove();\n }\n\n render() {\n const { em, el, $el, ppfx, model } = this;\n const disable = model.get('disable');\n const attr = model.get('attributes') || {};\n const cls = attr.class || '';\n const className = `${ppfx}block`;\n const label = (em && em.t(`blockManager.labels.${model.id}`)) || model.get('label');\n // @ts-ignore deprecated\n const render = model.get('render');\n const media = model.get('media');\n const clsAdd = disable ? `${className}--disable` : `${ppfx}four-color-h`;\n $el.attr(attr);\n el.className = `${cls} ${className} ${ppfx}one-bg ${clsAdd}`.trim();\n el.innerHTML = `\n ${media ? `
${media}
` : ''}\n
${label}
\n `;\n el.title = attr.title || el.textContent?.trim();\n el.setAttribute('draggable', `${hasDnd(em) && !disable ? true : false}`);\n // @ts-ignore\n const result = render && render({ el, model, className, prefix: ppfx });\n if (result) el.innerHTML = result;\n return this;\n }\n}\n","import { View } from '../common';\nimport EditorModel from '../editor/model/Editor';\nimport html from '../utils/html';\nimport Category from './ModuleCategory';\n\nexport interface CategoryViewConfig {\n em: EditorModel;\n pStylePrefix?: string;\n stylePrefix?: string;\n}\n\nexport default class CategoryView extends View {\n em: EditorModel;\n config: CategoryViewConfig;\n pfx: string;\n caretR: string;\n caretD: string;\n iconClass: string;\n activeClass: string;\n iconEl?: HTMLElement;\n typeEl?: HTMLElement;\n catName: string;\n\n events() {\n return {\n 'click [data-title]': 'toggle',\n };\n }\n\n template({ pfx, label, catName }: { pfx: string; label: string; catName: string }) {\n return html`\n
\n \n ${label}\n
\n
\n `;\n }\n\n /** @ts-ignore */\n attributes() {\n return this.model.get('attributes') || {};\n }\n\n constructor(o: any, config: CategoryViewConfig, catName: string) {\n super(o);\n this.config = config;\n const pfx = config.pStylePrefix || '';\n this.em = config.em;\n this.catName = catName;\n this.pfx = pfx;\n this.caretR = 'fa fa-caret-right';\n this.caretD = 'fa fa-caret-down';\n this.iconClass = `${pfx}caret-icon`;\n this.activeClass = `${pfx}open`;\n this.className = `${pfx}${catName}-category`;\n this.listenTo(this.model, 'change:open', this.updateVisibility);\n this.model.view = this;\n }\n\n updateVisibility() {\n if (this.model.get('open')) this.open();\n else this.close();\n }\n\n open() {\n this.$el.addClass(this.activeClass);\n this.getIconEl()!.className = `${this.iconClass} ${this.caretD}`;\n this.getTypeEl()!.style.display = '';\n }\n\n close() {\n this.$el.removeClass(this.activeClass);\n this.getIconEl()!.className = `${this.iconClass} ${this.caretR}`;\n this.getTypeEl()!.style.display = 'none';\n }\n\n toggle() {\n var model = this.model;\n model.set('open', !model.get('open'));\n }\n\n getIconEl() {\n if (!this.iconEl) {\n this.iconEl = this.el.querySelector(`.${this.iconClass}`)!;\n }\n\n return this.iconEl;\n }\n\n getTypeEl() {\n if (!this.typeEl) {\n this.typeEl = this.el.querySelector(`.${this.pfx}${this.catName}s-c`)!;\n }\n\n return this.typeEl;\n }\n\n append(el: HTMLElement) {\n this.getTypeEl().appendChild(el);\n }\n\n render() {\n const { em, el, $el, model, pfx, catName } = this;\n const label = em.t(`${catName}Manager.categories.${model.id}`) || model.get('label');\n el.innerHTML = this.template({ pfx, label, catName });\n $el.addClass(this.className!);\n $el.css({ order: model.get('order')! });\n this.updateVisibility();\n\n return this;\n }\n}\n","import { isString, isObject, bindAll } from 'underscore';\nimport BlockManager from '..';\nimport { View } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport EditorModel from '../../editor/model/Editor';\nimport Block from '../model/Block';\nimport Categories from '../../abstract/ModuleCategories';\nimport BlockView from './BlockView';\nimport CategoryView from '../../abstract/ModuleCategoryView';\n\nexport interface BlocksViewConfig {\n em: EditorModel;\n pStylePrefix?: string;\n ignoreCategories?: boolean;\n getSorter?: any;\n}\n\nexport default class BlocksView extends View {\n em: EditorModel;\n config: BlocksViewConfig;\n categories: Categories;\n renderedCategories = new Map();\n ppfx: string;\n noCatClass: string;\n blockContClass: string;\n catsClass: string;\n catsEl?: HTMLElement;\n blocksEl?: HTMLElement;\n rendered?: boolean;\n sorter: any;\n\n constructor(opts: any, config: BlocksViewConfig) {\n super(opts);\n bindAll(this, 'getSorter', 'onDrag', 'onDrop', 'onMove');\n this.config = config || {};\n this.categories = opts.categories || '';\n const ppfx = this.config.pStylePrefix || '';\n this.ppfx = ppfx;\n this.noCatClass = `${ppfx}blocks-no-cat`;\n this.blockContClass = `${ppfx}blocks-c`;\n this.catsClass = `${ppfx}block-categories`;\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n this.em = this.config.em;\n\n if (this.em) {\n this.config.getSorter = this.getSorter;\n }\n }\n\n __getModule(): BlockManager {\n return this.em.Blocks;\n }\n\n updateConfig(opts = {}) {\n this.config = {\n ...this.config,\n ...opts,\n };\n }\n\n /**\n * Get sorter\n * @private\n */\n getSorter() {\n const { em } = this;\n if (!em) return;\n\n if (!this.sorter) {\n const utils = em.Utils;\n const canvas = em.Canvas;\n\n this.sorter = new utils.Sorter({\n // @ts-ignore\n container: canvas.getBody(),\n placer: canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: this.ppfx,\n onStart: this.onDrag,\n onEndMove: this.onDrop,\n onMove: this.onMove,\n document: canvas.getFrameEl().contentDocument,\n direction: 'a',\n wmargin: 1,\n nested: 1,\n em,\n canvasRelative: 1,\n });\n }\n\n return this.sorter;\n }\n\n onDrag(ev: Event) {\n this.em.stopDefault();\n this.__getModule().__startDrag(this.sorter.__currentBlock, ev);\n }\n\n onMove(ev: Event) {\n this.__getModule().__drag(ev);\n }\n\n onDrop(component?: Component) {\n this.em.runDefault();\n this.__getModule().__endDrag({ component });\n delete this.sorter.__currentBlock;\n }\n\n /**\n * Add new model to the collection\n * @param {Model} model\n * @private\n * */\n addTo(model: Block) {\n this.add(model);\n }\n\n /**\n * Render new model inside the view\n * @param {Model} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n add(model: Block, fragment?: DocumentFragment) {\n const { config, renderedCategories } = this;\n const attributes = model.get('attributes');\n const view = new BlockView({ model, attributes }, config);\n const rendered = view.render().el;\n const category = model.parent.initCategory(model);\n\n // Check for categories\n if (category && this.categories && !config.ignoreCategories) {\n const catId = category.getId();\n const categories = this.getCategoriesEl();\n let catView = renderedCategories.get(catId);\n\n if (!catView && categories) {\n catView = new CategoryView({ model: category }, config, 'block').render();\n renderedCategories.set(catId, catView);\n categories.appendChild(catView.el);\n }\n\n catView?.append(rendered);\n return;\n }\n\n fragment ? fragment.appendChild(rendered) : this.append(rendered);\n }\n\n getCategoriesEl() {\n if (!this.catsEl) {\n this.catsEl = this.el.querySelector(`.${this.catsClass}`)!;\n }\n\n return this.catsEl;\n }\n\n getBlocksEl() {\n if (!this.blocksEl) {\n this.blocksEl = this.el.querySelector(`.${this.noCatClass} .${this.blockContClass}`)!;\n }\n\n return this.blocksEl;\n }\n\n append(el: HTMLElement | DocumentFragment) {\n let blocks = this.getBlocksEl();\n blocks && blocks.appendChild(el);\n }\n\n render() {\n const ppfx = this.ppfx;\n const frag = document.createDocumentFragment();\n delete this.catsEl;\n delete this.blocksEl;\n this.renderedCategories = new Map();\n this.el.innerHTML = `\n
\n
\n
\n
\n `;\n\n this.collection.each(model => this.add(model, frag));\n this.append(frag);\n const cls = `${this.blockContClass}s ${ppfx}one-bg ${ppfx}two-color`;\n this.$el.addClass(cls);\n this.rendered = true;\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/block_manager/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * blockManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('block:add', (block) => { ... });\n *\n * // Use the API\n * const blockManager = editor.Blocks;\n * blockManager.add(...);\n * ```\n *\n * {REPLACE_EVENTS}\n *\n * [Block]: block.html\n * [Component]: component.html\n *\n * @module Blocks\n */\nimport { debounce, isArray } from 'underscore';\nimport { ItemManagerModule } from '../abstract/Module';\nimport FrameView from '../canvas/view/FrameView';\nimport Component from '../dom_components/model/Component';\nimport EditorModel from '../editor/model/Editor';\nimport defaults, { BlockManagerConfig } from './config/config';\nimport Block, { BlockProperties } from './model/Block';\nimport Blocks from './model/Blocks';\nimport Categories from '../abstract/ModuleCategories';\nimport Category, { getItemsByCategory } from '../abstract/ModuleCategory';\nimport { BlocksByCategory, BlocksEvents } from './types';\nimport BlocksView from './view/BlocksView';\n\nexport type BlockEvent = `${BlocksEvents}`;\n\nexport default class BlockManager extends ItemManagerModule {\n blocks: Blocks;\n blocksVisible: Blocks;\n categories: Categories;\n blocksView?: BlocksView;\n _dragBlock?: Block;\n _bhv?: Record;\n events = BlocksEvents;\n\n Block = Block;\n\n Blocks = Blocks;\n\n Category = Category;\n\n Categories = Categories;\n\n storageKey = '';\n\n constructor(em: EditorModel) {\n super(em, 'BlockManager', new Blocks(em.config.blockManager?.blocks || [], { em }), BlocksEvents, defaults);\n\n // Global blocks collection\n this.blocks = this.all;\n this.blocksVisible = new Blocks(this.blocks.models, { em });\n this.categories = new Categories([], {\n em,\n events: { update: BlocksEvents.categoryUpdate },\n });\n\n // Setup the sync between the global and public collections\n this.blocks.on('add', model => this.blocksVisible.add(model));\n this.blocks.on('remove', model => this.blocksVisible.remove(model));\n this.blocks.on('reset', coll => this.blocksVisible.reset(coll.models));\n\n this.__onAllEvent = debounce(() => this.__trgCustom(), 0);\n\n return this;\n }\n\n /**\n * Get configuration object\n * @name getConfig\n * @function\n * @return {Object}\n */\n\n __trgCustom() {\n this.em.trigger(this.events.custom, this.__customData());\n }\n\n __customData() {\n const bhv = this.__getBehaviour();\n return {\n bm: this as BlockManager,\n blocks: this.getAll().models,\n container: bhv.container,\n dragStart: (block: Block, ev?: Event) => this.startDrag(block, ev),\n drag: (ev: Event) => this.__drag(ev),\n dragStop: (cancel?: boolean) => this.endDrag(cancel),\n };\n }\n\n __startDrag(block: Block, ev?: Event) {\n const { em, events, blocks } = this;\n const content = block.getContent ? block.getContent() : block;\n this._dragBlock = block;\n em.set({ dragResult: null, dragContent: content });\n [em, blocks].map(i => i.trigger(events.dragStart, block, ev));\n }\n\n __drag(ev: Event) {\n const { em, events, blocks } = this;\n const block = this._dragBlock;\n [em, blocks].map(i => i.trigger(events.drag, block, ev));\n }\n\n __endDrag(opts: { component?: Component } = {}) {\n const { em, events, blocks } = this;\n const block = this._dragBlock;\n const cmp = opts.component || em.get('dragResult');\n delete this._dragBlock;\n\n if (cmp && block) {\n const oldKey = 'activeOnRender';\n const oldActive = cmp.get && cmp.get(oldKey);\n const toActive = block.get('activate') || oldActive;\n const toSelect = block.get('select');\n const first = isArray(cmp) ? cmp[0] : cmp;\n\n if (toSelect || (toActive && toSelect !== false)) {\n em.setSelected(first);\n }\n\n if (toActive) {\n first.trigger('active');\n oldActive && first.unset(oldKey);\n }\n\n if (block.get('resetId')) {\n first.onAll((cmp: any) => cmp.resetId());\n }\n }\n\n em.set({ dragResult: null, dragContent: null });\n\n if (block) {\n [em, blocks].map(i => i.trigger(events.dragEnd, cmp, block));\n }\n }\n\n __getFrameViews(): FrameView[] {\n return this.em.Canvas.getFrames()\n .map(frame => frame.view!)\n .filter(Boolean);\n }\n\n __behaviour(opts = {}) {\n return (this._bhv = {\n ...(this._bhv || {}),\n ...opts,\n });\n }\n\n __getBehaviour() {\n return this._bhv || {};\n }\n\n startDrag(block: Block, ev?: Event) {\n this.__startDrag(block, ev);\n this.__getFrameViews().forEach(fv => fv.droppable?.startCustom());\n }\n\n endDrag(cancel?: boolean) {\n this.__getFrameViews().forEach(fv => fv.droppable?.endCustom(cancel));\n this.__endDrag();\n }\n\n postRender() {\n const { categories, config, em } = this;\n const collection = this.blocksVisible;\n this.blocksView = new BlocksView({ collection, categories }, { ...config, em });\n this.__appendTo(collection.models);\n this.__trgCustom();\n }\n\n /**\n * Add new block.\n * @param {String} id Block ID\n * @param {[Block]} props Block properties\n * @returns {[Block]} Added block\n * @example\n * blockManager.add('h1-block', {\n * label: 'Heading',\n * content: '

Put your title here

',\n * category: 'Basic',\n * attributes: {\n * title: 'Insert h1 block'\n * }\n * });\n */\n add(id: string, props: BlockProperties, opts = {}) {\n const prp = props || {};\n prp.id = id;\n return this.blocks.add(prp, opts);\n }\n\n /**\n * Get the block by id.\n * @param {String} id Block id\n * @returns {[Block]}\n * @example\n * const block = blockManager.get('h1-block');\n * console.log(JSON.stringify(block));\n * // {label: 'Heading', content: '

Put your ...', ...}\n */\n get(id: string) {\n return this.blocks.get(id);\n }\n\n /**\n * Return all blocks.\n * @returns {Collection<[Block]>}\n * @example\n * const blocks = blockManager.getAll();\n * console.log(JSON.stringify(blocks));\n * // [{label: 'Heading', content: '

Put your ...'}, ...]\n */\n getAll() {\n return this.blocks;\n }\n\n /**\n * Return the visible collection, which containes blocks actually rendered\n * @returns {Collection<[Block]>}\n */\n getAllVisible() {\n return this.blocksVisible;\n }\n\n /**\n * Remove block.\n * @param {String|[Block]} block Block or block ID\n * @returns {[Block]} Removed block\n * @example\n * const removed = blockManager.remove('BLOCK_ID');\n * // or by passing the Block\n * const block = blockManager.get('BLOCK_ID');\n * blockManager.remove(block);\n */\n remove(block: string | Block, opts = {}) {\n return this.__remove(block, opts);\n }\n\n /**\n * Get all available categories.\n * It's possible to add categories only within blocks via 'add()' method\n * @return {Array|Collection}\n */\n getCategories() {\n return this.categories;\n }\n\n /**\n * Return the Blocks container element\n * @return {HTMLElement}\n */\n getContainer() {\n return this.blocksView?.el;\n }\n\n /**\n * Returns currently dragging block.\n * Updated when the drag starts and cleared once it's done.\n * @returns {[Block]|undefined}\n */\n getDragBlock() {\n return this._dragBlock;\n }\n\n /**\n * Get blocks by category.\n * @example\n * blockManager.getBlocksByCategory();\n * // Returns an array of items of this type\n * // > { category?: Category; items: Block[] }\n *\n * // NOTE: The item without category is the one containing blocks without category.\n *\n * // You can also get the same output format by passing your own array of Blocks\n * const myFilteredBlocks: Block[] = [...];\n * blockManager.getBlocksByCategorymyFilteredBlocks\n */\n getBlocksByCategory(blocks?: Block[]): BlocksByCategory[] {\n return getItemsByCategory(blocks || this.getAll().models);\n }\n\n /**\n * Render blocks\n * @param {Array} blocks Blocks to render, without the argument will render all global blocks\n * @param {Object} [opts={}] Options\n * @param {Boolean} [opts.external] Render blocks in a new container (HTMLElement will be returned)\n * @param {Boolean} [opts.ignoreCategories] Render blocks without categories\n * @return {HTMLElement} Rendered element\n * @example\n * // Render all blocks (inside the global collection)\n * blockManager.render();\n *\n * // Render new set of blocks\n * const blocks = blockManager.getAll();\n * const filtered = blocks.filter(block => block.get('category') == 'sections')\n *\n * blockManager.render(filtered);\n * // Or a new set from an array\n * blockManager.render([\n * {label: 'Label text', content: '
Content
'}\n * ]);\n *\n * // Back to blocks from the global collection\n * blockManager.render();\n *\n * // You can also render your blocks outside of the main block container\n * const newBlocksEl = blockManager.render(filtered, { external: true });\n * document.getElementById('some-id').appendChild(newBlocksEl);\n */\n render(blocks?: Block[], opts: { external?: boolean } = {}) {\n const { categories, config, em } = this;\n const toRender = blocks || this.getAll().models;\n\n if (opts.external) {\n const collection = new Blocks(toRender, { em });\n return new BlocksView({ collection, categories }, { em, ...config, ...opts }).render().el;\n }\n\n if (this.blocksView) {\n this.blocksView.updateConfig(opts);\n this.blocksView.collection.reset(toRender);\n\n if (!this.blocksView.rendered) {\n this.blocksView.render();\n this.blocksView.rendered = true;\n }\n }\n\n return this.getContainer();\n }\n\n destroy() {\n const colls = [this.blocks, this.blocksVisible, this.categories];\n colls.map(c => c.stopListening());\n colls.map(c => c.reset());\n this.blocksView?.remove();\n }\n}\n","export interface SelectorManagerConfig {\n /**\n * Style prefix.\n * @default 'clm-'\n */\n stylePrefix?: string;\n\n /**\n * Specify the element to use as a container, string (query) or HTMLElement.\n * With the empty value, nothing will be rendered.\n * @default ''\n */\n appendTo?: string | HTMLElement;\n\n /**\n * Default selectors.\n * @default []\n */\n selectors?: any[];\n\n /**\n * Default states.\n * @default [{ name: 'hover' }, { name: 'active' }, { name: 'nth-of-type(2n)' }]\n */\n states?: any[];\n\n /**\n * Custom selector name escaping strategy.\n * @example\n * escapeName: name => name.replace(' ', '_'),\n */\n escapeName?: (name: string) => string;\n\n /**\n * Custom selected name strategy (the string you see after 'Selected').\n * @example\n * selectedName: ({ result, state, target }) => `${result} - ID: ${target.getId()}`,\n */\n selectedName?: (props: { result: string; state: any; target: any }) => string;\n\n /**\n * Icon used to add new selector\n */\n iconAdd?: string;\n\n /**\n * Icon used to sync styles.\n */\n iconSync?: string;\n\n /**\n * Icon to show when the selector is enabled.\n */\n iconTagOn?: string;\n\n /**\n * Icon to show when the selector is disabled.\n */\n iconTagOff?: string;\n\n /**\n * Icon used to remove the selector.\n */\n iconTagRemove?: string;\n\n /**\n * Custom render function for the Selector Manager.\n * @example\n * render: ({ el, labelHead, labelStates, labelInfo, }) => {\n * // You can use the default `el` to extend/edit the current\n * // DOM element of the Selector Manager\n * const someEl = document.createElement('div');\n * // ...\n * el.appendChild(someEl);\n * // no need to return anything from the function\n *\n * // Create and return a new DOM element\n * const newEl = document.createElement('div');\n * // ...\n * return newEl;\n *\n * // Return an HTML string for a completely different layout.\n * // Use `data-*` attributes to make the module recognize some elements:\n * // `data-states` - Where to append state `