/*! For license information please see vendors-main.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[1],[function(e,t,n){"use strict";e.exports=n(402)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Te})),n.d(t,"b",(function(){return Ae})),n.d(t,"c",(function(){return De})),n.d(t,"d",(function(){return be})),n.d(t,"f",(function(){return Ie}));var r=n(116),o=n(0),i=n.n(o),a=n(307),s=n.n(a),l=n(168),u=n(169),c=n(247),f=n(99),d=n.n(f);function h(){return(h=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var _=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&k(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i=T&&(T=t+1),C.set(e,t),j.set(t,e)},M="style["+x+'][data-styled-version="5.3.1"]',P=new RegExp("^"+x+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),D=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(x))return r}}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(x,"active"),r.setAttribute("data-styled-version","5.3.1");var a=$();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},F=function(){function e(e){var t=this.element=N(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+",")})),r+=""+s+l+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),V=/(a)(d)/gi,G=function(e){return String.fromCharCode(e+(e>25?39:97))};function q(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=G(t%52)+n;return(G(t%52)+n).replace(V,"$1-$2")}var Y=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},K=function(e){return Y(5381,e)};function X(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=n(i,"."+a,void 0,r);t.insertRules(r,a,s)}o.push(a),this.staticRulesId=a}else{for(var l=this.rules.length,u=Y(this.baseHash,n.hash),c="",f=0;f>>0);if(!t.hasNameForId(r,g)){var m=n(c,"."+g,void 0,r);t.insertRules(r,g,m)}o.push(g)}}return o.join(" ")},e}(),Z=/^\s*\/\/.*$/gm,ee=[":","[",".","#"];function te(e){var t,n,r,o,i=void 0===e?v:e,a=i.options,s=void 0===a?v:a,u=i.plugins,c=void 0===u?m:u,f=new l.a(s),d=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,i,a,s,l,u,c,f){switch(n){case 1:if(0===c&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),p=function(e,r,i){return 0===r&&-1!==ee.indexOf(i[n.length])||i.match(o)?e:"."+t};function g(e,i,a,s){void 0===s&&(s="&");var l=e.replace(Z,""),u=i&&a?a+" "+i+" { "+l+" }":l;return t=s,n=i,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),f(a||!i?"":i,u)}return f.use([].concat(c,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,p))},h,function(e){if(-2===e){var t=d;return d=[],t}}])),g.hash=c.length?c.reduce((function(e,t){return t.name||k(15),Y(e,t.name)}),5381).toString():"",g}var ne=i.a.createContext(),re=(ne.Consumer,i.a.createContext()),oe=(re.Consumer,new U),ie=te();function ae(){return Object(o.useContext)(ne)||oe}function se(){return Object(o.useContext)(re)||ie}function le(e){var t=Object(o.useState)(e.stylisPlugins),n=t[0],r=t[1],a=ae(),l=Object(o.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),u=Object(o.useMemo)((function(){return te({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return Object(o.useEffect)((function(){s()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),i.a.createElement(ne.Provider,{value:l},i.a.createElement(re.Provider,{value:u},e.children))}var ue=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=ie);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return k(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ie),this.name+e.hash},e}(),ce=/([A-Z])/,fe=/([A-Z])/g,de=/^ms-/,he=function(e){return"-"+e.toLowerCase()};function pe(e){return ce.test(e)?e.replace(fe,he).replace(de,"-ms-"):e}var ge=function(e){return null==e||!1===e||""===e};function me(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,xe=/(^-|-$)/g;function Se(e){return e.replace(we,"-").replace(xe,"")}var Oe=function(e){return q(K(e)>>>0)};function Ee(e){return"string"==typeof e&&!0}var ke=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},_e=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ce(e,t,n){var r=e[n];ke(t)&&ke(r)?je(r,t):e[n]=t}function je(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(o[n]=e[n]);return o}(t,["componentId"]),i=r&&r+"-"+(Ee(e)?e:Se(y(e)));return Le(e,h({},o,{attrs:S,componentId:i}),n)},Object.defineProperty(E,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?je({},e.defaultProps,t):t}}),E.toString=function(){return"."+E.styledComponentId},a&&d()(E,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),E}var Me=function(e){return function e(t,n,o){if(void 0===o&&(o=v),!Object(r.isValidElementType)(n))return k(1,String(n));var i=function(){return t(n,o,be.apply(void 0,arguments))};return i.withConfig=function(r){return e(t,n,h({},o,{},r))},i.attrs=function(r){return e(t,n,h({},o,{attrs:Array.prototype.concat(o.attrs,r).filter(Boolean)}))},i}(Le,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Me[e]=Me(e)}));var Pe=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=X(e),U.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var o=r(me(this.rules,t,n,r).join(""),""),i=this.componentId+e;n.insertRules(i,i,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&U.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function De(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r"+t+""},this.getStyleTags=function(){return e.sealed?k(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return k(2);var n=((t={})[x]="",t["data-styled-version"]="5.3.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=$();return r&&(n.nonce=r),[i.a.createElement("style",h({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new U({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?k(2):i.a.createElement(le,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return k(3)}}();t.e=Me}).call(this,n(219))},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"d",(function(){return b})),n.d(t,"e",(function(){return S})),n.d(t,"c",(function(){return h})),n.d(t,"b",(function(){return O.unstable_batchedUpdates}));var r=n(0),o=n.n(r),i=(n(3),o.a.createContext(null));var a=function(e){e()};function s(){var e=a,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var l={notify:function(){},get:function(){return[]}};function u(e,t){var n,r=l;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=s())}var a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=l)},getListeners:function(){return r}};return a}var c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;var f=function(e){var t=e.store,n=e.context,a=e.children,s=Object(r.useMemo)((function(){var e=u(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),l=Object(r.useMemo)((function(){return t.getState()}),[t]);c((function(){var e=s.subscription;return e.trySubscribe(),l!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[s,l]);var f=n||i;return o.a.createElement(f.Provider,{value:s},a)};n(15),n(43),n(99),n(116);function d(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function h(e,t){if(d(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:d(e)?2:h(e)?3:0}function l(e,t){return 2===s(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return 2===s(e)?e.get(t):e[t]}function c(e,t,n){var r=s(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){return H&&e instanceof Map}function h(e){return W&&e instanceof Set}function p(e){return e.o||e.t}function g(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=X(e);delete t[q];for(var n=K(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=v),Object.freeze(e),t&&a(e,(function(e,t){return m(t,!0)}),!0)),e}function v(){r(2)}function b(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function y(e){var t=Q[e];return t||r(18,e),t}function w(e,t){Q[e]||(Q[e]=t)}function x(){return B}function S(e,t){t&&(y("Patches"),e.u=[],e.s=[],e.v=t)}function O(e){E(e),e.p.forEach(_),e.p=null}function E(e){e===B&&(B=e.l)}function k(e){return B={p:[],l:B,h:e,m:!0,_:0}}function _(e){var t=e[q];0===t.i||1===t.i?t.j():t.O=!0}function C(e,t){t._=t.p.length;var n=t.p[0],o=void 0!==e&&e!==n;return t.h.g||y("ES5").S(t,e,o),o?(n[q].P&&(O(t),r(4)),i(e)&&(e=j(t,e),t.l||A(t,e)),t.u&&y("Patches").M(n[q],e,t.u,t.s)):e=j(t,n,[]),O(t),t.u&&t.v(t.u,t.s),e!==V?e:void 0}function j(e,t,n){if(b(t))return t;var r=t[q];if(!r)return a(t,(function(o,i){return T(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return A(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=g(r.k):r.o;a(3===r.i?new Set(o):o,(function(t,i){return T(e,r,o,t,i,n)})),A(e,o,!1),n&&e.u&&y("Patches").R(r,n,e.u,e.s)}return r.o}function T(e,t,n,r,a,s){if(o(a)){var u=j(e,a,s&&t&&3!==t.i&&!l(t.D,r)?s.concat(r):void 0);if(c(n,r,u),!o(u))return;e.m=!1}if(i(a)&&!b(a)){if(!e.h.F&&e._<1)return;j(e,a),t&&t.A.l||A(e,a)}}function A(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&m(t,n)}function R(e,t){var n=e[q];return(n?p(n):e)[t]}function L(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function M(e){e.P||(e.P=!0,e.l&&M(e.l))}function P(e){e.o||(e.o=g(e.t))}function D(e,t,n){var r=d(t)?y("MapSet").N(t,n):h(t)?y("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:x(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=J;n&&(o=[r],i=Z);var a=Proxy.revocable(o,i),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):y("ES5").J(t,n);return(n?n.A:x()).p.push(r),r}function I(e){return o(e)||r(22,e),function e(t){if(!i(t))return t;var n,r=t[q],o=s(t);if(r){if(!r.P&&(r.i<4||!y("ES5").K(r)))return r.t;r.I=!0,n=$(t,o),r.I=!1}else n=$(t,o);return a(n,(function(t,o){r&&u(r.t,t)===o||c(n,t,e(o))})),3===o?new Set(n):n}(e)}function $(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return g(e)}function N(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[q];return J.get(t,e)},set:function(t){var n=this[q];J.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][q];if(!o.P)switch(o.i){case 5:r(o)&&M(o);break;case 4:n(o)&&M(o)}}}function n(e){for(var t=e.t,n=e.k,r=K(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==q){var a=t[i];if(void 0===a&&!l(t,i))return!0;var s=n[i],u=s&&s[q];if(u?u.t!==a:!f(s,a))return!0}}var c=!!t[q];return r.length!==K(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!n||n.get)}var i={};w("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o1?r-1:0),i=1;i1?r-1:0),i=1;i=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var i=y("Patches").$;return o(e)?i(e,t):this.produce(e,(function(e){return i(e,t.slice(n+1))}))},e}(),te=new ee,ne=te.produce,re=(te.produceWithPatches.bind(te),te.setAutoFreeze.bind(te),te.setUseProxies.bind(te),te.applyPatches.bind(te),te.createDraft.bind(te),te.finishDraft.bind(te),ne),oe=(n(165),n(59));function ie(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var ae=ie();ae.withExtraArgument=ie;var se,le=ae,ue=(se=function(e,t){return se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},se(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ce=function(e,t){for(var n=0,r=t.length,o=e.length;n-1){var i=n[o];return o>0&&(n.splice(o,1),n.unshift(i)),i.value}return r}return{get:o,put:function(t,i){o(t)===r&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(c,d);function p(){var t=h.get(arguments);if(t===r){if(t=e.apply(null,arguments),f){var n=h.getEntries(),o=n.find((function(e){return f(e.value,t)}));o&&(t=o.value)}h.put(arguments,t)}return t}return p.clearCache=function(){return h.clear()},p}function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function s(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),a=1;a2?n-2:0),o=2;o=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}))},,function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return X})),n.d(t,"c",(function(){return x})),n.d(t,"d",(function(){return C})),n.d(t,"e",(function(){return b})),n.d(t,"f",(function(){return Ie})),n.d(t,"g",(function(){return $})),n.d(t,"h",(function(){return Q})),n.d(t,"i",(function(){return he})),n.d(t,"j",(function(){return se})),n.d(t,"k",(function(){return ae})),n.d(t,"l",(function(){return ve})),n.d(t,"m",(function(){return le})),n.d(t,"n",(function(){return me})),n.d(t,"o",(function(){return we})),n.d(t,"p",(function(){return Z})),n.d(t,"q",(function(){return z})),n.d(t,"r",(function(){return N})),n.d(t,"s",(function(){return ce})),n.d(t,"t",(function(){return D})),n.d(t,"u",(function(){return U})),n.d(t,"v",(function(){return Ee})),n.d(t,"w",(function(){return ke})),n.d(t,"x",(function(){return _e})),n.d(t,"y",(function(){return B})),n.d(t,"z",(function(){return Re})),n.d(t,"A",(function(){return Le})),n.d(t,"B",(function(){return Me})),n.d(t,"C",(function(){return J})),n.d(t,"D",(function(){return j})),n.d(t,"E",(function(){return T})),n.d(t,"F",(function(){return $e})),n.d(t,"G",(function(){return w}));var r=n(81),o=n(15),i=n(21),a=n(30),s=n(31),l=n(39),u=n(38),c=n(32),f=n(0),d=n(20),h=n(34),p=n(82),g=n(84);var m=n(143),v=n.n(m),b=function(){};function y(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function w(e,t,n){var r=[n];if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&r.push("".concat(y(e,o)));return r.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var x=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===Object(p.a)(e)&&null!==e?[e]:[]};function S(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function O(e){return S(e)?window.pageYOffset:e.scrollTop}function E(e,t){S(e)?window.scrollTo(0,t):e.scrollTop=t}function k(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:b,o=O(e),i=t-o,a=10,s=0;function l(){var t=k(s+=a,o,i,n);E(e,t),sn.bottom?E(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o=h)return{placement:"bottom",maxHeight:t};if(k>=h&&!a)return i&&_(l,C,T),{placement:"bottom",maxHeight:t};if(!a&&k>=r||a&&x>=r)return i&&_(l,C,T),{placement:"bottom",maxHeight:a?x-b:k-b};if("auto"===o||a){var A=t,R=a?w:S;return R>=r&&(A=Math.min(R-b-s.controlHeight,t)),{placement:"top",maxHeight:A}}if("bottom"===o)return E(l,C),{placement:"bottom",maxHeight:t};break;case"top":if(w>=h)return{placement:"top",maxHeight:t};if(S>=h&&!a)return i&&_(l,j,T),{placement:"top",maxHeight:t};if(!a&&S>=r||a&&w>=r){var L=t;return(!a&&S>=r||a&&w>=r)&&(L=a?w-y:S-y),i&&_(l,j,T),{placement:"top",maxHeight:L}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return u}var P=function(e){return"auto"===e?"bottom":e},D=function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,a=r.spacing,s=r.colors;return t={label:"menu"},Object(i.a)(t,function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),Object(i.a)(t,"backgroundColor",s.neutral0),Object(i.a)(t,"borderRadius",o),Object(i.a)(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Object(i.a)(t,"marginBottom",a.menuGutter),Object(i.a)(t,"marginTop",a.menuGutter),Object(i.a)(t,"position","absolute"),Object(i.a)(t,"width","100%"),Object(i.a)(t,"zIndex",1),t},I=Object(f.createContext)({getPortalPlacement:null}),$=function(e){Object(l.a)(n,e);var t=L(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i"']/g,Q=RegExp(K.source),J=RegExp(X.source),Z=/<%-([\s\S]+?)%>/g,ee=/<%([\s\S]+?)%>/g,te=/<%=([\s\S]+?)%>/g,ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,re=/^\w*$/,oe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(ie.source),se=/^\s+/,le=/\s/,ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,fe=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ve=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,we=/^0o[0-7]+$/i,xe=/^(?:0|[1-9]\d*)$/,Se=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Oe=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,ke="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_e="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Re="['’]",Le="[\\ud800-\\udfff]",Me="["+Ae+"]",Pe="["+ke+"]",De="\\d+",Ie="[\\u2700-\\u27bf]",$e="["+Ce+"]",Ne="[^\\ud800-\\udfff"+Ae+De+_e+Ce+je+"]",Fe="\\ud83c[\\udffb-\\udfff]",Be="[^\\ud800-\\udfff]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+je+"]",Ue="(?:"+$e+"|"+Ne+")",Ve="(?:"+We+"|"+Ne+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Pe+"|"+Fe+")"+"?",Ke="[\\ufe0e\\ufe0f]?",Xe=Ke+Ye+("(?:\\u200d(?:"+[Be,ze,He].join("|")+")"+Ke+Ye+")*"),Qe="(?:"+[Ie,ze,He].join("|")+")"+Xe,Je="(?:"+[Be+Pe+"?",Pe,ze,He,Le].join("|")+")",Ze=RegExp(Re,"g"),et=RegExp(Pe,"g"),tt=RegExp(Fe+"(?="+Fe+")|"+Je+Xe,"g"),nt=RegExp([We+"?"+$e+"+"+Ge+"(?="+[Me,We,"$"].join("|")+")",Ve+"+"+qe+"(?="+[Me,We+Ue,"$"].join("|")+")",We+"?"+Ue+"+"+Ge,We+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",De,Qe].join("|"),"g"),rt=RegExp("[\\u200d\\ud800-\\udfff"+ke+Te+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[$]=st[N]=st[F]=st[B]=st[z]=st[H]=st[W]=st[U]=st[V]=!0,st[y]=st[w]=st[D]=st[x]=st[I]=st[S]=st[O]=st[E]=st[_]=st[C]=st[j]=st[A]=st[R]=st[L]=st[P]=!1;var lt={};lt[y]=lt[w]=lt[D]=lt[I]=lt[x]=lt[S]=lt[$]=lt[N]=lt[F]=lt[B]=lt[z]=lt[_]=lt[C]=lt[j]=lt[A]=lt[R]=lt[L]=lt[M]=lt[H]=lt[W]=lt[U]=lt[V]=!0,lt[O]=lt[E]=lt[P]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,ft=parseInt,dt="object"==typeof e&&e&&e.Object===Object&&e,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=dt||ht||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&"object"==typeof r&&r&&!r.nodeType&&r,vt=mt&&mt.exports===gt,bt=vt&&dt.process,yt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=yt&&yt.isArrayBuffer,xt=yt&&yt.isDate,St=yt&&yt.isMap,Ot=yt&&yt.isRegExp,Et=yt&&yt.isSet,kt=yt&&yt.isTypedArray;function _t(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function Mt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function nn(e,t){for(var n=e.length;n--&&Ht(t,e[n],0)>-1;);return n}function rn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var on=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),an=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ut[e]}function ln(e){return rt.test(e)}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function fn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var bn=function e(t){var n,r=(t=null==t?pt:bn.defaults(pt.Object(),t,bn.pick(pt,it))).Array,o=t.Date,le=t.Error,ke=t.Function,_e=t.Math,Ce=t.Object,je=t.RegExp,Te=t.String,Ae=t.TypeError,Re=r.prototype,Le=ke.prototype,Me=Ce.prototype,Pe=t["__core-js_shared__"],De=Le.toString,Ie=Me.hasOwnProperty,$e=0,Ne=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Fe=Me.toString,Be=De.call(Ce),ze=pt._,He=je("^"+De.call(Ie).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=vt?t.Buffer:i,Ue=t.Symbol,Ve=t.Uint8Array,Ge=We?We.allocUnsafe:i,qe=cn(Ce.getPrototypeOf,Ce),Ye=Ce.create,Ke=Me.propertyIsEnumerable,Xe=Re.splice,Qe=Ue?Ue.isConcatSpreadable:i,Je=Ue?Ue.iterator:i,tt=Ue?Ue.toStringTag:i,rt=function(){try{var e=pi(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,dt=o&&o.now!==pt.Date.now&&o.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=_e.ceil,mt=_e.floor,bt=Ce.getOwnPropertySymbols,yt=We?We.isBuffer:i,Ft=t.isFinite,qt=Re.join,yn=cn(Ce.keys,Ce),wn=_e.max,xn=_e.min,Sn=o.now,On=t.parseInt,En=_e.random,kn=Re.reverse,_n=pi(t,"DataView"),Cn=pi(t,"Map"),jn=pi(t,"Promise"),Tn=pi(t,"Set"),An=pi(t,"WeakMap"),Rn=pi(Ce,"create"),Ln=An&&new An,Mn={},Pn=zi(_n),Dn=zi(Cn),In=zi(jn),$n=zi(Tn),Nn=zi(An),Fn=Ue?Ue.prototype:i,Bn=Fn?Fn.valueOf:i,zn=Fn?Fn.toString:i;function Hn(e){if(os(e)&&!qa(e)&&!(e instanceof Gn)){if(e instanceof Vn)return e;if(Ie.call(e,"__wrapped__"))return Hi(e)}return new Vn(e)}var Wn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ye)return Ye(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Un(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function cr(e,t,n,r,o,a){var s,l=1&t,u=2&t,c=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!rs(e))return e;var f=qa(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ie.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Lo(e,s)}else{var d=vi(e),h=d==E||d==k;if(Qa(e))return _o(e,l);if(d==j||d==y||h&&!o){if(s=u||h?{}:yi(e),!l)return u?function(e,t){return Mo(e,mi(e),t)}(e,function(e,t){return e&&Mo(t,Ds(t),e)}(s,e)):function(e,t){return Mo(e,gi(e),t)}(e,ar(s,e))}else{if(!lt[d])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case D:return Co(e);case x:case S:return new r(+e);case I:return function(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case $:case N:case F:case B:case z:case H:case W:case U:case V:return jo(e,n);case _:case R:return new r;case C:case L:return new r(e);case A:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return o=e,Bn?Ce(Bn.call(o)):{}}var o}(e,d,l)}}a||(a=new Qn);var p=a.get(e);if(p)return p;a.set(e,s),us(e)?e.forEach((function(r){s.add(cr(r,t,n,r,e,a))})):is(e)&&e.forEach((function(r,o){s.set(o,cr(r,t,n,o,e,a))}));var g=f?i:(c?u?si:ai:u?Ds:Ps)(e);return jt(g||e,(function(r,o){g&&(r=e[o=r]),rr(s,o,cr(r,t,n,o,e,a))})),s}function fr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ce(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function dr(e,t,n){if("function"!=typeof e)throw new Ae(a);return Pi((function(){e.apply(i,n)}),t)}function hr(e,t,n,r){var o=-1,i=Lt,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=Pt(t,Jt(n))),r?(i=Mt,a=!1):t.length>=200&&(i=en,a=!1,t=new Xn(t));e:for(;++o-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Kn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Cn||Yn),string:new qn}},Kn.prototype.delete=function(e){var t=di(this,e).delete(e);return this.size-=t?1:0,t},Kn.prototype.get=function(e){return di(this,e).get(e)},Kn.prototype.has=function(e){return di(this,e).has(e)},Kn.prototype.set=function(e,t){var n=di(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,s),this},Xn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Qn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Qn.prototype.get=function(e){return this.__data__.get(e)},Qn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Kn(r)}return n.set(e,t),this.size=n.size,this};var pr=Io(Sr),gr=Io(Or,!0);function mr(e,t){var n=!0;return pr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?yr(s,t-1,n,r,o):Dt(o,s):r||(o[o.length]=s)}return o}var wr=$o(),xr=$o(!0);function Sr(e,t){return e&&wr(e,t,Ps)}function Or(e,t){return e&&xr(e,t,Ps)}function Er(e,t){return Rt(t,(function(t){return es(e[t])}))}function kr(e,t){for(var n=0,r=(t=So(t,e)).length;null!=e&&nt}function Tr(e,t){return null!=e&&Ie.call(e,t)}function Ar(e,t){return null!=e&&t in Ce(e)}function Rr(e,t,n){for(var o=n?Mt:Lt,a=e[0].length,s=e.length,l=s,u=r(s),c=1/0,f=[];l--;){var d=e[l];l&&t&&(d=Pt(d,Jt(t))),c=xn(d.length,c),u[l]=!n&&(t||a>=120&&d.length>=120)?new Xn(l&&d):i}d=e[0];var h=-1,p=u[0];e:for(;++h=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)s!==e&&Xe.call(s,l,1),Xe.call(e,l,1);return e}function Kr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;xi(o)?Xe.call(e,o,1):po(e,o)}}return e}function Xr(e,t){return e+mt(En()*(t-e+1))}function Qr(e,t){var n="";if(!e||t<1||t>g)return n;do{t%2&&(n+=e),(t=mt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Di(Ti(e,t,al),e+"")}function Zr(e){return Zn(Ws(e))}function eo(e,t){var n=Ws(e);return Ni(n,ur(t,0,n.length))}function to(e,t,n,r){if(!rs(e))return e;for(var o=-1,a=(t=So(t,e)).length,s=a-1,l=e;null!=l&&++oi?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o>>1,a=e[i];null!==a&&!fs(a)&&(n?a<=t:a=200){var u=t?null:Jo(e);if(u)return dn(u);a=!1,o=en,l=new Xn}else l=t?[]:s;e:for(;++r=r?e:io(e,t,n)}var ko=ut||function(e){return pt.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Co(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function jo(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function To(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=fs(e),s=t!==i,l=null===t,u=t==t,c=fs(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||r&&s&&u||!n&&u||!o)return 1;if(!r&&!a&&!c&&e1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&Si(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=Ce(t);++r-1?o[a?t[s]:s]:i}}function Ho(e){return ii((function(t){var n=t.length,r=n,o=Vn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Ae(a);if(o&&!l&&"wrapper"==ui(s))var l=new Vn([],!0)}for(r=l?r:n;++r1&&y.reverse(),h&&cl))return!1;var c=a.get(e),f=a.get(t);if(c&&f)return c==t&&f==e;var d=-1,h=!0,p=2&n?new Xn:i;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ue,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(b,(function(n){var r="_."+n[0];t&n[1]&&!Lt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(fe):[]}(r),n)))}function $i(e){var t=0,n=0;return function(){var r=Sn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ni(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,la(e,n)}));function ga(e){var t=Hn(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var va=ii((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&xi(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ma,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ba=Po((function(e,t,n){Ie.call(e,n)?++e[n]:sr(e,n,1)}));var ya=zo(Gi),wa=zo(qi);function xa(e,t){return(qa(e)?jt:pr)(e,fi(t,3))}function Sa(e,t){return(qa(e)?Tt:gr)(e,fi(t,3))}var Oa=Po((function(e,t,n){Ie.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ea=Jr((function(e,t,n){var o=-1,i="function"==typeof t,a=Ka(e)?r(e.length):[];return pr(e,(function(e){a[++o]=i?_t(t,e,n):Lr(e,t,n)})),a})),ka=Po((function(e,t,n){sr(e,n,t)}));function _a(e,t){return(qa(e)?Pt:zr)(e,fi(t,3))}var Ca=Po((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ja=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&Si(e,t[0],t[1])?t=[]:n>2&&Si(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,yr(t,1),[])})),Ta=dt||function(){return pt.Date.now()};function Aa(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,ei(e,d,i,i,i,i,t)}function Ra(e,t){var n;if("function"!=typeof t)throw new Ae(a);return e=vs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var La=Jr((function(e,t,n){var r=1;if(n.length){var o=fn(n,ci(La));r|=c}return ei(e,r,t,n,o)})),Ma=Jr((function(e,t,n){var r=3;if(n.length){var o=fn(n,ci(Ma));r|=c}return ei(t,r,e,n,o)}));function Pa(e,t,n){var r,o,s,l,u,c,f=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ae(a);function g(t){var n=r,a=o;return r=o=i,f=t,l=e.apply(a,n)}function m(e){return f=e,u=Pi(b,t),d?g(e):l}function v(e){var n=e-c;return c===i||n>=t||n<0||h&&e-f>=s}function b(){var e=Ta();if(v(e))return y(e);u=Pi(b,function(e){var n=t-(e-c);return h?xn(n,s-(e-f)):n}(e))}function y(e){return u=i,p&&r?g(e):(r=o=i,l)}function w(){var e=Ta(),n=v(e);if(r=arguments,o=this,c=e,n){if(u===i)return m(c);if(h)return ko(u),u=Pi(b,t),g(c)}return u===i&&(u=Pi(b,t)),l}return t=ys(t)||0,rs(n)&&(d=!!n.leading,s=(h="maxWait"in n)?wn(ys(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),w.cancel=function(){u!==i&&ko(u),f=0,r=c=o=u=i},w.flush=function(){return u===i?l:y(Ta())},w}var Da=Jr((function(e,t){return dr(e,1,t)})),Ia=Jr((function(e,t,n){return dr(e,ys(t)||0,n)}));function $a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ae(a);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new($a.Cache||Kn),n}function Na(e){if("function"!=typeof e)throw new Ae(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}$a.Cache=Kn;var Fa=Oo((function(e,t){var n=(t=1==t.length&&qa(t[0])?Pt(t[0],Jt(fi())):Pt(yr(t,1),Jt(fi()))).length;return Jr((function(r){for(var o=-1,i=xn(r.length,n);++o=t})),Ga=Mr(function(){return arguments}())?Mr:function(e){return os(e)&&Ie.call(e,"callee")&&!Ke.call(e,"callee")},qa=r.isArray,Ya=wt?Jt(wt):function(e){return os(e)&&Cr(e)==D};function Ka(e){return null!=e&&ns(e.length)&&!es(e)}function Xa(e){return os(e)&&Ka(e)}var Qa=yt||yl,Ja=xt?Jt(xt):function(e){return os(e)&&Cr(e)==S};function Za(e){if(!os(e))return!1;var t=Cr(e);return t==O||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=Cr(e);return t==E||t==k||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==vs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function os(e){return null!=e&&"object"==typeof e}var is=St?Jt(St):function(e){return os(e)&&vi(e)==_};function as(e){return"number"==typeof e||os(e)&&Cr(e)==C}function ss(e){if(!os(e)||Cr(e)!=j)return!1;var t=qe(e);if(null===t)return!0;var n=Ie.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var ls=Ot?Jt(Ot):function(e){return os(e)&&Cr(e)==A};var us=Et?Jt(Et):function(e){return os(e)&&vi(e)==R};function cs(e){return"string"==typeof e||!qa(e)&&os(e)&&Cr(e)==L}function fs(e){return"symbol"==typeof e||os(e)&&Cr(e)==M}var ds=kt?Jt(kt):function(e){return os(e)&&ns(e.length)&&!!st[Cr(e)]};var hs=Ko(Br),ps=Ko((function(e,t){return e<=t}));function gs(e){if(!e)return[];if(Ka(e))return cs(e)?gn(e):Lo(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=vi(e);return(t==_?un:t==R?dn:Ws)(e)}function ms(e){return e?(e=ys(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function bs(e){return e?ur(vs(e),0,v):0}function ys(e){if("number"==typeof e)return e;if(fs(e))return m;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Qt(e);var n=be.test(e);return n||we.test(e)?ft(e.slice(2),n?2:8):ve.test(e)?m:+e}function ws(e){return Mo(e,Ds(e))}function xs(e){return null==e?"":fo(e)}var Ss=Do((function(e,t){if(_i(t)||Ka(t))Mo(t,Ps(t),e);else for(var n in t)Ie.call(t,n)&&rr(e,n,t[n])})),Os=Do((function(e,t){Mo(t,Ds(t),e)})),Es=Do((function(e,t,n,r){Mo(t,Ds(t),e,r)})),ks=Do((function(e,t,n,r){Mo(t,Ps(t),e,r)})),_s=ii(lr);var Cs=Jr((function(e,t){e=Ce(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&Si(t[0],t[1],o)&&(r=1);++n1),t})),Mo(e,si(e),n),r&&(n=cr(n,7,ri));for(var o=t.length;o--;)po(n,t[o]);return n}));var Fs=ii((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return As(e,n)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var n=Pt(si(e),(function(e){return[e]}));return t=fi(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var zs=Zo(Ps),Hs=Zo(Ds);function Ws(e){return null==e?[]:Zt(e,Ps(e))}var Us=Fo((function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)}));function Vs(e){return Zs(xs(e).toLowerCase())}function Gs(e){return(e=xs(e))&&e.replace(Se,on).replace(et,"")}var qs=Fo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ys=Fo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ks=No("toLowerCase");var Xs=Fo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Qs=Fo((function(e,t,n){return e+(n?" ":"")+Zs(t)}));var Js=Fo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Zs=No("toUpperCase");function el(e,t,n){return e=xs(e),(t=n?i:t)===i?function(e){return ot.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var tl=Jr((function(e,t){try{return _t(e,i,t)}catch(e){return Za(e)?e:new le(e)}})),nl=ii((function(e,t){return jt(t,(function(t){t=Bi(t),sr(e,t,La(e[t],e))})),e}));function rl(e){return function(){return e}}var ol=Ho(),il=Ho(!0);function al(e){return e}function sl(e){return $r("function"==typeof e?e:cr(e,1))}var ll=Jr((function(e,t){return function(n){return Lr(n,e,t)}})),ul=Jr((function(e,t){return function(n){return Lr(e,n,t)}}));function cl(e,t,n){var r=Ps(t),o=Er(t,r);null!=n||rs(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Er(t,Ps(t)));var i=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return jt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Lo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Dt([this.value()],arguments))})})),e}function fl(){}var dl=Go(Pt),hl=Go(At),pl=Go(Nt);function gl(e){return Oi(e)?Gt(Bi(e)):function(e){return function(t){return kr(t,e)}}(e)}var ml=Yo(),vl=Yo(!0);function bl(){return[]}function yl(){return!1}var wl=Vo((function(e,t){return e+t}),0),xl=Qo("ceil"),Sl=Vo((function(e,t){return e/t}),1),Ol=Qo("floor");var El,kl=Vo((function(e,t){return e*t}),1),_l=Qo("round"),Cl=Vo((function(e,t){return e-t}),0);return Hn.after=function(e,t){if("function"!=typeof t)throw new Ae(a);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},Hn.ary=Aa,Hn.assign=Ss,Hn.assignIn=Os,Hn.assignInWith=Es,Hn.assignWith=ks,Hn.at=_s,Hn.before=Ra,Hn.bind=La,Hn.bindAll=nl,Hn.bindKey=Ma,Hn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Hn.chain=ga,Hn.chunk=function(e,t,n){t=(n?Si(e,t,n):t===i)?1:wn(vs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(gt(o/t));ao?0:o+n),(r=r===i||r>o?o:vs(r))<0&&(r+=o),r=n>r?0:bs(r);n>>0)?(e=xs(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=fo(t))&&ln(e)?Eo(gn(e),0,n):e.split(t,n):[]},Hn.spread=function(e,t){if("function"!=typeof e)throw new Ae(a);return t=null==t?0:wn(vs(t),0),Jr((function(n){var r=n[t],o=Eo(n,0,t);return r&&Dt(o,r),_t(e,this,o)}))},Hn.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Hn.take=function(e,t,n){return e&&e.length?io(e,0,(t=n||t===i?1:vs(t))<0?0:t):[]},Hn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?io(e,(t=r-(t=n||t===i?1:vs(t)))<0?0:t,r):[]},Hn.takeRightWhile=function(e,t){return e&&e.length?mo(e,fi(t,3),!1,!0):[]},Hn.takeWhile=function(e,t){return e&&e.length?mo(e,fi(t,3)):[]},Hn.tap=function(e,t){return t(e),e},Hn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new Ae(a);return rs(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Pa(e,t,{leading:r,maxWait:t,trailing:o})},Hn.thru=ma,Hn.toArray=gs,Hn.toPairs=zs,Hn.toPairsIn=Hs,Hn.toPath=function(e){return qa(e)?Pt(e,Bi):fs(e)?[e]:Lo(Fi(xs(e)))},Hn.toPlainObject=ws,Hn.transform=function(e,t,n){var r=qa(e),o=r||Qa(e)||ds(e);if(t=fi(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rs(e)&&es(i)?Wn(qe(e)):{}}return(o?jt:Sr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Hn.unary=function(e){return Aa(e,1)},Hn.union=oa,Hn.unionBy=ia,Hn.unionWith=aa,Hn.uniq=function(e){return e&&e.length?ho(e):[]},Hn.uniqBy=function(e,t){return e&&e.length?ho(e,fi(t,2)):[]},Hn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ho(e,i,t):[]},Hn.unset=function(e,t){return null==e||po(e,t)},Hn.unzip=sa,Hn.unzipWith=la,Hn.update=function(e,t,n){return null==e?e:go(e,t,xo(n))},Hn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:go(e,t,xo(n),r)},Hn.values=Ws,Hn.valuesIn=function(e){return null==e?[]:Zt(e,Ds(e))},Hn.without=ua,Hn.words=el,Hn.wrap=function(e,t){return Ba(xo(t),e)},Hn.xor=ca,Hn.xorBy=fa,Hn.xorWith=da,Hn.zip=ha,Hn.zipObject=function(e,t){return yo(e||[],t||[],rr)},Hn.zipObjectDeep=function(e,t){return yo(e||[],t||[],to)},Hn.zipWith=pa,Hn.entries=zs,Hn.entriesIn=Hs,Hn.extend=Os,Hn.extendWith=Es,cl(Hn,Hn),Hn.add=wl,Hn.attempt=tl,Hn.camelCase=Us,Hn.capitalize=Vs,Hn.ceil=xl,Hn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ys(n))==n?n:0),t!==i&&(t=(t=ys(t))==t?t:0),ur(ys(e),t,n)},Hn.clone=function(e){return cr(e,4)},Hn.cloneDeep=function(e){return cr(e,5)},Hn.cloneDeepWith=function(e,t){return cr(e,5,t="function"==typeof t?t:i)},Hn.cloneWith=function(e,t){return cr(e,4,t="function"==typeof t?t:i)},Hn.conformsTo=function(e,t){return null==t||fr(e,t,Ps(t))},Hn.deburr=Gs,Hn.defaultTo=function(e,t){return null==e||e!=e?t:e},Hn.divide=Sl,Hn.endsWith=function(e,t,n){e=xs(e),t=fo(t);var r=e.length,o=n=n===i?r:ur(vs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Hn.eq=Wa,Hn.escape=function(e){return(e=xs(e))&&J.test(e)?e.replace(X,an):e},Hn.escapeRegExp=function(e){return(e=xs(e))&&ae.test(e)?e.replace(ie,"\\$&"):e},Hn.every=function(e,t,n){var r=qa(e)?At:mr;return n&&Si(e,t,n)&&(t=i),r(e,fi(t,3))},Hn.find=ya,Hn.findIndex=Gi,Hn.findKey=function(e,t){return Bt(e,fi(t,3),Sr)},Hn.findLast=wa,Hn.findLastIndex=qi,Hn.findLastKey=function(e,t){return Bt(e,fi(t,3),Or)},Hn.floor=Ol,Hn.forEach=xa,Hn.forEachRight=Sa,Hn.forIn=function(e,t){return null==e?e:wr(e,fi(t,3),Ds)},Hn.forInRight=function(e,t){return null==e?e:xr(e,fi(t,3),Ds)},Hn.forOwn=function(e,t){return e&&Sr(e,fi(t,3))},Hn.forOwnRight=function(e,t){return e&&Or(e,fi(t,3))},Hn.get=Ts,Hn.gt=Ua,Hn.gte=Va,Hn.has=function(e,t){return null!=e&&bi(e,t,Tr)},Hn.hasIn=As,Hn.head=Ki,Hn.identity=al,Hn.includes=function(e,t,n,r){e=Ka(e)?e:Ws(e),n=n&&!r?vs(n):0;var o=e.length;return n<0&&(n=wn(o+n,0)),cs(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Ht(e,t,n)>-1},Hn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vs(n);return o<0&&(o=wn(r+o,0)),Ht(e,t,o)},Hn.inRange=function(e,t,n){return t=ms(t),n===i?(n=t,t=0):n=ms(n),function(e,t,n){return e>=xn(t,n)&&e=-9007199254740991&&e<=g},Hn.isSet=us,Hn.isString=cs,Hn.isSymbol=fs,Hn.isTypedArray=ds,Hn.isUndefined=function(e){return e===i},Hn.isWeakMap=function(e){return os(e)&&vi(e)==P},Hn.isWeakSet=function(e){return os(e)&&"[object WeakSet]"==Cr(e)},Hn.join=function(e,t){return null==e?"":qt.call(e,t)},Hn.kebabCase=qs,Hn.last=Zi,Hn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=vs(n))<0?wn(r+o,0):xn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):zt(e,Ut,o,!0)},Hn.lowerCase=Ys,Hn.lowerFirst=Ks,Hn.lt=hs,Hn.lte=ps,Hn.max=function(e){return e&&e.length?vr(e,al,jr):i},Hn.maxBy=function(e,t){return e&&e.length?vr(e,fi(t,2),jr):i},Hn.mean=function(e){return Vt(e,al)},Hn.meanBy=function(e,t){return Vt(e,fi(t,2))},Hn.min=function(e){return e&&e.length?vr(e,al,Br):i},Hn.minBy=function(e,t){return e&&e.length?vr(e,fi(t,2),Br):i},Hn.stubArray=bl,Hn.stubFalse=yl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=kl,Hn.nth=function(e,t){return e&&e.length?Vr(e,vs(t)):i},Hn.noConflict=function(){return pt._===this&&(pt._=ze),this},Hn.noop=fl,Hn.now=Ta,Hn.pad=function(e,t,n){e=xs(e);var r=(t=vs(t))?pn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return qo(mt(o),n)+e+qo(gt(o),n)},Hn.padEnd=function(e,t,n){e=xs(e);var r=(t=vs(t))?pn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=En();return xn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return Xr(e,t)},Hn.reduce=function(e,t,n){var r=qa(e)?It:Yt,o=arguments.length<3;return r(e,fi(t,4),n,o,pr)},Hn.reduceRight=function(e,t,n){var r=qa(e)?$t:Yt,o=arguments.length<3;return r(e,fi(t,4),n,o,gr)},Hn.repeat=function(e,t,n){return t=(n?Si(e,t,n):t===i)?1:vs(t),Qr(xs(e),t)},Hn.replace=function(){var e=arguments,t=xs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Hn.result=function(e,t,n){var r=-1,o=(t=So(t,e)).length;for(o||(o=1,e=i);++rg)return[];var n=v,r=xn(e,v);t=fi(t),e-=v;for(var o=Xt(r,t);++n=a)return e;var l=n-pn(r);if(l<1)return r;var u=s?Eo(s,0,l).join(""):e.slice(0,l);if(o===i)return u+r;if(s&&(l+=u.length-l),ls(o)){if(e.slice(l).search(o)){var c,f=u;for(o.global||(o=je(o.source,xs(me.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var d=c.index;u=u.slice(0,d===i?l:d)}}else if(e.indexOf(fo(o),l)!=l){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+r},Hn.unescape=function(e){return(e=xs(e))&&Q.test(e)?e.replace(K,vn):e},Hn.uniqueId=function(e){var t=++$e;return xs(e)+t},Hn.upperCase=Js,Hn.upperFirst=Zs,Hn.each=xa,Hn.eachRight=Sa,Hn.first=Ki,cl(Hn,(El={},Sr(Hn,(function(e,t){Ie.call(Hn.prototype,t)||(El[t]=e)})),El),{chain:!1}),Hn.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Hn[e].placeholder=Hn})),jt(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===i?1:wn(vs(n),0);var r=this.__filtered__&&!t?new Gn(this):this.clone();return r.__filtered__?r.__takeCount__=xn(n,r.__takeCount__):r.__views__.push({size:xn(n,v),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:fi(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Lr(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Na(fi(e)))},Gn.prototype.slice=function(e,t){e=vs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=vs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(v)},Sr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Hn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Hn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof Gn,u=s[0],c=l||qa(t),f=function(e){var t=o.apply(Hn,Dt([e],s));return r&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,h=!!this.__actions__.length,p=a&&!d,g=l&&!h;if(!a&&c){t=g?t:new Gn(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[f],thisArg:i}),new Vn(m,d)}return p&&g?e.apply(this,s):(m=this.thru(f),p?r?m.value()[0]:m.value():m)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Re[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Hn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(qa(o)?o:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),Sr(Gn.prototype,(function(e,t){var n=Hn[t];if(n){var r=n.name+"";Ie.call(Mn,r)||(Mn[r]=[]),Mn[r].push({name:t,func:n})}})),Mn[Wo(i,2).name]=[{name:"wrapper",func:i}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Lo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Lo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Lo(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Hn.prototype.plant=function(e){for(var t,n=this;n instanceof Un;){var r=Hi(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Hn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ra)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,Je&&(Hn.prototype[Je]=function(){return this}),Hn}();pt._=bn,(o=function(){return bn}.call(t,n,t,r))===i||(r.exports=o)}).call(this)}).call(this,n(47),n(106)(e))},,function(e,t,n){"use strict";var r=n(167),o="object"==typeof self&&self&&self.Object===Object&&self,i=r.a||o||Function("return this")();t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(245),o=n.n(r),i=n(24);function a(e,t){if(t&&("object"===o()(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Object(i.a)(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(190);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(21);function o(e){for(var t=1;t=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(37).a.Symbol;t.a=r},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(190);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}},,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){e.exports=n(437)},,function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";var r=n(118),o=n(124);t.a=function(e){return null!=e&&Object(o.a)(e.length)&&!Object(r.a)(e)}},function(e,t,n){"use strict";var r,o=n(118),i=n(37).a["__core-js_shared__"],a=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";var s=function(e){return!!a&&a in e},l=n(33),u=n(88),c=/^\[object .+?Constructor\]$/,f=Function.prototype,d=Object.prototype,h=f.toString,p=d.hasOwnProperty,g=RegExp("^"+h.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var m=function(e){return!(!Object(l.a)(e)||s(e))&&(Object(o.a)(e)?g:c).test(Object(u.a)(e))};var v=function(e,t){return null==e?void 0:e[t]};t.a=function(e,t){var n=v(e,t);return m(n)?n:void 0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),o=function(e){var t=e.block,n=e.element,o=e.modifiers,i=e.className;return Object(r.useMemo)((function(){for(var e=n?t+"__"+n:t,r=e,a=0,s=Object.keys(o||{});a=0?parseFloat((i.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=i.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(i.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(i.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(i.split(" Edge/")[1])||void 0,t.isAIR=i.indexOf("AdobeAIR")>=0,t.isAndroid=i.indexOf("Android")>=0,t.isChromeOS=i.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(i)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var r=e("./useragent");if(t.buildDom=function e(t,n,r){if("string"==typeof t&&t){var o=document.createTextNode(t);return n&&n.appendChild(o),o}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var i=[],a=0;a=1.5,"undefined"!=typeof document){var o=document.createElement("div");t.HI_DPI&&void 0!==o.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),r.isEdge||void 0===o.style.animationName||(t.HAS_CSS_ANIMATION=!0),o=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/oop",["require","exports","module"],(function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}})),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],(function(e,t,n){"use strict";var r=e("./oop"),o=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return r.mixin(n,n.MODIFIER_KEYS),r.mixin(n,n.PRINTABLE_KEYS),r.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,n[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter((function(e){return t&n.KEY_MODS[e]})).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();r.mixin(t,o),t.keyCodeToString=function(e){var t=o[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var r,o=e("./keys"),i=e("./useragent"),a=null,s=0;function l(){return null==r&&function(){r=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){r={passive:!1}}})}catch(e){}}(),r}function u(e,t,n){this.elem=e,this.type=t,this.callback=n}u.prototype.destroy=function(){f(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var c=t.addListener=function(e,t,n,r){e.addEventListener(t,n,l()),r&&r.$toDestroy.push(new u(e,t,n))},f=t.removeListener=function(e,t,n){e.removeEventListener(t,n,l())};t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,n){var r=e&&e.ownerDocument||document;function o(e){t&&t(e),n&&n(e),f(r,"mousemove",t),f(r,"mouseup",o),f(r,"dragstart",o)}return c(r,"mousemove",t),c(r,"mouseup",o),c(r,"dragstart",o),o},t.addMouseWheelListener=function(e,t,n){"onmousewheel"in e?c(e,"mousewheel",(function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),t(e)}),n):"onwheel"in e?c(e,"wheel",(function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}t(e)}),n):c(e,"DOMMouseScroll",(function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),t(e)}),n)},t.addMultiMouseDownListener=function(e,n,r,o,a){var s,l,u,f=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function h(e){if(0!==t.getButton(e)?f=0:e.detail>1?++f>4&&(f=1):f=1,i.isIE){var a=Math.abs(e.clientX-s)>5||Math.abs(e.clientY-l)>5;u&&!a||(f=1),u&&clearTimeout(u),u=setTimeout((function(){u=null}),n[f-1]||600),1==f&&(s=e.clientX,l=e.clientY)}if(e._clicks=f,r[o]("mousedown",e),f>4)f=0;else if(f>1)return r[o](d[f],e)}Array.isArray(e)||(e=[e]),e.forEach((function(e){c(e,"mousedown",h,a)}))};var d=function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function h(e,t,n){var r=d(t);if(!i.isMac&&a){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(r|=8),a.altGr){if(3==(3&r))return;a.altGr=0}if(18===n||17===n){var l="location"in t?t.location:t.keyLocation;if(17===n&&1===l)1==a[n]&&(s=t.timeStamp);else if(18===n&&3===r&&2===l){t.timeStamp-s<50&&(a.altGr=!0)}}}if((n in o.MODIFIER_KEYS&&(n=-1),!r&&13===n)&&(3===(l="location"in t?t.location:t.keyLocation)&&(e(t,r,-n),t.defaultPrevented)))return;if(i.isChromeOS&&8&r){if(e(t,r,n),t.defaultPrevented)return;r&=-9}return!!(r||n in o.FUNCTION_KEYS||n in o.PRINTABLE_KEYS)&&e(t,r,n)}function p(){a=Object.create(null)}if(t.getModifierString=function(e){return o.KEY_MODS[d(e)]},t.addCommandKeyListener=function(e,n,r){if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;c(e,"keydown",(function(e){o=e.keyCode}),r),c(e,"keypress",(function(e){return h(n,e,o)}),r)}else{var s=null;c(e,"keydown",(function(e){a[e.keyCode]=(a[e.keyCode]||0)+1;var t=h(n,e,e.keyCode);return s=e.defaultPrevented,t}),r),c(e,"keypress",(function(e){s&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),s=null)}),r),c(e,"keyup",(function(e){a[e.keyCode]=null}),r),a||(p(),c(window,"focus",p))}},"object"==typeof window&&window.postMessage&&!i.isOldIE){var g=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+g++,o=function(i){i.data==r&&(t.stopPropagation(i),f(n,"message",o),e())};c(n,"message",o),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout((function n(){t.$idleBlocked?setTimeout(n,100):e()}),n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout((function(){t.$idleBlocked=!1}),e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/range",["require","exports","module"],(function(e,t,n){"use strict";var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,r=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(r.row,r.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(r.row,r.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var o={row:t+1,column:0};else if(this.start.row0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\s\s*/,o=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(o,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;nDate.now()-50)||(r=!1)},cancel:function(){r=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(e,t,n){"use strict";var r=e("../lib/event"),o=e("../lib/useragent"),i=e("../lib/dom"),a=e("../lib/lang"),s=e("../clipboard"),l=o.isChrome<18,u=o.isIE,c=o.isChrome>63,f=400,d=e("../lib/keys"),h=d.KEY_MODS,p=o.isIOS,g=p?/\s/:/\n/,m=o.isMobile;t.TextInput=function(e,t){var n=i.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var v=!1,b=!1,y=!1,w=!1,x="";m||(n.style.fontSize="1px");var S=!1,O=!1,E="",k=0,_=0,C=0;try{var j=document.activeElement===n}catch(e){}r.addListener(n,"blur",(function(e){O||(t.onBlur(e),j=!1)}),t),r.addListener(n,"focus",(function(e){if(!O){if(j=!0,o.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),o.isEdge?setTimeout(T):T()}}),t),this.$focusScroll=!1,this.focus=function(){if(x||c||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=0!=n.getBoundingClientRect().top}catch(e){return}var r=[];if(t)for(var o=n.parentElement;o&&1==o.nodeType;)r.push(o),o.setAttribute("ace_nocontext",!0),o=!o.parentElement&&o.getRootNode?o.getRootNode().host:o.parentElement;n.focus({preventScroll:!0}),t&&r.forEach((function(e){e.removeAttribute("ace_nocontext")})),setTimeout((function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)}),0)},this.blur=function(){n.blur()},this.isFocused=function(){return j},t.on("beforeEndOperation",(function(){var e=t.curOp,r=e&&e.command&&e.command.name;if("insertstring"!=r){var o=r&&(e.docChanged||e.selectionChanged);y&&o&&(E=n.value="",B()),T()}}));var T=p?function(e){if(j&&(!v||e)&&!w){e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=E=r);var o=4+(e.length||(t.selection.isEmpty()?0:1));4==k&&_==o||n.setSelectionRange(4,o),k=4,_=o}}:function(){if(!y&&!w&&(j||R)){y=!0;var e=0,r=0,o="";if(t.session){var i=t.selection,a=i.getRange(),s=i.cursor.row;if(e=a.start.column,r=a.end.column,o=t.session.getLine(s),a.start.row!=s){var l=t.session.getLine(s-1);e=a.start.rows+1?u.length:r,r+=o.length+1,o=o+"\n"+u}else m&&s>0&&(o="\n"+o,r+=1,e+=1);o.length>f&&(e0&&E[d]==e[d];)d++,s--;for(u=u.slice(d),d=1;l>0&&E.length-d>k-1&&E[E.length-d]==e[e.length-d];)d++,l--;c-=d-1,f-=d-1;var h=u.length-d+1;if(h<0&&(s=-h,h=0),u=u.slice(0,h),!(r||u||c||s||l||f))return"";w=!0;var p=!1;return o.isAndroid&&". "==u&&(u=" ",p=!0),u&&!s&&!l&&!c&&!f||S?t.onTextInput(u):t.onTextInput(u,{extendLeft:s,extendRight:l,restoreStart:c,restoreEnd:f}),w=!1,E=e,k=i,_=a,C=f,p?"\n":u},M=function(e){if(y)return F();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var r=n.value,o=L(r,!0);(r.length>500||g.test(o)||m&&k<1&&k==_)&&T()},P=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(r&&!l){var o=u||n?"Text":"text/plain";try{return t?!1!==r.setData(o,t):r.getData(o)}catch(e){if(!n)return P(e,t,!0)}}},D=function(e,o){var i=t.getCopyText();if(!i)return r.preventDefault(e);P(e,i)?(p&&(T(i),v=i,setTimeout((function(){v=!1}),10)),o?t.onCut():t.onCopy(),r.preventDefault(e)):(v=!0,n.value=i,n.select(),setTimeout((function(){v=!1,T(),o?t.onCut():t.onCopy()})))},I=function(e){D(e,!0)},$=function(e){D(e,!1)},N=function(e){var i=P(e);s.pasteCancelled()||("string"==typeof i?(i&&t.onPaste(i,e),o.isIE&&setTimeout(T),r.preventDefault(e)):(n.value="",b=!0))};r.addCommandKeyListener(n,t.onCommandKey.bind(t),t),r.addListener(n,"select",(function(e){y||(v?v=!1:!function(e){return 0===e.selectionStart&&e.selectionEnd>=E.length&&e.value===E&&E&&e.selectionEnd!==_}(n)?m&&n.selectionStart!=k&&T():(t.selectAll(),T()))}),t),r.addListener(n,"input",M,t),r.addListener(n,"cut",I,t),r.addListener(n,"copy",$,t),r.addListener(n,"paste",N,t),"oncut"in n&&"oncopy"in n&&"onpaste"in n||r.addListener(e,"keydown",(function(e){if((!o.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:$(e);break;case 86:N(e);break;case 88:I(e)}}),t);var F=function(){if(y&&t.onCompositionUpdate&&!t.$readOnly){if(S)return z();if(y.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;L(e),y.markerRange&&(y.context&&(y.markerRange.start.column=y.selectionStart=y.context.compositionStartOffset),y.markerRange.end.column=y.markerRange.start.column+_-y.selectionStart+C)}}},B=function(e){t.onCompositionEnd&&!t.$readOnly&&(y=!1,t.onCompositionEnd(),t.off("mousedown",z),e&&M())};function z(){O=!0,n.blur(),n.focus(),O=!1}var H,W=a.delayedCall(F,50).schedule.bind(null,null);function U(){clearTimeout(H),H=setTimeout((function(){x&&(n.style.cssText=x,x=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}r.addListener(n,"compositionstart",(function(e){if(!y&&t.onCompositionStart&&!t.$readOnly&&(y={},!S)){e.data&&(y.useTextareaForIME=!1),setTimeout(F,0),t._signal("compositionStart"),t.on("mousedown",z);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,y.markerRange=r,y.selectionStart=k,t.onCompositionStart(y),y.useTextareaForIME?(E=n.value="",k=0,_=0):(n.msGetInputContext&&(y.context=n.msGetInputContext()),n.getInputContext&&(y.context=n.getInputContext()))}}),t),r.addListener(n,"compositionupdate",F,t),r.addListener(n,"keyup",(function(e){27==e.keyCode&&n.value.length_&&"\n"==E[i]?a=d.end:r_&&E.slice(0,i).split("\n").length>2?a=d.down:i>_&&" "==E[i-1]?(a=d.right,s=h.option):(i>_||i==_&&_!=k&&r==i)&&(a=d.right),r!==i&&(s|=h.shift),a){if(!t.onCommandKey({},s,a)&&t.commands){a=d.keyCodeToString(a);var l=t.commands.findKeyCommand(s,a);l&&t.execCommand(l)}k=r,_=i,T("")}}};document.addEventListener("selectionchange",i),t.on("destroy",(function(){document.removeEventListener("selectionchange",i)}))}(0,t,n)},t.$setUserAgentForTests=function(e,t){m=e,p=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var r=e("../lib/useragent");function o(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(t){e[t]=this[t]}),this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function i(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else var n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var o=this.editor,i=e.getButton();return 0!==i?((o.getSelectionRange().isEmpty()||1==i)&&o.selection.moveToPosition(n),void(2==i&&(o.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||o.isFocused()||(o.focus(),!this.$focusTimeout||this.$clickSelection||o.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(-1==r)e=this.$clickSelection.end;else if(1==r)e=this.$clickSelection.start;else{var o=i(this.$clickSelection,n);n=o.cursor,e=o.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),o=n.selection[e](r.row,r.column);if(this.$clickSelection){var a=this.$clickSelection.comparePoint(o.start),s=this.$clickSelection.comparePoint(o.end);if(-1==a&&s<=0)t=this.$clickSelection.end,o.end.row==r.row&&o.end.column==r.column||(r=o.start);else if(1==s&&a>=0)t=this.$clickSelection.start,o.start.row==r.row&&o.start.column==r.column||(r=o.end);else if(-1==a&&1==s)r=o.end,t=o.start;else{var l=i(this.$clickSelection,r);r=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e,t,n,r,o=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,r=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))),i=Date.now();(o>0||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState("select")):(r=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=r,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,o=r-n.t,i=o?e.wheelX/o:n.vx,a=o?e.wheelY/o:n.vy;o<550&&(i=(i+n.vx)/2,a=(a+n.vy)/2);var s=Math.abs(i/a),l=!1;if(s>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),s<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l)n.allowed=r;else if(r-n.allowed<550){Math.abs(i)<=1.5*Math.abs(n.vx)&&Math.abs(a)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0}return n.t=r,n.vx=i,n.vy=a,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(o.prototype),t.DefaultHandlers=o})),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],(function(e,t,n){"use strict";e("./lib/oop");var r=e("./lib/dom");function o(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=r.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){r.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(o.prototype),t.Tooltip=o})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],(function(e,t,n){"use strict";var r=e("../lib/dom"),o=e("../lib/oop"),i=e("../lib/event"),a=e("../tooltip").Tooltip;function s(e){a.call(this,e)}o.inherits(s,a),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),i=this.getHeight();(e+=15)+o>n&&(e-=e+o-n),(t+=15)+i>r&&(t-=20+i),a.prototype.setPosition.call(this,e,t)}}.call(s.prototype),t.GutterHandler=function(e){var t,n,o,a=e.editor,l=a.renderer.$gutterLayer,u=new s(a.container);function c(){t&&(t=clearTimeout(t)),o&&(u.hide(),o=null,a._signal("hideGutterTooltip",u),a.off("mousewheel",c))}function f(e){u.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(a.isFocused()&&0==t.getButton()&&"foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,r=a.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return a.selectAll(),t.preventDefault();e.$clickSelection=a.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(i){var s=i.domEvent.target||i.domEvent.srcElement;if(r.hasCssClass(s,"ace_fold-widget"))return c();o&&e.$tooltipFollowsMouse&&f(i),n=i,t||(t=setTimeout((function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row,r=l.$annotations[t];if(!r)return c();if(t==a.session.getLength()){var i=a.renderer.pixelToScreenCoordinates(0,n.y).row,s=n.$pos;if(i>a.session.documentToScreenRow(s.row,s.column))return c()}if(o!=r)if(o=r.text.join("
"),u.setHtml(o),u.show(),a._signal("showGutterTooltip",u),a.on("mousewheel",c),e.$tooltipFollowsMouse)f(n);else{var d=n.domEvent.target.getBoundingClientRect(),h=u.getElement().style;h.left=d.right+"px",h.top=d.bottom+"px"}}():c()}),50))})),i.addListener(a.renderer.$gutter,"mouseout",(function(e){n=null,o&&!t&&(t=setTimeout((function(){t=null,c()}),50))}),a),a.on("changeSession",c)}})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var r=e("../lib/event"),o=e("../lib/useragent"),i=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=o.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(i.prototype)})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var r=e("../lib/dom"),o=e("../lib/event"),i=e("../lib/useragent");function a(e){var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",i.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),t.on("mousedown",this.onMouseDown.bind(e));var a,l,u,c,f,d,h,p,g,m,v,b=t.container,y=0;function w(){var e=d;(function(e,n){var r=Date.now(),o=!n||e.row!=n.row,i=!n||e.column!=n.column;!m||o||i?(t.moveCursorToPosition(e),m=r,v={x:l,y:u}):s(v.x,v.y,l,u)>5?m=null:r-m>=200&&(t.renderer.scrollCursorIntoView(),m=null)})(d=t.renderer.screenToTextCoordinates(l,u),e),function(e,n){var r=Date.now(),o=t.renderer.layerConfig.lineHeight,i=t.renderer.layerConfig.characterWidth,a=t.renderer.scroller.getBoundingClientRect(),s={x:{left:l-a.left,right:a.right-l},y:{top:u-a.top,bottom:a.bottom-u}},c=Math.min(s.x.left,s.x.right),f=Math.min(s.y.top,s.y.bottom),d={row:e.row,column:e.column};c/i<=2&&(d.column+=s.x.left=200&&t.renderer.scrollCursorIntoView(d):g=r:g=null}(d,e)}function x(){f=t.selection.toOrientedRange(),a=t.session.addMarker(f,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(c),w(),c=setInterval(w,20),y=0,o.addListener(document,"mousemove",E)}function S(){clearInterval(c),t.session.removeMarker(a),a=null,t.selection.fromOrientedRange(f),t.isFocused()&&!p&&t.$resetCursorStyle(),f=null,d=null,y=0,g=null,m=null,o.removeListener(document,"mousemove",E)}this.onDragStart=function(e){if(this.cancelDrag||!b.draggable){var r=this;return setTimeout((function(){r.startSelect(),r.captureMouse(e)}),0),e.preventDefault()}f=t.getSelectionRange();var o=e.dataTransfer;o.effectAllowed=t.getReadOnly()?"copy":"copyMove",i.isOpera&&(t.container.appendChild(n),n.scrollTop=0),o.setDragImage&&o.setDragImage(n,0,0),i.isOpera&&t.container.removeChild(n),o.clearData(),o.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(b.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;h||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&k(e.dataTransfer))return l=e.clientX,u=e.clientY,a||x(),y++,e.dataTransfer.dropEffect=h=_(e),o.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&k(e.dataTransfer))return l=e.clientX,u=e.clientY,a||(x(),y++),null!==O&&(O=null),e.dataTransfer.dropEffect=h=_(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--y<=0&&a)return S(),h=null,o.preventDefault(e)},this.onDrop=function(e){if(d){var n=e.dataTransfer;if(p)switch(h){case"move":f=f.contains(d.row,d.column)?{start:d,end:d}:t.moveText(f,d);break;case"copy":f=t.moveText(f,d,!0)}else{var r=n.getData("Text");f={start:d,end:t.session.insert(d,r)},t.focus(),h=null}return S(),o.preventDefault(e)}},o.addListener(b,"dragstart",this.onDragStart.bind(e),t),o.addListener(b,"dragend",this.onDragEnd.bind(e),t),o.addListener(b,"dragenter",this.onDragEnter.bind(e),t),o.addListener(b,"dragover",this.onDragOver.bind(e),t),o.addListener(b,"dragleave",this.onDragLeave.bind(e),t),o.addListener(b,"drop",this.onDrop.bind(e),t);var O=null;function E(){null==O&&(O=setTimeout((function(){null!=O&&a&&S()}),20))}function k(e){var t=e.types;return!t||Array.prototype.some.call(t,(function(e){return"text/plain"==e||"Text"==e}))}function _(e){var t=["copy","copymove","all","uninitialized"],n=i.isMac?e.altKey:e.ctrlKey,r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return n&&t.indexOf(r)>=0?o="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(r)>=0?o="move":t.indexOf(r)>=0&&(o="copy"),o}}function s(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=i.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;i.isIE&&"dragReady"==this.state&&(s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop());"dragWait"===this.state&&(s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition())))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if(1===(e.domEvent.detail||1)&&0===r&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in o&&(o.unselectable="on"),t.getDragDelay()){if(i.isWebKit)this.cancelDrag=!0,t.container.draggable=!0;this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(a.prototype),t.DragdropHandler=a})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,o=e("../lib/event"),i=e("../lib/dom");t.addTouchListeners=function(e,t){var n,a,s,l,u,c,f,d,h,p="scroll",g=0,m=0,v=0,b=0;function y(){var e=window.navigator&&window.navigator.clipboard,n=!1,r=function(r){var o,a,s=r.target.getAttribute("action");if("more"==s||!n)return n=!n,o=t.getCopyText(),a=t.session.getUndoManager().hasUndo(),void h.replaceChild(i.buildDom(n?["span",!o&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],o&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],o&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],a&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),h.firstChild);"paste"==s?e.readText().then((function(e){t.execCommand(s,e)})):s&&("cut"!=s&&"copy"!=s||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(s)),h.firstChild.style.display="none",n=!1,"openCommandPallete"!=s&&t.focus()};h=i.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){p="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container)}function w(){h||y();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),r=t.renderer.textToScreenCoordinates(0,0).pageX,o=t.renderer.scrollLeft,i=t.container.getBoundingClientRect();h.style.top=n.pageY-i.top-3+"px",n.pageX-i.left1)return clearTimeout(u),u=null,s=-1,void(p="zoom");d=t.$mouseHandler.isMousePressed=!0;var i=t.renderer.layerConfig.lineHeight,c=t.renderer.layerConfig.lineHeight,h=e.timeStamp;l=h;var y=o[0],w=y.clientX,x=y.clientY;Math.abs(n-w)+Math.abs(a-x)>i&&(s=-1),n=e.clientX=w,a=e.clientY=x,v=b=0;var O=new r(e,t);if(f=O.getDocumentPosition(),h-s<500&&1==o.length&&!g)m++,e.preventDefault(),e.button=0,function(){u=null,clearTimeout(u),t.selection.moveToPosition(f);var e=m>=2?t.selection.getLineRange(f.row):t.session.getBracketRange(f);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),p="wait"}();else{m=0;var E=t.selection.cursor,k=t.selection.isEmpty()?E:t.selection.anchor,_=t.renderer.$cursorLayer.getPixelPosition(E,!0),C=t.renderer.$cursorLayer.getPixelPosition(k,!0),j=t.renderer.scroller.getBoundingClientRect(),T=t.renderer.layerConfig.offset,A=t.renderer.scrollLeft,R=function(e,t){return(e/=c)*e+(t=t/i-.75)*t};if(e.clientXM?"cursor":"anchor"),p=M<3.5?"anchor":L<3.5?"cursor":"scroll",u=setTimeout(S,450)}s=h}),t),o.addListener(e,"touchend",(function(e){d=t.$mouseHandler.isMousePressed=!1,c&&clearInterval(c),"zoom"==p?(p="",g=0):u?(t.selection.moveToPosition(f),g=0,w()):"scroll"==p?(g+=60,c=setInterval((function(){g--<=0&&(clearInterval(c),c=null),Math.abs(v)<.01&&(v=0),Math.abs(b)<.01&&(b=0),g<20&&(v*=.9),g<20&&(b*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*v,10*b),e==t.session.getScrollTop()&&(g=0)}),10),x()):w(),clearTimeout(u),u=null}),t),o.addListener(e,"touchmove",(function(e){u&&(clearTimeout(u),u=null);var o=e.touches;if(!(o.length>1||"zoom"==p)){var i=o[0],s=n-i.clientX,c=a-i.clientY;if("wait"==p){if(!(s*s+c*c>4))return e.preventDefault();p="cursor"}n=i.clientX,a=i.clientY,e.clientX=i.clientX,e.clientY=i.clientY;var f=e.timeStamp,d=f-l;if(l=f,"scroll"==p){var h=new r(e,t);h.speed=1,h.wheelX=s,h.wheelY=c,10*Math.abs(s)1&&(o=n[n.length-2]);var a=l[t+"Path"];return null==a?a=l.basePath:"/"==r&&(t=r=""),a&&"/"!=a.slice(-1)&&(a+="/"),a+t+r+o+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var o,a;Array.isArray(n)&&(a=n[0],n=n[1]);try{o=e(n)}catch(e){}if(o&&!t.$loading[n])return r&&r(o);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r),!(t.$loading[n].length>1)){var s=function(){e([n],(function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach((function(t){t&&t(e)}))}))};if(!t.get("packaged"))return s();i.loadScript(t.moduleUrl(n,a),s),u()}};var u=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),u=function(){})};function c(o){if(s&&s.document){l.packaged=o||e.packaged||r.packaged||s.define&&n(266).packaged;for(var i,a={},u="",c=document.currentScript||document._currentScript,f=(c&&c.ownerDocument||document).getElementsByTagName("script"),d=0;d=e){for(i=f+1;i=e;)i++;for(s=f,l=i-1;s=t.length||2!=(l=n[o-1])&&3!=l||2!=(u=t[o+1])&&3!=u?4:(i&&(u=3),u==l?u:4);case 10:return 2==(l=o>0?n[o-1]:5)&&o+10&&2==n[o-1])return 2;if(i)return 4;for(h=o+1,d=t.length;h=1425&&g<=2303||64286==g;if(l=t[h],m&&(1==l||7==l))return 1}return o<1||5==(l=t[o-1])?4:n[o-1];case 5:return i=!1,a=!0,r;case 6:return s=!0,4;case 13:case 14:case 16:case 17:case 15:i=!1;case f:return 4}}function m(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:d[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?c:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?h[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,c){if(e.length<2)return{};var d=e.split(""),h=new Array(d.length),v=new Array(d.length),b=[];r=c?1:0,function(e,t,n,c){var f=r?u:l,d=null,h=null,p=null,v=0,b=null,y=-1,w=null,x=null,S=[];if(!c)for(w=0,c=[];w0)if(16==b){for(w=y;w-1){for(w=y;w=0&&8==c[O];O--)t[O]=r}}(d,b,d.length,n);for(var y=0;y7&&n[y]<13||4===n[y]||n[y]===f)?b[y]=t.ON_R:y>0&&"ل"===d[y-1]&&/\u0622|\u0623|\u0625|\u0627/.test(d[y])&&(b[y-1]=b[y]=t.R_H,y++);d[d.length-1]===t.DOT&&(b[d.length-1]=t.B),"‫"===d[0]&&(b[0]=t.RLE);for(y=0;y=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===r;)r=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var i=this.session.$wrapData[e];i&&(void 0===t&&(t=this.getSplitIndex()),t>0&&i.length?(this.wrapIndent=i.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,o=r.getVisualFromLogicalIdx(n,this.bidiMap),i=this.bidiMap.bidiLevels,a=0;!this.session.getOverwrite()&&e<=t&&i[o]%2!=0&&o++;for(var s=0;st&&i[o]%2==0&&(a+=this.charWidths[i[o]]),this.wrapIndent&&(a+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(a+=this.rtlLineOffset),a},this.getSelections=function(e,t){var n,r=this.bidiMap,o=r.bidiLevels,i=[],a=0,s=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,u=!1,c=!1,f=0;this.wrapIndent&&(a+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,h=0;h=s&&dn+i/2;){if(n+=i,r===o.length-1){i=0;break}i=this.charWidths[o[++r]]}return r>0&&o[r-1]%2!=0&&o[r]%2==0?(e0&&o[r-1]%2==0&&o[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===o.length-1&&0===i&&o[r-1]%2==0||!this.isRtlDir&&0===r&&o[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&o[r-1]%2!=0&&0!==i&&r--,t=this.bidiMap.logicalFromVisual[r]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(a.prototype),t.BidiHandler=a})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,n){"use strict";var r=e("./lib/oop"),o=e("./lib/lang"),i=e("./lib/event_emitter").EventEmitter,a=e("./range").Range,s=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",(function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)})),this.anchor.on("change",(function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")}))};(function(){r.implement(this,i),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?a.fromPoints(t,t):this.isBackwards()?a.fromPoints(t,e):a.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){if(!this.$silent){var o=this.$isEmpty,i=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||i)&&this._emit("changeSelection")}},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},this.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,r="number"==typeof e?e:this.lead.row,o=this.session.getFoldLine(r);return o?(r=o.start.row,n=o.end.row):n=r,!0===t?new a(r,0,n,this.session.getLine(n).length):new a(r,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,o=e.column+t;return n<0&&(r=e.column-t,o=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,o).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(e,t,1);if(o)this.moveCursorTo(o.end.row,o.end.column);else{if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(i)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,r=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&r.test(t);)n++;if(n<1)for(o.lastIndex=0;(t=e[n])&&!o.test(t);)if(o.lastIndex=0,n++,r.test(t)){if(n>2){n--;break}for(;(t=e[n])&&r.test(t);)n++;if(n>2)break}}return o.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),o=this.session.getFoldAt(e,t,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(t==n.length){var i=this.doc.getLength();do{e++,r=this.doc.getLine(e)}while(e0&&/^\s*$/.test(r));n=r.length,/\s+$/.test(r)||(r="")}var i=o.stringReverse(r),a=this.$shortWordEndIndex(i);return this.moveCursorTo(t,n-a)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,r=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(r.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(r.column),r.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=r.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?r.column=this.$desiredColumn:this.$desiredColumn=r.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var o=this.session.lineWidgets[this.lead.row];e<0?e-=o.rowsAbove||0:e>0&&(e+=o.rowCount-(o.rowsAbove||0))}var i=this.session.screenToDocumentPosition(r.row+e,r.column,n);0!==e&&0===t&&i.row===this.lead.row&&(i.column,this.lead.column),this.moveCursorTo(i.row,i.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(o.charAt(t))&&o.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return a.fromPoints(t,n)}catch(e){return a.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t}));else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=a.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(s.prototype),t.Selection=s})),ace.define("ace/tokenizer",["require","exports","module","ace/config"],(function(e,t,n){"use strict";var r=e("./config"),o=2e3,i=function(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],o=0,i=this.matchMappings[t]={defaultToken:"text"},a="g",s=[],l=0;l1?this.$applyToken:u.token),f>1&&(/\\\d/.test(u.regex)?c=u.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+o+1)})):(f=1,c=this.removeCapturingGroups(u.regex)),u.splitRegex||"string"==typeof u.token||s.push(u)),i[o]=l,o+=f,r.push(c),u.onMatch||(u.onMatch=null)}}r.length||(i[0]=0,r.push("$")),s.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,a)}),this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",a)}};(function(){this.$setMaxTokenCount=function(e){o=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var r=[],o=0,i=n.length;oc){var v=e.substring(c,m-g.length);d.type==h?d.value+=v:(d.type&&u.push(d),d={type:h,value:v})}for(var b=0;bo){for(f>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});c1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:u,state:n.length?n:r}},this.reportError=r.reportError}).call(i.prototype),t.Tokenizer=i})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],(function(e,t,n){"use strict";var r=e("../lib/lang"),o=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var r=e[n],o=0;o=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(o.prototype),t.TokenIterator=o})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,n){"use strict";var r,o=e("../../lib/oop"),i=e("../behaviour").Behaviour,a=e("../../token_iterator").TokenIterator,s=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},f={'"':'"',"'":"'"},d=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return r=c[t];r=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(e,t,n,r){var o=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,o,e.end.column+(o?0:1)]}},p=function(e){this.add("braces","insertion",(function(t,n,o,i,a){var l=o.getCursorPosition(),u=i.doc.getLine(l.row);if("{"==a){d(o);var c=o.getSelectionRange(),f=i.doc.getTextRange(c);if(""!==f&&"{"!==f&&o.getWrapBehavioursEnabled())return h(c,f,"{","}");if(p.isSaneInsertion(o,i))return/[\]\}\)]/.test(u[l.column])||o.inMultiSelectMode||e&&e.braces?(p.recordAutoInsert(o,i,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(o,i,"{"),{text:"{",selection:[1,1]})}else if("}"==a){if(d(o),"}"==u.substring(l.column,l.column+1))if(null!==i.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&p.isAutoInsertedClosing(l,u,a))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==a||"\r\n"==a){d(o);var g="";if(p.isMaybeInsertedClosing(l,u)&&(g=s.stringRepeat("}",r.maybeInsertedBrackets),p.clearMaybeInsertedClosing()),"}"===u.substring(l.column,l.column+1)){var m=i.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!m)return null;var v=this.$getIndent(i.getLine(m.row))}else{if(!g)return void p.clearMaybeInsertedClosing();v=this.$getIndent(u)}var b=v+i.getTabString();return{text:"\n"+b+"\n"+v+g,selection:[1,b.length,1,b.length]}}p.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,n,o,i){var a=o.doc.getTextRange(i);if(!i.isMultiLine()&&"{"==a){if(d(n),"}"==o.doc.getLine(i.start.row).substring(i.end.column,i.end.column+1))return i.end.column++,i;r.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,n,r,o){if("("==o){d(n);var i=n.getSelectionRange(),a=r.doc.getTextRange(i);if(""!==a&&n.getWrapBehavioursEnabled())return h(i,a,"(",")");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(")"==o){d(n);var s=n.getCursorPosition(),l=r.doc.getLine(s.row);if(")"==l.substring(s.column,s.column+1))if(null!==r.$findOpeningBracket(")",{column:s.column+1,row:s.row})&&p.isAutoInsertedClosing(s,l,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,n,r,o){var i=r.doc.getTextRange(o);if(!o.isMultiLine()&&"("==i&&(d(n),")"==r.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("brackets","insertion",(function(e,t,n,r,o){if("["==o){d(n);var i=n.getSelectionRange(),a=r.doc.getTextRange(i);if(""!==a&&n.getWrapBehavioursEnabled())return h(i,a,"[","]");if(p.isSaneInsertion(n,r))return p.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if("]"==o){d(n);var s=n.getCursorPosition(),l=r.doc.getLine(s.row);if("]"==l.substring(s.column,s.column+1))if(null!==r.$findOpeningBracket("]",{column:s.column+1,row:s.row})&&p.isAutoInsertedClosing(s,l,o))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,n,r,o){var i=r.doc.getTextRange(o);if(!o.isMultiLine()&&"["==i&&(d(n),"]"==r.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("string_dquotes","insertion",(function(e,t,n,r,o){var i=r.$mode.$quotes||f;if(1==o.length&&i[o]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(o))return;d(n);var a=o,s=n.getSelectionRange(),l=r.doc.getTextRange(s);if(!(""===l||1==l.length&&i[l])&&n.getWrapBehavioursEnabled())return h(s,l,a,a);if(!l){var u=n.getCursorPosition(),c=r.doc.getLine(u.row),p=c.substring(u.column-1,u.column),g=c.substring(u.column,u.column+1),m=r.getTokenAt(u.row,u.column),v=r.getTokenAt(u.row,u.column+1);if("\\"==p&&m&&/escape/.test(m.type))return null;var b,y=m&&/string|escape/.test(m.type),w=!v||/string|escape/.test(v.type);if(g==a)(b=y!==w)&&/string\.end/.test(v.type)&&(b=!1);else{if(y&&!w)return null;if(y&&w)return null;var x=r.$mode.tokenRe;x.lastIndex=0;var S=x.test(p);x.lastIndex=0;var O=x.test(p);if(S||O)return null;if(g&&!/[\s;,.})\]\\]/.test(g))return null;var E=c[u.column-2];if(p==a&&(E==a||x.test(E)))return null;b=!0}return{text:b?a+a:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,n,r,o){var i=r.$mode.$quotes||f,a=r.doc.getTextRange(o);if(!o.isMultiLine()&&i.hasOwnProperty(a)&&(d(n),r.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)==a))return o.end.column++,o}))};p.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new a(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var o=new a(t,n.row,n.column+1);if(!this.$matchTokenType(o.getCurrentToken()||"text",l))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",u)},p.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},p.recordAutoInsert=function(e,t,n){var o=e.getCursorPosition(),i=t.doc.getLine(o.row);this.isAutoInsertedClosing(o,i,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=o.row,r.autoInsertedLineEnd=n+i.substr(o.column),r.autoInsertedBrackets++},p.recordMaybeInsert=function(e,t,n){var o=e.getCursorPosition(),i=t.doc.getLine(o.row);this.isMaybeInsertedClosing(o,i)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=o.row,r.maybeInsertedLineStart=i.substr(0,o.column)+n,r.maybeInsertedLineEnd=i.substr(o.column),r.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(e,t,n){return r.autoInsertedBrackets>0&&e.row===r.autoInsertedRow&&n===r.autoInsertedLineEnd[0]&&t.substr(e.column)===r.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(e,t){return r.maybeInsertedBrackets>0&&e.row===r.maybeInsertedRow&&t.substr(e.column)===r.maybeInsertedLineEnd&&t.substr(0,e.column)==r.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},o.inherits(p,i),t.CstyleBehaviour=p})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,n){"use strict";for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],o=0,i=[],a=0;a2?r%u!=u-1:r%u==0})}else{if(!this.blockComment)return!1;var h=this.blockComment.start,p=this.blockComment.end,g=new RegExp("^(\\s*)(?:"+l.escapeRegExp(h)+")"),m=new RegExp("(?:"+l.escapeRegExp(p)+")\\s*$"),v=function(e,t){y(e,t)||i&&!/\S/.test(e)||(o.insertInLine({row:t,column:e.length},p),o.insertInLine({row:t,column:s},h))},b=function(e,t){var n;(n=e.match(m))&&o.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(g))&&o.removeInLine(t,n[1].length,n[0].length)},y=function(e,n){if(g.test(e))return!0;for(var r=t.getTokens(n),o=0;oe.length&&(x=e.length)})),s==1/0&&(s=x,i=!1,a=!1),c&&s%u!=0&&(s=Math.floor(s/u)*u),w(a?b:v)},this.toggleBlockComment=function(e,t,n,r){var o=this.blockComment;if(o){!o.start&&o[0]&&(o=o[0]);var i,a,s=(g=new u(t,r.row,r.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(s&&/comment/.test(s.type)){for(var f,d;s&&/comment/.test(s.type);){if(-1!=(m=s.value.indexOf(o.start))){var h=g.getCurrentTokenRow(),p=g.getCurrentTokenColumn()+m;f=new c(h,p,h,p+o.start.length);break}s=g.stepBackward()}var g;for(s=(g=new u(t,r.row,r.column)).getCurrentToken();s&&/comment/.test(s.type);){var m;if(-1!=(m=s.value.indexOf(o.end))){h=g.getCurrentTokenRow(),p=g.getCurrentTokenColumn()+m;d=new c(h,p,h,p+o.end.length);break}s=g.stepForward()}d&&t.remove(d),f&&(t.remove(f),i=f.start.row,a=-o.start.length)}else a=o.start.length,i=n.start.row,t.insert(n.end,o.end),t.insert(n.start,o.start);l.start.row==i&&(l.start.column+=a),l.end.row==i&&(l.end.column+=a),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],o=n.prototype.$id,i=r.$modes[o];i||(r.$modes[o]=i=new n),r.$modes[t]||(r.$modes[t]=i),this.$embeds.push(t),this.$modes[t]=i}var a=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;tthis.row)){var n=function(t,n,r){var o="insert"==t.action,i=(o?1:-1)*(t.end.row-t.start.row),a=(o?1:-1)*(t.end.column-t.start.column),s=t.start,l=o?s:t.end;if(e(n,s,r))return{row:n.row,column:n.column};if(e(l,n,!r))return{row:n.row+i,column:n.column+(n.row==l.row?a:0)};return{row:s.row,column:s.column}}(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var r;if(r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=r.row||this.column!=r.column){var o={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:o,value:r})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(i.prototype)})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(e,t,n){"use strict";var r=e("./lib/oop"),o=e("./apply_delta").applyDelta,i=e("./lib/event_emitter").EventEmitter,a=e("./range").Range,s=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,i),this.setValue=function(e){var t=this.getLength()-1;this.remove(new a(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new s(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return null==t&&(t=r.length),{row:e,column:t=Math.min(Math.max(t,0),r.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof a||(e=a.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!a.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(o(this.$lines,e,t),this._signal("change",e)))},this.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==r&&(r=t),i<=r&&n.fireUpdateEvent(i,r)}}};(function(){r.implement(this,o),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(i.prototype),t.BackgroundTokenizer=i})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,n){"use strict";var r=e("./lib/lang"),o=(e("./lib/oop"),e("./range").Range),i=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,n,i){if(this.regExp)for(var a=i.firstRow,s=i.lastRow,l=a;l<=s;l++){var u=this.cache[l];null==u&&((u=r.getMatchOffsets(n.getLine(l),this.regExp)).length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map((function(e){return new o(l,e.offset,l,e.offset+e.length)})),this.cache[l]=u.length?u:"");for(var c=u.length;c--;)t.drawSingleLineMarker(e,u[c].toScreenRange(n),this.clazz,i)}}}).call(i.prototype),t.SearchHighlight=i})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var r=e("../range").Range;function o(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(e){e.setFoldLine(this)}),this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach((function(t){t.start.row+=e,t.end.row+=e}))},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort((function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)})),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r,o,i=0,a=this.folds,s=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l0)){var l=r(e,a.start);return 0===s?t&&0!==l?-i-2:i:l>0||0===l&&!t?i:-i-1}}return-i-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){for(var e,t=[],n=this.ranges,o=(n=n.sort((function(e,t){return r(e.start,t.start)})))[0],i=1;i=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r)break}if("insert"==e.action)for(var l=o-r,u=-t.column+n.column;ar)break;if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&ac.start.column&&c.end.column==i[a+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(l=r-o,u=t.column-n.column;ao)break;c.end.rowt.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>o&&(c.end.row+=l),c.start.rowt.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>o&&(c.start.row+=l)}if(0!=l&&a=e)return o;if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),-1==r&&(r=0);r=e)return o}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,o=0;o=t){s=e?r-=t-s:r=0);break}a>=e&&(r-=s>=e?a-s:a-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var n,r=this.$foldData,a=!1;e instanceof i?n=e:(n=new i(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var s=n.start.row,l=n.start.column,u=n.end.row,c=n.end.column,f=this.getFoldAt(s,l,1),d=this.getFoldAt(u,c,-1);if(f&&d==f)return f.addSubFold(n);f&&!f.range.isStart(s,l)&&this.removeFold(f),d&&!d.range.isEnd(u,c)&&this.removeFold(d);var h=this.getFoldsInRange(n.range);h.length>0&&(this.removeFolds(h),n.collapseChildren||h.forEach((function(e){n.addSubFold(e)})));for(var p=0;p0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach((function(e){this.expandFold(e)}),this)},this.unfold=function(e,t){var n,o;if(null==e?(n=new r(0,0,this.getLength(),0),null==t&&(t=!0)):n="number"==typeof e?new r(e,0,e,this.getLine(e).length):"row"in e?r.fromPoints(e,e):e,o=this.getFoldsInRangeList(n),0!=t?this.removeFolds(o):this.expandFolds(o),o.length)return o},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,o){null==r&&(r=e.start.row),null==o&&(o=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var i=this.doc,a="";return e.walk((function(e,t,n,s){if(!(tc)break}while(i&&l.test(i.type));i=o.stepBackward()}else i=o.getCurrentToken();return u.end.row=o.getCurrentTokenRow(),u.end.column=o.getCurrentTokenColumn()+i.value.length-2,u}},this.foldAll=function(e,t,n,r){null==n&&(n=1e5);var o=this.foldWidgets;if(o){t=t||this.getLength();for(var i=e=e||0;i=e&&(i=a.end.row,a.collapseChildren=n,this.addFold("...",a))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var n=e.getTokens(t),r=0;r=0;){var i=n[o];if(null==i&&(i=n[o]=this.getFoldWidget(o)),"start"==i){var a=this.getFoldWidgetRange(o);if(r||(r=a),a&&a.end.row>=e)break}o--}return{range:-1!==o&&a,firstRange:r}},this.onFoldWidgetClick=function(e,t){var n={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),o="end"===n?-1:1,i=this.getFoldAt(e,-1===o?0:r.length,o);if(i)return t.children||t.all?this.removeFold(i):this.expandFold(i),i;var a=this.getFoldWidgetRange(e,!0);if(a&&!a.isMultiLine()&&(i=this.getFoldAt(a.start.row,a.start.column,1))&&a.isEqual(i.range))return this.removeFold(i),i;if(t.siblings){var s=this.getParentFoldRangeData(e);if(s.range)var l=s.range.start.row+1,u=s.range.end.row;this.foldAll(l,u,t.all?1e4:0)}else t.children?(u=a?a.end.row:this.getLength(),this.foldAll(e+1,u,t.all?1e4:0)):a&&(t.all&&(a.collapseChildren=1e4),this.addFold("...",a));return a}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange){t=n.start.row;var o=this.getFoldAt(t,this.getLine(t).length,1);o?this.removeFold(o):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,n){"use strict";var r=e("../token_iterator").TokenIterator,o=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),r=!0,i=n.charAt(e.column-1),a=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(a||(i=n.charAt(e.column),e={row:e.row,column:e.column+1},a=i&&i.match(/([\(\[\{])|([\)\]\}])/),r=!1),!a)return null;if(a[1]){if(!(s=this.$findClosingBracket(a[1],e)))return null;t=o.fromPoints(e,s),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{var s;if(!(s=this.$findOpeningBracket(a[2],e)))return null;t=o.fromPoints(s,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e){var t=this.getLine(e.row),n=t.charAt(e.column-1),r=n&&n.match(/([\(\[\{])|([\)\]\}])/);if(r||(n=t.charAt(e.column),e={row:e.row,column:e.column+1},r=n&&n.match(/([\(\[\{])|([\)\]\}])/)),!r)return null;var i=new o(e.row,e.column-1,e.row,e.column),a=r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e);return a?[i,new o(a.row,a.column,a.row,a.column+1)]:[i]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var o=this.$brackets[e],i=1,a=new r(this,t.row,t.column),s=a.getCurrentToken();if(s||(s=a.stepForward()),s){n||(n=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-a.getCurrentTokenColumn()-2,u=s.value;;){for(;l>=0;){var c=u.charAt(l);if(c==o){if(0==(i-=1))return{row:a.getCurrentTokenRow(),column:l+a.getCurrentTokenColumn()}}else c==e&&(i+=1);l-=1}do{s=a.stepBackward()}while(s&&!n.test(s.type));if(null==s)break;l=(u=s.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var o=this.$brackets[e],i=1,a=new r(this,t.row,t.column),s=a.getCurrentToken();if(s||(s=a.stepForward()),s){n||(n=new RegExp("(\\.?"+s.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-a.getCurrentTokenColumn();;){for(var u=s.value,c=u.length;ln&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var o=n+r>>1,i=e[o];if(t>i)n=o+1;else{if(!(t=t);i++);return(n=r[i])?(n.index=i,n.start=o-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=o.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?o.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe)),r)var o=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))o=/\s/;else o=this.nonTokenRe;var i=t;if(i>0){do{i--}while(i>=0&&n.charAt(i).match(o));i++}for(var a=t;ae&&(e=t.screenWidth)})),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,o=0,i=this.$foldData[o],a=i?i.start.row:1/0,s=t.length,l=0;la){if((l=i.end.row+1)>=s)break;a=(i=this.$foldData[o++])?i.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>r&&(r=n[l])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var r=e[n];"insert"==r.action||"remove"==r.action?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;ne.end.column&&(i.start.column+=u),i.end.row==e.end.row&&i.end.column>e.end.column&&(i.end.column+=u)),a&&i.start.row>=e.end.row&&(i.start.row+=a,i.end.row+=a)}if(i.end=this.insert(i.start,r),o.length){var s=e.start,l=i.start,u=(a=l.row-s.row,l.column-s.column);this.addFolds(o.map((function(e){return(e=e.clone()).start.row==s.row&&(e.start.column+=u),e.end.row==s.row&&(e.end.column+=u),e.start.row+=a,e.end.row+=a,e})))}return i},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){for(var t=e.collapseRows(),n=new c(0,0,0,0),r=this.getTabSize(),o=t.start.row;o<=t.end.row;++o){var i=this.getLine(o);n.start.row=o,n.end.row=o;for(var a=0;a0){var o;if((o=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;r=o-t}else{e=this.$clipRowToDocument(e);r=(t=this.$clipRowToDocument(t))-e+1}var i=new c(e,0,t,Number.MAX_VALUE),a=this.getFoldsInRange(i).map((function(e){return(e=e.clone()).start.row+=r,e.end.row+=r,e})),s=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+r,s),a.length&&this.addFolds(a),r},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1&&(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,o=e.end,i=r.row,a=o.row,s=a-i,l=null;if(this.$updating=!0,0!=s)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(i,s);var u=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var c=0;if(g=this.getFoldLine(o.row)){g.addRemoveChars(o.row,o.column,r.column-o.column),g.shiftRow(-s);var f=this.getFoldLine(i);f&&f!==g&&(f.merge(g),g=f),c=u.indexOf(g)+1}for(;c=o.row&&g.shiftRow(-s)}a=i}else{var d=Array(s);d.unshift(i,0);var h=t?this.$wrapData:this.$rowLengthCache;h.splice.apply(h,d);u=this.$foldData,c=0;if(g=this.getFoldLine(i)){var p=g.range.compareInside(r.row,r.column);0==p?(g=g.split(r.row,r.column))&&(g.shiftRow(s),g.addRemoveChars(a,0,o.column-r.column)):-1==p&&(g.addRemoveChars(i,0,o.column-r.column),g.shiftRow(s)),c=u.indexOf(g)+1}for(;c=i&&g.shiftRow(s)}}else s=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),s=-s),(g=this.getFoldLine(i))&&g.addRemoveChars(i,r.column,s);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(i,a):this.$updateRowLengthCache(i,a),l},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(n,r){var o,i,a=this.doc.getAllLines(),s=this.getTabSize(),l=this.$wrapData,u=this.$wrapLimit,c=n;for(r=Math.min(r,a.length-1);c<=r;)(i=this.getFoldLine(c,i))?(o=[],i.walk(function(n,r,i,s){var l;if(null!=n){(l=this.$getDisplayTokens(n,o.length))[0]=e;for(var u=1;u=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}this.$computeWrapSplits=function(n,r,o){if(0==n.length)return[];var i=[],a=n.length,s=0,l=0,u=this.$wrapAsCode,c=this.$indentedSoftWrap,f=r<=Math.max(2*o,8)||!1===c?0:Math.floor(r/2);function d(e){for(var t=e-s,r=s;rr-h;){var p=s+r-h;if(n[p-1]>=10&&n[p]>=10)d(p);else if(n[p]!=e&&n[p]!=t){for(var g=Math.max(p-(r-(r>>2)),s-1);p>g&&n[p]g&&n[p]g&&9==n[p];)p--}else for(;p>g&&n[p]<10;)p--;p>g?d(++p):(2==n[p=s+r]&&p--,d(p-h))}else{for(;p!=s-1&&n[p]!=e;p--);if(p>s){d(p);continue}for(p=s+r;p39&&a<48||a>57&&a<64?o.push(9):a>=4352&&n(a)?o.push(1,2):o.push(1)}return o},this.$getStringScreenWidth=function(e,t,r){if(0==t)return[0,0];var o,i;for(null==t&&(t=1/0),r=r||0,i=0;i=4352&&n(o)?r+=2:r+=1,!(r>t));i++);return[r,i]},this.lineWidgets=null,this.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0){s=u[c],i=this.$docRowCache[c];var d=e>u[f-1]}else d=!f;for(var h=this.getLength()-1,p=this.getNextFoldLine(i),g=p?p.start.row:1/0;s<=e&&!(s+(l=this.getRowLength(i))>e||i>=h);)s+=l,++i>g&&(i=p.end.row+1,g=(p=this.getNextFoldLine(i,p))?p.start.row:1/0),d&&(this.$docRowCache.push(i),this.$screenRowCache.push(s));if(p&&p.start.row<=i)r=this.getFoldDisplayLine(p),i=p.start.row;else{if(s+l<=e||i>h)return{row:h,column:this.getLine(h).length};r=this.getLine(i),p=null}var m=0,v=Math.floor(e-s);if(this.$useWrapMode){var b=this.$wrapData[i];b&&(o=b[v],v>0&&b.length&&(m=b.indent,a=b[v-1]||b[b.length-1],r=r.substring(a)))}return void 0!==n&&this.$bidiHandler.isBidiRow(s+v,i,v)&&(t=this.$bidiHandler.offsetToCol(n)),a+=this.$getStringScreenWidth(r,t-m)[1],this.$useWrapMode&&a>=o&&(a=o-1),p?p.idxToPosition(a):{row:i,column:a}},this.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r,o=0,i=null;(r=this.getFoldAt(e,t,1))&&(e=r.start.row,t=r.start.column);var a,s=0,l=this.$docRowCache,u=this.$getRowCacheIndex(l,e),c=l.length;if(c&&u>=0){s=l[u],o=this.$screenRowCache[u];var f=e>l[c-1]}else f=!c;for(var d=this.getNextFoldLine(s),h=d?d.start.row:1/0;s=h){if((a=d.end.row+1)>e)break;h=(d=this.getNextFoldLine(a,d))?d.start.row:1/0}else a=s+1;o+=this.getRowLength(s),s=a,f&&(this.$docRowCache.push(s),this.$screenRowCache.push(o))}var p="";d&&s>=h?(p=this.getFoldDisplayLine(d,e,t),i=d.start.row):(p=this.getLine(e).substring(0,t),i=e);var g=0;if(this.$useWrapMode){var m=this.$wrapData[i];if(m){for(var v=0;p.length>=m[v];)o++,v++;p=p.substring(m[v-1]||0,p.length),g=v>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[s]&&this.lineWidgets[s].rowsAbove&&(o+=this.lineWidgets[s].rowsAbove),{row:o,column:g+this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,o=(s=0,(t=this.$foldData[s++])?t.start.row:1/0);ro&&(r=t.end.row+1,o=(t=this.$foldData[s++])?t.start.row:1/0)}else{e=this.getLength();for(var a=this.$foldData,s=0;sn);i++);return[r,i]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=n}.call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),a.defineOptions(p.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=p})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,n){"use strict";var r=e("./lib/lang"),o=e("./lib/oop"),i=e("./range").Range,a=function(){this.$options={}};(function(){this.set=function(e){return o.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach((function(e,n,o,a){return r=new i(e,n,o,a),!(n==a&&t.start&&t.start.start&&0!=t.skipCurrent&&r.isEqual(t.start))||(r=null,!1)})),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,o=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),a=[],s=t.re;if(t.$isMultiLine){var l,u=s.length,c=o.length-u;e:for(var f=s.offset||0;f<=c;f++){for(var d=0;dg||(a.push(l=new i(f,g,f+u-1,m)),u>2&&(f=f+u-2))}}else for(var v=0;vx&&a[d].end.row==n.end.row;)d--;for(a=a.slice(v,d+1),v=0,d=a.length;v=s;n--)if(f(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,s=a.row;n>=s;n--)if(f(n,Number.MAX_VALUE,e))return}};else u=function(e){var n=a.row;if(!f(n,a.column,e)){for(n+=1;n<=l;n++)if(f(n,0,e))return;if(0!=t.wrap)for(n=s,l=a.row;n<=l;n++)if(f(n,0,e))return}};if(t.$isMultiLine)var c=n.length,f=function(t,o,i){var a=r?t-c+1:t;if(!(a<0)){var s=e.getLine(a),l=s.search(n[0]);if(!(!r&&lo))return!!i(a,l,a+c-1,f)||void 0}}};else if(r)f=function(t,r,o){var i,a=e.getLine(t),s=[],l=0;for(n.lastIndex=0;i=n.exec(a);){var u=i[0].length;if(l=i.index,!u){if(l>=a.length)break;n.lastIndex=l+=1}if(i.index+u>r)break;s.push(i.index,u)}for(var c=s.length-1;c>=0;c-=2){var f=s[c-1];if(o(t,f,t,f+(u=s[c])))return!0}};else f=function(t,r,o){var i,a,s=e.getLine(t);for(n.lastIndex=r;a=n.exec(s);){var l=a[0].length;if(o(t,i=a.index,t,i+l))return!0;if(!l&&(n.lastIndex=i+=1,i>=s.length))return!1}};return{forEach:u}}}).call(a.prototype),t.Search=a})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var r=e("../lib/keys"),o=e("../lib/useragent"),i=r.KEY_MODS;function a(e,t){this.platform=t||(o.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function s(e,t){a.call(this,e,t),this.$singleCommand=!1}s.prototype=a.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var o in r){var i=r[o];if(i==e)delete r[o];else if(Array.isArray(i)){var a=i.indexOf(e);-1!=a&&(i.splice(a,1),1==i.length&&(r[o]=i[0]))}}},this.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach((function(e){var r="";if(-1!=e.indexOf(" ")){var o=e.split(/\s+/);e=o.pop(),o.forEach((function(e){var t=this.parseKeys(e),n=i[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")}),this),r+=" "}var a=this.parseKeys(e),s=i[a.hashId]+a.key;this._addCommandToBinding(r+s,t,n)}),this)},this._addCommandToBinding=function(t,n,r){var o,i=this.commandKeyBinding;if(n)if(!i[t]||this.$singleCommand)i[t]=n;else{Array.isArray(i[t])?-1!=(o=i[t].indexOf(n))&&i[t].splice(o,1):i[t]=[i[t]],"number"!=typeof r&&(r=e(n));var a=i[t];for(o=0;or)break}a.splice(o,0,n)}else delete i[t]},this.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}}),this)},this.removeCommands=function(e){Object.keys(e).forEach((function(t){this.removeCommand(e[t])}),this)},this.bindKeys=function(e){Object.keys(e).forEach((function(t){this.bindKey(t,e[t])}),this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(e){return e})),n=t.pop(),o=r[n];if(r.FUNCTION_KEYS[o])n=r.FUNCTION_KEYS[o].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var i=0,a=t.length;a--;){var s=r.KEY_MODS[t[a]];if(null==s)return"undefined"!=typeof console&&console.error("invalid modifier "+t[a]+" in "+e),!1;i|=s}return{key:n,hashId:i}},this.findKeyCommand=function(e,t){var n=i[e]+t;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,t,n,r){if(!(r<0)){var o=i[t]+n,a=this.commandKeyBinding[o];return e.$keyChain&&(e.$keyChain+=" "+o,a=this.commandKeyBinding[e.$keyChain]||a),!a||"chainKeys"!=a&&"chainKeys"!=a[a.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||r>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-o.length-1)),{command:a}):(e.$keyChain=e.$keyChain||o,{command:"null"})}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(a.prototype),t.HashHandler=a,t.MultiHashHandler=s})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,n){"use strict";var r=e("../lib/oop"),o=e("../keyboard/hash_handler").MultiHashHandler,i=e("../lib/event_emitter").EventEmitter,a=function(e,t){o.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",(function(e){return e.command.exec(e.editor,e.args||{})}))};r.inherits(a,o),function(){r.implement(this,i),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var o={editor:t,command:e,args:n};return o.returnValue=this._emit("exec",o),this._signal("afterExec",o),!1!==o.returnValue},this.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach((function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])}),this)}finally{this.$inReplay=!1}}},this.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e}))}}.call(a.prototype),t.CommandManager=a})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,n){"use strict";var r=e("../lib/lang"),o=e("../config"),i=e("../range").Range;function a(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",bindKey:a("Ctrl-,","Command-,"),exec:function(e){o.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",bindKey:a("Alt-E","F4"),exec:function(e){o.loadModule("./ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(e){o.loadModule("./ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:a("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:a("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),o=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),a=e.session.doc.getLine(n.row).length,s=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),u=n.row+1;u<=o.row+1;u++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(u)));0!==c.length&&(c=" "+c),l+=c}o.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+s)):(a=e.session.doc.getLine(n.row).length>a?a+1:a,e.selection.moveCursorTo(n.row,a))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,o=[];r.length<1&&(r=[e.selection.getRange()]);for(var a=0;a=o.lastRow||r.end.row<=o.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var i=this.selection.toJSON();this.curOp.selectionAfter=i,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(i),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var o=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(o)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;v.loadModule(["keybinding",e],(function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()}))}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||o.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t=e.session;if(t&&t.bgTokenizer){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach((function(e){t.removeMarker(e)})),t.$bracketHighlight=null);var n=t.getMatchingBracketRanges(e.getCursorPosition());if(!n&&t.$mode.getMatching&&(n=t.$mode.getMatching(e.session)),n){var r="ace_bracket";Array.isArray(n)?1==n.length&&(r="ace_error_bracket"):n=[n],2==n.length&&(0==h.comparePoints(n[0].end,n[1].start)?n=[h.fromPoints(n[0].start,n[1].end)]:0==h.comparePoints(n[0].start,n[1].end)&&(n=[h.fromPoints(n[1].start,n[0].end)])),t.$bracketHighlight={ranges:n,markerIds:n.map((function(e){return t.addMarker(e,r,"text")}))}}}}),50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var e=this;this.$highlightTagPending=!0,setTimeout((function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var n=e.getCursorPosition(),r=new b(e.session,n.row,n.column),o=r.getCurrentToken();if(!o||!/\b(?:tag-open|tag-name)/.test(o.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1===o.type.indexOf("tag-open")||(o=r.stepForward())){var i=o.value,a=o.value,s=0,l=r.stepBackward();if("<"===l.value)do{l=o,(o=r.stepForward())&&(-1!==o.type.indexOf("tag-name")?i===(a=o.value)&&("<"===l.value?s++:""===o.value&&s--)}while(o&&s>=0);else{do{if(o=l,l=r.stepBackward(),o)if(-1!==o.type.indexOf("tag-name"))i===o.value&&("<"===l.value?s++:""===o.value){for(var u=0,c=l;c;){if(-1!==c.type.indexOf("tag-name")&&c.value===i){s--;break}if("<"===c.value)break;c=r.stepBackward(),u++}for(var f=0;f1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new h(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}var o=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(o),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,r=t.end.column,o=e.getLine(t.start.row),i=o.substring(n,r);if(!(i.length>5e3)&&/[\w\d]/.test(i)){var a=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:i}),s=o.substring(n-1,r+1);if(a.test(s))return a}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),o=0;os.search(/\S|$/)){var l=s.substr(o.column).search(/\S|$/);n.doc.removeInLine(o.row,o.column,o.column+l)}}this.clearSelection();var u=o.column,c=n.getState(o.row),f=(s=n.getLine(o.row),r.checkOutdent(c,s,e));if(n.insert(o,e),i&&i.selection&&(2==i.selection.length?this.selection.setSelectionRange(new h(o.row,u+i.selection[0],o.row,u+i.selection[1])):this.selection.setSelectionRange(new h(o.row+i.selection[0],i.selection[1],o.row+i.selection[2],i.selection[3]))),this.$enableAutoIndent){if(n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(c,s.slice(0,o.column),n.getTabString());n.insert({row:o.row+1,column:0},d)}f&&r.autoOutdent(c,n,o.row)}},this.autoIndent=function(){var e,t,n=this.session,r=n.getMode();if(this.selection.isEmpty())e=0,t=n.doc.getLength()-1;else{var o=this.getSelectionRange();e=o.start.row,t=o.end.row}for(var i,a,s,l="",u="",c="",f=n.getTabString(),d=e;d<=t;d++)d>0&&(l=n.getState(d-1),u=n.getLine(d-1),c=r.getNextLineIndent(l,u,f)),i=n.getLine(d),c!==(a=r.$getIndent(i))&&(a.length>0&&(s=new h(d,0,d,a.length),n.remove(s)),c.length>0&&n.insert({row:d,column:0},c)),r.autoOutdent(l,n,d)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),e||n.isEmpty()||this.remove());(!e&&this.selection.isEmpty()||this.insert(e,!0),t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),o=n.getMode().transformAction(r,"deletion",this,n,t);if(0===t.end.column){var i=n.getTextRange(t);if("\n"==i[i.length-1]){var a=n.getLine(t.end.row);/^\s+$/.test(a)&&(t.end.column=a.length)}}o&&(t=o)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,r,o=this.session.getLine(e.row);tt.toLowerCase()?1:0}));var o=new h(0,0,0,0);for(r=e.first;r<=e.last;r++){var i=t.getLine(r);o.start.row=r,o.end.row=r,o.end.column=i.length,t.replace(o,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex=t)return{value:o[0],start:o.index,end:o.index+o[0].length}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new h(t,n-1,t,n),o=this.session.getTextRange(r);if(!isNaN(parseFloat(o))&&isFinite(o)){var i=this.getNumberAt(t,n);if(i){var a=i.value.indexOf(".")>=0?i.start+i.value.indexOf(".")+1:i.end,s=i.start+i.value.length-a,l=parseFloat(i.value);l*=Math.pow(10,s),a!==i.end&&n=s&&a<=l&&(n=t,u.selection.clearSelection(),u.moveCursorTo(e,s+r),u.selection.selectTo(e,l+r)),s=l}));for(var c,f=this.$toggleWordPairs,d=0;dh+1)break;h=p.last}for(c--,s=this.session.$moveLines(d,h,t?0:e),t&&-1==e&&(f=c+1);f<=c;)a[f].moveBy(s,0),f++;t||(s=0),l+=s}o.fromOrientedRange(o.ranges[0]),o.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,o=e*Math.floor(r.height/r.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(o,0)})):!1===t&&(this.selection.moveCursorBy(o,0),this.selection.clearSelection());var i=n.scrollTop;n.scrollBy(0,o*r.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(i)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new b(this.session,n.row,n.column),o=r.getCurrentToken(),i=o||r.stepForward();if(i){var a,s,l=!1,u={},c=n.column-i.start,f={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(i.value.match(/[{}()\[\]]/g)){for(;c=0;--i)this.$tryReplace(n[i],e)&&r++;return this.selection.setSelectionRange(o),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.mixin(t,e);var o=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(o)||this.$search.$options.needle)||(o=this.session.getWordRange(o.start.row,o.start.column),e=this.session.getTextRange(o)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:o});var i=this.$search.find(this.session);return t.preventScroll?i:i?(this.revealRange(i,n),i):(t.backwards?o.start=o.end:o.end=o.start,void this.selection.setRange(o))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach((function(e){e.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var o=this.$scrollAnchor;o.style.cssText="position:absolute",this.container.insertBefore(o,this.container.firstChild);var i=this.on("changeSelection",(function(){r=!0})),a=this.renderer.on("beforeRender",(function(){r&&(t=n.renderer.container.getBoundingClientRect())})),s=this.renderer.on("afterRender",(function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,i=e.$cursorLayer.$pixelPos,a=e.layerConfig,s=i.top-a.offset;null!=(r=i.top>=0&&s+t.top<0||!(i.topwindow.innerHeight)&&null)&&(o.style.top=s+"px",o.style.left=i.left+"px",o.style.height=a.lineHeight+"px",o.scrollIntoView(r)),r=t=null}}));this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",i),this.renderer.off("afterRender",s),this.renderer.off("beforeRender",a))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,o.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,n){var r=this;v.loadModule("./ext/prompt",(function(o){o.prompt(r,e,t,n)}))}}.call(w.prototype),v.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?x.attach(this):x.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?x.attach(this):x.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.getValue());if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),o.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(e||this.renderer.placeholderNode)!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),o.addCssClass(this.container,"ace_hasPlaceholder");var t=o.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var x={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=w})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var r=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,n){this.$fromUndo||e!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,r=n.length;r--;){var o=n[r][0];if(o.id<=e)break;o.id0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?s(e):s(this.$undoStack)+"\n---\n"+s(this.$redoStack)}}).call(r.prototype);var o=e("./range").Range,i=o.comparePoints;o.comparePoints;function a(e){return{row:e.row,column:e.column}}function s(e){if(e=e||this,Array.isArray(e))return e.map(s).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function u(e,t){var n="insert"==e.action,r="insert"==t.action;if(n&&r)if(i(t.start,e.end)>=0)d(t,e,-1);else{if(!(i(t.start,e.start)<=0))return null;d(e,t,1)}else if(n&&!r)if(i(t.start,e.end)>=0)d(t,e,-1);else{if(!(i(t.end,e.start)<=0))return null;d(e,t,-1)}else if(!n&&r)if(i(t.start,e.start)>=0)d(t,e,1);else{if(!(i(t.start,e.start)<=0))return null;d(e,t,1)}else if(!n&&!r)if(i(t.start,e.start)>=0)d(t,e,1);else{if(!(i(t.end,e.start)<=0))return null;d(e,t,-1)}return[t,e]}function c(e,t){for(var n=e.length;n--;)for(var r=0;r=0?d(e,t,-1):(i(e.start,t.start)<=0||d(e,o.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!n&&r)i(t.start,e.end)>=0?d(t,e,-1):(i(t.start,e.start)<=0||d(t,o.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!n&&!r)if(i(t.start,e.end)>=0)d(t,e,-1);else{var a,s;if(!(i(t.end,e.start)<=0))return i(e.start,t.start)<0&&(a=e,e=p(e,t.start)),i(e.end,t.end)>0&&(s=p(e,t.end)),h(t.end,e.start,e.end,-1),s&&!a&&(e.lines=s.lines,e.start=s.start,e.end=s.end,s=e),[t,a,s].filter(Boolean);d(e,t,-1)}return[t,e]}function d(e,t,n){h(e.start,t.start,t.end,n),h(e.end,t.start,t.end,n)}function h(e,t,n,r){e.row==(1==r?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function p(e,t){var n=e.lines,r=e.end;e.end=a(t);var o=e.end.row-e.start.row,i=n.splice(o,n.length),s=o?t.column:t.column-e.start.column;return n.push(i[0].substring(0,s)),i[0]=i[0].substr(s),{start:a(t),end:r,lines:i,action:e.action}}function g(e,t){t=function(e){return{start:a(e.start),end:a(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var r=e[n],o=0;oi&&(l=o.end.row+1,i=(o=t.getNextFoldLine(l,o))?o.start.row:1/0),l>r){for(;this.$lines.getLength()>s+1;)this.$lines.pop();break}(a=this.$lines.get(++s))?a.row=l:(a=this.$lines.createCell(l,e,this.session,u),this.$lines.push(a)),this.$renderCell(a,e,o,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,o=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(o=t.getLength()+r-1);var i=n?n.getWidth(t,o,e):o.toString().length*e.characterWidth,a=this.$padding||this.$computePadding();(i+=a.left+a.right)===this.gutterWidth||isNaN(i)||(this.gutterWidth=i,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",i))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var o=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&o&&o.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}}}},this.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r0;o--)this.$lines.shift();if(r>n)for(o=this.session.getFoldedRowCount(n+1,r);o>0;o--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){for(var r=[],o=t,i=this.session.getNextFoldLine(o),a=i?i.start.row:1/0;o>a&&(o=i.end.row+1,a=(i=this.session.getNextFoldLine(o,i))?i.start.row:1/0),!(o>n);){var s=this.$lines.createCell(o,e,this.session,u);this.$renderCell(s,e,i,o),r.push(s),o++}return r},this.$renderCell=function(e,t,n,o){var i=e.element,a=this.session,s=i.childNodes[0],l=i.childNodes[1],u=a.$firstLineNumber,c=a.$breakpoints,f=a.$decorations,d=a.gutterRenderer||this.$renderer,h=this.$showFoldWidgets&&a.foldWidgets,p=n?n.start.row:Number.MAX_VALUE,g="ace_gutter-cell ";if(this.$highlightGutterLine&&(o==this.$cursorRow||n&&o=p&&this.$cursorRow<=n.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),c[o]&&(g+=c[o]),f[o]&&(g+=f[o]),this.$annotations[o]&&(g+=this.$annotations[o].className),i.className!=g&&(i.className=g),h){var m=h[o];null==m&&(m=h[o]=a.getFoldWidget(o))}if(m){g="ace_fold-widget ace_"+m;"start"==m&&o==p&&on.right-t.right?"foldWidgets":void 0}}).call(l.prototype),t.Gutter=l})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,n){"use strict";var r=e("../range").Range,o=e("../lib/dom"),i=function(e){this.element=o.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var r=this.markers[n];if(r.range){var o=r.range.clipRows(e.firstRow,e.lastRow);if(!o.isEmpty())if(o=o.toScreenRange(this.session),r.renderer){var i=this.$getTop(o.start.row,e),a=this.$padding+o.start.column*e.characterWidth;r.renderer(t,o,a,i,e)}else"fullLine"==r.type?this.drawFullLineMarker(t,o,r.clazz,e):"screenLine"==r.type?this.drawScreenLineMarker(t,o,r.clazz,e):o.isMultiLine()?"text"==r.type?this.drawTextMarker(t,o,r.clazz,e):this.drawMultiLineMarker(t,o,r.clazz,e):this.drawSingleLineMarker(t,o,r.clazz+" ace_start ace_br15",e)}else r.update(t,this,this.session,e)}if(-1!=this.i)for(;this.id?4:0)|(u==l?8:0)),o,u==l?0:1,i)},this.drawMultiLineMarker=function(e,t,n,r,o){var i=this.$padding,a=r.lineHeight,s=this.$getTop(t.start.row,r),l=i+t.start.column*r.characterWidth;(o=o||"",this.session.$bidiHandler.isBidiRow(t.start.row))?((u=t.clone()).end.row=u.start.row,u.end.column=this.session.getLine(u.start.row).length,this.drawBidiSingleLineMarker(e,u,n+" ace_br1 ace_start",r,null,o)):this.elt(n+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+s+"px;left:"+l+"px;"+(o||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var u;(u=t.clone()).start.row=u.end.row,u.start.column=0,this.drawBidiSingleLineMarker(e,u,n+" ace_br12",r,null,o)}else{s=this.$getTop(t.end.row,r);var c=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+a+"px;width:"+c+"px;top:"+s+"px;left:"+i+"px;"+(o||""))}if(!((a=(t.end.row-t.start.row-1)*r.lineHeight)<=0)){s=this.$getTop(t.start.row+1,r);var f=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(f?" ace_br"+f:""),"height:"+a+"px;right:0;top:"+s+"px;left:"+i+"px;"+(o||""))}},this.drawSingleLineMarker=function(e,t,n,r,o,i){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,o,i);var a=r.lineHeight,s=(t.end.column+(o||0)-t.start.column)*r.characterWidth,l=this.$getTop(t.start.row,r),u=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+a+"px;width:"+s+"px;top:"+l+"px;left:"+u+"px;"+(i||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,o,i){var a=r.lineHeight,s=this.$getTop(t.start.row,r),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(n,"height:"+a+"px;width:"+e.width+(o||0)+"px;top:"+s+"px;left:"+(l+e.left)+"px;"+(i||""))}),this)},this.drawFullLineMarker=function(e,t,n,r,o){var i=this.$getTop(t.start.row,r),a=r.lineHeight;t.start.row!=t.end.row&&(a+=this.$getTop(t.end.row,r)-i),this.elt(n,"height:"+a+"px;top:"+i+"px;left:0;right:0;"+(o||""))},this.drawScreenLineMarker=function(e,t,n,r,o){var i=this.$getTop(t.start.row,r),a=r.lineHeight;this.elt(n,"height:"+a+"px;top:"+i+"px;left:0;right:0;"+(o||""))}}).call(i.prototype),t.Marker=i})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],(function(e,t,n){"use strict";var r=e("../lib/oop"),o=e("../lib/dom"),i=e("../lib/lang"),a=e("./lines").Lines,s=e("../lib/event_emitter").EventEmitter,l=function(e){this.dom=o,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)};(function(){r.implement(this,s),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,"string"==typeof e?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;nc&&(s=l.end.row+1,c=(l=this.session.getNextFoldLine(s,l))?l.start.row:1/0),!(s>o);){var f=i[a++];if(f){this.dom.removeChildren(f),this.$renderLine(f,s,s==c&&l),u&&(f.style.top=this.$lines.computeLineTop(s,e,this.session)+"px");var d=e.lineHeight*this.session.getRowLength(s)+"px";f.style.height!=d&&(u=!0,f.style.height=d)}s++}if(u)for(;a0;o--)this.$lines.shift();if(t.lastRow>e.lastRow)for(o=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);o>0;o--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){for(var r=[],i=t,a=this.session.getNextFoldLine(i),s=a?a.start.row:1/0;i>s&&(i=a.end.row+1,s=(a=this.session.getNextFoldLine(i,a))?a.start.row:1/0),!(i>n);){var l=this.$lines.createCell(i,e,this.session),u=l.element;this.dom.removeChildren(u),o.setStyle(u.style,"height",this.$lines.computeLineHeight(i,e,this.session)+"px"),o.setStyle(u.style,"top",this.$lines.computeLineTop(i,e,this.session)+"px"),this.$renderLine(u,i,i==s&&a),this.$useLineGroups()?u.className="ace_line_group":u.className="ace_line",r.push(l),i++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){for(var o,a=this,s=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,l=this.dom.createFragment(this.element),u=0;o=s.exec(r);){var c=o[1],f=o[2],d=o[3],h=o[4],p=o[5];if(a.showSpaces||!f){var g=u!=o.index?r.slice(u,o.index):"";if(u=o.index+o[0].length,g&&l.appendChild(this.dom.createTextNode(g,this.element)),c){var m=a.session.getScreenTabSize(t+o.index);l.appendChild(a.$tabStrings[m].cloneNode(!0)),t+=m-1}else if(f){if(a.showSpaces)(b=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",b.textContent=i.stringRepeat(a.SPACE_CHAR,f.length),l.appendChild(b);else l.appendChild(this.com.createTextNode(f,this.element))}else if(d){(b=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",b.textContent=i.stringRepeat(a.SPACE_CHAR,d.length),l.appendChild(b)}else if(h){t+=1,(b=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",b.className=a.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",b.textContent=a.showSpaces?a.SPACE_CHAR:h,l.appendChild(b)}else if(p){t+=1,(b=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",b.className="ace_cjk",b.textContent=p,l.appendChild(b)}}}if(l.appendChild(this.dom.createTextNode(u?r.slice(u):r,this.element)),this.$textToken[n.type])e.appendChild(l);else{var v="ace_"+n.type.replace(/\./g," ace_"),b=this.dom.createElement("span");"fold"==n.type&&(b.style.width=n.value.length*this.config.characterWidth+"px"),b.className=v,b.appendChild(l),e.appendChild(b)}return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(" "==t[0]){for(var o=(r-=r%this.tabSize)/this.tabSize,i=0;i=a;)s=this.$renderToken(l,s,c,f.substring(0,a-r)),f=f.substring(a-r),r=a,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(i.stringRepeat(" ",n.indent),this.element)),s=0,a=n[++o]||Number.MAX_VALUE;0!=f.length&&(r+=f.length,s=this.$renderToken(l,s,c,f))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,s,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],o=r.value;this.displayIndentGuides&&(o=this.renderIndentGuide(e,o)),o&&(n=this.$renderToken(e,n,r,o));for(var i=1;ithis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,o);n=this.$renderToken(e,n,r,o)}},this.$renderOverflowMessage=function(e,t,n,r,o){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var i=this.dom.createElement("span");i.className="ace_inline_button ace_keyword ace_toggle_wrap",i.textContent=o?"":"",e.appendChild(i)},this.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else r=this.session.getTokens(t);var o=e;if(r.length){var i=this.session.getRowSplitData(t);if(i&&i.length){this.$renderWrappedLine(e,r,i);o=e.lastChild}else{o=e;this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o)),this.$renderSimpleLine(o,r)}}else this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o));if(this.showEOL&&o){n&&(t=n.end.row);var a=this.dom.createElement("span");a.className="ace_invisible ace_invisible_eol",a.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,o.appendChild(a)}},this.$getFoldLineTokens=function(e,t){var n=this.session,r=[];var o=n.getTokens(e);return t.walk((function(e,t,i,a,s){null!=e?r.push({type:"fold",value:e}):(s&&(o=n.getTokens(t)),o.length&&function(e,t,n){for(var o=0,i=0;i+e[o].value.lengthn-t&&(a=a.substring(0,n-t)),r.push({type:e[o].type,value:a}),i=t+a.length,o+=1);in?r.push({type:e[o].type,value:a.substring(0,n-i)}):r.push(e[o]),i+=a.length,o+=1}}(o,a,i))}),t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(l.prototype),t.Text=l})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var r=e("../lib/dom"),o=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this)),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout((function(){e(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){e(!0),t()}),this.blinkInterval),t()}else this.$stopCssAnimation()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||a.top<0)&&n>1)){var s=this.cursors[o++]||this.addCursor(),l=s.style;this.drawCursor?this.drawCursor(s,a,e,t[n],this.session):this.isCursorInView(a,e)?(r.setStyle(l,"display","block"),r.translate(s,a.left,a.top),r.setStyle(l,"width",Math.round(e.characterWidth)+"px"),r.setStyle(l,"height",e.lineHeight+"px")):r.setStyle(l,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=a,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(o.prototype),t.Cursor=o})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,n){"use strict";var r=e("./lib/oop"),o=e("./lib/dom"),i=e("./lib/event"),a=e("./lib/event_emitter").EventEmitter,s=32768,l=function(e){this.element=o.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=o.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,i.addListener(this.element,"scroll",this.onScroll.bind(this)),i.addListener(this.element,"mousedown",i.preventDefault)};(function(){r.implement(this,a),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(l.prototype);var u=function(e,t){l.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=o.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(u,l),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>s?(this.coeff=s/e,e=s):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(u.prototype);var c=function(e,t){l.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(c,l),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(c.prototype),t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=c,t.VScrollBar=u,t.HScrollBar=c})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,n){"use strict";var r=e("./lib/event"),o=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(o.prototype),t.RenderLoop=o})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(e,t,n){var r=e("../lib/oop"),o=e("../lib/dom"),i=e("../lib/lang"),a=e("../lib/event"),s=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,u=256,c="function"==typeof ResizeObserver,f=200,d=t.FontMetrics=function(e){this.el=o.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=o.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=o.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=i.stringRepeat("X",u),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,l),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",s.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver((function(t){e.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=a.onIdle((function t(){e.checkForSizeChanges(),a.onIdle(t,500)}),500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/u};return 0===t.width||0===t.height?null:t},this.$measureCharWidth=function(e){return this.$main.textContent=i.stringRepeat(e,u),this.$main.getBoundingClientRect().width/u},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t&&t.parentElement?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=o.buildDom([e(0,0),e(f,0),e(0,f),e(f,f)],this.el)},this.transformCoordinates=function(e,t){e&&(e=i(1/this.$getZoom(this.el),e));function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function o(e,t){return[e[0]+t[0],e[1]+t[1]]}function i(e,t){return[e*t[0],e*t[1]]}function a(e){var t=e.getBoundingClientRect();return[t.left,t.top]}this.els||this.$initTransformMeasureNodes();var s=a(this.els[0]),l=a(this.els[1]),u=a(this.els[2]),c=a(this.els[3]),d=n(r(c,l),r(c,u),r(o(l,u),o(c,s))),h=i(1+d[0],r(l,s)),p=i(1+d[1],r(u,s));if(t){var g=t,m=d[0]*g[0]/f+d[1]*g[1]/f+1,v=o(i(g[0],h),i(g[1],p));return o(i(1/m/f,v),s)}var b=r(e,s),y=n(r(h,i(d[0],b)),r(p,i(d[1],b)),b);return i(f,y)}}).call(d.prototype)})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],(function(e,t,n){"use strict";var r=e("./lib/oop"),o=e("./lib/dom"),i=e("./config"),a=e("./layer/gutter").Gutter,s=e("./layer/marker").Marker,l=e("./layer/text").Text,u=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,f=e("./scrollbar").VScrollBar,d=e("./renderloop").RenderLoop,h=e("./layer/font_metrics").FontMetrics,p=e("./lib/event_emitter").EventEmitter,g='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',m=e("./lib/useragent"),v=m.isIE;o.importCssString(g,"ace_editor.css");var b=function(e,t){var n=this;this.container=e||o.createElement("div"),o.addCssClass(this.container,"ace_editor"),o.HI_DPI&&o.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=o.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=o.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=o.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new a(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new s(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new s(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new f(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new h(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)})),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),i.resetOptions(this),i._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,p),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),o.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var o=this.container;r||(r=o.clientHeight||o.scrollHeight),n||(n=o.clientWidth||o.scrollWidth);var i=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(i|this.$changes,!0):this.$loop.schedule(i|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var i=0,a=this.$size,s={width:a.width,height:a.height,scrollerHeight:a.scrollerHeight,scrollerWidth:a.scrollerWidth};if(r&&(e||a.height!=r)&&(a.height=r,i|=this.CHANGE_SIZE,a.scrollerHeight=a.height,this.$horizScroll&&(a.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",i|=this.CHANGE_SCROLL),n&&(e||a.width!=n)){i|=this.CHANGE_SIZE,a.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,o.setStyle(this.scrollBarH.element.style,"left",t+"px"),o.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),a.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),o.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";o.setStyle(this.scrollBarH.element.style,"right",l),o.setStyle(this.scroller.style,"right",l),o.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(i|=this.CHANGE_FULL)}return a.$dirty=!n||!r,i&&this._signal("resize",s),i},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=o.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=o.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,i=n.top,a=n.left;i-=r.offset;var s=t&&t.useTextareaForIME?this.lineHeight:v?0:1;if(i<0||i>r.height-s)o.translate(this.textarea,0,0);else{var l=1,u=this.$size.height-s;if(t)if(t.useTextareaForIME){var c=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(c)[0]}else i+=this.lineHeight+2;else i+=this.lineHeight;(a-=this.scrollLeft)>this.$size.scrollerWidth-l&&(a=this.$size.scrollerWidth-l),a+=this.gutterWidth+this.margin.left,o.setStyle(e,"height",s+"px"),o.setStyle(e,"width",l+"px"),o.translate(this.textarea,Math.min(a,this.$size.scrollerWidth-l),Math.min(i,u))}}}else o.translate(this.textarea,-100,0)}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var o=this.scrollMargin;o.top=0|e,o.bottom=0|t,o.right=0|r,o.left=0|n,o.v=o.top+o.bottom,o.h=o.left+o.right,o.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-o.top),this.updateFull()},this.setMargin=function(e,t,n,r){var o=this.margin;o.top=0|e,o.bottom=0|t,o.right=0|r,o.left=0|n,o.v=o.top+o.bottom,o.h=o.left+o.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),o.translate(this.content,-this.scrollLeft,-n.offset);var i=n.width+2*this.$padding+"px",a=n.minHeight+"px";o.setStyle(this.content.style,"width",i),o.setStyle(this.content.style,"height",a)}if(e&this.CHANGE_H_SCROLL&&(o.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",e)}else this.$changes|=e},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var o=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,o,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,o=this.$getLongestLine(),i=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-o-2*this.$padding<0),a=this.$horizScroll!==i;a&&(this.$horizScroll=i,this.scrollBarH.setVisible(i));var s=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,u=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=u;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,r-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,o+2*this.$padding-t.scrollerWidth+c.right)));var f=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+u<0||this.scrollTop>c.top),d=s!==f;d&&(this.$vScroll=f,this.scrollBarV.setVisible(f));var h,p,g=this.scrollTop%this.lineHeight,m=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight)),b=v+m,y=this.lineHeight;v=e.screenToDocumentRow(v,0);var w=e.getFoldLine(v);w&&(v=w.start.row),h=e.documentToScreenRow(v,0),p=e.getRowLength(v)*y,b=Math.min(e.screenToDocumentRow(b,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(b)*y+p,g=this.scrollTop-h*y;var x=0;return(this.layerConfig.width!=o||a)&&(x=this.CHANGE_H_SCROLL),(a||d)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),d&&(o=this.$getLongestLine())),this.layerConfig={width:o,padding:this.$padding,firstRow:v,firstRowScreen:h,lastRow:b,lineHeight:y,characterWidth:this.characterWidth,minHeight:l,maxHeight:r,offset:g,gutterOffset:y?Math.max(0,Math.ceil((g+t.height-t.scrollerHeight)/y)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(o-this.$padding),x},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var r=this.$cursorLayer.getPixelPosition(e),o=r.left,i=r.top,a=n&&n.top||0,s=n&&n.bottom||0,l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+a>i?(t&&l+a>i+this.lineHeight&&(i-=t*this.$size.scrollerHeight),0===i&&(i=-this.scrollMargin.top),this.session.setScrollTop(i)):l+this.$size.scrollerHeight-so?(o=1-this.scrollMargin.top||(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0)))},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var o=e+this.scrollLeft-n.left-this.$padding,i=o/this.characterWidth,a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),s=this.$blockCursor?Math.floor(i):Math.round(i);return{row:a,column:s,side:i-s>0?1:-1,offsetX:o}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var o=e+this.scrollLeft-n.left-this.$padding,i=o/this.characterWidth,a=this.$blockCursor?Math.floor(i):Math.round(i),s=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(s,Math.max(a,0),o)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),o=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),i=r.row*this.lineHeight;return{pageX:n.left+o-this.scrollLeft,pageY:n.top+i-this.scrollTop}},this.visualizeFocus=function(){o.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){o.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(o.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),o.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(e,t,n,r){var o=this.session;o.bgTokenizer.lines[n]=null;var i={type:t,value:e},a=o.getTokens(n);if(null==r)a.push(i);else for(var s=0,l=0;l50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype);t.UIWorkerClient=function(e,t,n){var r=null,o=!1,s=Object.create(i),u=[],c=new l({messageBuffer:u,terminate:function(){},postMessage:function(e){u.push(e),r&&(o?setTimeout(f):f())}});c.setEmitSync=function(e){o=e};var f=function(){var e=u.shift();e.command?r[e.command].apply(r,e.args):e.event&&s._signal(e.event,e.data)};return s.postMessage=function(e){c.onMessage({data:e})},s.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},s.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},a.loadModule(["worker",t],(function(e){for(r=new e[n](s);u.length;)f()})),c},t.WorkerClient=l,t.createWorker=s})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,n){"use strict";var r=e("./range").Range,o=e("./lib/event_emitter").EventEmitter,i=e("./lib/oop"),a=function(e,t,n,r,o,i){var a=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=o,this.othersClass=i,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout((function(){a.onCursorChange()}))},this.$pos=n;var s=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=s.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){i.implement(this,o),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var o=this.pos;o.$insertRight=!0,o.detach(),o.markerId=n.addMarker(new r(o.row,o.column,o.row,o.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)})),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach((function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)}))}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,i=t.start.column-this.pos.column;if(this.updateAnchors(e),o&&(this.length+=n),o&&!this.session.$fromUndo)if("insert"===e.action)for(var a=this.others.length-1;a>=0;a--){var s={row:(l=this.others[a]).row,column:l.column+i};this.doc.insertMergedLines(s,e.lines)}else if("remove"===e.action)for(a=this.others.length-1;a>=0;a--){var l;s={row:(l=this.others[a]).row,column:l.column+i};this.doc.remove(new r(s.row,s.column,s.row,s.column-n))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,o){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),o,null,!1)};n(this.pos,this.mainClass);for(var o=this.others.length;o--;)n(this.others[o],this.othersClass)}},this.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var r=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new r(t.multiSelectCommands)})),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],(function(e,t,n){var r=e("./range_list").RangeList,o=e("./range").Range,i=e("./selection").Selection,a=e("./mouse/multi_select_handler").onMouseDown,s=e("./lib/event"),l=e("./lib/lang"),u=e("./commands/multi_select_commands");t.commands=u.defaultCommands.concat(u.multiSelectCommands);var c=new(0,e("./search").Search);var f=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(f.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var r=this.rangeList.add(e);return this.$onAddRange(e),r.length&&this.$onRemoveRange(r),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],n=0;n1){var e=this.rangeList.ranges,t=e[e.length-1],n=o.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),i=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,i).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],i=e.column0;)b--;if(b>0)for(var y=0;r[y].isEmpty();)y++;for(var w=b;w>=y;w--)r[w].isEmpty()&&r.splice(w,1)}return r}}.call(i.prototype);var d=e("./editor").Editor;function h(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",a),e.commands.addCommands(u.defaultCommands),function(e){if(!e.textInput)return;var t=e.textInput.getElement(),n=!1;function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}s.addListener(t,"keydown",(function(t){var o=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&o?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),e),s.addListener(t,"keyup",r,e),s.addListener(t,"blur",r,e)}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var o=t.indexOf(r);-1!=o&&t.splice(o,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(u.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(u.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?r=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?r=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r,o=n&&n.keepOrder,a=1==n||n&&n.$byLines,s=this.session,l=this.selection,u=l.rangeList,c=(o?l:u).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var f=l._eventRegistry;l._eventRegistry={};var d=new i(s);this.inVirtualSelectionMode=!0;for(var h=c.length;h--;){if(a)for(;h>0&&c[h].start.row==c[h-1].end.row;)h--;d.fromOrientedRange(c[h]),d.index=h,this.selection=s.selection=d;var p=e.exec?e.exec(this,t||{}):e(this,t||{});r||void 0===p||(r=p),d.toOrientedRange(c[h])}d.detach(),this.selection=s.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=f,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var g=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),g&&g.from==g.to&&this.renderer.animateScrolling(g.from),r}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;ra&&(a=n.column),rc?e.insert(r,l.stringRepeat(" ",i-c)):e.remove(new o(r.row,r.column,r.row,r.column-i+c)),t.start.column=t.end.column=a,t.start.row=t.end.row=r.row,t.cursor=t.end})),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),f=c.start.row,d=c.end.row,h=f==d;if(h){var p,g=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d0);f<0&&(f=0),d>=g&&(d=g-1)}var m=this.session.removeFullLines(f,d);m=this.$reAlignText(m,h),this.session.insert({row:f,column:0},m.join("\n")+"\n"),h||(c.start.column=0,c.end.column=m[m.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){var n,r,o,i=!0,a=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,r=t[2].length,o=t[3].length,t):(n+r+o!=t[1].length+t[2].length+t[3].length&&(a=!1),n!=t[1].length&&(i=!1),n>t[1].length&&(n=t[1].length),rt[3].length&&(o=t[3].length),t):[e]})).map(t?u:i?a?function(e){return e[2]?s(n+r-e[2].length)+e[2]+s(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:u:function(e){return e[2]?s(n)+e[2]+s(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function s(e){return l.stringRepeat(" ",e)}function u(e){return e[2]?s(n)+e[2]+s(r-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=h,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){h(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",a)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",a))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var r=e("../../range").Range,o=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var o=/\S/,i=e.getLine(t),a=i.search(o);if(-1!=a){for(var s=n||i.length,l=e.getLength(),u=t,c=t;++tu){var h=e.getLine(c).length;return new r(u,s,c,h)}}},this.openingBracketBlock=function(e,t,n,o,i){var a={row:n,column:o+1},s=e.$findClosingBracket(t,a,i);if(s){var l=e.foldWidgets[s.row];return null==l&&(l=e.getFoldWidget(s.row)),"start"==l&&s.row>a.row&&(s.row--,s.column=e.getLine(s.row).length),r.fromPoints(a,s)}},this.closingBracketBlock=function(e,t,n,o,i){var a={row:n,column:o},s=e.$findOpeningBracket(t,a);if(s)return s.column++,a.column--,r.fromPoints(s,a)}}).call(o.prototype)})),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var r=e("./lib/dom");function o(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}(function(){this.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach((function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)})),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach((function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))}))}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var r=e.data,o=r.start.row,i=r.end.row,a="add"==e.action,s=o+1;st[n].column&&n++,i.unshift(n,0),t.splice.apply(t,i),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach((function(e,n){if(e)for(t=!1,e.row=n;e.$oldWidget;)e.$oldWidget.row=n,e=e.$oldWidget})),t&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},this.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=r.createElement("div"),e.el.innerHTML=e.html),e.el&&(r.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight)),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);if(e.$fold=n,n){var o=this.session.lineWidgets;e.row!=n.end.row||o[n.start.row]?e.hidden=!0:o[n.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],r=[];n;)r.push(n),n=n.$oldWidget;return r},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var n=this.session._changedWidgets,r=t.layerConfig;if(n&&n.length){for(var o=1/0,i=0;i0&&!r[o];)o--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var a=o;a<=i;a++){var s=r[a];if(s&&s.el)if(s.hidden)s.el.style.top=-100-(s.pixelHeight||0)+"px";else{s._inDocument||(s._inDocument=!0,t.container.appendChild(s.el));var l=t.$cursorLayer.getPixelPosition({row:a,column:0},!0).top;s.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(s.row)),s.el.style.top=l-n.offset+"px";var u=s.coverGutter?0:t.gutterWidth;s.fixedWidth||(u-=t.scrollLeft),s.el.style.left=u+"px",s.fullWidth&&s.screenWidth&&(s.el.style.minWidth=n.width+2*n.padding+"px"),s.fixedWidth?s.el.style.right=t.scrollBar.getWidth()+"px":s.el.style.right=""}}}}}).call(o.prototype),t.LineWidgets=o})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],(function(e,t,n){"use strict";var r=e("../line_widgets").LineWidgets,o=e("../lib/dom"),i=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var a=e.getCursorPosition(),s=a.row,l=n.widgetManager.getWidgetsAtRow(s).filter((function(e){return"errorMarker"==e.type}))[0];l?l.destroy():s-=t;var u,c=function(e,t,n){var r=e.getAnnotations().sort(i.comparePoints);if(r.length){var o=function(e,t,n){for(var r=0,o=e.length-1;r<=o;){var i=r+o>>1,a=n(t,e[i]);if(a>0)r=i+1;else{if(!(a<0))return i;o=i-1}}return-(r+1)}(r,{row:t,column:-1},i.comparePoints);o<0&&(o=-o-1),o>=r.length?o=n>0?0:r.length-1:0===o&&n<0&&(o=r.length-1);var a=r[o];if(a&&n){if(a.row===t){do{a=r[o+=n]}while(a&&a.row===t);if(!a)return r.slice()}var s=[];t=a.row;do{s[n<0?"unshift":"push"](a),a=r[o+=n]}while(a&&a.row==t);return s.length&&s}}}(n,s,t);if(c){var f=c[0];a.column=(f.pos&&"number"!=typeof f.column?f.pos.sc:f.column)||0,a.row=f.row,u=e.renderer.$gutterLayer.$annotations[a.row]}else{if(l)return;u={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(a.row),e.selection.moveToPosition(a);var d={row:a.row,fixedWidth:!0,coverGutter:!0,el:o.createElement("div"),type:"errorMarker"},h=d.el.appendChild(o.createElement("div")),p=d.el.appendChild(o.createElement("div"));p.className="error_widget_arrow "+u.className;var g=e.renderer.$cursorLayer.getPixelPosition(a).left;p.style.left=g+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",h.className="error_widget "+u.className,h.innerHTML=u.text.join("
"),h.appendChild(o.createElement("div"));var m=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(m),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},o.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")})),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],(function(e,t,r){"use strict";e("./lib/fixoldbrowsers");var o=e("./lib/dom"),i=e("./lib/event"),a=e("./range").Range,s=e("./editor").Editor,l=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,c=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.define=n(266),t.edit=function(e,n){if("string"==typeof e){var r=e;if(!(e=document.getElementById(r)))throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof s)return e.env.editor;var a="";if(e&&/input|textarea/i.test(e.tagName)){var l=e;a=l.value,e=o.createElement("pre"),l.parentNode.replaceChild(e,l)}else e&&(a=e.textContent,e.innerHTML="");var u=t.createEditSession(a),f=new s(new c(e),u,n),d={document:u,editor:f,onResize:f.resize.bind(f,null)};return l&&(d.textarea=l),i.addListener(window,"resize",d.onResize),f.on("destroy",(function(){i.removeListener(window,"resize",d.onResize),d.editor.container.env=null})),f.container.env=f.env=d,f},t.createEditSession=function(e,t){var n=new l(e,t);return n.setUndoManager(new u),n},t.Range=a,t.Editor=s,t.EditSession=l,t.UndoManager=u,t.VirtualRenderer=c,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){for(var n in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(n)&&(window.ace[n]=t[n]);window.ace.default=window.ace,e&&(e.exports=window.ace)}))}).call(this,n(106)(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return f}));var r=n(21);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t-1}function u(e,t){return e.apply(null,t)}var c={arr:function(e){return Array.isArray(e)},obj:function(e){return l(Object.prototype.toString.call(e),"Object")},pth:function(e){return c.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return e.nodeType||c.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},nil:function(e){return c.und(e)||null===e},hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},rgb:function(e){return/^rgb/.test(e)},hsl:function(e){return/^hsl/.test(e)},col:function(e){return c.hex(e)||c.rgb(e)||c.hsl(e)},key:function(e){return!r.hasOwnProperty(e)&&!o.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function f(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function d(e,t){var n=f(e),r=s(c.und(n[0])?1:n[0],.1,100),o=s(c.und(n[1])?100:n[1],.1,100),i=s(c.und(n[2])?10:n[2],.1,100),l=s(c.und(n[3])?0:n[3],.1,100),u=Math.sqrt(o/r),d=i/(2*Math.sqrt(o*r)),h=d<1?u*Math.sqrt(1-d*d):0,p=d<1?(d*u-l)/h:-l+u;function g(e){var n=t?t*e/1e3:e;return n=d<1?Math.exp(-n*d*u)*(1*Math.cos(h*n)+p*Math.sin(h*n)):(1+p*n)*Math.exp(-n*u),0===e||1===e?e:1-n}return t?g:function(){var t=a.springs[e];if(t)return t;for(var n=1/6,r=0,o=0;;)if(1===g(r+=n)){if(++o>=16)break}else o=0;var i=r*n*1e3;return a.springs[e]=i,i}}function h(e){return void 0===e&&(e=10),function(t){return Math.ceil(s(t,1e-6,1)*e)*(1/e)}}var p,g,m=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function r(e){return 3*e}function o(e,o,i){return((t(o,i)*e+n(o,i))*e+r(o))*e}function i(e,o,i){return 3*t(o,i)*e*e+2*n(o,i)*e+r(o)}return function(t,n,r,a){if(0<=t&&t<=1&&0<=r&&r<=1){var s=new Float32Array(11);if(t!==n||r!==a)for(var l=0;l<11;++l)s[l]=o(l*e,t,r);return function(e){return t===n&&r===a||0===e||1===e?e:o(u(e),n,a)}}function u(n){for(var a=0,l=1;10!==l&&s[l]<=n;++l)a+=e;--l;var u=a+(n-s[l])/(s[l+1]-s[l])*e,c=i(u,t,r);return c>=.001?function(e,t,n,r){for(var a=0;a<4;++a){var s=i(t,n,r);if(0===s)return t;t-=(o(t,n,r)-e)/s}return t}(n,u,t,r):0===c?u:function(e,t,n,r,i){var a,s,l=0;do{(a=o(s=t+(n-t)/2,r,i)-e)>0?n=s:t=s}while(Math.abs(a)>1e-7&&++l<10);return s}(n,a,a+e,t,r)}}}(),v=(p={linear:function(){return function(e){return e}}},g={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},Circ:function(){return function(e){return 1-Math.sqrt(1-e*e)}},Back:function(){return function(e){return e*e*(3*e-2)}},Bounce:function(){return function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}},Elastic:function(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var n=s(e,1,10),r=s(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(e,t){g[e]=function(){return function(e){return Math.pow(e,t+2)}}})),Object.keys(g).forEach((function(e){var t=g[e];p["easeIn"+e]=t,p["easeOut"+e]=function(e,n){return function(r){return 1-t(e,n)(1-r)}},p["easeInOut"+e]=function(e,n){return function(r){return r<.5?t(e,n)(2*r)/2:1-t(e,n)(-2*r+2)/2}},p["easeOutIn"+e]=function(e,n){return function(r){return r<.5?(1-t(e,n)(1-2*r))/2:(t(e,n)(2*r-1)+1)/2}}})),p);function b(e,t){if(c.fnc(e))return e;var n=e.split("(")[0],r=v[n],o=f(e);switch(n){case"spring":return d(e,t);case"cubicBezier":return u(m,o);case"steps":return u(h,o);default:return u(r,o)}}function y(e){try{return document.querySelectorAll(e)}catch(e){return}}function w(e,t){for(var n=e.length,r=arguments.length>=2?arguments[1]:void 0,o=[],i=0;i1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==a)t=n=r=s;else{var c=s<.5?s*(1+a):s+a-s*a,f=2*s-c;t=u(f,c,i+1/3),n=u(f,c,i),r=u(f,c,i-1/3)}return"rgba("+255*t+","+255*n+","+255*r+","+l+")"}(e):void 0;var t,n}function j(e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(e);if(t)return t[1]}function T(e,t){return c.fnc(e)?e(t.target,t.id,t.total):e}function A(e,t){return e.getAttribute(t)}function R(e,t,n){if(O([n,"deg","rad","turn"],j(t)))return t;var r=a.CSS[t+n];if(!c.und(r))return r;var o=document.createElement(e.tagName),i=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;i.appendChild(o),o.style.position="absolute",o.style.width=100+n;var s=100/o.offsetWidth;i.removeChild(o);var l=s*parseFloat(t);return a.CSS[t+n]=l,l}function L(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?R(e,o,n):o}}function M(e,t){return c.dom(e)&&!c.inp(e)&&(!c.nil(A(e,t))||c.svg(e)&&e[t])?"attribute":c.dom(e)&&O(i,t)?"transform":c.dom(e)&&"transform"!==t&&L(e,t)?"css":null!=e[t]?"object":void 0}function P(e){if(c.dom(e)){for(var t,n=e.style.transform||"",r=/(\w+)\(([^)]*)\)/g,o=new Map;t=r.exec(n);)o.set(t[1],t[2]);return o}}function D(e,t,n,r){var o=l(t,"scale")?1:0+function(e){return l(e,"translate")||"perspective"===e?"px":l(e,"rotate")||l(e,"skew")?"deg":void 0}(t),i=P(e).get(t)||o;return n&&(n.transforms.list.set(t,i),n.transforms.last=t),r?R(e,i,r):i}function I(e,t,n,r){switch(M(e,t)){case"transform":return D(e,t,r,n);case"css":return L(e,t,n);case"attribute":return A(e,t);default:return e[t]||0}}function $(e,t){var n=/^(\*=|\+=|-=)/.exec(e);if(!n)return e;var r=j(e)||0,o=parseFloat(t),i=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return o+i+r;case"-":return o-i+r;case"*":return o*i+r}}function N(e,t){if(c.col(e))return C(e);if(/\s/g.test(e))return e;var n=j(e),r=n?e.substr(0,e.length-n.length):e;return t?r+t:r}function F(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function B(e){for(var t,n=e.points,r=0,o=0;o0&&(r+=F(t,i)),t=i}return r}function z(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*A(e,"r")}(e);case"rect":return function(e){return 2*A(e,"width")+2*A(e,"height")}(e);case"line":return function(e){return F({x:A(e,"x1"),y:A(e,"y1")},{x:A(e,"x2"),y:A(e,"y2")})}(e);case"polyline":return B(e);case"polygon":return function(e){var t=e.points;return B(e)+F(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function H(e,t){var n=t||{},r=n.el||function(e){for(var t=e.parentNode;c.svg(t)&&c.svg(t.parentNode);)t=t.parentNode;return t}(e),o=r.getBoundingClientRect(),i=A(r,"viewBox"),a=o.width,s=o.height,l=n.viewBox||(i?i.split(" "):[0,0,a,s]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:a,h:s,vW:l[2],vH:l[3]}}function W(e,t,n){function r(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var o=H(e.el,e.svg),i=r(),a=r(-1),s=r(1),l=n?1:o.w/o.vW,u=n?1:o.h/o.vH;switch(e.property){case"x":return(i.x-o.x)*l;case"y":return(i.y-o.y)*u;case"angle":return 180*Math.atan2(s.y-a.y,s.x-a.x)/Math.PI}}function U(e,t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=N(c.pth(e)?e.totalLength:e,t)+"";return{original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:c.str(e)||t?r.split(n):[]}}function V(e){return w(e?x(c.arr(e)?e.map(S):S(e)):[],(function(e,t,n){return n.indexOf(e)===t}))}function G(e){var t=V(e);return t.map((function(e,n){return{target:e,id:n,total:t.length,transforms:{list:P(e)}}}))}function q(e,t){var n=E(t);if(/^spring/.test(n.easing)&&(n.duration=d(n.easing)),c.arr(e)){var r=e.length;2===r&&!c.obj(e[0])?e={value:e}:c.fnc(t.duration)||(n.duration=t.duration/r)}var o=c.arr(e)?e:[e];return o.map((function(e,n){var r=c.obj(e)&&!c.pth(e)?e:{value:e};return c.und(r.delay)&&(r.delay=n?0:t.delay),c.und(r.endDelay)&&(r.endDelay=n===o.length-1?t.endDelay:0),r})).map((function(e){return _(e,n)}))}function Y(e,t){var n=[],r=t.keyframes;for(var o in r&&(t=_(function(e){for(var t=w(x(e.map((function(e){return Object.keys(e)}))),(function(e){return c.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),n={},r=function(r){var o=t[r];n[o]=e.map((function(e){var t={};for(var n in e)c.key(n)?n==o&&(t.value=e[n]):t[n]=e[n];return t}))},o=0;o0?requestAnimationFrame(t):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){oe.suspendWhenDocumentHidden&&(re()?e=cancelAnimationFrame(e):(te.forEach((function(e){return e._onDocumentVisibility()})),ne()))})),function(){e||re()&&oe.suspendWhenDocumentHidden||!(te.length>0)||(e=requestAnimationFrame(t))}}();function re(){return!!document&&document.hidden}function oe(e){void 0===e&&(e={});var t,n=0,i=0,a=0,l=0,u=null;function c(e){var t=window.Promise&&new Promise((function(e){return u=e}));return e.finished=t,t}var f=function(e){var t=k(r,e),n=k(o,e),i=Y(n,e),a=G(e.targets),s=J(a,i),l=Z(s,n),u=ee;return ee++,_(t,{id:u,children:[],animatables:a,animations:s,duration:l.duration,delay:l.delay,endDelay:l.endDelay})}(e);c(f);function d(){var e=f.direction;"alternate"!==e&&(f.direction="normal"!==e?"normal":"reverse"),f.reversed=!f.reversed,t.forEach((function(e){return e.reversed=f.reversed}))}function h(e){return f.reversed?f.duration-e:e}function p(){n=0,i=h(f.currentTime)*(1/oe.speed)}function g(e,t){t&&t.seek(e-t.timelineOffset)}function m(e){for(var t=0,n=f.animations,r=n.length;t2||(y=Math.round(y*p)/p)),g.push(y)}var O=h.length;if(O){v=h[0];for(var E=0;E0&&(f.began=!0,v("begin")),!f.loopBegan&&f.currentTime>0&&(f.loopBegan=!0,v("loopBegin")),b<=o&&0!==f.currentTime&&m(0),(b>=p&&f.currentTime!==r||!r)&&m(r),b>o&&b=r&&(i=0,f.remaining&&!0!==f.remaining&&f.remaining--,f.remaining?(n=a,v("loopComplete"),f.loopBegan=!1,"alternate"===f.direction&&d()):(f.paused=!0,f.completed||(f.completed=!0,v("loopComplete"),v("complete"),!f.passThrough&&"Promise"in window&&(u(),c(f)))))}return f.reset=function(){var e=f.direction;f.passThrough=!1,f.currentTime=0,f.progress=0,f.paused=!0,f.began=!1,f.loopBegan=!1,f.changeBegan=!1,f.completed=!1,f.changeCompleted=!1,f.reversePlayback=!1,f.reversed="reverse"===e,f.remaining=f.loop,t=f.children;for(var n=l=t.length;n--;)f.children[n].reset();(f.reversed&&!0!==f.loop||"alternate"===e&&1===f.loop)&&f.remaining++,m(f.reversed?f.duration:0)},f._onDocumentVisibility=p,f.set=function(e,t){return Q(e,t),f},f.tick=function(e){a=e,n||(n=a),b((a+(i-n))*oe.speed)},f.seek=function(e){b(h(e))},f.pause=function(){f.paused=!0,p()},f.play=function(){f.paused&&(f.completed&&f.reset(),f.paused=!1,te.push(f),p(),ne())},f.reverse=function(){d(),f.completed=!f.reversed,p()},f.restart=function(){f.reset(),f.play()},f.remove=function(e){ae(V(e),f)},f.reset(),f.autoplay&&f.play(),f}function ie(e,t){for(var n=t.length;n--;)O(e,t[n].animatable.target)&&t.splice(n,1)}function ae(e,t){var n=t.animations,r=t.children;ie(e,n);for(var o=r.length;o--;){var i=r[o],a=i.animations;ie(e,a),a.length||i.children.length||r.splice(o,1)}n.length||r.length||t.pause()}oe.version="3.2.1",oe.speed=1,oe.suspendWhenDocumentHidden=!0,oe.running=te,oe.remove=function(e){for(var t=V(e),n=te.length;n--;){ae(t,te[n])}},oe.get=I,oe.set=Q,oe.convertPx=R,oe.path=function(e,t){var n=c.str(e)?y(e)[0]:e,r=t||100;return function(e){return{property:e,el:n,svg:H(n),totalLength:z(n)*(r/100)}}},oe.setDashoffset=function(e){var t=z(e);return e.setAttribute("stroke-dasharray",t),t},oe.stagger=function(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?b(t.easing):null,o=t.grid,i=t.axis,a=t.from||0,s="first"===a,l="center"===a,u="last"===a,f=c.arr(e),d=f?parseFloat(e[0]):parseFloat(e),h=f?parseFloat(e[1]):0,p=j(f?e[1]:e)||0,g=t.start||0+(f?d:0),m=[],v=0;return function(e,t,c){if(s&&(a=0),l&&(a=(c-1)/2),u&&(a=c-1),!m.length){for(var b=0;b-1&&te.splice(i,1);for(var l=0;l":".","?":"/","|":"\\"},f={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},d=1;d<20;++d)l[111+d]="f"+d;for(d=0;d<=9;++d)l[d+96]=d.toString();y.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},y.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},y.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},y.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},y.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(b(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},y.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},y.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);s=null},y.init=function(){var e=y(i);for(var t in e)"_"!==t.charAt(0)&&(y[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},y.init(),o.Mousetrap=y,e.exports&&(e.exports=y),void 0===(r=function(){return y}.call(t,n,t,e))||(e.exports=r)}function h(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function p(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return l[e.which]?l[e.which]:u[e.which]?u[e.which]:String.fromCharCode(e.which).toLowerCase()}function g(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function m(e,t,n){return n||(n=function(){if(!s)for(var e in s={},l)e>95&&e<112||l.hasOwnProperty(e)&&(s[l[e]]=e);return s}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function v(e,t){var n,r,o,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o1?d(e,s,n,r):(a=v(e,r),t._callbacks[a.key]=t._callbacks[a.key]||[],u(a.key,a.modifiers,{type:a.action},o,e,i),t._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:e}))}t._handleKey=function(e,t,n){var r,o=u(e,t,n),i={},f=0,d=!1;for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return l}));var r=n(22),o=n(3),i=function(e){var t;return(t={})[e?e+"ClassName":"className"]=Object(o.oneOfType)([o.string,o.func]),t[e?e+"Styles":"styles"]=Object(o.oneOfType)([o.object,o.func]),t},a=Object(r.a)({className:o.string},i("menu"),i("arrow"),{arrow:o.bool,offsetX:o.number,offsetY:o.number,align:Object(o.oneOf)(["start","center","end"]),direction:Object(o.oneOf)(["left","right","top","bottom"]),position:Object(o.oneOf)(["auto","anchor","initial"]),overflow:Object(o.oneOf)(["auto","visible","hidden"])}),s=(o.object,o.bool,o.bool,o.bool,o.bool,o.bool,o.bool,o.number,o.object,o.string,o.string,o.number,o.number,o.number,o.bool,o.string,o.func,o.object,o.func,o.func,{offsetX:0,offsetY:0,align:"start",direction:"bottom",position:"auto",overflow:"visible"}),l=Object(r.a)({},s,{reposition:"auto",viewScroll:"initial",transitionTimeout:500,submenuOpenDelay:300,submenuCloseDelay:150})},function(e,t,n){"use strict";var r=n(102);t.a=function(){for(var e=arguments.length,t=new Array(e),n=0;n-1&&e%1==0&&e=55296&&s<=57343){if(s>=55296&&s<=56319&&i+1=56320&&l<=57343){c+=encodeURIComponent(e[i]+e[i+1]),i++;continue}c+="%EF%BF%BD"}else c+=encodeURIComponent(e[i]);return c}o.defaultChars=";/?:@&=+$,-_.!~*'()#",o.componentChars="-_.!~*'()",e.exports=o},function(e,t,n){"use strict";function r(e,t){for(var n=e.length,r=0;r-1?e[r]:n}var W=function(){var e=B(),t=E&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return t?t.bind(window):function(t){var n=B();return window.setTimeout((function(){t(n-e)}),1e3/60)}}(),U=function(){var e=E&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return e?e.bind(window):function(e){clearTimeout(e)}}();function V(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in t)t.push(n);return t}function G(e,t){var n=F(e),r=n.value,o=n.unit;if(T(t)){var i=t[o];if(i){if(L(i))return i(r);if(C[o])return C[o](r,i)}}else if("%"===o)return r*t/100;return C[o]?C[o](r):r}function q(e,t,n){return[[Z(t[0],_),Z(t[0]*e[1]/e[0],_)],[Z(t[1]*e[0]/e[1],_),Z(t[1],_)]].filter((function(e){return e.every((function(e,r){return n?e<=t[r]:e>=t[r]}))}))[0]||e}function Y(e,t,n,r){if(!r)return e.map((function(e,r){return function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t[r],n[r])}));var o=e[0],i=e[1],a=q(e,t,!1),s=a[0],l=a[1],u=q(e,n,!0),c=u[0],f=u[1];return oc||i>f)&&(o=c,i=f),[o,i]}function K(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}function X(e,t){var n=t[0]-e[0],r=t[1]-e[1],o=Math.atan2(r,n);return o>=0?o:o+2*Math.PI}function Q(e){var t=function(e){return[0,1].map((function(t){return K(e.map((function(e){return e[t]})))}))}(e),n=X(t,e[0]),r=X(t,e[1]);return nr&&r-n<-Math.PI?1:-1}function J(e,t){return Math.sqrt(Math.pow((t?t[0]:0)-e[0],2)+Math.pow((t?t[1]:0)-e[1],2))}function Z(e,t){return t?Math.round(e/t)*t:e}function ee(e,t){return e.forEach((function(n,r){e[r]=Z(e[r],t)})),e}function te(e,t){return e.classList?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function ne(e,t,n,r){e.addEventListener(t,n,r)}function re(e,t,n,r){e.removeEventListener(t,n,r)}function oe(e,t,n,r,o,i){for(var a=0;a=0;--n)t+=e[n];return t}(e.map((function(t,n){var r=e[n+1]||e[0];return t[0]*r[1]-r[0]*t[1]}))))/2}function Ue(e,t){var n=t.width,r=t.height,o=t.left,i=t.top,a=Ve(e),s=a.minX,l=a.minY,u=a.maxX,c=a.maxY,f=n/(u-s),d=r/(c-l);return e.map((function(e){return[o+(e[0]-s)*f,i+(e[1]-l)*d]}))}function Ve(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]}));return{minX:Math.min.apply(Math,t),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,t),maxY:Math.max.apply(Math,n)}}function Ge(e,t,n){var r=e[0],o=e[1],i=Ve(t),a=i.minX,s=i.minY,l=i.maxX,u=i.maxY,c=[[a,o],[l,o]],f=[[r,s],[r,u]],d=qe(c[0],c[1]),h=qe(f[0],f[1]),p=Xe(t),g=[],m=[];return p.forEach((function(e){var t=qe(e[0],e[1]),n=Ke(Ye(d,t),[c,e]),i=Ke(Ye(h,t),[f,e]);1===n.length&&e[0][1]===o||g.push.apply(g,n),1===i.length&&e[0][0]===r||m.push.apply(m,i),t[0]||g.push.apply(g,n),t[1]||m.push.apply(m,i)})),!n&&(z(g,(function(e){return e[0]===r}))>-1||z(m,(function(e){return e[1]===o}))>-1)||!!(g.filter((function(e){return e[0]>r})).length%2&&m.filter((function(e){return e[1]>o})).length%2)}function qe(e,t){var n=e[0],r=e[1],o=t[0],i=t[1];if(n===o&&r===i)return[0,0,0];if(n===o)return[1,0,-n];if(r===i)return[0,1,-r];var a=(o-n)/(r-i);return[1,a,-n-a*r]}function Ye(e,t){var n,r,o=e[0],i=e[1],a=e[2],s=t[0],l=t[1],u=t[2],c=0===o&&0===s,f=0===i&&0===l;if(c&&f)return[];if(c){var d=-a/i;return d!==-u/l?[]:[[-1/0,d],[1/0,d]]}if(f){var h=-a/o;return h!==-u/s?[]:[[h,-1/0],[h,1/0]]}return 0===o?[[n=-(l*(r=-a/i)+u)/s,r]]:0===s?[[n=-(i*(r=-u/l)+a)/o,r]]:0===i?[[n=-a/o,r=-(s*n+u)/l]]:0===l?[[n=-u/s,r=-(o*n+a)/i]]:[[n=(i*u-l*a)/(l*o-i*s),r=-(o*n+a)/i]]}function Ke(e,t){var n=t.map((function(e){return[0,1].map((function(t){return[Math.min(e[0][t],e[1][t]),Math.max(e[0][t],e[1][t])]}))}));if(2===e.length){var r=e[0],o=r[0],i=r[1];if(o===e[1][0]){var a=Math.max.apply(Math,n.map((function(e){return e[1][0]}))),s=Math.min.apply(Math,n.map((function(e){return e[1][1]})));return a>s?[]:[[o,a],[o,s]]}if(i===e[1][1]){var l=Math.max.apply(Math,n.map((function(e){return e[0][0]}))),u=Math.min.apply(Math,n.map((function(e){return e[0][1]})));return l>u?[]:[[l,i],[u,i]]}}return e.filter((function(e){return n.every((function(t){return t[0][0]<=e[0]&&e[0]<=t[0][1]&&t[1][0]<=e[1]&&e[1]<=t[1][1]}))}))}function Xe(e){return function(){for(var e=0,t=0,n=arguments.length;t-1&&r.splice(o,1)}}else this._events[e]=[];else this._events={};return this},t.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise((function(t){n._addEvent(e,t,{once:!0})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var o=!1;return t.eventType=e,t.stop=function(){o=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;tr-i?(s[1]>a.top||rs[1])&&(l[1]=1),a.left>n-i?(s[0]>a.left||ns[0])&&(l[0]=1),clearTimeout(this._timer),!(!l[0]&&!l[1])&&this._continueDrag(nt(nt({},t),{direction:l,inputEvent:e,isDrag:!0}))},n.checkScroll=function(e){var t=this;if(this._isWait)return!1;var n=e.prevScrollPos,r=void 0===n?this._prevScrollPos:n,o=e.direction,i=e.throttleTime,a=void 0===i?0:i,s=e.inputEvent,l=e.isDrag,u=this._getScrollPosition(o||[0,0],e),c=u[0]-r[0],f=u[1]-r[1],d=o||[c?Math.abs(c)/c:0,f?Math.abs(f)/f:0];return this._prevScrollPos=u,!(!c&&!f)&&(this.trigger("move",{offsetX:d[0]?c:0,offsetY:d[1]?f:0,inputEvent:s}),a&&l&&(this._timer=window.setTimeout((function(){t._continueDrag(e)}),a)),!0)},n.dragEnd=function(){clearTimeout(this._timer)},n._getScrollPosition=function(e,t){var n=t.container,r=t.getScrollPosition;return(void 0===r?rt:r)({container:n,direction:e})},n._continueDrag=function(e){var t=this,n=e.container,r=e.direction,o=e.throttleTime,i=e.useScroll,a=e.isDrag,s=e.inputEvent;if(!a||!this._isWait){var l=B(),u=Math.max(o+this._prevTime-l,0);if(u>0)return this._timer=window.setTimeout((function(){t._continueDrag(e)}),u),!1;this._prevTime=l;var c=this._getScrollPosition(r,e);return this._prevScrollPos=c,a&&(this._isWait=!0),this.trigger("scroll",{container:n,direction:r,inputEvent:s}),this._isWait=!1,i||this.checkScroll(nt(nt({},e),{prevScrollPos:c,direction:r,inputEvent:s}))}},t}(et),it=ot,at=n(0),st=function(e,t){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},st(e,t)};var lt=function(){return lt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI)/Math.PI);var t,n,r,o,i}function ct(e){return e?e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,g=d.isContentEditable;if(p||g){if(l||f===d)return!1;if(f&&g&&f.isContentEditable&&f.contains(d))return!1}else if((s||"touchstart"===e.type)&&f){var m=f.tagName;(f.isContentEditable||mt.indexOf(m)>-1)&&f.blur()}if(r.clientStores=[new gt(ct(e))],r.flag=!0,r.isDrag=!1,r._dragFlag=!0,r.datas={},a&&(3===e.which||2===e.button))return r.initDrag(),!1;r.doubleFlag=B()-r.prevTime<200,!1===r.emit("dragStart",lt(lt({datas:r.datas,inputEvent:e,isTrusted:t,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()),{preventDefault:function(){e.preventDefault()},preventDrag:function(){r._dragFlag=!1}}))&&r.initDrag(),r.flag&&s&&e.preventDefault()}if(!r.flag)return!1;var v=0;if(c&&u&&i&&(v=setTimeout((function(){ne(o,"touchstart",r.onDragStart,{passive:!1})}))),!c&&u&&i&&re(o,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(v),c&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=ct(e),o=r.moveClients(n,e,!1);if(r._dragFlag){if(r.pinchFlag||o.deltaX||o.deltaY)if(!1===r.emit("drag",lt(lt({},o),{isScroll:!!t,inputEvent:e})))return void r.stop();r.pinchFlag&&r.onPinch(e,n)}r.getCurrentStore().getPosition(n,!0)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,o=t.container;r.isTouch&&n&&re(o,"touchstart",r.onDragStart),r.pinchFlag&&r.onPinchEnd(e);var i=(null==e?void 0:e.touches)?ct(e):[];0!==i.length&&r.options.keepDragging?r._addStore(new gt(i)):r.flag=!1;var a=r._getPosition(),s=B(),l=!r.isDrag&&r.doubleFlag;r.prevTime=r.isDrag||l?0:s,r.flag||(r.emit("dragEnd",lt({datas:r.datas,isDouble:l,isDrag:r.isDrag,isClick:!r.isDrag,inputEvent:e},a)),r.clientStores=[])}},r.onBlur=function(){r.onDragEnd()};var o=[].concat(t);r.options=lt({checkInput:!1,container:o.length>1?window:o[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},n);var i=r.options,a=i.container,s=i.events,l=i.checkWindowBlur;if(r.isTouch=s.indexOf("touch")>-1,r.isMouse=s.indexOf("mouse")>-1,r.targets=o,r.isMouse&&(o.forEach((function(e){ne(e,"mousedown",r.onDragStart)})),ne(a,"mousemove",r.onDrag),ne(a,"mouseup",r.onDragEnd),ne(a,"contextmenu",r.onDragEnd)),l&&ne(window,"blur",r.onBlur),r.isTouch){var u={passive:!1};o.forEach((function(e){ne(e,"touchstart",r.onDragStart,u)})),ne(a,"touchmove",r.onDrag,u),ne(a,"touchend",r.onDragEnd,u),ne(a,"touchcancel",r.onDragEnd,u)}return r}!function(e,t){function n(){this.constructor=e}st(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.stop=function(){this.isDrag=!1,this.flag=!1,this.clientStores=[],this.datas={}},n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isDoubleFlag=function(){return this.doubleFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],o=this.getCurrentStore().prevClients;return this.moveClients(o.map((function(e){var t=e.clientX,o=e.clientY;return{clientX:t+n,clientY:o+r,originalClientX:t,originalClientY:o}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getCurrentEvent=function(e){return lt(lt({datas:this.datas},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:e})},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),re(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){re(t,"mousedown",e.onDragStart)})),re(n,"mousemove",this.onDrag),re(n,"mouseup",this.onDragEnd),re(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){re(t,"touchstart",e.onDragStart)})),re(n,"touchstart",this.onDragStart),re(n,"touchmove",this.onDrag),re(n,"touchend",this.onDragEnd),re(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new gt(ct(e));this.pinchFlag=!0,this._addStore(n),!1===this.emit("pinchStart",lt(lt({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition()),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",lt(lt({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t)),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",lt(lt({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition()),{inputEvent:e}))}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this._getPosition(e,n);return(r.deltaX||r.deltaY)&&(this.isDrag=!0),lt(lt({datas:this.datas},r),{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},n._addStore=function(e){this.clientStores.splice(0,0,e)},n._getPosition=function(e,t){var n=this.getCurrentStore().getPosition(e,t),r=this.clientStores.slice(1).reduce((function(e,t){var n=t.getPosition();return e.distX+=n.distX,e.distY+=n.distY,e}),n),o=r.distX,i=r.distY;return lt(lt({},n),{distX:o,distY:i})},t}(et);var bt=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0};function yt(e,t,n,r){var o=document.createElement("style");return o.setAttribute("type","text/css"),o.setAttribute("data-styled-id",e),n.nonce&&o.setAttribute("nonce",n.nonce),o.innerHTML=function(e,t,n){return n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(t,n){var r=n.trim();return(r?$(r):[""]).map((function(t){var n=t.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?""+n.replace(/\:host/g,"."+e):n?"."+e+" "+n:"."+e})).join(", ")+" {"}))}(e,t,n),(r||document.head||document.body).appendChild(o),o}var wt=function(e){var t,n="rCS"+bt(e).toString(36),r=0;return{className:n,inject:function(o,i){void 0===i&&(i={});var a,s=function(e){if(e&&e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t}}(o),l=0===r;return(s||l)&&(a=yt(n,e,i,s)),l&&(t=a),s||++r,{destroy:function(){s?(o.removeChild(a),a=null):(r>0&&--r,0===r&&t&&(t.parentNode.removeChild(t),t=null))}}}}},xt=function(e,t){return xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},xt(e,t)};function St(e,t){function n(){this.constructor=e}xt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ot=function(){return Ot=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1&&r&&(s={portalContainer:r}),Object(at.createElement)(a,Ot({ref:x(this,"element"),"data-styled-id":i,className:n+" "+i},s,o))},n.componentDidMount=function(){this.injectResult=this.injector.inject(this.element,{nonce:this.props.cspNonce})},n.componentWillUnmount=function(){this.injectResult.destroy(),this.injectResult=null},n.getElement=function(){return this.element},t}(at.Component);var kt=function(e,t){var n=wt(t);return function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.injector=n,r.tag=e,r}return St(r,t),r}(Et)},_t=function(e,t){return _t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},_t(e,t)};function Ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}_t(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var jt=function(){return jt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n')}(1,e),n=45*Math.round(e/45)%180,r="ns-resize";return 135===n?r="nwse-resize":45===n?r="nesw-resize":90===n&&(r="ew-resize"),"cursor:".concat(r,";cursor: url('").concat(t,"') 16 16, ").concat(r,";")}(e),"\n}\n")})).join("\n"),"\n.group {\n z-index: -1;\n}\n.area {\n position: absolute;\n}\n.area-pieces {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n}\n.area.avoid, .area.pass {\n pointer-events: none;\n}\n.area.avoid+.area-pieces {\n display: block;\n}\n.area-piece {\n position: absolute;\n}\n\n").concat(Pt?':global svg *:before {\n\tcontent:"";\n\ttransform-origin: inherit;\n}':"","\n"),$t=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],Nt=1e-7,Ft=1e-9,Bt=Math.pow(10,10),zt=-Bt,Ht=["n","w","s","e","nw","ne","sw","se"],Wt={n:[0,1],s:[2,3],w:[2,0],e:[1,3],nw:[0],ne:[1],sw:[2],se:[3]},Ut={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},Vt=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate"];function Gt(e,t,n,r,o){var i=t.gesto.move(n,e.inputEvent),a=i.originalDatas||i.datas,s=a.draggable||(a.draggable={});return jt(jt({},o?vo(t,i):i),{isDrag:!0,isPinch:!!r,parentEvent:!0,datas:s,originalDatas:e.originalDatas})}var qt=function(){function e(){this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}}}var t=e.prototype;return t.dragStart=function(e,t){this.isDrag=!1,this.isFlag=!1;var n=t.originalDatas;return this.datas=n,n.draggable||(n.draggable={}),jt(jt({},this.move(e,t.inputEvent)),{type:"dragstart"})},t.drag=function(e,t){return this.move([e[0]-this.prevX,e[1]-this.prevY],t)},t.move=function(e,t){var n,r;return this.isFlag?(n=this.prevX+e[0],r=this.prevY+e[1],this.isDrag=!0):(this.prevX=e[0],this.prevY=e[1],this.startX=e[0],this.startY=e[1],n=e[0],r=e[1],this.isFlag=!0),this.prevX=n,this.prevY=r,{type:"drag",clientX:n,clientY:r,inputEvent:t,isDrag:this.isDrag,distX:n-this.startX,distY:r-this.startY,deltaX:e[0],deltaY:e[1],datas:this.datas.draggable,originalDatas:this.datas,parentEvent:!0,parentGesto:this}},e}();function Yt(e,t,n){var r=n.originalDatas;r.groupable=r.groupable||{};var o=r.groupable;o.childDatas=o.childDatas||[];var i=o.childDatas;return e.moveables.map((function(e,r){return i[r]=i[r]||{},i[r][t]=i[r][t]||{},jt(jt({},n),{datas:i[r][t],originalDatas:i[r]})}))}function Kt(e,t,n,r,o,i){var a=!!n.match(/Start$/g),s=!!n.match(/End$/g),l=o.isPinch,u=o.datas,c=Yt(e,t.name,o),f=e.moveables,d=c.map((function(e,o){var c=f[o],d=e;a?d=(new qt).dragStart(r,e):(c.state.gesto||(c.state.gesto=u.childGestos[o]),d=Gt(e,c.state,r,l,i));var h=t[n](c,jt(jt({},d),{parentFlag:!0}));return s&&(c.state.gesto=null),h}));return a&&(u.childGestos=f.map((function(e){return e.state.gesto}))),d}function Xt(e,t,n,r,o,i){void 0===o&&(o=function(e,t){return t});var a=!!n.match(/End$/g),s=Yt(e,t.name,r),l=e.moveables;return s.map((function(e,r){var s,u=l[r];s=o(u,e);var c=t[n](u,jt(jt({},s),{parentFlag:!0}));return c&&i&&i(u,e,c,r),a&&(u.state.gesto=null),c}))}function Qt(e,t,n,r){void 0===r&&(r="");var o=e.state,i=o.renderPoses,a=o.rotation,s=o.direction,l=e.props,u=l.renderDirections,c=void 0===u?t:u,f=l.zoom,d={};if(!c)return[];var h=s>0?1:-1,p=!0===c?Ht:c,g=a/Math.PI*180;return p.forEach((function(e){d[e]=!0})),p.map((function(e){var t=Wt[e];if(!t||!d[e])return null;var o=(Z(g,15)+h*Ut[e]+720)%180;return n.createElement("div",{className:jr("control","direction",e,r),"data-rotation":o,"data-direction":e,key:"direction-".concat(e),style:Jr.apply(void 0,Tt([a,f],t.map((function(e){return i[e]})),!1))})}))}function Jt(e,t,n,r,o,i){for(var a=[],s=6;se&&i>270&&e<90?++a:i270&&--a;var s=t*(360*a+e-r);return n.prevDeg=r+s,s}function rn(e,t,n,r){return nn(X(r.startAbsoluteOrigin,[e,t])/Math.PI*180,n,r)}function on(e,t,n,r,o,i){var a=e.props.throttleRotate,s=void 0===a?0:a,l=r,u=n.prevSnapDeg;i&&(l=function(e,t,n,r){if(!dn(e,"rotatable"))return r;var o=t.pos1,i=t.pos2,a=t.pos3,s=t.pos4,l=r*Math.PI/180,u=[o,i,a,s].map((function(e){return pe(e,n)})),c=u.map((function(e){return xe(e,l)})),f=Tt(Tt([],function(e,t,n,r,o){if(!e.props.bounds)return[];var i=o*Math.PI/180,a=In(e),s=a.left,l=a.top,u=a.right,c=a.bottom,f=s-r[0],d=u-r[0],h=l-r[1],p=c-r[1],g={left:f,top:h,right:d,bottom:p};if(!Nn(n,g,0))return[];var m=[];return[[f,0],[d,0],[h,1],[p,1]].forEach((function(e){var r=e[0],o=e[1];n.forEach((function(e){var n=X([0,0],e);m.push.apply(m,function(e,t,n){var r=Kr(e),o=Math.sqrt(r*r-t*t)||0;return[o,-o].sort((function(t,r){return Math.abs(t-e[n?0:1])-Math.abs(r-e[n?0:1])})).map((function(e){return X([0,0],n?[e,t]:[t,e])}))}(e,r,o).map((function(e){return i+e-n})).filter((function(e){return!Nn(t,g,e)})).map((function(e){return Z(180*e/Math.PI,Nt)})))}))})),m}(e,u,c,n,r),!0),function(e,t,n,r,o){var i=e.props.innerBounds,a=o*Math.PI/180;if(!i)return[];var s=i.left,l=i.top,u=i.width,c=i.height,f=s-r[0],d=s+u-r[0],h=l-r[1],p=l+c-r[1],g=[[f,h],[d,h],[f,p],[d,p]],m=gr(n,[0,0]);if(!Pn(n,g,m,0))return[];var v=[],b=g.map((function(e){return[Kr(e),X([0,0],e)]}));return[[n[0],n[1]],[n[1],n[3]],[n[3],n[2]],[n[2],n[0]]].forEach((function(e){var n=X([0,0],function(e){var t=e[0],n=e[1],r=n[0]-t[0],o=n[1]-t[1];if(!r)return[t[0],0];if(!o)return[0,t[1]];var i=o/r,a=-i*t[0]+t[1];return[-a/(i+1/i),a/(i*i+1)]}(e)),r=function(e){var t=e[0],n=e[1],r=n[0]-t[0],o=n[1]-t[1];if(!r)return Math.abs(t[0]);if(!o)return Math.abs(t[1]);var i=o/r;return Math.abs((-i*t[0]+t[1])/Math.sqrt(Math.pow(i,2)+1))}(e);v.push.apply(v,b.filter((function(e){var t=e[0];return t&&r<=t})).map((function(e){var t=e[0],o=e[1],i=Math.acos(t?r/t:0);return[a+(o+i)-n,a+(o-i)-n]})).reduce((function(e,t){return e.push.apply(e,t),e}),[]).filter((function(e){return!Pn(t,g,m,e)})).map((function(e){return Z(180*e/Math.PI,Nt)})))})),v}(e,u,c,n,r),!0);return f.sort((function(e,t){return Math.abs(e-r)-Math.abs(t-r)})),f.length?f[0]:r}(e,t,n.origin,l));var c=Z(o+l,s),f=c-o;return n.prevSnapDeg=f,[f-u,l,c]}function an(e,t){if(t.isRequest)return"rotatable"===t.requestAble;var n=t.inputEvent.target;if(te(n,jr("rotation-control")))return!0;var r=e.props.rotationTarget;return!!r&&Eo(r,!0).some((function(e){return!!e&&(n===e||n.contains(e))}))}var sn={name:"rotatable",canPinch:!0,props:{rotatable:Boolean,rotationPosition:String,throttleRotate:Number,renderDirections:Object,rotationTarget:Object},events:{onRotateStart:"rotateStart",onBeforeRotate:"beforeRotate",onRotate:"rotate",onRotateEnd:"rotateEnd",onRotateGroupStart:"rotateGroupStart",onBeforeRotateGroup:"beforeRotateGroup",onRotateGroup:"rotateGroup",onRotateGroupEnd:"rotateGroupEnd"},css:[".rotation {\n position: absolute;\n height: 40px;\n width: 1px;\n transform-origin: 50% 100%;\n height: calc(40px * var(--zoom));\n top: auto;\n left: 0;\n bottom: 100%;\n will-change: transform;\n }\n .rotation .rotation-line {\n display: block;\n width: 100%;\n height: 100%;\n transform-origin: 50% 50%;\n }\n .rotation .rotation-control {\n border-color: #4af;\n border-color: var(--moveable-color);\n background:#fff;\n cursor: alias;\n }"],render:function(e,t){var n=e.props,r=n.rotatable,o=n.rotationPosition,i=n.zoom,a=n.renderDirections,s=e.state,l=s.renderPoses,u=s.direction;if(!r)return null;var c=function(e,t,n){var r=t[0],o=t[1],i=t[2],a=t[3];if("none"!==e){var s=(e||"top").split("-"),l=s[0],u=s[1],c=[r,o];"left"===l?c=[i,r]:"right"===l?c=[o,a]:"bottom"===l&&(c=[a,i]);var f=[(c[0][0]+c[1][0])/2,(c[0][1]+c[1][1])/2],d=eo(c,n);if(u){var h="top"===u||"left"===u,p="bottom"===l||"left"===l;f=c[h&&!p||!h&&p?0:1]}return[f,d]}}(o,l,u),f=[];if(c){var d=c[0],h=c[1];f.push(t.createElement("div",{key:"rotation",className:jr("rotation"),style:{transform:"translate(-50%) translate(".concat(d[0],"px, ").concat(d[1],"px) rotate(").concat(h,"rad)")}},t.createElement("div",{className:jr("line rotation-line"),style:{transform:"scaleX(".concat(i,")")}}),t.createElement("div",{className:jr("control rotation-control"),style:{transform:"translate(0.5px) scale(".concat(i,")")}})))}return a&&f.push.apply(f,Qt(e,[],t)),f},dragControlCondition:an,dragControlStart:function(e,t){var n=t.datas,r=t.clientX,o=t.clientY,i=t.parentRotate,a=t.parentFlag,s=t.isPinch,l=t.isRequest,u=e.state,c=u.target,f=u.left,d=u.top,h=u.origin,p=u.beforeOrigin,g=u.direction,m=u.beforeDirection,v=u.targetTransform,b=u.moveableClientRect;if(!l&&!c)return!1;var y=e.getRect();if(n.rect=y,n.transform=v,n.left=f,n.top=d,n.fixedPosition=kr(e,Er(e)),l||s||a){var w=i||0;n.beforeInfo={origin:y.beforeOrigin,prevDeg:w,defaultDeg:w,prevSnapDeg:0},n.afterInfo=jt(jt({},n.beforeInfo),{origin:y.origin}),n.absoluteInfo=jt(jt({},n.beforeInfo),{origin:y.origin,startValue:w})}else n.beforeInfo={origin:y.beforeOrigin},n.afterInfo={origin:y.origin},n.absoluteInfo={origin:y.origin,startValue:y.rotation},tn(e,n.beforeInfo,r,o,p,b),tn(e,n.afterInfo,r,o,h,b),tn(e,n.absoluteInfo,r,o,h,b);n.direction=g,n.beforeDirection=m,n.startValue=0,n.datas={},br(t,"rotate");var x=so(e,t,jt(jt({set:function(e){n.startValue=e*Math.PI/180}},vr(t)),{dragStart:ir.dragStart(e,(new qt).dragStart([0,0],t))})),S=co(e,"onRotateStart",x);return n.isRotate=!1!==S,e.state.snapRenderInfo={request:t.isRequest},!!n.isRotate&&x},dragControl:function(e,t){var n,r,o,i=t.datas,a=t.clientX,s=t.clientY,l=t.parentRotate,u=t.parentFlag,c=t.isPinch,f=t.groupDelta,d=i.beforeDirection,h=i.beforeInfo,p=i.afterInfo,g=i.absoluteInfo,m=i.isRotate,v=i.startValue,b=i.rect;if(m){lr(t,"rotate");var y,w,x,S,O,E,k,_,C,j=function(e){return Yr(e.datas.beforeTransform,[50,50],100,100).direction}(t),T=d*j,A=e.props.parentMoveable,R=180/Math.PI*v,L=g.startValue,M=!1;if(!u&&"parentDist"in t){var P=t.parentDist;w=P,O=P,_=P}else c||u?(w=nn(l,d,h),O=nn(l,T,p),_=nn(l,T,g)):(w=rn(a,s,d,h),O=rn(a,s,T,p),_=rn(a,s,T,g),M=!0);if(co(e,"onBeforeRotate",so(e,t,{beforeRotation:x=R+w,rotation:E=R+O,absoluteRotation:C=L+_,setRotation:function(e){w=O=e-R,_=O}},!0)),y=(n=on(e,b,h,w,R,M))[0],w=n[1],x=n[2],S=(r=on(e,b,p,O,R,M))[0],O=r[1],E=r[2],k=(o=on(e,b,g,_,L,M))[0],_=o[1],C=o[2],k||S||y||A){var D=ur(i,"rotate(".concat(E,"deg)"),"rotate(".concat(O,"deg)")),I=function(e,t,n,r){var o=Er(e);return Or(e,"rotate(".concat(t,"deg)"),o,n,r)}(e,O,i.fixedPosition,i),$=pe(he(f||[0,0],I),i.prevInverseDist||[0,0]);i.prevInverseDist=I,i.requestValue=null;var N=so(e,t,jt({delta:S,dist:O,rotate:E,rotation:E,beforeDist:w,beforeDelta:y,beforeRotate:x,beforeRotation:x,absoluteDist:_,absoluteDelta:k,absoluteRotate:C,absoluteRotation:C,isPinch:!!c},Sr(e,D,$,c,t)));return co(e,"onRotate",N),N}}},dragControlAfter:function(e,t){t.datas.requestValue},dragControlEnd:function(e,t){var n=t.datas;if(n.isRotate){n.isRotate=!1;var r=lo(e,t,{});return co(e,"onRotateEnd",r),r}},dragGroupControlCondition:an,dragGroupControlStart:function(e,t){var n=t.datas,r=e.state,o=r.left,i=r.top,a=r.beforeOrigin,s=this.dragControlStart(e,t);if(!s)return!1;s.set(n.beforeDirection*e.rotation);var l=Xt(e,this,"dragControlStart",t,(function(e,t){var n=e.state,r=n.left,s=n.top,l=n.beforeOrigin,u=he(pe([r,s],[o,i]),pe(l,a));return t.datas.groupClient=u,jt(jt({},t),{parentRotate:0})})),u=co(e,"onRotateGroupStart",jt(jt({},s),{targets:e.props.targets,events:l}));return n.isRotate=!1!==u,!!n.isRotate&&s},dragGroupControl:function(e,t){var n=t.datas;if(n.isRotate){uo(e,"onBeforeRotate",(function(n){co(e,"onBeforeRotateGroup",so(e,t,jt(jt({},n),{targets:e.props.targets}),!0))}));var r=this.dragControl(e,t);if(r){var o=n.beforeDirection,i=r.beforeDist,a=r.beforeDelta/180*Math.PI,s=Xt(e,this,"dragControl",t,(function(e,t){var n=t.datas.groupClient,r=n[0],s=n[1],l=xe([r,s],a*o),u=l[0],c=l[1],f=[u-r,c-s];return t.datas.groupClient=[u,c],jt(jt({},t),{parentRotate:i,groupDelta:f})}));e.rotation=o*r.beforeRotation;var l=jt({targets:e.props.targets,events:s,set:function(t){e.rotation=t},setGroupRotation:function(t){e.rotation=t}},r);return co(e,"onRotateGroup",l),l}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isRotate){this.dragControlEnd(e,t);var r=Xt(e,this,"dragControlEnd",t);return co(e,"onRotateGroupEnd",lo(e,t,{targets:e.props.targets,events:r})),n}},request:function(e){var t={},n=0,r=e.getRotation();return{isControl:!0,requestStart:function(){return{datas:t}},request:function(e){return"deltaRotate"in e?n+=e.deltaRotate:"rotate"in e&&(n=e.rotate-r),{datas:t,parentDist:n}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},ln=["left","right","center"],un=["top","bottom","middle"],cn={start:"left",end:"right",center:"center"},fn={start:"top",end:"bottom",center:"middle"};function dn(e,t){var n=e.props,r=n.snappable,o=n.bounds,i=n.innerBounds,a=n.verticalGuidelines,s=n.horizontalGuidelines,l=n.snapGridWidth,u=n.snapGridHeight,c=e.state,f=c.guidelines,d=c.enableSnap;return!(!r||!d||t&&!0!==r&&r.indexOf(t)<0)&&!!(l||u||o||i||f&&f.length||a&&a.length||s&&s.length)}function hn(e){return!1===e?{}:!0!==e&&e?e:{left:!0,right:!0,top:!0,bottom:!0}}function pn(e,t){var n=function(e,t){var n=hn(e),r={};for(var o in n)o in t&&n[o]&&(r[o]=t[o]);return r}(e,t),r=un.filter((function(e){return e in n})),o=ln.filter((function(e){return e in n}));return{horizontal:r.map((function(e){return n[e]})),vertical:o.map((function(e){return n[e]}))}}function gn(e,t,n,r,o,i,a){void 0===o&&(o=0),void 0===i&&(i=0),void 0===a&&(a={left:0,top:0,right:0,bottom:0});var s=[],l=a.left,u=a.top,c=a.bottom,f=n+a.right-l,d=r+c-u;return e&&e.forEach((function(e){s.push({type:"horizontal",pos:[l,Z(e-i+u,.1)],size:f})})),t&&t.forEach((function(e){s.push({type:"vertical",pos:[Z(e-o+l,.1),u],size:d})})),s}function mn(e,t){if(!t.length)return[];var n=e.state,r=n.containerClientRect,o=n.targetClientRect,i=o.top,a=o.left,s=n.rootMatrix,l=n.is3d?4:3,u=function(e,t,n){var r=Ur(e,[t.clientLeft,t.clientTop],n);return[t.left+r[0],t.top+r[1]]}(s,r,l),c=u[0],f=u[1],d=Ve(io(n)),h=pe([d.minX,d.minY],mo(s,[a-c,i-f],l)).map((function(e){return t=e,Math.round(t%1==-.5?t-1:t);var t})),p=h[0],g=h[1];return t.map((function(e){var t=e.element.getBoundingClientRect(),n=t.left-c,r=t.top-f,o=r+t.height,i=n+t.width,a=mo(s,[n,r],l),u=a[0],d=a[1],h=mo(s,[i,o],l),m=h[0],v=h[1];return jt(jt({},e),{rect:{left:u+p,right:m+p,top:d+g,bottom:v+g,center:(u+m)/2+p,middle:(d+v)/2+g}})}))}function vn(e){var t=e.state,n=e.props.elementGuidelines,r=void 0===n?[]:n;if(!r.length)return t.elementRects=[],[];var o,i,a=(t.elementRects||[]).filter((function(e){return!e.refresh})),s=r.map((function(e){return T(e)&&"element"in e?e:{element:Oo(e,!0)}})).filter((function(e){return e.element})),l=(o=a.map((function(e){return e.element})),i=s.map((function(e){return e.element})),$e(o,i,ze)),u=l.maintained,c=l.added,f=[];u.forEach((function(e){var t=e[0],n=e[1];f[n]=a[t]})),mn(e,c.map((function(e){return s[e]}))).map((function(e,t){f[c[t]]=e})),t.elementRects=f;var d=hn(e.props.elementSnapDirections),h=[];return f.forEach((function(e){var t=e.element,n=e.top,r=void 0===n?d.top:n,o=e.left,i=void 0===o?d.left:o,a=e.right,s=void 0===a?d.right:a,l=e.bottom,u=void 0===l?d.bottom:l,c=e.center,f=void 0===c?d.center:c,p=e.middle,g=void 0===p?d.middle:p,m=e.className,v=e.rect,b=pn({top:r,right:s,left:i,bottom:u,center:f,middle:g},v),y=b.horizontal,w=b.vertical,x=v.top,S=v.left,O=v.right-S,E=v.bottom-x,k=[O,E];w.forEach((function(n){h.push({type:"vertical",element:t,pos:[Z(n,.1),x],size:E,sizes:k,className:m,elementRect:e})})),y.forEach((function(n){h.push({type:"horizontal",element:t,pos:[S,Z(n,.1)],size:O,sizes:k,className:m,elementRect:e})}))})),h}function bn(e){var t=e.state,n=t.snapOffset,r=t.containerClientRect,o=r.overflow,i=r.scrollHeight,a=r.scrollWidth,s=r.clientHeight,l=r.clientWidth,u=r.clientLeft,c=r.clientTop,f=e.props,d=f.snapGap,h=void 0===d||d,p=f.verticalGuidelines,g=f.horizontalGuidelines,m=f.snapThreshold,v=void 0===m?5:m,b=f.snapGridWidth,y=void 0===b?0:b,w=f.snapGridHeight,x=void 0===w?0:w,S=Tt([],vn(e),!0);if(h){var O=Gr(io(e.state)),E=O.top,k=O.left,_=O.bottom,C=O.right;S.push.apply(S,function(e,t,n){var r=e.state.elementRects,o=[];return[["vertical",cn,fn],["horizontal",fn,cn]].forEach((function(e){var i=e[0],a=e[1],s=e[2],l=t[a.start],u=t[a.end],c=t[a.center],f=t[s.start],d=t[s.end];function h(e){var t=e.rect;return t[a.end]d||t[s.end]0})).sort((function(e,t){return h(e)-h(t)})),g=[];p.forEach((function(e){p.forEach((function(t){if(e!==t){var n=e.rect,r=t.rect,o=n[s.start],i=n[s.end],a=r[s.start];o>r[s.end]||a>i||g.push([e,t])}}))})),g.forEach((function(e){var t=e[0],r=e[1],s=t.rect,f=r.rect,d=s[a.start],h=s[a.end],p=f[a.start],g=f[a.end],m=0,v=0,b=!1,y=!1,w=!1;if(h<=l&&u<=p){if(y=!0,v=h+(m=(p-h-(u-l))/2)+(u-l)/2,Math.abs(v-c)>n)return}else if(hn)return}else{if(!(hn)return}m&&o.push({type:i,pos:"vertical"===i?[v,0]:[0,v],element:r.element,size:0,className:r.className,isStart:b,isCenter:y,isEnd:w,gap:m,hide:!0,gapRects:[t,r]})}))})),o}(e,{top:E,left:k,bottom:_,right:C,center:(k+C)/2,middle:(E+_)/2},v))}return S.push.apply(S,function(e,t,n,r,o,i){void 0===o&&(o=0);void 0===i&&(i=0);var a=[];if(t)for(var s=0;s<=r;s+=t)a.push({type:"horizontal",pos:[0,Z(s-i,.1)],size:n,hide:!0});if(e)for(s=0;s<=n;s+=e)a.push({type:"vertical",pos:[Z(s-o,.1),0],size:r,hide:!0});return a}(y,x,o?a:l,o?i:s,u,c)),S.push.apply(S,gn(g||!1,p||!1,o?a:l,o?i:s,u,c,n)),S}function yn(e,t,n,r){var o=function(){for(var e=[],t=0;tr)})).sort((function(e,t){return e.dist-t.dist}));return{pos:n,index:i,guidelineInfos:a}})).filter((function(e){return e.guidelineInfos.length>0})).sort((function(e,t){return e.guidelineInfos[0].dist-t.guidelineInfos[0].dist})),a=i.length>0;return{isSnap:a,index:a?i[0].index:-1,posInfos:i}}function En(e,t){var n=Math.abs(e.offset),r=Math.abs(t.offset);return e.isBound&&t.isBound?r-n:e.isBound?-1:t.isBound?1:e.isSnap&&t.isSnap?r-n:e.isSnap?-1:t.isSnap||ni&&s.push({isBound:!0,offset:i-r,pos:r}),o-1.1||e[0]>t.right&&Math.abs(e[0]-t.right)>.1||e[1].1||e[1]>t.bottom&&Math.abs(e[1]-t.bottom)>.1}))}function Fn(e,t){return function(e,t){var n,r=e.direction,o=e.classNames,i=e.size,a=e.pos,s=e.zoom,l=e.key,u="horizontal"===r,c=u?"Y":"X";return t.createElement("div",{key:l,className:o.join(" "),style:(n={},n[u?"width":"height"]="".concat(i),n.transform="translate(".concat(a[0],", ").concat(a[1],") translate").concat(c,"(-50%) scale").concat(c,"(").concat(s,")"),n)})}(jt(jt({},e),{classNames:Tt([jr("line","guideline",e.direction)],e.classNames,!0).filter((function(e){return e})),size:e.size||"".concat(e.sizeValue,"px"),pos:e.pos||e.posValue.map((function(e){return"".concat(Z(e,.1),"px")}))}),t)}function Bn(e,t,n,r,o,i,a,s){var l=e.props.zoom;return n.map((function(e,n){var u=e.type,c=e.pos,f=[0,0];return f[a]=r,f[a?0:1]=-o+c,Fn({key:"".concat(t,"TargetGuideline").concat(n),classNames:[jr("target","bold",u)],posValue:f,sizeValue:i,zoom:l,direction:t},s)}))}function zn(e,t,n,r,o,i){var a=e.props,s=a.zoom,l=a.isDisplayInnerSnapDigit,u="horizontal"===t?cn:fn,c=o[u.start],f=o[u.end];return n.filter((function(e){var t=e.hide,n=e.elementRect;if(t)return!1;if(l&&n){var r=n.rect;if(r[u.start]<=c&&f<=r[u.end])return!1}return!0})).map((function(e,n){var o=e.pos,a=e.size,l=e.element,u=[-r[0]+o[0],-r[1]+o[1]];return Fn({key:"".concat(t,"-default-guideline-").concat(n),classNames:l?[jr("bold")]:[],direction:t,posValue:u,sizeValue:a,zoom:s},i)}))}function Hn(e,t,n,r,o,i,a,s){var l,u=e.props,c=u.snapDigit,f=void 0===c?0:c,d=u.isDisplaySnapDigit,h=void 0===d||d,p=u.snapDistFormat,g=void 0===p?function(e){return e}:p,m=u.zoom,v="horizontal"===t?"X":"Y",b="vertical"===t?"height":"width",y=Math.abs(o),w=h?parseFloat(y.toFixed(f)):0;return s.createElement("div",{key:"".concat(t,"-").concat(n,"-guideline-").concat(r),className:jr("guideline-group",t),style:(l={left:"".concat(i[0],"px"),top:"".concat(i[1],"px")},l[b]="".concat(y,"px"),l)},Fn({direction:t,classNames:[jr(n),a],size:"100%",posValue:[0,0],sizeValue:y,zoom:m},s),s.createElement("div",{className:jr("size-value","gap"),style:{transform:"translate".concat(v,"(-50%) scale(").concat(m,")")}},w>0?g(w):""))}function Wn(e,t,n,r,o){var i=e.props.isDisplayInnerSnapDigit,a=[];return["vertical","horizontal"].forEach((function(s){var l=t.filter((function(e){return e.type===s})),u="vertical"===s?1:0,c=u?0:1,f=function(e,t,n,r){var o,i,a,s,l="vertical"===e?0:1,u="vertical"===e?1:0,c=l?cn:fn,f=n[c.start],d=n[c.end];return(o=t,i=function(e){return e.pos[l]},a=[],s=[],o.forEach((function(e,t){var n=i(e,t,o),r=s.indexOf(n),l=a[r]||[];-1===r&&(s.push(n),a.push(l)),l.push(e)})),a).map((function(t){var n=[],o=[];return t.forEach((function(t){var i,a,s=t.element,h=t.elementRect.rect;if(h[c.end]0){var l=[0,0];l[u]=n[u]+b[d.start]-p-i,l[c]=v,a.push(Hn(e,s,"dashed",a.length,i,l,t.className,o))}b=r})),b=r,f.forEach((function(t){var r=t.elementRect.rect,i=r[d.start]-b[d.end];if(i>0){var l=[0,0];l[u]=n[u]+b[d.end]-p,l[c]=v,a.push(Hn(e,s,"dashed",a.length,i,l,t.className,o))}b=r})),m.forEach((function(t){var r=t.elementRect.rect,i=p-r[d.start],l=r[d.end]-g,f=[0,0],h=[0,0];f[u]=n[u]-i,f[c]=v,h[u]=n[u]+g-p,h[c]=v,a.push(Hn(e,s,"dashed",a.length,i,f,t.className,o)),a.push(Hn(e,s,"dashed",a.length,l,h,t.className,o))}))}))})),a}function Un(e,t,n,r,o){var i=function(e,t,n,r){var o=t[0]-e[0],i=t[1]-e[1];if(Math.abs(o)<_&&(o=0),Math.abs(i)<_&&(i=0),!o)return r?[0,0]:[0,n];if(!i)return r?[n,0]:[0,0];var a=i/o,s=e[1]-a*e[0];return r?[n,a*(t[0]+n)+s-t[1]]:[(t[1]+n-s)/a-t[0],n]}(e,t,n,r);if(!i)return{isOutside:!1,offset:[0,0]};var a=J(e,t),s=J(i,e),l=J(i,t),u=s>a||l>a,c=dr({datas:o,distX:i[0],distY:i[1]});return{offset:[c[0],c[1]],isOutside:u}}function Vn(e,t){return e.isBound?e.offset:t.isSnap?Sn(t).offset:0}function Gn(e,t,n,r,o,i){if(!dn(e,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var a=oo(i.absolutePoses,[t,n]),s=Gr(a),l=s.left,u=s.right,c=s.top,f=s.bottom,d={horizontal:a.map((function(e){return e[1]})),vertical:a.map((function(e){return e[0]}))},h=qn(e,o,pn(hn(e.props.snapDirections),{left:l,right:u,top:c,bottom:f,center:(l+u)/2,middle:(c+f)/2}),d),p=h.vertical,g=h.horizontal,m=Ln(e,a,i),v=m.vertical,b=m.horizontal,y=p.isSnap,w=g.isSnap,x=p.isBound||v.isBound,S=g.isBound||b.isBound,O=function(e,t,n,r,o){var i=t[0],a=t[1],s=n[0],l=n[1],u=r[0],c=r[1],f=o[0],d=o[1],h=-f,p=-d;if(e&&i&&a){h=0,p=0;var g=[];if(s&&l?g.push([0,d],[f,0]):s?g.push([f,0]):l?g.push([0,d]):u&&c?g.push([0,d],[f,0]):u?g.push([f,0]):c&&g.push([0,d]),g.length){g.sort((function(e,t){return Kr(pe([i,a],e))-Kr(pe([i,a],t))}));var m=g[0];if(m[0]&&Math.abs(i)>_)h=-m[0],p=a*Math.abs(i+h)/Math.abs(i)-a;else if(m[1]&&Math.abs(a)>_){var v=a;p=-m[1],h=i*Math.abs(a+p)/Math.abs(v)-i}if(e&&l&&s)if(Math.abs(h)>_&&Math.abs(h)_&&Math.abs(p)0,p=f>0,g={isBound:!1,offset:0,pos:0},m={isBound:!1,offset:0,pos:0};if(0===f&&0===d)return{vertical:g,horizontal:m};if(0===f)h?su&&(m.pos=i,m.offset=u-i);else if(0===d)p?al&&(g.pos=o,g.offset=l-o);else{var v=d/f,b=n[1]-v*l,y=0,w=0,x=!1;p&&a<=l?(y=v*a+b,w=a,x=!0):!p&&l<=o&&(y=v*o+b,w=o,x=!0),x&&(ys)&&(x=!1),x||(h&&s<=u?(w=((y=s)-b)/v,x=!0):!h&&u<=i&&(w=((y=i)-b)/v,x=!0)),x&&(g.isBound=!0,g.pos=w,g.offset=l-w,m.isBound=!0,m.pos=y,m.offset=u-y)}return{vertical:g,horizontal:m}}(e,t,n),i=o.horizontal,a=o.vertical,s=r?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(e,t,n){var r=n[0],o=n[1],i=t[0],a=t[1],s=pe(n,t),l=s[0],u=s[1],c=u>0,f=l>0;l=wo(l),u=wo(u);var d={isSnap:!1,offset:0,pos:0},h={isSnap:!1,offset:0,pos:0};if(0===l&&0===u)return{vertical:d,horizontal:h};var p=yn(e,l?[r]:[],u?[o]:[]),g=p.vertical,m=p.horizontal;g.posInfos.filter((function(e){var t=e.pos;return f?t>=i:t<=i})),m.posInfos.filter((function(e){var t=e.pos;return c?t>=a:t<=a})),g.isSnap=g.posInfos.length>0,m.isSnap=m.posInfos.length>0;var v=Sn(g),b=v.isSnap,y=v.guideline,w=Sn(m),x=w.isSnap,S=w.guideline,O=x?S.pos[1]:0,E=b?y.pos[0]:0;if(0===l)x&&(h.isSnap=!0,h.pos=S.pos[1],h.offset=o-h.pos);else if(0===u)b&&(d.isSnap=!0,d.pos=E,d.offset=r-E);else{var k=u/l,_=n[1]-k*r,C=0,j=0,T=!1;b?(C=k*(j=E)+_,T=!0):x&&(j=((C=O)-_)/k,T=!0),T&&(d.isSnap=!0,d.pos=j,d.offset=r-j,h.isSnap=!0,h.pos=C,h.offset=o-C)}return{vertical:d,horizontal:h}}(e,t,n),l=s.horizontal,u=s.vertical,c=Xn(i,l),f=Xn(a,u),d=Math.abs(c),h=Math.abs(f);return{horizontal:{isBound:i.isBound,isSnap:l.isSnap,offset:c,dist:d},vertical:{isBound:a.isBound,isSnap:u.isSnap,offset:f,dist:h}}}(e,l,u,o):qn(e,o,{vertical:[u[0]],horizontal:[u[1]]}),f=c.horizontal,d=f.offset,h=f.isBound,p=f.isSnap,g=c.vertical,m=g.offset,v=g.isBound,b=g.isSnap,y=pe(s,a);if(!m&&!d)return{isBound:v||h,isSnap:b||p,sign:y,offset:[0,0]};var w=function(e,t,n,r){var o=X(e,t)/Math.PI*180,i=n.vertical,a=i.isBound,s=i.isSnap,l=i.dist,u=n.horizontal,c=u.isBound,f=u.isSnap,d=o%180,h=d<3||d>177,p=d>87&&d<93;return u.dist-1||t.push(n)}))})),t}function rr(e,t,n,r,o,i){var a=Dn(In(e,i),t,n),s=a.vertical,l=a.horizontal;s.forEach((function(e){e.isBound&&r.push({type:"bounds",pos:e.pos})})),l.forEach((function(e){e.isBound&&o.push({type:"bounds",pos:e.pos})}));var u=function(e){var t=e.props.innerBounds;if(!t)return{vertical:[],horizontal:[]};var n=e.getRect(),r=n.pos1,o=n.pos2,i=n.pos3,a=n.pos4,s=gr([r,o,i,a],[0,0]),l=t.left,u=t.top,c=t.width,f=t.height,d=[[l,u],[l,u+f]],h=[[l,u],[l+c,u]],p=[[l+c,u],[l+c,u+f]],g=[[l,u+f],[l+c,u+f]],m=[],v=[],b={top:!1,bottom:!1,left:!1,right:!1};return[[r,o],[o,a],[a,i],[i,r]].forEach((function(e){var t=_n(s,e),n=t.horizontal,r=t.vertical,o=An(e,h,r,1,!0),i=An(e,g,r,1,!0),a=An(e,d,n,1,!0),y=An(e,p,n,1,!0);o.isBound&&!b.top&&(m.push(u),b.top=!0),i.isBound&&!b.bottom&&(m.push(u+f),b.bottom=!0),a.isBound&&!b.left&&(v.push(l),b.left=!0),y.isBound&&!b.right&&(v.push(l+c),b.right=!0)})),{horizontal:m,vertical:v}}(e),c=u.vertical,f=u.horizontal;c.forEach((function(e){z(r,(function(t){var n=t.type,r=t.pos;return"bounds"===n&&r===e}))>=0||r.push({type:"bounds",pos:e})})),f.forEach((function(e){z(o,(function(t){var n=t.type,r=t.pos;return"bounds"===n&&r===e}))>=0||o.push({type:"bounds",pos:e})}))}var or={name:"snappable",dragRelation:"strong",props:{snappable:[Boolean,Array],snapContainer:Object,snapDirections:[Boolean,Object],elementSnapDirections:[Boolean,Object],snapGap:Boolean,snapGridWidth:Number,snapGridHeight:Number,isDisplaySnapDigit:Boolean,isDisplayInnerSnapDigit:Boolean,snapDigit:Number,snapThreshold:Number,horizontalGuidelines:Array,verticalGuidelines:Array,elementGuidelines:Array,bounds:Object,innerBounds:Object,snapDistFormat:Function},events:{onSnap:"snap"},css:[":host {\n --bounds-color: #d66;\n}\n.guideline {\n pointer-events: none;\n z-index: 2;\n}\n.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}\n.guideline-group {\n position: absolute;\n top: 0;\n left: 0;\n}\n.guideline-group .size-value {\n position: absolute;\n color: #f55;\n font-size: 12px;\n font-weight: bold;\n}\n.guideline-group.horizontal .size-value {\n transform-origin: 50% 100%;\n transform: translateX(-50%);\n left: 50%;\n bottom: 5px;\n}\n.guideline-group.vertical .size-value {\n transform-origin: 0% 50%;\n top: 50%;\n transform: translateY(-50%);\n left: 5px;\n}\n.guideline.gap {\n background: #f55;\n}\n.size-value.gap {\n color: #f55;\n}\n"],render:function(e,t){var n=e.state,r=n.top,o=n.left,i=n.pos1,a=n.pos2,s=n.pos3,l=n.pos4,u=n.snapRenderInfo;if(!u||!dn(e,""))return[];n.guidelines=bn(e);var c=Math.min(i[0],a[0],s[0],l[0]),f=Math.min(i[1],a[1],s[1],l[1]),d=u.externalPoses||[],h=io(e.state),p=[],g=[],m=[],v=[],b=[],y=Gr(h),w=y.width,x=y.height,S=y.top,O=y.left,E=y.bottom,k=y.right,_={left:O,right:k,top:S,bottom:E,center:(O+k)/2,middle:(S+E)/2},C=d.length>0,j=C?Gr(d):{};if(!u.request){if(u.direction&&b.push(function(e,t,n){var r=[];if(n[0]&&n[1])r=[n,[-n[0],n[1]],[n[0],-n[1]]].map((function(e){return gr(t,e)}));else if(n[0]||n[1])e.props.keepRatio?r=[[-1,-1],[-1,1],[1,-1],[1,1],n].map((function(e){return gr(t,e)})):(r=pr(t,n)).length>1&&r.push([(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]);else for(var o=[t[0],t[1],t[3],t[2],t[0]],i=0;i<4;++i)r.push(o[i]),r.push([(o[i][0]+o[i+1][0])/2,(o[i][1]+o[i+1][1])/2]);return yn(e,r.map((function(e){return e[0]})),r.map((function(e){return e[1]})),1)}(e,h,u.direction)),u.snap){var T=Gr(h);u.center&&(T.middle=(T.top+T.bottom)/2,T.center=(T.left+T.right)/2),b.push(xn(e,T,1))}C&&(u.center&&(j.middle=(j.top+j.bottom)/2,j.center=(j.left+j.right)/2),b.push(xn(e,j,1))),b.forEach((function(e){var t=e.vertical.posInfos,n=e.horizontal.posInfos;p.push.apply(p,t.filter((function(e){return e.guidelineInfos.some((function(e){return!e.guideline.hide}))})).map((function(e){return{type:"snap",pos:e.pos}}))),g.push.apply(g,n.filter((function(e){return e.guidelineInfos.some((function(e){return!e.guideline.hide}))})).map((function(e){return{type:"snap",pos:e.pos}}))),m.push.apply(m,nr(t)),v.push.apply(v,nr(n))}))}rr(e,[O,k],[S,E],p,g),C&&rr(e,[j.left,j.right],[j.top,j.bottom],p,g,u.externalBounds);var A=Tt(Tt([],m,!0),v,!0),R=A.filter((function(e){return e.element&&!e.gapRects})),L=A.filter((function(e){return e.gapRects}));return co(e,"onSnap",{guidelines:A.filter((function(e){return!e.element})),elements:R,gaps:L},!0),Tt(Tt(Tt(Tt(Tt(Tt([],Wn(e,R,[c,f],_,t),!0),function(e,t,n,r,o){var i=[];return["horizontal","vertical"].forEach((function(a){var s=t.filter((function(e){return e.type===a})),l="vertical"===a?0:1,u=l?0:1,c=l?fn:cn,f=l?cn:fn,d=r[c.start],h=r[c.end],p=r[f.start],g=r[f.end];s.forEach((function(t){var r=t.gap,a=t.gapRects,s=t.className,m=Math.max.apply(Math,Tt([p],a.map((function(e){return e.rect[f.start]})),!1)),v=Math.min.apply(Math,Tt([g],a.map((function(e){return e.rect[f.end]})),!1)),b=(m+v)/2;m!==v&&b!==(p+g)/2&&a.forEach((function(t){var a=t.rect,f=[n[0],n[1]];if(a[c.end]0&&(l||u)){var w=p.startDragRotate||0,x=Z(w+180*X([0,0],[l,u])/Math.PI,v)-w,S=u*Math.abs(Math.cos((x-90)/180*Math.PI)),O=Kr([l*Math.abs(Math.cos(x/180*Math.PI)),S]);y=x*Math.PI/180,l=O*Math.cos(y),u=O*Math.sin(y)}if(!i&&!r&&!o&&(!v||l||u)){var E=Gn(e,l,u,v,a||s,n),k=E[0],_=E[1],C=k.isSnap,j=k.isBound,T=k.offset,A=_.isSnap,R=_.isBound;b=C||A||j||R,l+=T,u+=_.offset}var L=he(fr({datas:n,distX:l,distY:u}),h),M=he(function(e){var t=e.datas,n=e.distX,r=e.distY,o=fr({datas:t,distX:n,distY:r}),i=o[0],a=o[1];return me(cr(t,function(e,t){for(var n=ke(t),r=0;r=0&&(e[0]>=0&&t.push(3),e[0]<=0&&t.push(2)),e[1]<=0&&(e[0]>=0&&t.push(1),e[0]<=0&&t.push(0)),t}function pr(e,t){return hr(t).map((function(t){return e[t]}))}function gr(e,t){var n=pr(e,t);return[K(n.map((function(e){return e[0]}))),K(n.map((function(e){return e[1]})))]}function mr(e,t,n,r){return de(e,Ar(t,r,n),r)}function vr(e){var t=e.originalDatas.beforeRenderable;return{setTransform:function(n,r){void 0===r&&(r=-1),t.startTransforms=A(n)?n:I(n),yr(e,r)},setTransformIndex:function(t){yr(e,t)}}}function br(e,t){yr(e,z(e.originalDatas.beforeRenderable.startTransforms,(function(e){return 0===e.indexOf("".concat(t,"("))})))}function yr(e,t){var n=e.originalDatas.beforeRenderable,r=e.datas;if(r.transformIndex=t,-1!==t){var o=n.startTransforms[t];if(o){var i=Re([o]);r.startValue=i[0].functionValue}}}function wr(e,t){e.originalDatas.beforeRenderable.nextTransforms=I(t)}function xr(e){return e.originalDatas.beforeRenderable.nextTransforms.join(" ")}function Sr(e,t,n,r,o){return wr(o,t),{transform:t,drag:ir.drag(e,Gt(o,e.state,n,r,!1))}}function Or(e,t,n,r,o){var i=e.state,a=i.left,s=i.top,l=e.props.groupable,u=function(e,t,n){var r=e.transformOrigin,o=e.offsetMatrix,i=e.is3d,a=t.beforeTransform,s=t.afterTransform,l=i?4:3;return mr(o,ce(de(de(a,Te([n]),4),s,4),4,l),r,l)}(e.state,o,t),c=l?a:0,f=l?s:0,d=pe(r,kr(e,n,u));return pe(d,[c,f])}function Er(e){var t=e.state,n=t.width,r=t.height,o=t.transformOrigin;return[o[0]/(n/2)-1,o[1]/(r/2)-1]}function kr(e,t,n){void 0===n&&(n=e.state.allMatrix);var r=e.state,o=r.width,i=r.height,a=r.is3d?4:3;return Ur(n,[o/2*(1+t[0]),i/2*(1+t[1])],a)}function _r(e,t,n,r,o,i){var a=e.props.groupable,s=e.state,l=s.transformOrigin,u=s.targetMatrix,c=s.offsetMatrix,f=s.is3d,d=s.width,h=s.height,p=s.left,g=s.top,m=f?4:3,v=function(e,t,n,r,o,i){return void 0===r&&(r=t),void 0===o&&(o=n),void 0===i&&(i=[0,0]),e?e.map((function(e,a){var s=F(e),l=s.value,u=s.unit,c=a?o:r,f=a?n:t;return"%"===e||isNaN(l)?f*(c?i[a]/c:0):"%"!==u?l:f*l/100})):i}(i,t,n,d,h,l),b=a?p:0,y=a?g:0,w=function(e,t,n,r,o,i){var a=gr(Vr(t,n,r,o),i);return[e[0]-a[0],e[1]-a[1]]}(o,mr(c,u,v,m),t,n,m,r);return pe(w,[b,y])}function Cr(e,t){return gr(io(e.state),t)}function jr(){for(var e=[],t=0;t9),"".concat(t?"matrix3d":"matrix","(").concat(ge(e,!t).join(","),")")}function Hr(e){var t=e.clientWidth,n=e.clientHeight;if(!e)return{x:0,y:0,width:0,height:0,clientWidth:t,clientHeight:n};var r=e.viewBox,o=r&&r.baseVal||{x:0,y:0,width:0,height:0};return{x:o.x,y:o.y,width:o.width||t,height:o.height||n,clientWidth:t,clientHeight:n}}function Wr(e,t){var n=Hr(e),r=n.width,o=n.height,i=n.clientWidth,a=n.clientHeight,s=i/r,l=a/o,u=e.preserveAspectRatio.baseVal,c=u.align,f=u.meetOrSlice,d=[0,0],h=[s,l],p=[0,0];if(1!==c){var g=(c-2)%3,m=Math.floor((c-2)/3);d[0]=r*g/2,d[1]=o*m/2;var v=2===f?Math.max(l,s):Math.min(s,l);h[0]=v,h[1]=v,p[0]=(i-r)/2*g,p[1]=(a-o)/2*m}var b=_e(h,t);return b[t*(t-1)]=p[0],b[t*(t-1)+1]=p[1],Ar(b,t,d)}function Ur(e,t,n){return me(e,ue(t,n),n)}function Vr(e,t,n,r){return[[0,0],[t,0],[0,n],[t,n]].map((function(t){return Ur(e,t,r)}))}function Gr(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]})),r=Math.min.apply(Math,t),o=Math.min.apply(Math,n),i=Math.max.apply(Math,t),a=Math.max.apply(Math,n);return{left:r,top:o,right:i,bottom:a,width:i-r,height:a-o}}function qr(e,t,n,r){return Gr(Vr(e,t,n,r))}function Yr(e,t,n,r){var o=16===e.length?4:3,i=Vr(e,n,r,o),a=i[0],s=a[0],l=a[1],u=i[1],c=u[0],f=u[1],d=i[2],h=d[0],p=d[1],g=i[3],m=g[0],v=g[1],b=Ur(e,t,o),y=b[0],w=b[1],x=Math.min(s,c,h,m),S=Math.min(l,f,p,v),O=Math.max(s,c,h,m);return s=s-x||0,{left:x,top:S,right:O,bottom:Math.max(l,f,p,v),origin:[y=y-x||0,w=w-S||0],pos1:[s,l=l-S||0],pos2:[c=c-x||0,f=f-S||0],pos3:[h=h-x||0,p=p-S||0],pos4:[m=m-x||0,v=v-S||0],direction:Q(i)}}function Kr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Xr(e,t){return Kr([t[0]-e[0],t[1]-e[1]])}function Qr(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=X(e,t));var o=Xr(e,t);return{transform:"translateY(-50%) translate(".concat(e[0],"px, ").concat(e[1],"px) rotate(").concat(r,"rad) scaleY(").concat(n,")"),width:"".concat(o,"px")}}function Jr(e,t){for(var n=[],r=2;r0?e[0]:e[1],t>0?e[1]:e[0])}function to(e,t,n,r,o){var i=1,a=[0,0],s={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},l={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},u={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},c=Br(t,n,o,!1);if(t){var f=c.is3d?4:3,d=Yr(c.offsetMatrix,he(c.transformOrigin,function(e,t){void 0===t&&(t=Math.sqrt(e.length));for(var n=[],r=e[t*t-1],o=0;o-1&&(n[0]=-1),t.indexOf("e")>-1&&(n[0]=1),t.indexOf("n")>-1&&(n[1]=-1),t.indexOf("s")>-1&&(n[1]=1),n}}}function oo(e,t){return[he(t,e[0]),he(t,e[1]),he(t,e[2]),he(t,e[3])]}function io(e){var t=e.left,n=e.top;return oo([e.pos1,e.pos2,e.pos3,e.pos4],[t,n])}function ao(e,t){var n;null===(n=e[t])||void 0===n||n.unset(),e[t]=null}function so(e,t,n,r){var o=t.datas;o.datas||(o.datas={});var i=jt(jt({},n),{target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,moveable:e,datas:o.datas});return o.isStartEvent?r||(o.lastEvent=i):o.isStartEvent=!0,i}function lo(e,t,n){var r=t.datas,o="isDrag"in n?n.isDrag:t.isDrag;return r.datas||(r.datas={}),jt(jt({isDrag:o},n),{moveable:e,target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,lastEvent:r.lastEvent,isDouble:t.isDouble,datas:r.datas})}function uo(e,t,n){e._emitter.on(t,n)}function co(e,t,n,r){return e.triggerEvent(t,n,r)}function fo(e,t){return window.getComputedStyle(e,t)}function ho(e,t,n){var r={},o={};return e.filter((function(e){var i=e.name;if(r[i]||!t.some((function(t){return e[t]})))return!1;if(!n&&e.ableGroup){if(o[e.ableGroup])return!1;o[e.ableGroup]=!0}return r[i]=!0,!0}))}function po(e,t){return e===t||null==e&&null==t}function go(){for(var e=[],t=0;t-1}))).filter((function(e){return e.canPinch&&e[c]})),d=so(e,t,{});r&&(d.targets=r);var h=co(e,u,d);n.isPinch=!1!==h,n.ables=f;var p=n.isPinch;return!!p&&(f.forEach((function(n){if(i[n.name]=i[n.name]||{},n[c]){var r=jt(jt({},t),{datas:i[n.name],parentRotate:o,isPinch:!0});n[c](e,r)}})),e.state.snapRenderInfo={request:t.isRequest,direction:[0,0]},p)},pinch:function(e,t){var n=t.datas,r=t.scale,o=t.distance,i=t.originalDatas,a=t.inputEvent,s=t.targets,l=t.angle;if(n.isPinch){var u=o*(1-1/r),c=so(e,t,{});s&&(c.targets=s);var f="onPinch".concat(s?"Group":"");co(e,f,c);var d=n.ables,h="drag".concat(s?"Group":"","Control");return d.forEach((function(n){n[h]&&n[h](e,jt(jt({},t),{datas:i[n.name],inputEvent:a,parentDistance:u,parentRotate:l,isPinch:!0}))})),c}},pinchEnd:function(e,t){var n=t.datas,r=t.isPinch,o=t.inputEvent,i=t.targets,a=t.originalDatas;if(n.isPinch){var s="onPinch".concat(i?"Group":"","End"),l=lo(e,t,{isDrag:r});i&&(l.targets=i),co(e,s,l);var u=n.ables,c="drag".concat(i?"Group":"","ControlEnd");return u.forEach((function(n){n[c]&&n[c](e,jt(jt({},t),{isDrag:r,datas:a[n.name],inputEvent:o,isPinch:!0}))})),r}},pinchGroupStart:function(e,t){return this.pinchStart(e,jt(jt({},t),{targets:e.props.targets}))},pinchGroup:function(e,t){return this.pinch(e,jt(jt({},t),{targets:e.props.targets}))},pinchGroupEnd:function(e,t){return this.pinchEnd(e,jt(jt({},t),{targets:e.props.targets}))}}),jo={name:"resizable",ableGroup:"size",canPinch:!0,props:{resizable:Boolean,throttleResize:Number,renderDirections:Array,keepRatio:Boolean,resizeFormat:Function},events:{onResizeStart:"resizeStart",onBeforeResize:"beforeResize",onResize:"resize",onResizeEnd:"resizeEnd",onResizeGroupStart:"resizeGroupStart",onBeforeResizeGroup:"beforeResizeGroup",onResizeGroup:"resizeGroup",onResizeGroupEnd:"resizeGroupEnd"},render:function(e,t){var n=e.props,r=n.resizable,o=n.edge;if(r)return o?en(e,t):Zt(e,t)},dragControlCondition:xo,dragControlStart:function(e,t){var n,r=t.inputEvent,o=t.isPinch,i=t.parentDirection,a=t.datas,s=t.parentFlag,l=i||(o?[0,0]:ro(r.target)),u=e.state,c=u.target,f=u.width,d=u.height;if(!l||!c)return!1;!o&&sr(e,t),a.datas={},a.direction=l,a.startOffsetWidth=f,a.startOffsetHeight=d,a.prevWidth=0,a.prevHeight=0,n=function(e){var t=fo(e);return[parseFloat(t.width),parseFloat(t.height)]}(c),a.startWidth=n[0],a.startHeight=n[1];var h=[Math.max(0,f-a.startWidth),Math.max(0,d-a.startHeight)];if(a.minSize=h,a.maxSize=[1/0,1/0],!s){var p=fo(c),g=p.position,m=p.minWidth,v=p.minHeight,b=p.maxWidth,y=p.maxHeight,w="static"===g||"relative"===g,x=w?c.parentElement:c.offsetParent,S=f,O=d;if(x&&(S=x.clientWidth,O=x.clientHeight,w)){var E=fo(x);S-=parseFloat(E.paddingLeft)||0,O-=parseFloat(E.paddingTop)||0}a.minSize=he([G(m,S)||0,G(v,O)||0],h),a.maxSize=he([G(b,S)||1/0,G(y,O)||1/0],h)}var k=e.props.transformOrigin||"% %";function _(e){a.ratio=e&&isFinite(e)?e:0}function C(e){a.fixedDirection=e,a.fixedPosition=gr(a.startPositions,e)}a.transformOrigin=k&&R(k)?k.split(" "):k,a.isWidth=!l[0]&&!l[1]||l[0]||!l[1],a.startPositions=io(e.state),_(f/d),C([-l[0],-l[1]]),a.setFixedDirection=C;var j=so(e,t,{direction:l,set:function(e){var t=e[0],n=e[1];a.startWidth=t,a.startHeight=n},setMin:function(e){a.minSize=e},setMax:function(e){a.maxSize=[e[0]||1/0,e[1]||1/0]},setRatio:_,setFixedDirection:C,setOrigin:function(e){a.transformOrigin=e},dragStart:ir.dragStart(e,(new qt).dragStart([0,0],t))});return!1!==co(e,"onResizeStart",j)&&(a.isResize=!0,e.state.snapRenderInfo={request:t.isRequest,direction:l}),!!a.isResize&&j},dragControl:function(e,t){var n,r=t.datas,o=t.parentFlag,i=t.isPinch,a=t.parentKeepRatio,s=t.dragClient,l=t.parentDist,u=t.isRequest,c=r.isResize,f=r.transformOrigin,d=r.startWidth,h=r.startHeight,p=r.prevWidth,g=r.prevHeight,m=r.minSize,v=r.maxSize,b=r.ratio,y=r.isWidth,w=r.startOffsetWidth,x=r.startOffsetHeight;if(c){var S=e.props,O=S.resizeFormat,E=S.throttleResize,k=void 0===E?1:E,_=S.parentMoveable,C=S.snapThreshold,j=void 0===C?5:C,T=r.direction,A=T,R=0,L=0;T[0]||T[1]||(A=[1,1]);var M=b&&(null!=a?a:S.keepRatio)||!1,P=W(),D=P[0],I=P[1];r.setFixedDirection(r.fixedDirection),co(e,"onBeforeResize",so(e,t,{setFixedDirection:function(e){var t;return r.setFixedDirection(e),t=W(),D=t[0],I=t[1],[D,I]},boundingWidth:D,boundingHeight:I,setSize:function(e){D=e[0],I=e[1]}},!0));var $=s;s||($=!o&&i?Cr(e,[0,0]):r.fixedPosition);var N=[0,0];if(i||(N=function(e,t,n,r,o,i,a){if(!dn(e,"resizable"))return[0,0];var s=a.fixedDirection,l=e.state,u=l.allMatrix,c=l.is3d;return er(e,(function(e,r){return Jn(u,t+e,n+r,s,o,c)}),t,n,r,o,i,a)}(e,D,I,T,$,u,r)),l&&(!l[0]&&(N[0]=0),!l[1]&&(N[1]=0)),M){A[0]&&A[1]&&N[0]&&N[1]&&(Math.abs(N[0])>Math.abs(N[1])?N[1]=0:N[0]=0);var F=!N[0]&&!N[1];F&&U(),A[0]&&!A[1]||N[0]&&!N[1]||F&&y?(D+=N[0],I=D/b):(!A[0]&&A[1]||!N[0]&&N[1]||F&&!y)&&(I+=N[1],D=I*b)}else w+R<-j&&(N[0]=0),w+L<-j&&(N[1]=0),D+=N[0],I+=N[1];n=Y([D,I],m,v,M),D=n[0],I=n[1],U();var B=[(R=D-w)-p,(L=I-x)-g];r.prevWidth=R,r.prevHeight=L;var z=_r(e,D,I,r.fixedDirection,$,f);if(_||!B.every((function(e){return!e}))||!z.every((function(e){return!e}))){var H=so(e,t,{width:d+R,height:h+L,offsetWidth:Math.round(D),offsetHeight:Math.round(I),boundingWidth:D,boundingHeight:I,direction:T,dist:[R,L],delta:B,isPinch:!!i,drag:ir.drag(e,Gt(t,e.state,z,!!i,!1))});return co(e,"onResize",H),H}}function W(){var e=_o(A,M,r,t);R=e.distWidth,L=e.distHeight;var n=A[0]||M?Math.max(w+R,Nt):w,o=A[1]||M?Math.max(x+L,Nt):x;return M&&w&&x&&(y?o=n/b:n=o*b),[n,o]}function U(){var e;O&&(e=O([D,I]),D=e[0],I=e[1]),D=Z(D,k),I=Z(I,k)}},dragControlAfter:function(e,t){var n=t.datas,r=n.isResize,o=n.startOffsetWidth,i=n.startOffsetHeight,a=n.prevWidth,s=n.prevHeight;if(r){var l=e.state,u=l.width-(o+a),c=l.height-(i+s),f=Math.abs(u)>3,d=Math.abs(c)>3;return f&&(n.startWidth+=u,n.startOffsetWidth+=u,n.prevWidth+=u),d&&(n.startHeight+=c,n.startOffsetHeight+=c,n.prevHeight+=c),f||d?this.dragControl(e,t):void 0}},dragControlEnd:function(e,t){var n=t.datas;if(n.isResize){n.isResize=!1;var r=lo(e,t,{});return co(e,"onResizeEnd",r),r}},dragGroupControlCondition:xo,dragGroupControlStart:function(e,t){var n=t.datas,r=this.dragControlStart(e,t);if(!r)return!1;var o=Yt(e,"resizable",t);function i(t,r){var o=n.fixedDirection,i=n.fixedPosition,a=gr(r.datas.startPositions||io(t.state),o),s=me(Ee(-e.rotation/180*Math.PI,3),[a[0]-i[0],a[1]-i[1],1],3),l=s[0],u=s[1];return r.datas.originalX=l,r.datas.originalY=u,r}var a=Xt(e,this,"dragControlStart",t,(function(e,t){return i(e,t)})),s=function(e){r.setFixedDirection(e),a.forEach((function(t,n){t.setFixedDirection(e),i(t.moveable,o[n])}))};n.setFixedDirection=s;var l=jt(jt({},r),{targets:e.props.targets,events:a,setFixedDirection:s}),u=co(e,"onResizeGroupStart",l);return n.isResize=!1!==u,!!n.isResize&&r},dragGroupControl:function(e,t){var n=t.datas;if(n.isResize){uo(e,"onBeforeResize",(function(n){co(e,"onBeforeResizeGroup",so(e,t,jt(jt({},n),{targets:e.props.targets}),!0))}));var r=this.dragControl(e,t);if(r){var o=r.boundingWidth,i=r.boundingHeight,a=r.dist,s=e.props.keepRatio,l=[o/(o-a[0]),i/(i-a[1])],u=n.fixedPosition,c=Xt(e,this,"dragControl",t,(function(t,n){var r=me(Ee(e.rotation/180*Math.PI,3),[n.datas.originalX*l[0],n.datas.originalY*l[1],1],3),o=r[0],i=r[1];return jt(jt({},n),{parentDist:null,parentScale:l,dragClient:he(u,[o,i]),parentKeepRatio:s})})),f=jt({targets:e.props.targets,events:c},r);return co(e,"onResizeGroup",f),f}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isResize){this.dragControlEnd(e,t);var r=Xt(e,this,"dragControlEnd",t);return co(e,"onResizeGroupEnd",lo(e,t,{targets:e.props.targets,events:r})),n}},request:function(e){var t={},n=0,r=0,o=e.getRect();return{isControl:!0,requestStart:function(e){return{datas:t,parentDirection:e.direction||[1,1]}},request:function(e){return"offsetWidth"in e?n=e.offsetWidth-o.offsetWidth:"deltaWidth"in e&&(n+=e.deltaWidth),"offsetHeight"in e?r=e.offsetHeight-o.offsetHeight:"deltaHeight"in e&&(r+=e.deltaHeight),{datas:t,parentDist:[n,r],parentKeepRatio:e.keepRatio}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},To={name:"scalable",ableGroup:"size",canPinch:!0,props:{scalable:Boolean,throttleScale:Number,renderDirections:String,keepRatio:Boolean},events:{onScaleStart:"scaleStart",onBeforeScale:"beforeScale",onScale:"scale",onScaleEnd:"scaleEnd",onScaleGroupStart:"scaleGroupStart",onBeforeScaleGroup:"beforeScaleGroup",onScaleGroup:"scaleGroup",onScaleGroupEnd:"scaleGroupEnd"},render:function(e,t){var n=e.props,r=n.resizable,o=n.scalable,i=n.edge;if(!r&&o)return i?en(e,t):Zt(e,t)},dragControlCondition:xo,dragControlStart:function(e,t){var n=t.datas,r=t.isPinch,o=t.inputEvent,i=t.parentDirection||(r?[0,0]:ro(o.target)),a=e.state,s=a.width,l=a.height,u=a.targetTransform,c=a.target,f=a.pos1,d=a.pos2,h=a.pos4;if(!i||!c)return!1;r||sr(e,t),n.datas={},n.transform=u,n.prevDist=[1,1],n.direction=i,n.startOffsetWidth=s,n.startOffsetHeight=l,n.startValue=[1,1];var p=J(f,d),g=J(d,h),m=!i[0]&&!i[1]||i[0]||!i[1];function v(e){n.ratio=e&&isFinite(e)?e:0}function b(e){n.fixedDirection=e,n.fixedPosition=gr(n.startPositions,e)}n.scaleWidth=p,n.scaleHeight=g,n.scaleXRatio=p/s,n.scaleYRatio=g/l,br(t,"scale"),n.isWidth=m,n.startPositions=io(e.state),n.setFixedDirection=b,v(J(f,d)/J(d,h)),b([-i[0],-i[1]]);var y=so(e,t,jt(jt({direction:i,set:function(e){n.startValue=e},setRatio:v,setFixedDirection:b},vr(t)),{dragStart:ir.dragStart(e,(new qt).dragStart([0,0],t))}));return!1!==co(e,"onScaleStart",y)&&(n.isScale=!0,e.state.snapRenderInfo={request:t.isRequest,direction:i}),!!n.isScale&&y},dragControl:function(e,t){lr(t,"scale");var n=t.datas,r=t.parentKeepRatio,o=t.parentFlag,i=t.isPinch,a=t.dragClient,s=t.isRequest,l=n.prevDist,u=n.direction,c=n.startOffsetWidth,f=n.startOffsetHeight,d=n.isScale,h=n.startValue,p=n.isWidth,g=n.ratio;if(!d)return!1;var m=e.props,v=m.throttleScale,b=m.parentMoveable,y=u;u[0]||u[1]||(y=[1,1]);var w=g&&(null!=r?r:m.keepRatio)||!1,x=e.state;function S(){var e=_o(y,w,n,t),r=e.distWidth,o=e.distHeight,i=(c+r)/c,a=(f+o)/f;return i=y[0]||w?i*h[0]:h[0],a=y[1]||w?a*h[1]:h[1],0===i&&(i=(l[0]>0?1:-1)*Ft),0===a&&(a=(l[1]>0?1:-1)*Ft),[i,a]}var O=S();if(!i&&e.props.groupable){var E=(x.snapRenderInfo||{}).direction;A(E)&&(E[0]||E[1])&&(x.snapRenderInfo={direction:u,request:t.isRequest})}co(e,"onBeforeScale",so(e,t,{scale:O,setFixedDirection:function(e){return n.setFixedDirection(e),O=S()},setScale:function(e){O=e}},!0));var k=[O[0]/h[0],O[1]/h[1]],_=a,C=[0,0];if(a||(_=!o&&i?Cr(e,[0,0]):n.fixedPosition),i||(C=tr(e,k,u,s,n)),w){y[0]&&y[1]&&C[0]&&C[1]&&(Math.abs(C[0]*c)>Math.abs(C[1]*f)?C[1]=0:C[0]=0);var j=!C[0]&&!C[1];if(j&&(p?k[0]=Z(k[0]*h[0],v)/h[0]:k[1]=Z(k[1]*h[1],v)/h[1]),y[0]&&!y[1]||C[0]&&!C[1]||j&&p){k[0]+=C[0];var T=c*k[0]*h[0]/g;k[1]=T/f/h[1]}else if(!y[0]&&y[1]||!C[0]&&C[1]||j&&!p){k[1]+=C[1];var R=f*k[1]*h[1]*g;k[0]=R/c/h[0]}}else k[0]+=C[0],k[1]+=C[1],C[0]||(k[0]=Z(k[0]*h[0],v)/h[0]),C[1]||(k[1]=Z(k[1]*h[1],v)/h[1]);0===k[0]&&(k[0]=(l[0]>0?1:-1)*Ft),0===k[1]&&(k[1]=(l[1]>0?1:-1)*Ft);var L,M,P=[k[0]/l[0],k[1]/l[1]];M=h,O=[(L=k)[0]*M[0],L[1]*M[1]];var D=function(e,t,n,r,o){return Or(e,"scale(".concat(t.join(", "),")"),n,r,o)}(e,k,n.fixedDirection,_,n),I=pe(D,n.prevInverseDist||[0,0]);if(n.prevDist=k,n.prevInverseDist=D,O[0]===l[0]&&O[1]===l[1]&&I.every((function(e){return!e}))&&!b)return!1;var $=ur(n,"scale(".concat(O.join(", "),")"),"scale(".concat(k.join(", "),")")),N=so(e,t,jt({offsetWidth:c,offsetHeight:f,direction:u,scale:O,dist:k,delta:P,isPinch:!!i},Sr(e,$,I,i,t)));return co(e,"onScale",N),N},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isScale&&(n.isScale=!1,co(e,"onScaleEnd",lo(e,t,{})),r)},dragGroupControlCondition:xo,dragGroupControlStart:function(e,t){var n=t.datas,r=this.dragControlStart(e,t);if(!r)return!1;var o=Yt(e,"resizable",t);function i(t,r){var o=n.fixedDirection,i=n.fixedPosition,a=gr(r.datas.startPositions||io(t.state),o),s=me(Ee(-e.rotation/180*Math.PI,3),[a[0]-i[0],a[1]-i[1],1],3),l=s[0],u=s[1];return r.datas.originalX=l,r.datas.originalY=u,r}n.moveableScale=e.scale;var a=Xt(e,this,"dragControlStart",t,(function(e,t){return i(e,t)})),s=function(e){r.setFixedDirection(e),a.forEach((function(t,n){t.setFixedDirection(e),i(t.moveable,o[n])}))};n.setFixedDirection=s;var l=jt(jt({},r),{targets:e.props.targets,events:a,setFixedDirection:s}),u=co(e,"onScaleGroupStart",l);return n.isScale=!1!==u,!!n.isScale&&l},dragGroupControl:function(e,t){var n=t.datas;if(n.isScale){uo(e,"onBeforeScale",(function(n){co(e,"onBeforeScaleGroup",so(e,t,jt(jt({},n),{targets:e.props.targets}),!0))}));var r=this.dragControl(e,t);if(r){var o=n.moveableScale;e.scale=[r.scale[0]*o[0],r.scale[1]*o[1]];var i=e.props.keepRatio,a=r.dist,s=r.scale,l=n.fixedPosition,u=Xt(e,this,"dragControl",t,(function(t,n){var r=me(Ee(e.rotation/180*Math.PI,3),[n.datas.originalX*a[0],n.datas.originalY*a[1],1],3),o=r[0],u=r[1];return jt(jt({},n),{parentDist:null,parentScale:s,parentKeepRatio:i,dragClient:he(l,[o,u])})})),c=jt({targets:e.props.targets,events:u},r);return co(e,"onScaleGroup",c),c}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isScale){this.dragControlEnd(e,t);var r=Xt(e,this,"dragControlEnd",t);return co(e,"onScaleGroupEnd",lo(e,t,{targets:e.props.targets,events:r})),n}},request:function(){var e={},t=0,n=0;return{isControl:!0,requestStart:function(t){return{datas:e,parentDirection:t.direction||[1,1]}},request:function(r){return t+=r.deltaWidth,n+=r.deltaHeight,{datas:e,parentDist:[t,n],parentKeepRatio:r.keepRatio}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function Ao(e,t){return e.map((function(e,n){return r=e,o=t[n],(r*(a=2)+o*(i=1))/(i+a);var r,o,i,a}))}function Ro(e,t,n){var r=X(e,t),o=X(e,n)-r;return o>=0?o:o+2*Math.PI}var Lo={name:"warpable",ableGroup:"size",props:{warpable:Boolean,renderDirections:Array},events:{onWarpStart:"warpStart",onWarp:"warp",onWarpEnd:"warpEnd"},render:function(e,t){var n=e.props,r=n.resizable,o=n.scalable,i=n.warpable,a=n.zoom;if(r||o||!i)return[];var s=e.state,l=s.pos1,u=s.pos2,c=s.pos3,f=s.pos4,d=Ao(l,u),h=Ao(u,l),p=Ao(l,c),g=Ao(c,l),m=Ao(c,f),v=Ao(f,c),b=Ao(u,f),y=Ao(f,u);return Tt([t.createElement("div",{className:jr("line"),key:"middeLine1",style:Qr(d,m,a)}),t.createElement("div",{className:jr("line"),key:"middeLine2",style:Qr(h,v,a)}),t.createElement("div",{className:jr("line"),key:"middeLine3",style:Qr(p,b,a)}),t.createElement("div",{className:jr("line"),key:"middeLine4",style:Qr(g,y,a)})],Zt(e,t),!0)},dragControlCondition:function(e,t){return!t.isRequest&&te(t.inputEvent.target,jr("direction"))},dragControlStart:function(e,t){var n=t.datas,r=t.inputEvent,o=e.props.target,i=ro(r.target);if(!i||!o)return!1;var a=e.state,s=a.transformOrigin,l=a.is3d,u=a.targetTransform,c=a.targetMatrix,f=a.width,d=a.height,h=a.left,p=a.top;return n.datas={},n.targetTransform=u,n.warpTargetMatrix=l?c:ce(c,3,4),n.targetInverseMatrix=se(le(n.warpTargetMatrix,4),3,4),n.direction=i,n.left=h,n.top=p,n.poses=[[0,0],[f,0],[0,d],[f,d]].map((function(e){return pe(e,s)})),n.nextPoses=n.poses.map((function(e){var t=e[0],r=e[1];return me(n.warpTargetMatrix,[t,r,0,1],4)})),n.startValue=ke(4),n.prevMatrix=ke(4),n.absolutePoses=io(a),n.posIndexes=hr(i),sr(e,t),br(t,"matrix3d"),a.snapRenderInfo={request:t.isRequest,direction:i},!1!==co(e,"onWarpStart",so(e,t,jt({set:function(e){n.startValue=e}},vr(t))))&&(n.isWarp=!0),n.isWarp},dragControl:function(e,t){var n=t.datas,r=t.isRequest,o=t.distX,i=t.distY,a=n.targetInverseMatrix,s=n.prevMatrix,l=n.isWarp,u=n.startValue,c=n.poses,f=n.posIndexes,d=n.absolutePoses;if(!l)return!1;if(lr(t,"matrix3d"),dn(e,"warpable")){var h=f.map((function(e){return d[e]}));h.length>1&&h.push([(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]);var p=qn(e,r,{horizontal:h.map((function(e){return e[1]+i})),vertical:h.map((function(e){return e[0]+o}))}),g=p.horizontal,m=p.vertical;i-=g.offset,o-=m.offset}var v=dr({datas:n,distX:o,distY:i},!0),b=n.nextPoses.slice();if(f.forEach((function(e){b[e]=he(b[e],v)})),!$t.every((function(e){return t=e.map((function(e){return c[e]})),n=e.map((function(e){return b[e]})),r=Ro(t[0],t[1],t[2]),o=Ro(n[0],n[1],n[2]),i=Math.PI,!(r>=i&&o<=i||r<=i&&o>=i);var t,n,r,o,i})))return!1;var y=je(c[0],c[2],c[1],c[3],b[0],b[2],b[1],b[3]);if(!y.length)return!1;var w=cr(n,de(a,y,4),!0),x=de(le(s,4),w,4);n.prevMatrix=w;var S=de(u,w,4),O=ur(n,"matrix3d(".concat(S.join(", "),")"),"matrix3d(".concat(w.join(", "),")"));return wr(t,O),co(e,"onWarp",so(e,t,{delta:x,matrix:S,dist:w,multiply:de,transform:O})),!0},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isWarp&&(n.isWarp=!1,co(e,"onWarpEnd",lo(e,t,{})),r)}},Mo=jr("area-pieces"),Po=jr("area-piece"),Do=jr("avoid");function Io(e){var t=e.areaElement;if(t){var n=e.state,r=n.width,o=n.height;!function(e,t){if(e.classList)e.classList.remove(t);else{var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}(t,Do),t.style.cssText+="left: 0px; top: 0px; width: ".concat(r,"px; height: ").concat(o,"px")}}function $o(e){return e.createElement("div",{key:"area_pieces",className:Mo},e.createElement("div",{className:Po}),e.createElement("div",{className:Po}),e.createElement("div",{className:Po}),e.createElement("div",{className:Po}))}var No={name:"dragArea",props:{dragArea:Boolean,passDragArea:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},render:function(e,t){var n=e.props,r=n.target,o=n.dragArea,i=n.groupable,a=n.passDragArea,s=e.state,l=s.width,u=s.height,c=s.renderPoses,f=a?jr("area","pass"):jr("area");if(i)return[t.createElement("div",{key:"area",ref:x(e,"areaElement"),className:f}),$o(t)];if(!r||!o)return[];var d=je([0,0],[l,0],[0,u],[l,u],c[0],c[1],c[2],c[3]),h=d.length?zr(d,!0):"none";return[t.createElement("div",{key:"area",ref:x(e,"areaElement"),className:f,style:{top:"0px",left:"0px",width:"".concat(l,"px"),height:"".concat(u,"px"),transformOrigin:"0 0",transform:h}}),$o(t)]},dragStart:function(e,t){var n=t.datas,r=t.clientX,o=t.clientY;if(!t.inputEvent)return!1;n.isDragArea=!1;var i,a,s=e.areaElement,l=e.state,u=l.moveableClientRect,c=l.renderPoses,f=l.rootMatrix,d=l.is3d,h=u.left,p=u.top,g=Gr(c),m=g.left,v=g.top,b=g.width,y=g.height,w=mo(f,[r-h,o-p],d?4:3),x=w[0],S=w[1],O=[{left:m,top:v,width:b,height:(S-=v)-10},{left:m,top:v,width:(x-=m)-10,height:y},{left:m,top:v+S+10,width:b,height:y-S-10},{left:m+x+10,top:v,width:b-x-10,height:y}],E=[].slice.call(s.nextElementSibling.children);O.forEach((function(e,t){E[t].style.cssText="left: ".concat(e.left,"px;top: ").concat(e.top,"px; width: ").concat(e.width,"px; height: ").concat(e.height,"px;")})),a=Do,(i=s).classList?i.classList.add(a):i.className+=" "+a,l.disableNativeEvent=!0},drag:function(e,t){var n=t.datas,r=t.inputEvent;if(this.enableNativeEvent(e),!r)return!1;n.isDragArea||(n.isDragArea=!0,Io(e))},dragEnd:function(e,t){this.enableNativeEvent(e);var n=t.inputEvent,r=t.datas;if(!n)return!1;r.isDragArea||Io(e)},dragGroupStart:function(e,t){return this.dragStart(e,t)},dragGroup:function(e,t){return this.drag(e,t)},dragGroupEnd:function(e,t){return this.dragEnd(e,t)},unset:function(e){Io(e),e.state.disableNativeEvent=!1},enableNativeEvent:function(e){var t=e.state;t.disableNativeEvent&&W((function(){t.disableNativeEvent=!1}))}},Fo=At("origin",{render:function(e,t){var n=e.props.zoom,r=e.state,o=r.beforeOrigin,i=r.rotation;return[t.createElement("div",{className:jr("control","origin"),style:Jr(i,n,o),key:"beforeOrigin"})]}});function Bo(e){var t=e.scrollContainer;return[t.scrollLeft,t.scrollTop]}var zo={name:"scrollable",canPinch:!0,props:{scrollable:Boolean,scrollContainer:Object,scrollThreshold:Number,getScrollPosition:Function},events:{onScroll:"scroll",onScrollGroup:"scrollGroup"},dragRelation:"strong",dragStart:function(e,t){var n=e.props.scrollContainer,r=void 0===n?e.getContainer():n,o=new it,i=Oo(r,!0);t.datas.dragScroll=o;var a=t.isControl?"controlGesto":"targetGesto",s=t.targets;o.on("scroll",(function(n){var r=n.container,o=n.direction,i=so(e,t,{scrollContainer:r,direction:o}),a=s?"onScrollGroup":"onScroll";s&&(i.targets=s),co(e,a,i)})).on("move",(function(n){var r=n.offsetX,o=n.offsetY;e[a].scrollBy(r,o,t.inputEvent,!1)})),o.dragStart(t,{container:i})},checkScroll:function(e,t){var n=t.datas.dragScroll;if(n){var r=e.props,o=r.scrollContainer,i=void 0===o?e.getContainer():o,a=r.scrollThreshold,s=void 0===a?0:a,l=r.getScrollPosition,u=void 0===l?Bo:l;return n.drag(t,{container:i,threshold:s,getScrollPosition:function(e){return u({scrollContainer:e.container,direction:e.direction})}}),!0}},drag:function(e,t){return this.checkScroll(e,t)},dragEnd:function(e,t){t.datas.dragScroll.dragEnd(),t.datas.dragScroll=null},dragControlStart:function(e,t){return this.dragStart(e,jt(jt({},t),{isControl:!0}))},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupStart:function(e,t){return this.dragStart(e,jt(jt({},t),{targets:e.props.targets}))},dragGroup:function(e,t){return this.drag(e,jt(jt({},t),{targets:e.props.targets}))},dragGroupEnd:function(e,t){return this.dragEnd(e,jt(jt({},t),{targets:e.props.targets}))},dragGroupControlStart:function(e,t){return this.dragStart(e,jt(jt({},t),{targets:e.props.targets,isControl:!0}))},dragGroupContro:function(e,t){return this.drag(e,jt(jt({},t),{targets:e.props.targets}))},dragGroupControEnd:function(e,t){return this.dragEnd(e,jt(jt({},t),{targets:e.props.targets}))}},Ho={name:"",props:{target:Object,dragTarget:Object,container:Object,portalContainer:Object,rootContainer:Object,useResizeObserver:Boolean,zoom:Number,transformOrigin:Array,edge:Boolean,ables:Array,className:String,pinchThreshold:Number,pinchOutside:Boolean,triggerAblesSimultaneously:Boolean,checkInput:Boolean,cspNonce:String,translateZ:Number,hideDefaultLines:Boolean,props:Object},events:{}},Wo=At("padding",{render:function(e,t){var n=e.props;if(n.dragArea)return[];var r=n.padding||{},o=r.left,i=void 0===o?0:o,a=r.top,s=void 0===a?0:a,l=r.right,u=void 0===l?0:l,c=r.bottom,f=void 0===c?0:c,d=e.state,h=d.renderPoses,p=[d.pos1,d.pos2,d.pos3,d.pos4],g=[];return i>0&&g.push([0,2]),s>0&&g.push([0,1]),u>0&&g.push([1,3]),f>0&&g.push([2,3]),g.map((function(e,n){var r=e[0],o=e[1],i=je([0,0],[100,0],[0,100],[100,100],p[r],p[o],h[r],h[o]);if(i.length)return t.createElement("div",{key:"padding".concat(n),className:jr("padding"),style:{transform:zr(i,!0)}})}))}}),Uo=["nw","ne","se","sw"];function Vo(e,t){var n=e[0]+e[1],r=n>t?t/n:1;return e[0]*=r,e[1]=t-e[1]*r,e}var Go=[1,2,5,6],qo=[0,3,4,7],Yo=[1,-1,-1,1],Ko=[1,1,-1,-1];function Xo(e,t,n,r,o,i,a,s,l){void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=r),void 0===l&&(l=o);var u=[],c=!1,f=e.map((function(e,f){var d=t[f],h=d.horizontal,p=d.vertical;if(p&&!c&&(c=!0,u.push("/")),c){var g=Math.max(0,1===p?e[1]-a:l-e[1]);return u.push(yo(g,o,n)),g}g=Math.max(0,1===h?e[0]-i:s-e[0]);return u.push(yo(g,r,n)),g}));return{styles:u,raws:f}}function Qo(e){for(var t=[0,0],n=[0,0],r=e.length,o=0;o-1?e.slice(0,c):e).length,d=e.slice(0,f),h=e.slice(f+1),p=d[0],g=void 0===p?"0px":p,m=d[1],v=void 0===m?g:m,b=d[2],y=void 0===b?g:b,w=d[3],x=void 0===w?v:w,S=h[0],O=void 0===S?g:S,E=h[1],k=void 0===E?O:E,_=h[2],C=void 0===_?O:_,j=h[3],T=void 0===j?k:j,A=[g,v,y,x].map((function(e){return G(e,t)})),R=[O,k,C,T].map((function(e){return G(e,n)})),L=A.slice(),M=R.slice();a=Vo([L[0],L[1]],t),L[0]=a[0],L[1]=a[1],s=Vo([L[3],L[2]],t),L[3]=s[0],L[2]=s[1],l=Vo([M[0],M[3]],n),M[0]=l[0],M[3]=l[1],u=Vo([M[1],M[2]],n),M[1]=u[0],M[2]=u[1];var P=L.slice(0,Math.max(i[0],d.length)),D=M.slice(0,Math.max(i[1],h.length));return Tt(Tt([],P.map((function(e,t){var i=Uo[t];return{horizontal:Yo[t],vertical:0,pos:[r+e,o+(-1===Ko[t]?n:0)],sub:!0,raw:A[t],direction:i}})),!0),D.map((function(e,n){var i=Uo[n];return{horizontal:0,vertical:Ko[n],pos:[r+(-1===Yo[n]?t:0),o+e],sub:!0,raw:R[n],direction:i}})),!0)}function Zo(e,t,n,r,o){void 0===o&&(o=t.length);var i=Qo(e.slice(r)),a=i.horizontalRange,s=i.verticalRange,l=n-r,u=0;if(0===l)u=o;else if(l>0&&l=s[0]))return;u=s[0]+s[1]-l}e.splice(n,u),t.splice(n,u)}function ei(e,t,n,r,o,i,a,s,l,u,c){void 0===u&&(u=0),void 0===c&&(c=0);var f=Qo(e.slice(n)),d=f.horizontalRange,h=f.verticalRange;if(r>-1)for(var p=1===Yo[r]?i-u:s-i,g=d[1];g<=r;++g){var m=1===Ko[g]?c:l,v=0;if(r===g?v=i:0===g?v=u+p:-1===Yo[g]&&(v=s-(t[n][0]-u)),e.splice(n+g,0,{horizontal:Yo[g],vertical:0,pos:[v,m]}),t.splice(n+g,0,[v,m]),0===g)break}else if(o>-1){var b=1===Ko[o]?a-c:l-a;if(0===d[1]&&0===h[1]){var y=[u+b,c];e.push({horizontal:Yo[0],vertical:0,pos:y}),t.push(y)}var w=h[0];for(g=h[1];g<=o;++g){v=1===Yo[g]?u:s,m=0;if(o===g?m=a:0===g?m=c+b:1===Ko[g]?m=t[n+w][1]:-1===Ko[g]&&(m=l-(t[n+w][1]-c)),e.push({horizontal:0,vertical:Ko[g],pos:[v,m]}),t.push([v,m]),0===g)break}}}function ti(e,t){return void 0===t&&(t=e.map((function(e){return e.raw}))),{horizontals:e.map((function(e,n){return e.horizontal?t[n]:null})).filter((function(e){return null!=e})),verticals:e.map((function(e,n){return e.vertical?t[n]:null})).filter((function(e){return null!=e}))}}var ni=[[0,-1,"n"],[1,0,"e"]],ri=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function oi(e,t,n){var r=e.props.clipRelative,o=e.state,i=o.width,a=o.height,s=t,l=s.type,u=s.poses,c="rect"===l,f="circle"===l;if("polygon"===l)return n.map((function(e){return"".concat(yo(e[0],i,r)," ").concat(yo(e[1],a,r))}));if(c||"inset"===l){var d=n[1][1],h=n[3][0],p=n[7][0],g=n[5][1];if(c)return[d,h,g,p].map((function(e){return"".concat(e,"px")}));var m=[d,i-h,a-g,p].map((function(e,t){return yo(e,t%2?i:a,r)}));if(n.length>8){var v=pe(n[4],n[0]),b=v[0],y=v[1];m.push.apply(m,Tt(["round"],Xo(n.slice(8),u.slice(8),r,b,y,p,d,h,g).styles,!1))}return m}if(f||"ellipse"===l){var w=n[0],x=yo(Math.abs(n[1][1]-w[1]),f?Math.sqrt((i*i+a*a)/2):a,r);return(m=f?[x]:[yo(Math.abs(n[2][0]-w[0]),i,r),x]).push("at",yo(w[0],i,r),yo(w[1],a,r)),m}}function ii(e,t,n,r){var o=[r,(r+t)/2,t],i=[e,(e+n)/2,n];return ri.map((function(e){var t=e[0],n=e[1],r=e[2],a=o[t+1],s=i[n+1];return{vertical:Math.abs(n),horizontal:Math.abs(t),direction:r,pos:[a,s]}}))}function ai(e,t,n,r,o){var i,a,s,l,u,c,f,d=o;if(!d){var h=fo(e),p=h.clipPath;d="none"!==p?p:h.clip}if(d&&"none"!==d&&"auto"!==d||(d=r)){var g=N(d),m=g.prefix,v=void 0===m?d:m,b=g.value,y=void 0===b?"":b,w="circle"===v,x=" ";if("polygon"===v){x=",";var S=(C=$(y||"0% 0%, 100% 0%, 100% 100%, 0% 100%")).map((function(e){var r=e.split(" "),o=r[0],i=r[1];return{vertical:1,horizontal:1,pos:[G(o,t),G(i,n)]}}));return{type:v,clipText:d,poses:S,splitter:x}}if(w||"ellipse"===v){var O="",E="",k=0,_=0,C=I(y);if(w){var j;j=void 0===(i=C[0])?"50%":i,O=void 0===(a=C[2])?"50%":a,E=void 0===(s=C[3])?"50%":s,k=G(j,Math.sqrt((t*t+n*n)/2)),_=k}else{var T,A;T=void 0===(l=C[0])?"50%":l,A=void 0===(u=C[1])?"50%":u,O=void 0===(c=C[3])?"50%":c,E=void 0===(f=C[4])?"50%":f,k=G(T,t),_=G(A,n)}var R=[G(O,t),G(E,n)];S=Tt([{vertical:1,horizontal:1,pos:R,direction:"nesw"}],ni.slice(0,w?1:2).map((function(e){return{vertical:Math.abs(e[1]),horizontal:e[0],direction:e[2],sub:!0,pos:[R[0]+e[0]*k,R[1]+e[1]*_]}})),!0);return{type:v,clipText:d,radiusX:k,radiusY:_,left:R[0]-k,top:R[1]-_,poses:S,splitter:x}}if("inset"===v){var L=(C=I(y||"0 0 0 0")).indexOf("round"),M=(L>-1?C.slice(0,L):C).length,P=C.slice(M+1),D=C.slice(0,M),B=D[0],z=D[1],H=void 0===z?B:z,W=D[2],U=void 0===W?B:W,V=D[3],q=void 0===V?H:V,Y=[B,U].map((function(e){return G(e,n)})),K=Y[0],X=Y[1],Q=[q,H].map((function(e){return G(e,t)})),J=Q[0],Z=Q[1],ee=t-Z,te=n-X,ne=Jo(P,ee-J,te-K,J,K);return{type:"inset",clipText:d,poses:S=Tt(Tt([],ii(K,ee,te,J),!0),ne,!0),top:K,left:J,right:ee,bottom:te,radius:P,splitter:x}}if("rect"===v){x=",";var re=(C=$(y||"0px, ".concat(t,"px, ").concat(n,"px, 0px"))).map((function(e){return F(e).value}));return{type:"rect",clipText:d,poses:S=ii(K=re[0],Z=re[1],X=re[2],J=re[3]),top:K,right:Z,bottom:X,left:J,values:C,splitter:x}}}}var si={name:"clippable",props:{clippable:Boolean,defaultClipPath:String,customClipPath:String,clipRelative:Boolean,clipArea:Boolean,dragWithClip:Boolean,clipTargetBounds:Boolean,clipVerticalGuidelines:Array,clipHorizontalGuidelines:Array,clipSnapThreshold:Boolean},events:{onClipStart:"clipStart",onClip:"clip",onClipEnd:"clipEnd"},css:[".control.clip-control {\n background: #6d6;\n cursor: pointer;\n}\n.control.clip-control.clip-radius {\n background: #d66;\n}\n.line.clip-line {\n background: #6e6;\n cursor: move;\n z-index: 1;\n}\n.clip-area {\n position: absolute;\n top: 0;\n left: 0;\n}\n.clip-ellipse {\n position: absolute;\n cursor: move;\n border: 1px solid #6d6;\n border: var(--zoompx) solid #6d6;\n border-radius: 50%;\n transform-origin: 0px 0px;\n}",":host {\n --bounds-color: #d66;\n}",".guideline {\n pointer-events: none;\n z-index: 2;\n}",".line.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}"],render:function(e,t){var n=e.props,r=n.customClipPath,o=n.defaultClipPath,i=n.clipArea,a=n.zoom,s=e.state,l=s.target,u=s.width,c=s.height,f=s.allMatrix,d=s.is3d,h=s.left,p=s.top,g=s.pos1,m=s.pos2,v=s.pos3,b=s.pos4,y=s.clipPathState,w=s.snapBoundInfos,x=s.rotation;if(!l)return[];var S=ai(l,u,c,o||"inset",y||r);if(!S)return[];var O=d?4:3,E=S.type,k=S.poses.map((function(e){var t=Ur(f,e.pos,O);return[t[0]-h,t[1]-p]})),_=[],C=[],j="rect"===E,T="inset"===E,A="polygon"===E;if(j||T||A){var R=T?k.slice(0,8):k;C=R.map((function(e,n){var r=0===n?R[R.length-1]:R[n-1],o=X(r,e),i=Xr(r,e);return t.createElement("div",{key:"clipLine".concat(n),className:jr("line","clip-line","snap-control"),"data-clip-index":n,style:{width:"".concat(i,"px"),transform:"translate(".concat(r[0],"px, ").concat(r[1],"px) rotate(").concat(o,"rad) scaleY(").concat(a,")")}})}))}if(_=k.map((function(e,n){return t.createElement("div",{key:"clipControl".concat(n),className:jr("control","clip-control","snap-control"),"data-clip-index":n,style:{transform:"translate(".concat(e[0],"px, ").concat(e[1],"px) rotate(").concat(x,"rad) scale(").concat(a,")")}})})),T&&_.push.apply(_,k.slice(8).map((function(e,n){return t.createElement("div",{key:"clipRadiusControl".concat(n),className:jr("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+n,style:{transform:"translate(".concat(e[0],"px, ").concat(e[1],"px) rotate(").concat(x,"rad) scale(").concat(a,")")}})}))),"circle"===E||"ellipse"===E){var L=S.left,M=S.top,P=S.radiusX,D=S.radiusY,I=pe(Ur(f,[L,M],O),Ur(f,[0,0],O)),$=I[0],N=I[1],F="none";if(!i){for(var B=Math.max(10,P/5,D/5),z=[],H=0;H<=B;++H){var W=2*Math.PI/B*H;z.push([P+(P-a)*Math.cos(W),D+(D-a)*Math.sin(W)])}z.push([P,-2]),z.push([-2,-2]),z.push([-2,2*D+2]),z.push([2*P+2,2*D+2]),z.push([2*P+2,-2]),z.push([P,-2]),F="polygon(".concat(z.map((function(e){return"".concat(e[0],"px ").concat(e[1],"px")})).join(", "),")")}_.push(t.createElement("div",{key:"clipEllipse",className:jr("clip-ellipse","snap-control"),style:{width:"".concat(2*P,"px"),height:"".concat(2*D,"px"),clipPath:F,transform:"translate(".concat(-h+$,"px, ").concat(-p+N,"px) ").concat(zr(f))}}))}if(i){var U=Gr(Tt([g,m,v,b],k,!0)),V=U.width,G=U.height,q=U.left,Y=U.top;if(A||j||T){z=T?k.slice(0,8):k;_.push(t.createElement("div",{key:"clipArea",className:jr("clip-area","snap-control"),style:{width:"".concat(V,"px"),height:"".concat(G,"px"),transform:"translate(".concat(q,"px, ").concat(Y,"px)"),clipPath:"polygon(".concat(z.map((function(e){return"".concat(e[0]-q,"px ").concat(e[1]-Y,"px")})).join(", "),")")}}))}}return w&&["vertical","horizontal"].forEach((function(e){var n=w[e],r="horizontal"===e;n.isSnap&&C.push.apply(C,n.snap.posInfos.map((function(n,o){var i=n.pos,s=pe(Ur(f,r?[0,i]:[i,0],O),[h,p]),l=pe(Ur(f,r?[u,i]:[i,c],O),[h,p]);return Jt(t,"",s,l,a,"clip".concat(e,"snap").concat(o),"guideline")}))),n.isBound&&C.push.apply(C,n.bounds.map((function(n,o){var i=n.pos,s=pe(Ur(f,r?[0,i]:[i,0],O),[h,p]),l=pe(Ur(f,r?[u,i]:[i,c],O),[h,p]);return Jt(t,"",s,l,a,"clip".concat(e,"bounds").concat(o),"guideline","bounds","bold")})))})),Tt(Tt([],_,!0),C,!0)},dragControlCondition:function(e,t){return t.inputEvent&&(t.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(e,t){var n=e.props.dragWithClip;return!(void 0===n||n)&&this.dragControlStart(e,t)},drag:function(e,t){return this.dragControl(e,jt(jt({},t),{isDragTarget:!0}))},dragEnd:function(e,t){return this.dragControlEnd(e,t)},dragControlStart:function(e,t){var n=e.state,r=e.props,o=r.defaultClipPath,i=r.customClipPath,a=n.target,s=n.width,l=n.height,u=t.inputEvent?t.inputEvent.target:null,c=u&&u.getAttribute("class")||"",f=t.datas,d=ai(a,s,l,o||"inset",i);if(!d)return!1;var h=d.clipText;return!1===co(e,"onClipStart",so(e,t,{clipType:d.type,clipStyle:h,poses:d.poses.map((function(e){return e.pos}))}))?(f.isClipStart=!1,!1):(f.isControl=c&&c.indexOf("clip-control")>-1,f.isLine=c.indexOf("clip-line")>-1,f.isArea=c.indexOf("clip-area")>-1||c.indexOf("clip-ellipse")>-1,f.index=u?parseInt(u.getAttribute("data-clip-index"),10):-1,f.clipPath=d,f.isClipStart=!0,n.clipPathState=h,sr(e,t),!0)},dragControl:function(e,t){var n,r=t.datas,o=t.originalDatas,i=t.isDragTarget;if(!r.isClipStart)return!1;var a=r,s=a.isControl,l=a.isLine,u=a.isArea,c=a.index,f=a.clipPath;if(!f)return!1;var d=0,h=0,p=o.draggable,g=dr(t);i&&p?(n=p.prevBeforeDist,d=n[0],h=n[1]):(d=g[0],h=g[1]);var m=[d,h],v=e.props,b=e.state,y=b.width,w=b.height,x=!u&&!s&&!l,S=f.type,O=f.poses,E=f.splitter,k=O.map((function(e){return e.pos}));x&&(d=-d,h=-h);var _=!s||"nesw"===O[c].direction,C="inset"===S||"rect"===S,j=O.map((function(){return[0,0]}));if(s&&!_){var T=O[c],A=T.horizontal,R=T.vertical,L=[d*Math.abs(A),h*Math.abs(R)];j=function(e,t,n,r){var o=e[t],i=o.direction,a=o.sub,s=e.map((function(){return[0,0]})),l=i?i.split(""):[];if(r&&t<8){var u=l.filter((function(e){return"w"===e||"e"===e}))[0],c=l.filter((function(e){return"n"===e||"s"===e}))[0];s[t]=n,e.forEach((function(e,t){var r=e.direction;r&&(r.indexOf(u)>-1&&(s[t][0]=n[0]),r.indexOf(c)>-1&&(s[t][1]=n[1]))})),u&&(s[1][0]=n[0]/2,s[5][0]=n[0]/2),c&&(s[3][1]=n[1]/2,s[7][1]=n[1]/2)}else i&&!a?l.forEach((function(t){var r="n"===t||"s"===t;e.forEach((function(e,o){var i=e.direction,a=e.horizontal,l=e.vertical;i&&-1!==i.indexOf(t)&&(s[o]=[r||!a?0:n[0],r&&l?n[1]:0])}))})):s[t]=n;return s}(O,c,L,C)}else _&&(j=k.map((function(){return[d,h]})));var M=k.map((function(e,t){return he(e,j[t])})),P=Tt([],M,!0);b.snapBoundInfos=null;var D="circle"===f.type,I="ellipse"===f.type;if(D||I){var $=Gr(M),N=Math.abs($.bottom-$.top),F=Math.abs(I?$.right-$.left:N),B=M[0][1]+N,z=M[0][0]-F,H=M[0][0]+F;D&&(P.push([H,$.bottom]),j.push([1,0])),P.push([$.left,B]),j.push([0,1]),P.push([z,$.bottom]),j.push([1,0])}var W=gn((v.clipHorizontalGuidelines||[]).map((function(e){return G("".concat(e),w)})),(v.clipVerticalGuidelines||[]).map((function(e){return G("".concat(e),y)})),y,w),U=[],V=[];if(D||I)U=[P[4][0],P[2][0]],V=[P[1][1],P[3][1]];else if(C){var q=[P[0],P[2],P[4],P[6]],Y=[j[0],j[2],j[4],j[6]];U=q.filter((function(e,t){return Y[t][0]})).map((function(e){return e[0]})),V=q.filter((function(e,t){return Y[t][1]})).map((function(e){return e[1]}))}else U=P.filter((function(e,t){return j[t][0]})).map((function(e){return e[0]})),V=P.filter((function(e,t){return j[t][1]})).map((function(e){return e[1]}));for(var K=[0,0],X=function(e){var t=Yn(W,v.clipTargetBounds&&{left:0,top:0,right:y,bottom:w},U,V,5),n=t.horizontal,r=t.vertical,o=n.offset,i=r.offset;if(n.isBound&&(K[1]+=o),r.isBound&&(K[0]+=i),!I&&!D||0!==j[0][0]||0!==j[0][1])return P.forEach((function(e,t){var n=j[t];n[0]&&(e[0]-=i),n[1]&&(e[1]-=o)})),"break";var a=Gr(M),s=a.bottom-a.top,l=I?a.right-a.left:s;l-=r.isBound?Math.abs(i):0===r.snapIndex?-i:i,s-=n.isBound?Math.abs(o):0===n.snapIndex?-o:o,D&&(l=s=En(r,n)>0?s:l);var u=P[0];P[1][1]=u[1]-s,P[2][0]=u[0]+l,P[3][1]=u[1]+s,P[4][0]=u[0]-l},Q=0;Q<2;++Q){if("break"===X())break}var J=oi(e,f,M),Z="".concat(S,"(").concat(J.join(E),")");if(b.clipPathState=Z,D||I)U=[P[4][0],P[2][0]],V=[P[1][1],P[3][1]];else if(C){q=[P[0],P[2],P[4],P[6]];U=q.map((function(e){return e[0]})),V=q.map((function(e){return e[1]}))}else U=P.map((function(e){return e[0]})),V=P.map((function(e){return e[1]}));if(b.snapBoundInfos=Yn(W,v.clipTargetBounds&&{left:0,top:0,right:y,bottom:w},U,V,1),p){var ee=b.is3d,te=b.allMatrix,ne=ee?4:3,re=K;i&&(re=[m[0]+K[0]-g[0],m[1]+K[1]-g[1]]),p.deltaOffset=de(te,[re[0],re[1],0,0],ne)}return co(e,"onClip",so(e,t,{clipEventType:"changed",clipType:S,poses:M,clipStyle:Z,clipStyles:J,distX:d,distY:h})),!0},dragControlEnd:function(e,t){this.unset(e);var n=t.isDrag,r=t.datas,o=t.isDouble,i=r.isLine,a=r.isClipStart,s=r.isControl;return!!a&&(co(e,"onClipEnd",lo(e,t,{})),o&&(s?function(e,t){var n=t.datas,r=n.clipPath,o=n.index,i=r,a=i.type,s=i.poses,l=i.splitter,u=s.map((function(e){return e.pos})),c=u.length;if("polygon"===a)s.splice(o,1),u.splice(o,1);else{if("inset"!==a)return;if(o<8)return;if(Zo(s,u,o,8,c),c===s.length)return}var f=oi(e,r,u);co(e,"onClip",so(e,t,{clipEventType:"removed",clipType:a,poses:u,clipStyles:f,clipStyle:"".concat(a,"(").concat(f.join(l),")"),distX:0,distY:0}))}(e,t):i&&function(e,t){var n=ar(e,t),r=n[0],o=n[1],i=t.datas,a=i.clipPath,s=i.index,l=a,u=l.type,c=l.poses,f=l.splitter,d=c.map((function(e){return e.pos}));if("polygon"===u)d.splice(s,0,[r,o]);else{if("inset"!==u)return;var h=Go.indexOf(s),p=qo.indexOf(s),g=c.length;if(ei(c,d,8,h,p,r,o,d[4][0],d[4][1],d[0][0],d[0][1]),g===c.length)return}var m=oi(e,a,d);co(e,"onClip",so(e,t,{clipEventType:"added",clipType:u,poses:d,clipStyles:m,clipStyle:"".concat(u,"(").concat(m.join(f),")"),distX:0,distY:0}))}(e,t)),o||n)},unset:function(e){e.state.clipPathState="",e.state.snapBoundInfos=null}},li={name:"originDraggable",props:{originDraggable:Boolean,originRelative:Boolean},events:{onDragOriginStart:"dragOriginStart",onDragOrigin:"dragOrigin",onDragOriginEnd:"dragOriginEnd"},css:[":host[data-able-origindraggable] .control.origin {\n pointer-events: auto;\n}"],dragControlCondition:function(e,t){return t.isRequest?"originDraggable"===t.requestAble:te(t.inputEvent.target,jr("origin"))},dragControlStart:function(e,t){var n=t.datas;sr(e,t);var r=so(e,t,{dragStart:ir.dragStart(e,(new qt).dragStart([0,0],t))}),o=co(e,"onDragOriginStart",r);return n.startOrigin=e.state.transformOrigin,n.startTargetOrigin=e.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,!1===o?(n.isDragOrigin=!1,!1):r},dragControl:function(e,t){var n=t.datas,r=t.isPinch,o=t.isRequest;if(!n.isDragOrigin)return!1;var i=dr(t),a=i[0],s=i[1],l=e.state,u=l.width,c=l.height,f=l.offsetMatrix,d=l.targetMatrix,h=l.is3d,p=e.props.originRelative,g=void 0===p||p,m=h?4:3,v=[a,s];if(o){var b=t.distOrigin;(b[0]||b[1])&&(v=b)}var y=he(n.startOrigin,v),w=he(n.startTargetOrigin,v),x=pe(v,n.prevOrigin),S=mr(f,d,y,m),O=e.getRect(),E=Gr(Vr(S,u,c,m)),k=[O.left-E.left,O.top-E.top];n.prevOrigin=v;var _=so(e,t,{width:u,height:c,origin:y,dist:v,delta:x,transformOrigin:[yo(w[0],u,g),yo(w[1],c,g)].join(" "),drag:ir.drag(e,Gt(t,e.state,k,!!r,!1))});return co(e,"onDragOrigin",_),_},dragControlEnd:function(e,t){return!!t.datas.isDragOrigin&&(co(e,"onDragOriginEnd",lo(e,t,{})),!0)},dragGroupControlCondition:function(e,t){return this.dragControlCondition(e,t)},dragGroupControlStart:function(e,t){return!!this.dragControlStart(e,t)},dragGroupControl:function(e,t){var n=this.dragControl(e,t);return!!n&&(e.transformOrigin=n.transformOrigin,!0)},request:function(e){var t={},n=e.getRect(),r=0,o=0,i=n.transformOrigin,a=[0,0];return{isControl:!0,requestStart:function(){return{datas:t}},request:function(e){return"deltaOrigin"in e?(a[0]+=e.deltaOrigin[0],a[1]+=e.deltaOrigin[1]):"origin"in e?(a[0]=e.origin[0]-i[0],a[1]=e.origin[1]-i[1]):("x"in e?r=e.x-n.left:"deltaX"in e&&(r+=e.deltaX),"y"in e?o=e.y-n.top:"deltaY"in e&&(o+=e.deltaY)),{datas:t,distX:r,distY:o,distOrigin:a}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function ui(e,t,n,r,o){var i;void 0===r&&(r=[0,0]);if(o)i=o;else{var a=fo(e);i=a&&a.borderRadius||""}return Jo(!i||!o&&"0px"===i?[]:I(i),t,n,0,0,r)}function ci(e,t,n,r,o,i){var a=e.state,s=a.width,l=a.height,u=Xo(i,o,e.props.roundRelative,s,l),c=u.raws,f=u.styles,d=ti(o,c),h=d.horizontals,p=d.verticals,g=f.join(" ");a.borderRadiusState=g,co(e,"onRound",so(e,t,{horizontals:h,verticals:p,borderRadius:g,width:s,height:l,delta:r,dist:n}))}var fi={name:"roundable",props:{roundable:Boolean,roundRelative:Boolean,minRoundControls:Array,maxRoundControls:Array,roundClickable:Boolean},events:{onRoundStart:"roundStart",onRound:"round",onRoundEnd:"roundEnd"},css:[".control.border-radius {\n background: #d66;\n cursor: pointer;\n}",":host[data-able-roundable] .line.direction {\n cursor: pointer;\n}"],render:function(e,t){var n=e.state,r=n.target,o=n.width,i=n.height,a=n.allMatrix,s=n.is3d,l=n.left,u=n.top,c=n.borderRadiusState,f=e.props,d=f.minRoundControls,h=void 0===d?[0,0]:d,p=f.maxRoundControls,g=void 0===p?[4,4]:p,m=f.zoom;if(!r)return null;var v=s?4:3,b=ui(r,o,i,h,c);if(!b)return null;var y=0,w=0;return b.map((function(e,n){w+=Math.abs(e.horizontal),y+=Math.abs(e.vertical);var r=pe(Ur(a,e.pos,v),[l,u]),o=e.vertical?y<=g[1]:w<=g[0];return t.createElement("div",{key:"borderRadiusControl".concat(n),className:jr("control","border-radius"),"data-radius-index":n,style:{display:o?"block":"none",transform:"translate(".concat(r[0],"px, ").concat(r[1],"px) scale(").concat(m,")")}})}))},dragControlCondition:function(e,t){if(!t.inputEvent||t.isRequest)return!1;var n=t.inputEvent.target.getAttribute("class")||"";return n.indexOf("border-radius")>-1||n.indexOf("moveable-line")>-1&&n.indexOf("moveable-direction")>-1},dragControlStart:function(e,t){var n=t.inputEvent,r=t.datas,o=n.target,i=o.getAttribute("class")||"",a=i.indexOf("border-radius")>-1,s=i.indexOf("moveable-line")>-1&&i.indexOf("moveable-direction")>-1,l=a?parseInt(o.getAttribute("data-radius-index"),10):-1,u=s?parseInt(o.getAttribute("data-line-index"),10):-1;if(!a&&!s)return!1;if(!1===co(e,"onRoundStart",so(e,t,{})))return!1;r.lineIndex=u,r.controlIndex=l,r.isControl=a,r.isLine=s,sr(e,t);var c=e.props,f=c.roundRelative,d=c.minRoundControls,h=void 0===d?[0,0]:d,p=e.state,g=p.target,m=p.width,v=p.height;r.isRound=!0,r.prevDist=[0,0];var b=ui(g,m,v,h)||[];return r.controlPoses=b,p.borderRadiusState=Xo(b.map((function(e){return e.pos})),b,f,m,v).styles.join(" "),!0},dragControl:function(e,t){var n=t.datas;if(!n.isRound||!n.isControl||!n.controlPoses.length)return!1;var r=n.controlIndex,o=n.controlPoses,i=dr(t),a=i[0],s=i[1],l=[a,s],u=pe(l,n.prevDist),c=e.props.maxRoundControls,f=void 0===c?[4,4]:c,d=e.state,h=d.width,p=d.height,g=o[r],m=g.vertical,v=g.horizontal,b=o.map((function(e){var t=e.horizontal,n=e.vertical,r=[t*v*l[0],n*m*l[1]];if(t){if(1===f[0])return r;if(f[0]<4&&t!==v)return r}else{if(0===f[1])return r[1]=n*v*l[0]/h*p,r;if(m){if(1===f[1])return r;if(f[1]<4&&n!==m)return r}}return[0,0]}));b[r]=l;var y=o.map((function(e,t){return he(e.pos,b[t])}));return n.prevDist=[a,s],ci(e,t,l,u,o,y),!0},dragControlEnd:function(e,t){var n=e.state;n.borderRadiusState="";var r=t.datas,o=t.isDouble;if(!r.isRound)return!1;var i=n.width,a=n.height,s=r.isControl,l=r.controlIndex,u=r.isLine,c=r.lineIndex,f=r.controlPoses,d=f.map((function(e){return e.pos})),h=d.length,p=e.props.roundClickable;if(o&&(void 0===p||p)){if(s)Zo(f,d,l,0);else if(u){var g=ar(e,t);!function(e,t,n,r,o,i,a){var s=ti(e),l=s.horizontals,u=s.verticals,c=l.length,f=u.length,d=-1,h=-1;0===n?0===c?d=0:1===c&&(d=1):3===n&&(c<=2?d=2:c<=3&&(d=3)),2===n?0===f?h=0:f<4&&(h=3):1===n&&(f<=1?h=1:f<=2&&(h=2)),ei(e,t,0,d,h,r,o,i,a)}(f,d,c,g[0],g[1],i,a)}h!==f.length&&ci(e,t,[0,0],[0,0],f,d)}return co(e,"onRoundEnd",lo(e,t,{})),n.borderRadiusState="",!0},unset:function(e){e.state.borderRadiusState=""}};var di={isPinch:!0,name:"beforeRenderable",props:{},events:{onBeforeRenderStart:"beforeRenderStart",onBeforeRender:"beforeRender",onBeforeRenderEnd:"beforeRenderEnd",onBeforeRenderGroupStart:"beforeRenderGroupStart",onBeforeRenderGroup:"beforeRenderGroup",onBeforeRenderGroupEnd:"beforeRenderGroupEnd"},dragRelation:"weak",setTransform:function(e,t){var n=e.state,r=n.is3d,o=n.target,i=n.targetMatrix,a=null==o?void 0:o.style.transform,s=r?"matrix3d(".concat(i.join(","),")"):"matrix(".concat(ge(i,!0),")"),l=a&&"none"!==a?a:s;t.datas.startTransforms=function(e,t){return e===(t?"matrix3d(".concat(ke(4)):"matrix(".concat(ke(3),")"))||"matrix(1,0,0,1,0,0)"===e}(l,r)?[]:I(l)},resetTransform:function(e){e.datas.nextTransforms=e.datas.startTransforms,e.datas.nextTransformAppendedIndexes=[]},fillDragStartParams:function(e,t){return so(e,t,{setTransform:function(e){t.datas.startTransforms=A(e)?e:I(e)},isPinch:!!t.isPinch})},fillDragParams:function(e,t){return so(e,t,{isPinch:!!t.isPinch})},dragStart:function(e,t){this.setTransform(e,t),co(e,"onBeforeRenderStart",this.fillDragStartParams(e,t))},drag:function(e,t){this.resetTransform(t),co(e,"onBeforeRender",so(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){co(e,"onBeforeRenderEnd",so(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){var n=this;this.dragStart(e,t);var r=Yt(e,"beforeRenderable",t),o=e.moveables,i=r.map((function(e,t){var r=o[t];return n.setTransform(r,e),n.fillDragStartParams(r,e)}));co(e,"onBeforeRenderGroupStart",so(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,setTransform:function(){},events:i}))},dragGroup:function(e,t){var n=this;this.drag(e,t);var r=Yt(e,"beforeRenderable",t),o=e.moveables,i=r.map((function(e,t){var r=o[t];return n.resetTransform(e),n.fillDragParams(r,e)}));co(e,"onBeforeRenderGroup",so(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,events:i}))},dragGroupEnd:function(e,t){this.dragEnd(e,t),co(e,"onBeforeRenderGroupEnd",so(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}},hi={name:"renderable",props:{},events:{onRenderStart:"renderStart",onRender:"render",onRenderEnd:"renderEnd",onRenderGroupStart:"renderGroupStart",onRenderGroup:"renderGroup",onRenderGroupEnd:"renderGroupEnd"},dragRelation:"weak",dragStart:function(e,t){co(e,"onRenderStart",so(e,t,{isPinch:!!t.isPinch}))},drag:function(e,t){co(e,"onRender",this.fillDragParams(e,t))},dragAfter:function(e,t){if(t.resultCount)return this.drag(e,t)},dragEnd:function(e,t){co(e,"onRenderEnd",this.fillDragEndParams(e,t))},dragGroupStart:function(e,t){co(e,"onRenderGroupStart",so(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroup:function(e,t){var n=this,r=Yt(e,"beforeRenderable",t),o=e.moveables,i=r.map((function(e,t){var r=o[t];return n.fillDragParams(r,e)}));co(e,"onRenderGroup",so(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,transform:xr(t),events:i}))},dragGroupEnd:function(e,t){var n=this,r=Yt(e,"beforeRenderable",t),o=e.moveables,i=r.map((function(e,t){var r=o[t];return n.fillDragEndParams(r,e)}));co(e,"onRenderGroupEnd",so(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets,events:i}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlAfter:function(e,t){return this.dragAfter(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)},fillDragParams:function(e,t){return so(e,t,{isPinch:!!t.isPinch,transform:xr(t)})},fillDragEndParams:function(e,t){return so(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag})}};function pi(e,t,n,r,o,i,a){var s="Start"===o,l=e.state.target,u=i.isRequest;if(!l||s&&r.indexOf("Control")>-1&&!u&&e.areaElement===i.inputEvent.target)return!1;var c="".concat(n).concat(r).concat(o),f="".concat(n).concat(r,"Condition"),d="End"===o,h="After"===o,p=s&&(!e.targetGesto||!e.controlGesto||!e.targetGesto.isFlag()||!e.controlGesto.isFlag());p&&e.updateRect(o,!0,!1),""!==o||u||vo(e.state,i);var g=Tt([],e[t],!0);if(u){var m=i.requestAble;g.some((function(e){return e.name===m}))||g.push.apply(g,e.props.ables.filter((function(e){return e.name===m})))}if(!g.length)return!1;var v=Tt(Tt([di],g,!0),[hi],!1).filter((function(e){return e[c]})),b=i.datas;p&&v.forEach((function(t){t.unset&&t.unset(e)}));var y,w=i.inputEvent;d&&w&&(y=document.elementFromPoint(i.clientX,i.clientY)||w.target);var x=0,S=v.filter((function(t){var n=t.name,r=b[n]||(b[n]={});if(s&&(r.isEventStart=!t[f]||t[f](e,i)),r.isEventStart){var o=t[c](e,jt(jt({},i),{resultCount:x,datas:r,originalDatas:b,inputTarget:y}));return e._emitter.off(),s&&!1===o&&(r.isEventStart=!1),x+=o?1:0,o}return!1})).length,O=!1;return s&&v.length&&!S&&(O=0===v.filter((function(e){var t=e.name,n=b[t];return!!n.isEventStart&&("strong"!==e.dragRelation||(n.isEventStart=!1,!1))})).length),(d||O)&&(e.state.gesto=null,e.moveables&&e.moveables.forEach((function(e){e.state.gesto=null}))),p&&O&&v.forEach((function(t){t.unset&&t.unset(e)})),s&&!u&&S&&(null==i||i.preventDefault()),!e.isUnmounted&&!O&&((!s&&S&&!a||d)&&(e.updateRect(d?o:"",!0,!1),e.forceUpdate()),s||d||h||!S||a||pi(e,t,n,r,o+"After",i),!0)}function gi(e,t,n){var r=e.controlBox.getElement(),o=[];o.push(r),e.props.dragArea&&!e.props.dragTarget||o.push(t);var i=function(t){var n=t.inputEvent.target;return n===e.areaElement||!e.isMoveableElement(n)&&!e.controlBox.getElement().contains(n)||te(n,"moveable-area")||te(n,"moveable-padding")};return mi(e,o,"targetAbles",n,{dragStart:i,pinchStart:i})}function mi(e,t,n,r,o){void 0===o&&(o={});var i=e.props,a=i.pinchOutside,s=i.pinchThreshold,l={preventDefault:!1,container:window,pinchThreshold:s,pinchOutside:a},u=new vt(t,l);return["drag","pinch"].forEach((function(t){["Start","","End"].forEach((function(i){u.on("".concat(t).concat(i),(function(a){var s=a.eventType;!o[s]||o[s](a)?pi(e,n,t,r,i,a)||a.stop():a.stop()}))}))})),u}var vi=function(){function e(e,t,n){var r=this;this.target=e,this.moveable=t,this.eventName=n,this.ables=[],this._onEvent=function(e){var t=r.eventName,n=r.moveable;n.state.disableNativeEvent||r.ables.forEach((function(r){r[t](n,{inputEvent:e})}))},e.addEventListener(n.toLowerCase(),this._onEvent)}var t=e.prototype;return t.setAbles=function(e){this.ables=e},t.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},e}(),bi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state=jt({container:null,gesto:null,renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1},to(null)),t.enabledAbles=[],t.targetAbles=[],t.controlAbles=[],t.rotation=0,t.scale=[1,1],t.isUnmounted=!1,t.events={mouseEnter:null,mouseLeave:null},t._emitter=new et,t._prevTarget=null,t._prevDragArea=!1,t._observer=null,t._observerId=0,t.onPreventClick=function(e){e.stopPropagation(),re(window,"click",t.onPreventClick,!0)},t.checkUpdateRect=function(){if(!t.isDragging()){var e=t.props.parentMoveable;e?e.checkUpdateRect():(U(t._observerId),t._observerId=W((function(){t.isDragging()||t.updateRect()})))}},t}Ct(t,e);var n=t.prototype;return n.render=function(){var e=this.props,t=this.state,n=e.parentPosition,r=e.className,o=e.target,i=e.zoom,a=e.cspNonce,s=e.translateZ,l=e.cssStyled,u=e.portalContainer;this.checkUpdate(),this.updateRenderPoses();var c=n||{left:0,top:0},f=c.left,d=c.top,h=t.left,p=t.top,g=t.target,m=t.direction,v=t.hasFixed,b=e.targets,y=(b&&b.length||o)&&g,w=this.isDragging(),S={};return this.getEnabledAbles().forEach((function(e){S["data-able-".concat(e.name.toLowerCase())]=!0})),Object(at.createElement)(l,jt({cspNonce:a,ref:x(this,"controlBox"),className:"".concat(jr("control-box",-1===m?"reverse":"",w?"dragging":"")," ").concat(r)},S,{onClick:this.onPreventClick,portalContainer:u,style:{position:v?"fixed":"absolute",display:y?"block":"none",transform:"translate3d(".concat(h-f,"px, ").concat(p-d,"px, ").concat(s,")"),"--zoom":i,"--zoompx":"".concat(i,"px")}}),this.renderAbles(),this._renderLines())},n.componentDidMount=function(){this.isUnmounted=!1,this.controlBox.getElement();var e=this.props,t=e.parentMoveable,n=e.container,r=e.wrapperMoveable;this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),n||t||r||this.updateRect("",!1,!0),this.updateCheckInput(),this._updateObserver(this.props)},n.componentDidUpdate=function(e){this._updateNativeEvents(),this._updateEvents(),this._updateTargets(),this.updateCheckInput(),this._updateObserver(e)},n.componentWillUnmount=function(){this.isUnmounted=!0,this._emitter.off(),ao(this,"targetGesto"),ao(this,"controlGesto");var e=this.events;for(var t in e){var n=e[t];n&&n.destroy()}},n.getContainer=function(){var e=this.props,t=e.parentMoveable,n=e.wrapperMoveable;return e.container||n&&n.getContainer()||t&&t.getContainer()||this.controlBox.getElement().parentElement},n.isMoveableElement=function(e){return e&&(e.getAttribute("class")||"").indexOf(Dt)>-1},n.dragStart=function(e){var t=this.targetGesto;return t&&!t.isFlag()&&t.triggerDragStart(e),this},n.hitTest=function(e){var t,n=this.state,r=n.target,o=n.pos1,i=n.pos2,a=n.pos3,s=n.pos4,l=n.targetClientRect;if(!r)return 0;if(e instanceof Element){var u=e.getBoundingClientRect();t={left:u.left,top:u.top,width:u.width,height:u.height}}else t=jt({width:0,height:0},e);var c=t.left,f=t.top,d=t.width,h=t.height,p=Ue([o,i,s,a],l),g=Qe(p,[[c,f],[c+d,f],[c+d,f+h],[c,f+h]]),m=We(p);return g&&m?Math.min(100,g/m*100):0},n.isInside=function(e,t){var n=this.state,r=n.target,o=n.pos1,i=n.pos2,a=n.pos3,s=n.pos4,l=n.targetClientRect;return!!r&&Ge([e,t],Ue([o,i,s,a],l))},n.updateRect=function(e,t,n){void 0===n&&(n=!0);var r=this.props,o=r.parentMoveable,i=this.state.target||this.props.target,a=this.getContainer(),s=o?o.props.rootContainer:r.rootContainer;this.updateState(to(this.controlBox&&this.controlBox.getElement(),i,a,a,s||a),!o&&n)},n.isDragging=function(){return!!this.targetGesto&&this.targetGesto.isFlag()||!!this.controlGesto&&this.controlGesto.isFlag()},n.updateTarget=function(e){this.updateRect(e,!0)},n.getRect=function(){var e=this.state,t=io(this.state),n=t[0],r=t[1],o=t[2],i=t[3],a=Gr(t),s=e.width,l=e.height,u=a.width,c=a.height,f=a.left,d=a.top,h=[e.left,e.top],p=he(h,e.origin);return{width:u,height:c,left:f,top:d,pos1:n,pos2:r,pos3:o,pos4:i,offsetWidth:s,offsetHeight:l,beforeOrigin:he(h,e.beforeOrigin),origin:p,transformOrigin:e.transformOrigin,rotation:this.getRotation()}},n.getManager=function(){return this},n.getRotation=function(){var e=this.state;return function(e,t,n){var r=X(e,t)/Math.PI*180;return(r=n>=0?r:180-r)>=0?r:360+r}(e.pos1,e.pos2,e.direction)},n.request=function(e,t,n){void 0===t&&(t={});var r=this.props,o=r.ables,i=r.groupable,a=o.filter((function(t){return t.name===e}))[0];if(this.isDragging()||!a||!a.request)return{request:function(){return this},requestEnd:function(){return this}};var s=this,l=a.request(this),u=n||t.isInstant,c=l.isControl?"controlAbles":"targetAbles",f="".concat(i?"Group":"").concat(l.isControl?"Control":""),d={request:function(t){return pi(s,c,"drag",f,"",jt(jt({},l.request(t)),{requestAble:e,isRequest:!0}),u),this},requestEnd:function(){return pi(s,c,"drag",f,"End",jt(jt({},l.requestEnd()),{requestAble:e,isRequest:!0}),u),this}};return pi(s,c,"drag",f,"Start",jt(jt({},l.requestStart(t)),{requestAble:e,isRequest:!0}),u),u?d.request(t).requestEnd():d},n.destroy=function(){this.componentWillUnmount()},n.updateRenderPoses=function(){var e=this.state,t=this.props,n=e.originalBeforeOrigin,r=e.transformOrigin,o=e.allMatrix,i=e.is3d,a=e.pos1,s=e.pos2,l=e.pos3,u=e.pos4,c=e.left,f=e.top,d=t.padding||{},h=d.left,p=void 0===h?0:h,g=d.top,m=void 0===g?0:g,v=d.bottom,b=void 0===v?0:v,y=d.right,w=void 0===y?0:y,x=i?4:3,S=t.groupable?n:he(n,[c,f]);e.renderPoses=[he(a,bo(o,[-p,-m],r,S,x)),he(s,bo(o,[w,-m],r,S,x)),he(l,bo(o,[-p,b],r,S,x)),he(u,bo(o,[w,b],r,S,x))]},n.checkUpdate=function(){var e=this.props,t=e.target,n=e.container,r=e.parentMoveable,o=this.state,i=o.target,a=o.container;if((i||t)&&(this.updateAbles(),!po(i,t)||!po(a,n))){var s=n||this.controlBox;s&&this.unsetAbles(),this.updateState({target:t,container:n}),!r&&s&&this.updateRect("End",!1,!1)}},n.triggerEvent=function(e,t){this._emitter.trigger(e,t);var n=this.props[e];return n&&n(t)},n.useCSS=function(e,t){var n=this.props.customStyledMap,r=e+t;return n[r]||(n[r]=kt(e,t)),n[r]},n.unsetAbles=function(){var e=this;this.targetAbles.forEach((function(t){t.unset&&t.unset(e)}))},n.updateAbles=function(e,t){void 0===e&&(e=this.props.ables),void 0===t&&(t="");var n=this.props,r=n.triggerAblesSimultaneously,o=e.filter((function(e){return e&&(e.always&&!1!==n[e.name]||n[e.name])})),i="drag".concat(t,"Start"),a="pinch".concat(t,"Start"),s="drag".concat(t,"ControlStart"),l=ho(o,[i,a],r),u=ho(o,[s],r);this.enabledAbles=o,this.targetAbles=l,this.controlAbles=u},n.updateState=function(e,t){if(t){if(this.isUnmounted)return;this.setState(e)}else{var n=this.state;for(var r in e)n[r]=e[r]}},n.getEnabledAbles=function(){var e=this.props;return e.ables.filter((function(t){return t&&e[t.name]}))},n.renderAbles=function(){var e,t=this,n=this.props.triggerAblesSimultaneously,r={createElement:at.createElement};return function(e,t){var n=[],r={};return e.forEach((function(o,i){var a=t(o,i,e),s=r[a];s||(s=[],r[a]=s,n.push(s)),s.push(o)})),n}((e=ho(this.getEnabledAbles(),["render"],n).map((function(e){return(0,e.render)(t,r)||[]})),e.reduce((function(e,t){return e.concat(t)}),[])).filter((function(e){return e})),(function(e){return e.key})).map((function(e){return e[0]}))},n.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},n._updateObserver=function(e){var t,n=this.props,r=n.target;if(window.ResizeObserver&&r&&n.useResizeObserver){if(e.target!==r||!this._observer){var o=new ResizeObserver(this.checkUpdateRect);o.observe(r,{box:"border-box"}),this._observer=o}}else null===(t=this._observer)||void 0===t||t.disconnect()},n._updateEvents=function(){var e=this.controlBox.getElement(),t=this.targetAbles.length,n=this.controlAbles.length,r=this.props,o=r.dragTarget||r.target;(!t&&this.targetGesto||this._isTargetChanged(!0))&&(ao(this,"targetGesto"),this.updateState({gesto:null})),n||ao(this,"controlGesto"),o&&t&&!this.targetGesto&&(this.targetGesto=gi(this,o,"")),!this.controlGesto&&n&&(this.controlGesto=mi(this,e,"controlAbles","Control"))},n._updateTargets=function(){var e=this.props;this._prevTarget=e.dragTarget||e.target,this._prevDragArea=e.dragArea},n._renderLines=function(){var e=this.props,t=e.edge,n=e.zoom;if(e.hideDefaultLines)return[];var r=this.state.renderPoses,o={createElement:at.createElement};return[Jt(o,t?"n":"",r[0],r[1],n,0),Jt(o,t?"e":"",r[1],r[3],n,1),Jt(o,t?"w":"",r[0],r[2],n,2),Jt(o,t?"s":"",r[2],r[3],n,3)]},n._isTargetChanged=function(e){var t=this.props,n=t.dragTarget||t.target,r=this._prevTarget,o=this._prevDragArea,i=t.dragArea;return!i&&r!==n||(e||i)&&o!==i},n._updateNativeEvents=function(){var e=this,t=this.props.dragArea?this.areaElement:this.state.target,n=this.events,r=V(n);if(this._isTargetChanged())for(var o in n){var i=n[o];i&&i.destroy(),n[o]=null}if(t){var a=this.enabledAbles;r.forEach((function(r){var o=ho(a,[r]),i=o.length>0,s=n[r];i?(s||(s=new vi(t,e,r),n[r]=s),s.setAbles(o)):s&&(s.destroy(),n[r]=null)}))}},t.defaultProps={target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,edge:!1,parentMoveable:null,wrapperMoveable:null,parentPosition:null,portalContainer:null,useResizeObserver:!1,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{}},t}(at.PureComponent),yi={name:"groupable",props:{defaultGroupRotate:Number,defaultGroupOrigin:String,groupable:Boolean},events:{},render:function(e,t){var n=e.props.targets||[];e.moveables=[];var r=e.state,o={left:r.left,top:r.top},i=e.props;return n.map((function(n,r){return t.createElement(bi,{key:"moveable"+r,ref:S(e,"moveables",r),target:n,origin:!1,cssStyled:i.cssStyled,customStyledMap:i.customStyledMap,useResizeObserver:i.useResizeObserver,parentMoveable:e,parentPosition:o})}))}},wi=At("clickable",{props:{clickable:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},always:!0,dragRelation:"weak",dragStart:function(e,t){t.isRequest||ne(window,"click",e.onPreventClick,!0)},dragControlStart:function(e,t){this.dragStart(e,t)},dragGroupStart:function(e,t){this.dragStart(e,t),t.datas.inputTarget=t.inputEvent&&t.inputEvent.target},dragEnd:function(e,t){this.endEvent(e);var n=e.state.target,r=t.inputEvent,o=t.inputTarget,i=!e.isMoveableElement(o)&&e.controlBox.getElement().contains(o);if(t.isDrag&&!i||this.unset(e),r&&o&&!t.isDrag&&!e.isMoveableElement(o)&&!i){var a=n.contains(o);co(e,"onClick",so(e,t,{isDouble:t.isDouble,inputTarget:o,isTarget:n===o,containsTarget:a}))}},dragGroupEnd:function(e,t){this.endEvent(e);var n=t.inputEvent,r=t.inputTarget;if(n&&r&&!t.isDrag&&!e.isMoveableElement(r)&&t.datas.inputTarget!==r){var o=e.props.targets,i=o.indexOf(r),a=i>-1,s=!1;-1===i&&(s=(i=z(o,(function(e){return e.contains(r)})))>-1),co(e,"onClickGroup",so(e,t,{isDouble:t.isDouble,targets:o,inputTarget:r,targetIndex:i,isTarget:a,containsTarget:s}))}},dragControlEnd:function(e,t){this.dragEnd(e,t)},dragGroupControlEnd:function(e,t){this.dragEnd(e,t)},endEvent:function(e){var t=this;W((function(){t.unset(e)}))},unset:function(e){re(window,"click",e.onPreventClick,!0)}});function xi(e){var t=e.originalDatas.draggable;return t||(e.originalDatas.draggable={},t=e.originalDatas.draggable),jt(jt({},e),{datas:t})}var Si=At("edgeDraggable",{dragControlCondition:function(e,t){if(!e.props.edgeDraggable||!t.inputEvent)return!1;var n=t.inputEvent.target;return te(n,jr("direction"))&&te(n,jr("line"))},dragControlStart:function(e,t){return ir.dragStart(e,xi(t))},dragControl:function(e,t){return ir.drag(e,xi(t))},dragControlEnd:function(e,t){return ir.dragEnd(e,xi(t))},dragGroupControlCondition:function(e,t){if(!e.props.edgeDraggable||!t.inputEvent)return!1;var n=t.inputEvent.target;return te(n,jr("direction"))&&te(n,jr("line"))},dragGroupControlStart:function(e,t){return ir.dragGroupStart(e,xi(t))},dragGroupControl:function(e,t){return ir.dragGroup(e,xi(t))},dragGroupControlEnd:function(e,t){return ir.dragGroupEnd(e,xi(t))},unset:function(e){return ir.unset(e)}}),Oi={name:"individualGroupable",props:{individualGroupable:Boolean},events:{}},Ei=[di,Ho,or,Co,ir,Si,sn,jo,To,Lo,zo,Wo,Fo,li,si,fi,yi,Oi,wi,No,hi],ki=Ei.reduce((function(e,t){return jt(jt({},e),"events"in t?t.events:{})}),{}),_i=Ei.reduce((function(e,t){return jt(jt({},e),t.props)}),{}),Ci=So(ki);Object.keys(Ci),Object.keys(_i);function ji(e,t){return Math.max.apply(Math,e.map((function(e){var n=e[0],r=e[1],o=e[2],i=e[3];return Math.max(n[t],r[t],o[t],i[t])})))}function Ti(e,t){return Math.min.apply(Math,e.map((function(e){var n=e[0],r=e[1],o=e[2],i=e[3];return Math.min(n[t],r[t],o[t],i[t])})))}var Ai=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.differ=new He,t.moveables=[],t.transformOrigin="50% 50%",t}Ct(t,e);var n=t.prototype;return n.checkUpdate=function(){this.updateAbles()},n.updateRect=function(e,t,n){if(void 0===n&&(n=!0),this.controlBox){this.moveables.forEach((function(t){t.updateRect(e,!1,!1)}));var r=this.state,o=this.props,i=r.target||o.target;(!t||""!==e&&o.updateGroup)&&(this.rotation=o.defaultGroupRotate,this.transformOrigin=o.defaultGroupOrigin||"50% 50%",this.scale=[1,1]);var a=this.rotation,s=this.scale,l=function(e,t){if(!e.length)return[0,0,0,0];var n=e.map((function(e){return io(e.state)})),r=Bt,o=Bt,i=0,a=0,s=Z(t,Nt);if(s%90){var l=s/180*Math.PI,u=Math.tan(l),c=-1/u,f=[zt,Bt],d=[zt,Bt];n.forEach((function(e){e.forEach((function(e){var t=e[1]-u*e[0],n=e[1]-c*e[0];f[0]=Math.max(f[0],t),f[1]=Math.min(f[1],t),d[0]=Math.max(d[0],n),d[1]=Math.min(d[1],n)}))})),f.forEach((function(e){d.forEach((function(t){var n=(t-e)/(u-c),i=u*n+e;r=Math.min(r,n),o=Math.min(o,i)}))}));var h=n.map((function(e){var t=e[0],n=e[1],r=e[2],o=e[3];return[xe(t,-l),xe(n,-l),xe(r,-l),xe(o,-l)]}));i=ji(h,0)-Ti(h,0),a=ji(h,1)-Ti(h,1)}else if(r=Ti(n,0),o=Ti(n,1),i=ji(n,0)-r,a=ji(n,1)-o,s%180){var p=i;i=a,a=p}return[r,o,i,a]}(this.moveables,a),u=l[0],c=l[1],f=l[2],d=l[3],h="rotate(".concat(a,"deg) scale(").concat(s[0]>=0?1:-1,", ").concat(s[1]>=0?1:-1,")");i.style.cssText+="left:0px;top:0px; transform-origin: ".concat(this.transformOrigin,"; width:").concat(f,"px; height:").concat(d,"px;")+"transform:".concat(h),r.width=f,r.height=d;var p=this.getContainer(),g=to(this.controlBox.getElement(),i,this.controlBox.getElement(),this.getContainer(),this.props.rootContainer||p),m=[g.left,g.top],v=io(g),b=v[0],y=v[1],w=v[2],x=v[3],S=Ve([b,y,w,x]),O=[S.minX,S.minY];g.pos1=pe(b,O),g.pos2=pe(y,O),g.pos3=pe(w,O),g.pos4=pe(x,O),g.left=u-g.left+O[0],g.top=c-g.top+O[1],g.origin=pe(he(m,g.origin),O),g.beforeOrigin=pe(he(m,g.beforeOrigin),O),g.originalBeforeOrigin=he(m,g.originalBeforeOrigin);var E=g.targetClientRect,k=s[0]*s[1]>0?1:-1;E.top+=g.top-r.top,E.left+=g.left-r.left,i.style.transform="translate(".concat(-O[0],"px, ").concat(-O[1],"px) ").concat(h),this.updateState(jt(jt({},g),{direction:k,beforeDirection:k}),n)}},n.getRect=function(){return jt(jt({},e.prototype.getRect.call(this)),{children:this.moveables.map((function(e){return e.getRect()}))})},n.triggerEvent=function(t,n,r){if(r||t.indexOf("Group")>-1)return e.prototype.triggerEvent.call(this,t,n);this._emitter.trigger(t,n)},n.updateAbles=function(){e.prototype.updateAbles.call(this,Tt(Tt([],this.props.ables,!0),[yi],!1),"Group")},n._updateTargets=function(){e.prototype._updateTargets.call(this),this._prevTarget=this.props.dragTarget||this.areaElement},n._updateEvents=function(){var e=this.state,t=this.props,n=this._prevTarget,r=t.dragTarget||this.areaElement;n!==r&&(ao(this,"targetGesto"),ao(this,"controlGesto"),e.target=null),e.target||(e.target=this.areaElement,this.controlBox.getElement().style.display="block",this.targetGesto=gi(this,r,"Group"),this.controlGesto=mi(this,this.controlBox.getElement(),"controlAbles","GroupControl"));var o=!po(e.container,t.container);o&&(e.container=t.container);var i=this.differ.update(t.targets),a=i.added,s=i.changed,l=i.removed;(o||a.length||s.length||l.length)&&this.updateRect()},n._updateObserver=function(){},t.defaultProps=jt(jt({},bi.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),t}(bi),Ri=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.moveables=[],t}Ct(t,e);var n=t.prototype;return n.render=function(){var e=this,t=this.props,n=t.cspNonce,r=t.cssStyled,o=t.targets;return Object(at.createElement)(r,{cspNonce:n,ref:x(this,"controlBox"),className:jr("control-box")},o.map((function(t,n){return Object(at.createElement)(bi,jt({key:"moveable"+n,ref:S(e,"moveables",n)},e.props,{target:t,wrapperMoveable:e}))})))},n.componentDidUpdate=function(){},n.updateRect=function(e,t,n){void 0===n&&(n=!0),this.moveables.forEach((function(r){r.updateRect(e,t,n)}))},n.getRect=function(){return jt(jt({},e.prototype.getRect.call(this)),{children:this.moveables.map((function(e){return e.getRect()}))})},n.request=function(){return{request:function(){return this},requestEnd:function(){return this}}},n.dragStart=function(){return this},n.hitTest=function(){return 0},n.isInside=function(){return!1},n.isDragging=function(){return!1},n.updateRenderPoses=function(){},n.checkUpdate=function(){},n.triggerEvent=function(){},n.updateAbles=function(){},n._updateEvents=function(){},n._updateObserver=function(){},t}(bi),Li=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.refTargets=[],t.selectorMap={},t}Ct(t,e);var n,r,o=t.prototype;return t.makeStyled=function(){var e={};this.getTotalAbles().forEach((function(t){var n=t.css;n&&n.forEach((function(t){e[t]=!0}))}));var t=V(e).join("\n");this.defaultStyled=kt("div",function(e,t){return t.replace(/([^}{]*){/gm,(function(t,n){return n.replace(/\.([^{,\s\d.]+)/g,"."+e+"$1")+"{"}))}(Dt,It+t))},t.getTotalAbles=function(){return Tt([Ho,yi,Oi,No],this.defaultAbles,!0)},o.render=function(){var e=this.constructor;e.defaultStyled||e.makeStyled();var t=this.props,n=t.ables,r=t.props,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o1,s=Tt(Tt([],e.getTotalAbles(),!0),n||[],!0),l=jt(jt(jt({},o),r||{}),{ables:s,cssStyled:e.defaultStyled,customStyledMap:e.customStyledMap});return a?o.individualGroupable?Object(at.createElement)(Ri,jt({key:"individual-group",ref:x(this,"moveable")},l,{target:null,targets:i})):Object(at.createElement)(Ai,jt({key:"group",ref:x(this,"moveable")},l,{target:null,targets:i})):Object(at.createElement)(bi,jt({key:"single",ref:x(this,"moveable")},l,{target:i[0]}))},o.componentDidMount=function(){this._updateRefs()},o.componentDidUpdate=function(){this._updateRefs()},o.componentWillUnmount=function(){this.selectorMap={},this.refTargets=[]},o.getManager=function(){return this.moveable},o._updateRefs=function(e){var t=this.refTargets,n=Eo(this.props.target||this.props.targets),r="undefined"!=typeof document,o=t.length!==n.length||t.some((function(e,t){var r=n[t];return!(!e&&!r)&&e!==r})),i=this.selectorMap,a={};return this.refTargets.forEach((function(e){R(e)&&(i[e]?a[e]=i[e]:r&&(o=!0,a[e]=[].slice.call(document.querySelectorAll(e))))})),this.refTargets=n,this.selectorMap=a,!e&&o&&this.forceUpdate(),n},t.defaultAbles=[],t.customStyledMap={},t.defaultStyled=null,function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);i>3&&a&&Object.defineProperty(t,n,a)}([(n=Vt,void 0===r&&(r={}),function(e,t){n.forEach((function(n){var o=r[n]||n;o in e||(e[o]=function(){for(var e,r=[],o=0;o-1};var c=function(e,t){var n=this.__data__,r=i(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function f(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},o=n(169),i=n(170),a=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},c=Object(i.a)((function(e){return l(e)?e:e.replace(a,"-$&").toLowerCase()})),f=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(s,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===o.a[e]||l(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return h={name:n.name,styles:n.styles,next:h},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)h={name:o.name,styles:o.styles,next:h},o=o.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;ow},M=function(e){return function(e){var t=m[e].b;return g+t+y}(e)>x},P=function(e){return function(e){return k(e)<0}(e)||L(e)||function(e){return R(e)<0}(e)||M(e)},D=function(e){return!P(e)},I=["top","bottom","left","right"],$=[],N=0;N<4;N++){var F=I[N];D(F)&&$.push(F)}var B,z=!1,H=o!==r;return D(o)&&H?(z=!0,B=o):$.length>0&&P(o)&&P(r)&&(z=!0,B=$[0]),z?{isNewState:!0,newState:{place:B}}:{isNewState:!1,position:{left:parseInt(k(r)-E,10),top:parseInt(R(r)-O,10)}}}var _=function(e){var t=e.getBoundingClientRect(),n=t.height,r=t.width;return{height:parseInt(n,10),width:parseInt(r,10)}},C=function(e,t,n){var r=t.getBoundingClientRect(),o=r.top,i=r.left,a=_(t),s=a.width,l=a.height;return"float"===n?{mouseX:e.clientX,mouseY:e.clientY}:{mouseX:i+s/2,mouseY:o+l/2}},j=function(e,t,n,r,o){var i,a,s,l;return"float"===e?(i={l:-r/2,r:r/2,t:-(o+3+2),b:-3},s={l:-r/2,r:r/2,t:15,b:o+3+2+12},l={l:-(r+3+2),r:-3,t:-o/2,b:o/2},a={l:3,r:r+3+2,t:-o/2,b:o/2}):"solid"===e&&(i={l:-r/2,r:r/2,t:-(n/2+o+2),b:-n/2},s={l:-r/2,r:r/2,t:n/2,b:n/2+o+2},l={l:-(r+t/2+2),r:-t/2,t:-o/2,b:o/2},a={l:t/2,r:r+t/2+2,t:-o/2,b:o/2}),{top:i,bottom:s,left:l,right:a}},T=function(e){var t=0,n=0;for(var r in"[object String]"===Object.prototype.toString.apply(e)&&(e=JSON.parse(e.toString().replace(/'/g,'"'))),e)"top"===r?n-=parseInt(e[r],10):"bottom"===r?n+=parseInt(e[r],10):"left"===r?t-=parseInt(e[r],10):"right"===r&&(t+=parseInt(e[r],10));return{extraOffsetX:t,extraOffsetY:n}},A=function(e){for(var t=e;t;){var n=window.getComputedStyle(t);if("none"!==n.getPropertyValue("transform")||"transform"===n.getPropertyValue("will-change"))break;t=t.parentElement}return{parentTop:t&&t.getBoundingClientRect().top||0,parentLeft:t&&t.getBoundingClientRect().left||0}};function R(e,t,n,r){if(t)return t;if(null!=n)return n;if(null===n)return null;var i=//;return r&&"false"!==r&&i.test(e)?e.split(i).map((function(e,t){return o.a.createElement("span",{key:t,className:"multi-line"},e)})):e}function L(e){var t={};return Object.keys(e).filter((function(e){return/(^aria-\w+$|^role$)/.test(e)})).forEach((function(n){t[n]=e[n]})),t}function M(e){var t=e.length;return e.hasOwnProperty?Array.prototype.slice.call(e):new Array(t).fill().map((function(t){return e[t]}))}var P={dark:{text:"#fff",background:"#222",border:"transparent",arrow:"#222"},success:{text:"#fff",background:"#8DC572",border:"transparent",arrow:"#8DC572"},warning:{text:"#fff",background:"#F0AD4E",border:"transparent",arrow:"#F0AD4E"},error:{text:"#fff",background:"#BE6464",border:"transparent",arrow:"#BE6464"},info:{text:"#fff",background:"#337AB7",border:"transparent",arrow:"#337AB7"},light:{text:"#222",background:"#fff",border:"transparent",arrow:"#fff"}};function D(e,t,n,r){return function(e,t){var n=t.text,r=t.background,o=t.border,i=t.arrow;return"\n \t.".concat(e," {\n\t color: ").concat(n,";\n\t background: ").concat(r,";\n\t border: 1px solid ").concat(o,";\n \t}\n\n \t.").concat(e,".place-top {\n margin-top: -10px;\n }\n .").concat(e,".place-top::before {\n border-top: 8px solid ").concat(o,";\n }\n .").concat(e,".place-top::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n border-top-color: ").concat(i,";\n border-top-style: solid;\n border-top-width: 6px;\n }\n\n .").concat(e,".place-bottom {\n margin-top: 10px;\n }\n .").concat(e,".place-bottom::before {\n border-bottom: 8px solid ").concat(o,";\n }\n .").concat(e,".place-bottom::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n border-bottom-color: ").concat(i,";\n border-bottom-style: solid;\n border-bottom-width: 6px;\n }\n\n .").concat(e,".place-left {\n margin-left: -10px;\n }\n .").concat(e,".place-left::before {\n border-left: 8px solid ").concat(o,";\n }\n .").concat(e,".place-left::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n border-left-color: ").concat(i,";\n border-left-style: solid;\n border-left-width: 6px;\n }\n\n .").concat(e,".place-right {\n margin-left: 10px;\n }\n .").concat(e,".place-right::before {\n border-right: 8px solid ").concat(o,";\n }\n .").concat(e,".place-right::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n border-right-color: ").concat(i,";\n border-right-style: solid;\n border-right-width: 6px;\n }\n ")}(e,function(e,t,n){var r=e.text,o=e.background,i=e.border,a=e.arrow?e.arrow:e.background,s=function(e){return P[e]?h({},P[e]):void 0}(t);r&&(s.text=r);o&&(s.background=o);n&&(s.border=i||("light"===t?"black":"white"));a&&(s.arrow=a);return s}(t,n,r))}var I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function $(e,t){return e(t={exports:{}},t.exports),t.exports}var N=function(e){return e&&e.Math==Math&&e},F=N("object"==typeof globalThis&&globalThis)||N("object"==typeof window&&window)||N("object"==typeof self&&self)||N("object"==typeof I&&I)||function(){return this}()||Function("return this")(),B=function(e){try{return!!e()}catch(e){return!0}},z=!B((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),H={}.propertyIsEnumerable,W=Object.getOwnPropertyDescriptor,U={f:W&&!H.call({1:2},1)?function(e){var t=W(this,e);return!!t&&t.enumerable}:H},V=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},G={}.toString,q=function(e){return G.call(e).slice(8,-1)},Y="".split,K=B((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==q(e)?Y.call(e,""):Object(e)}:Object,X=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},Q=function(e){return K(X(e))},J=function(e){return"object"==typeof e?null!==e:"function"==typeof e},Z=function(e,t){if(!J(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!J(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!J(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!J(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},ee=function(e){return Object(X(e))},te={}.hasOwnProperty,ne=function(e,t){return te.call(ee(e),t)},re=F.document,oe=J(re)&&J(re.createElement),ie=function(e){return oe?re.createElement(e):{}},ae=!z&&!B((function(){return 7!=Object.defineProperty(ie("div"),"a",{get:function(){return 7}}).a})),se=Object.getOwnPropertyDescriptor,le={f:z?se:function(e,t){if(e=Q(e),t=Z(t,!0),ae)try{return se(e,t)}catch(e){}if(ne(e,t))return V(!U.f.call(e,t),e[t])}},ue=function(e){if(!J(e))throw TypeError(String(e)+" is not an object");return e},ce=Object.defineProperty,fe={f:z?ce:function(e,t,n){if(ue(e),t=Z(t,!0),ue(n),ae)try{return ce(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},de=z?function(e,t,n){return fe.f(e,t,V(1,n))}:function(e,t,n){return e[t]=n,e},he=function(e,t){try{de(F,e,t)}catch(n){F[e]=t}return t},pe="__core-js_shared__",ge=F[pe]||he(pe,{}),me=Function.toString;"function"!=typeof ge.inspectSource&&(ge.inspectSource=function(e){return me.call(e)});var ve,be,ye,we=ge.inspectSource,xe=F.WeakMap,Se="function"==typeof xe&&/native code/.test(we(xe)),Oe=$((function(e){(e.exports=function(e,t){return ge[e]||(ge[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.12.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),Ee=0,ke=Math.random(),_e=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Ee+ke).toString(36)},Ce=Oe("keys"),je=function(e){return Ce[e]||(Ce[e]=_e(e))},Te={},Ae="Object already initialized",Re=F.WeakMap;if(Se||ge.state){var Le=ge.state||(ge.state=new Re),Me=Le.get,Pe=Le.has,De=Le.set;ve=function(e,t){if(Pe.call(Le,e))throw new TypeError(Ae);return t.facade=e,De.call(Le,e,t),t},be=function(e){return Me.call(Le,e)||{}},ye=function(e){return Pe.call(Le,e)}}else{var Ie=je("state");Te[Ie]=!0,ve=function(e,t){if(ne(e,Ie))throw new TypeError(Ae);return t.facade=e,de(e,Ie,t),t},be=function(e){return ne(e,Ie)?e[Ie]:{}},ye=function(e){return ne(e,Ie)}}var $e,Ne,Fe={set:ve,get:be,has:ye,enforce:function(e){return ye(e)?be(e):ve(e,{})},getterFor:function(e){return function(t){var n;if(!J(t)||(n=be(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Be=$((function(e){var t=Fe.get,n=Fe.enforce,r=String(String).split("String");(e.exports=function(e,t,o,i){var a,s=!!i&&!!i.unsafe,l=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||ne(o,"name")||de(o,"name",t),(a=n(o)).source||(a.source=r.join("string"==typeof t?t:""))),e!==F?(s?!u&&e[t]&&(l=!0):delete e[t],l?e[t]=o:de(e,t,o)):l?e[t]=o:he(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||we(this)}))})),ze=F,He=function(e){return"function"==typeof e?e:void 0},We=function(e,t){return arguments.length<2?He(ze[e])||He(F[e]):ze[e]&&ze[e][t]||F[e]&&F[e][t]},Ue=Math.ceil,Ve=Math.floor,Ge=function(e){return isNaN(e=+e)?0:(e>0?Ve:Ue)(e)},qe=Math.min,Ye=function(e){return e>0?qe(Ge(e),9007199254740991):0},Ke=Math.max,Xe=Math.min,Qe=function(e){return function(t,n,r){var o,i=Q(t),a=Ye(i.length),s=function(e,t){var n=Ge(e);return n<0?Ke(n+t,0):Xe(n,t)}(r,a);if(e&&n!=n){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===n)return e||s||0;return!e&&-1}},Je={includes:Qe(!0),indexOf:Qe(!1)}.indexOf,Ze=function(e,t){var n,r=Q(e),o=0,i=[];for(n in r)!ne(Te,n)&&ne(r,n)&&i.push(n);for(;t.length>o;)ne(r,n=t[o++])&&(~Je(i,n)||i.push(n));return i},et=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tt=et.concat("length","prototype"),nt={f:Object.getOwnPropertyNames||function(e){return Ze(e,tt)}},rt={f:Object.getOwnPropertySymbols},ot=We("Reflect","ownKeys")||function(e){var t=nt.f(ue(e)),n=rt.f;return n?t.concat(n(e)):t},it=function(e,t){for(var n=ot(t),r=fe.f,o=le.f,i=0;i=74)&&($e=mt.match(/Chrome\/(\d+)/))&&(Ne=$e[1]);var wt,xt=Ne&&+Ne,St=!!Object.getOwnPropertySymbols&&!B((function(){return!String(Symbol())||!Symbol.sham&&xt&&xt<41})),Ot=St&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Et=Oe("wks"),kt=F.Symbol,_t=Ot?kt:kt&&kt.withoutSetter||_e,Ct=function(e){return ne(Et,e)&&(St||"string"==typeof Et[e])||(St&&ne(kt,e)?Et[e]=kt[e]:Et[e]=_t("Symbol."+e)),Et[e]},jt=Ct("species"),Tt=function(e,t){var n;return gt(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!gt(n.prototype)?J(n)&&null===(n=n[jt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},At=[].push,Rt=function(e){var t=1==e,n=2==e,r=3==e,o=4==e,i=6==e,a=7==e,s=5==e||i;return function(l,u,c,f){for(var d,h,p=ee(l),g=K(p),m=pt(u,c,3),v=Ye(g.length),b=0,y=f||Tt,w=t?y(l,v):n||a?y(l,0):void 0;v>b;b++)if((s||b in g)&&(h=m(d=g[b],b,p),e))if(t)w[b]=h;else if(h)switch(e){case 3:return!0;case 5:return d;case 6:return b;case 2:At.call(w,d)}else switch(e){case 4:return!1;case 7:At.call(w,d)}return i?-1:r||o?o:w}},Lt={forEach:Rt(0),map:Rt(1),filter:Rt(2),some:Rt(3),every:Rt(4),find:Rt(5),findIndex:Rt(6),filterOut:Rt(7)},Mt=Object.keys||function(e){return Ze(e,et)},Pt=z?Object.defineProperties:function(e,t){ue(e);for(var n,r=Mt(t),o=r.length,i=0;o>i;)fe.f(e,n=r[i++],t[n]);return e},Dt=We("document","documentElement"),It=je("IE_PROTO"),$t=function(){},Nt=function(e){return"