UNPKG

@nomyx/hardhat-adminui

Version:

A comprehensive Hardhat plugin providing a web-based admin UI for deployed smart contracts with Diamond proxy support, contract interaction, event monitoring, and deployment dashboard.

2 lines 1.18 MB
/*! For license information please see main.d701f4fc.js.LICENSE.txt */ (()=>{var __webpack_modules__={18:(e,t,r)=>{"use strict";var n=r(328),i=r(876),s=n.rotl32,o=n.sum32,a=n.sum32_3,l=n.sum32_4,c=i.BlockHash;function h(){if(!(this instanceof h))return new h;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(h,c),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],h=this.h[4],O=r,v=n,y=i,b=c,w=h,k=0;k<80;k++){var S=o(s(l(r,u(k,n,i,c),e[m[k]+t],d(k)),g[k]),h);r=h,h=c,c=s(i,10),i=n,n=S,S=o(s(l(O,u(79-k,v,y,b),e[p[k]+t],f(k)),x[k]),w),O=w,w=b,b=s(y,10),y=v,v=S}S=a(this.h[1],i,b),this.h[1]=a(this.h[2],c,w),this.h[2]=a(this.h[3],h,O),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,y),this.h[0]=S},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var m=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],x=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},49:(e,t)=>{"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,g={};function x(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||m}function O(){}function v(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||m}x.prototype.isReactComponent={},x.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},x.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},O.prototype=x.prototype;var y=v.prototype=new O;y.constructor=v,p(y,x.prototype),y.isPureReactComponent=!0;var b=Array.isArray,w=Object.prototype.hasOwnProperty,k={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function N(e,t,n){var i,s={},o=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)w.call(t,i)&&!S.hasOwnProperty(i)&&(s[i]=t[i]);var l=arguments.length-2;if(1===l)s.children=n;else if(1<l){for(var c=Array(l),h=0;h<l;h++)c[h]=arguments[h+2];s.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===s[i]&&(s[i]=l[i]);return{$$typeof:r,type:e,key:o,ref:a,props:s,_owner:k.current}}function j(e){return"object"===typeof e&&null!==e&&e.$$typeof===r}var _=/\/+/g;function A(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function P(e,t,i,s,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case r:case n:l=!0}}if(l)return o=o(l=e),e=""===s?"."+A(l,0):s,b(o)?(i="",null!=e&&(i=e.replace(_,"$&/")+"/"),P(o,t,i,"",function(e){return e})):null!=o&&(j(o)&&(o=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,i+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(_,"$&/")+"/")+e)),t.push(o)),1;if(l=0,s=""===s?".":s+":",b(e))for(var c=0;c<e.length;c++){var h=s+A(a=e[c],c);l+=P(a,t,i,h,o)}else if(h=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"===typeof h)for(e=h.call(e),c=0;!(a=e.next()).done;)l+=P(a=a.value,t,i,h=s+A(a,c++),o);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function E(e,t,r){if(null==e)return e;var n=[],i=0;return P(e,n,"","",function(e){return t.call(r,e,i++)}),n}function Q(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var C={current:null},M={transition:null},T={ReactCurrentDispatcher:C,ReactCurrentBatchConfig:M,ReactCurrentOwner:k};function R(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:E,forEach:function(e,t,r){E(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return E(e,function(){t++}),t},toArray:function(e){return E(e,function(e){return e})||[]},only:function(e){if(!j(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=x,t.Fragment=i,t.Profiler=o,t.PureComponent=v,t.StrictMode=s,t.Suspense=h,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.act=R,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=p({},e.props),s=e.key,o=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,a=k.current),void 0!==t.key&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)w.call(t,c)&&!S.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){l=Array(c);for(var h=0;h<c;h++)l[h]=arguments[h+2];i.children=l}return{$$typeof:r,type:e.type,key:s,ref:o,props:i,_owner:a}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=N,t.createFactory=function(e){var t=N.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=j,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:Q}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=M.transition;M.transition={};try{e()}finally{M.transition=t}},t.unstable_act=R,t.useCallback=function(e,t){return C.current.useCallback(e,t)},t.useContext=function(e){return C.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return C.current.useDeferredValue(e)},t.useEffect=function(e,t){return C.current.useEffect(e,t)},t.useId=function(){return C.current.useId()},t.useImperativeHandle=function(e,t,r){return C.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return C.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return C.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return C.current.useMemo(e,t)},t.useReducer=function(e,t,r){return C.current.useReducer(e,t,r)},t.useRef=function(e){return C.current.useRef(e)},t.useState=function(e){return C.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return C.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return C.current.useTransition()},t.version="18.3.1"},54:(e,t,r)=>{"use strict";var n=r(328),i=r(599);function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=s,s.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},s.prototype.update=function(e,t){return this.inner.update(e,t),this},s.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},80:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>L,EI:()=>P,KB:()=>Q,Lv:()=>me,Oh:()=>C,Q0:()=>u,SG:()=>Ce,WD:()=>q,Xt:()=>_,Yy:()=>N,Zt:()=>ke,_Y:()=>Z,_v:()=>E,b_:()=>X,bj:()=>m,cr:()=>ge,f7:()=>se,jU:()=>$e,mv:()=>p,mz:()=>B,p9:()=>h,tp:()=>A,y9:()=>ye,yd:()=>F});var n,i=r(728),s=r(498),o=r(107),a=r(794),l=r(347);const c=new i.uY;function h(e){return s.sj.define({combine:e?t=>t.concat(e):void 0})}const u=new i.uY;class d{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";this.data=e,this.name=n,s.$t.prototype.hasOwnProperty("tree")||Object.defineProperty(s.$t.prototype,"tree",{get(){return p(this)}}),this.parser=t,this.extension=[S.of(this),s.$t.languageData.of((e,t,r)=>{let n=f(e,t,r),i=n.type.prop(c);if(!i)return[];let s=e.facet(i),o=n.type.prop(u);if(o){let i=n.resolve(t-n.from,r);for(let t of o)if(t.test(i,e)){let r=e.facet(t.facet);return"replace"==t.type?r:r.concat(s)}}return s})].concat(r)}isActiveAt(e,t){return f(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1).type.prop(c)==this.data}findRegions(e){let t=e.facet(S);if((null===t||void 0===t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],n=(e,t)=>{if(e.prop(c)==this.data)return void r.push({from:t,to:t+e.length});let s=e.prop(i.uY.mounted);if(s){if(s.tree.prop(c)==this.data){if(s.overlay)for(let e of s.overlay)r.push({from:e.from+t,to:e.to+t});else r.push({from:t,to:t+e.length});return}if(s.overlay){let e=r.length;if(n(s.tree,s.overlay[0].from+t),r.length>e)return}}for(let r=0;r<e.children.length;r++){let s=e.children[r];s instanceof i.PH&&n(s,e.positions[r]+t)}};return n(p(e),0),r}get allowsNesting(){return!0}}function f(e,t,r){let n=e.facet(S),s=p(e).topNode;if(!n||n.allowsNesting)for(let o=s;o;o=o.enter(t,r,i.Qj.ExcludeBuffers))o.type.isTop&&(s=o);return s}d.setState=s.Pe.define();class m extends d{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=h(e.languageData);return new m(t,e.parser.configure({props:[c.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new m(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function p(e){let t=e.field(d.state,!1);return t?t.tree:i.PH.empty}class g{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let x=null;class O{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0;this.parser=e,this.state=t,this.fragments=r,this.tree=n,this.treeLen=i,this.viewport=s,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new O(e,t,[],i.PH.empty,0,r,[],null)}startParse(){return this.parser.startParse(new g(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=i.PH.empty&&this.isDone(null!==t&&void 0!==t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(i.rr.addTree(n,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(r=this.parse.stoppedAt)&&void 0!==r?r:this.state.doc.length,this.tree=n,this.parse=null,!(this.treeLen<(null!==t&&void 0!==t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(i.rr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=x;x=this;try{return e()}finally{x=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=v(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:n,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,r,n,i)=>t.push({fromA:e,toA:r,fromB:n,toB:i})),r=i.rr.applyChanges(r,t),n=i.PH.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let r=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);r<n&&a.push({from:r,to:n})}}}return new O(this.parser,t,r,n,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:t,to:n}=this.skipped[r];t<e.to&&n>e.from&&(this.fragments=v(this.fragments,t,n),this.skipped.splice(r--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends i.iX{createParse(t,r,n){let s=n[0].from,o=n[n.length-1].to;return{parsedPos:s,advance(){let t=x;if(t){for(let e of n)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new i.PH(i.Z6.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return x}}function v(e,t,r){return i.rr.applyChanges(e,[{fromA:t,toA:r,fromB:t,toB:r}])}class y{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new y(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=O.create(e.facet(S).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new y(r)}}d.state=s.sU.define({create:y.init,update(e,t){for(let r of t.effects)if(r.is(d.setState))return r.value;return t.startState.facet(S)!=t.state.facet(S)?y.init(t.state):e.apply(t)}});let b=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(b=e=>{let t=-1,r=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(r):cancelIdleCallback(t)});const w="undefined"!=typeof navigator&&(null===(n=navigator.scheduling)||void 0===n?void 0:n.isInputPending)?()=>navigator.scheduling.isInputPending():null,k=o.Z9.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(d.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(d.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=b(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:n}}=this.view,i=r.field(d.state);if(i.tree==i.context.tree&&i.context.isDone(n+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!w?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<n&&r.doc.length>n+1e3,a=i.context.work(()=>w&&w()||Date.now()>s,n+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:d.setState.of(new y(i.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,o.c_)(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),S=s.sj.define({combine:e=>e.length?e[0]:null,enables:e=>[d.state,k,o.Lz.contentAttributes.compute([e],t=>{let r=t.facet(e);return r&&r.name?{"data-language":r.name}:{}})]});class N{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.language=e,this.support=t,this.extension=[e,t]}}const j=s.sj.define(),_=s.sj.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function A(e){let t=e.facet(_);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function P(e,t){let r="",n=e.tabSize,i=e.facet(_)[0];if("\t"==i){for(;t>=n;)r+="\t",t-=n;i=" "}for(let s=0;s<t;s++)r+=i;return r}function E(e,t){e instanceof s.$t&&(e=new Q(e));for(let n of e.state.facet(j)){let r=n(e,t);if(void 0!==r)return r}let r=p(e.state);return r.length>=t?function(e,t,r){let n=t.resolveStack(r),i=t.resolveInner(r,-1).resolve(r,0).enterUnfinishedNodesBefore(r);if(i!=n.node){let e=[];for(let t=i;t&&!(t.from<n.node.from||t.to>n.node.to||t.from==n.node.from&&t.type==n.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)n={node:e[t],next:n}}return M(n,e,r)}(e,r,t):null}class Q{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.state=e,this.options=t,this.unit=A(e)}lineAt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:i}=this.options;return null!=n&&n>=r.from&&n<=r.to?i&&n==e?{text:"",from:e}:(t<0?n<e:n<=e)?{text:r.text.slice(n-r.from),from:n}:{text:r.text.slice(0,n-r.from),from:r.from}:r}textAfterPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:n}=this.lineAt(e,t);return r.slice(e-n,Math.min(r.length,e+100-n))}column(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{text:r,from:n}=this.lineAt(e,t),i=this.countColumn(r,e-n),s=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return s>-1&&(i+=s-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return(0,s.y$)(e,this.state.tabSize,t)}lineIndent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{text:r,from:n}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(n);if(e>-1)return e}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const C=new i.uY;function M(e,t,r){for(let n=e;n;n=n.next){let e=T(n.node);if(e)return e($.create(t,r,n))}return 0}function T(e){let t=e.type.prop(C);if(t)return t;let r,n=e.firstChild;if(n&&(r=n.type.prop(i.uY.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>I(e,!0,1,void 0,n&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?R:null}function R(){return 0}class $ extends Q{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new $(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(D(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return M(this.context.next,this.base,this.pos)}}function D(e,t){for(let r=t;r;r=r.parent)if(e==r)return!0;return!1}function L(e){let{closing:t,align:r=!0,units:n=1}=e;return e=>I(e,r,n,t)}function I(e,t,r,n,i){let s=e.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||i==e.pos+o,l=t?function(e){let t=e.node,r=t.childAfter(t.from),n=t.lastChild;if(!r)return null;let i=e.options.simulateBreak,s=e.state.doc.lineAt(r.from),o=null==i||i<=s.from?s.to:Math.min(s.to,i);for(let a=r.to;;){let e=t.childAfter(a);if(!e||e==n)return null;if(!e.type.isSkipped){if(e.from>=o)return null;let t=/^ */.exec(s.text.slice(r.to-s.from))[0].length;return{from:r.from,to:r.to+t}}a=e.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*r)}const Z=e=>e.baseIndent;function B(){let{except:e,units:t=1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=>{let n=e&&e.test(r.textAfter);return r.baseIndent+(n?0:t*r.unit)}}const z=200;function q(){return s.$t.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let r=e.newDoc,{head:n}=e.newSelection.main,i=r.lineAt(n);if(n>i.from+z)return e;let s=r.sliceString(i.from,n);if(!t.some(e=>e.test(s)))return e;let{state:o}=e,a=-1,l=[];for(let{head:c}of o.selection.ranges){let e=o.doc.lineAt(c);if(e.from==a)continue;a=e.from;let t=E(o,e.from);if(null==t)continue;let r=/^\s*/.exec(e.text)[0],n=P(o,t);r!=n&&l.push({from:e.from,to:e.from+r.length,insert:n})}return l.length?[e,{changes:l,sequential:!0}]:e})}const U=s.sj.define(),X=new i.uY;function F(e){let t=e.firstChild,r=e.lastChild;return t&&t.to<r.from?{from:t.to,to:r.type.isError?e.to:r.from}:null}function V(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Y(e,t,r){for(let n of e.facet(U)){let i=n(e,t,r);if(i)return i}return function(e,t,r){let n=p(e);if(n.length<r)return null;let i=null;for(let s=n.resolveStack(r,1);s;s=s.next){let o=s.node;if(o.to<=r||o.from>r)continue;if(i&&o.from<t)break;let a=o.type.prop(X);if(a&&(o.to<n.length-50||n.length==e.doc.length||!V(o))){let n=a(o,e);n&&n.from<=r&&n.from>=t&&n.to>r&&(i=n)}}return i}(e,t,r)}function W(e,t){let r=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);return r>=n?void 0:{from:r,to:n}}const G=s.Pe.define({map:W}),H=s.Pe.define({map:W});function K(e){let t=[];for(let{head:r}of e.state.selection.ranges)t.some(e=>e.from<=r&&e.to>=r)||t.push(e.lineBlockAt(r));return t}const J=s.sU.define({create:()=>o.NZ.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,r)=>e=ee(e,t,r)),e=e.map(t.changes);for(let r of t.effects)if(r.is(G)&&!re(e,r.value.from,r.value.to)){let{preparePlaceholder:n}=t.state.facet(ae),i=n?o.NZ.replace({widget:new ue(n(t.state,r.value))}):he;e=e.update({add:[i.range(r.value.from,r.value.to)]})}else r.is(H)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));return t.selection&&(e=ee(e,t.selection.main.head)),e},provide:e=>o.Lz.decorations.from(e),toJSON(e,t){let r=[];return e.between(0,t.doc.length,(e,t)=>{r.push(e,t)}),r},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let r=0;r<e.length;){let n=e[r++],i=e[r++];if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid JSON for fold state");t.push(he.range(n,i))}return o.NZ.set(t,!0)}});function ee(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=!1;return e.between(t,r,(e,i)=>{e<r&&i>t&&(n=!0)}),n?e.update({filterFrom:t,filterTo:r,filter:(e,n)=>e>=r||n<=t}):e}function te(e,t,r){var n;let i=null;return null===(n=e.field(J,!1))||void 0===n||n.between(t,r,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function re(e,t,r){let n=!1;return e.between(t,t,(e,i)=>{e==t&&i==r&&(n=!0)}),n}function ne(e,t){return e.field(J,!1)?t:t.concat(s.Pe.appendConfig.of(le()))}function ie(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return o.Lz.announce.of(`${e.state.phrase(r?"Folded lines":"Unfolded lines")} ${n} ${e.state.phrase("to")} ${i}.`)}const se=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of K(e)){let r=Y(e.state,t.from,t.to);if(r)return e.dispatch({effects:ne(e.state,[G.of(r),ie(e,r)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(J,!1))return!1;let t=[];for(let r of K(e)){let n=te(e.state,r.from,r.to);n&&t.push(H.of(n),ie(e,n,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,r=[];for(let n=0;n<t.doc.length;){let i=e.lineBlockAt(n),s=Y(t,i.from,i.to);s&&r.push(G.of(s)),n=(s?e.lineBlockAt(s.to):i).to+1}return r.length&&e.dispatch({effects:ne(e.state,r)}),!!r.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(J,!1);if(!t||!t.size)return!1;let r=[];return t.between(0,e.state.doc.length,(e,t)=>{r.push(H.of({from:e,to:t}))}),e.dispatch({effects:r}),!0}}],oe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},ae=s.sj.define({combine:e=>(0,s.QR)(e,oe)});function le(e){let t=[J,pe];return e&&t.push(ae.of(e)),t}function ce(e,t){let{state:r}=e,n=r.facet(ae),i=t=>{let r=e.lineBlockAt(e.posAtDOM(t.target)),n=te(e.state,r.from,r.to);n&&e.dispatch({effects:H.of(n)}),t.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(e,i,t);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",r.phrase("folded code")),s.title=r.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const he=o.NZ.replace({widget:new class extends o.xO{toDOM(e){return ce(e,null)}}});class ue extends o.xO{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ce(e,this.value)}}const de={openText:"\u2304",closedText:"\u203a",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class fe extends o.wJ{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function me(){let e={...de,...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}},t=new fe(e,!0),r=new fe(e,!1),n=o.Z9.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(S)!=t.state.facet(S)||t.startState.field(J,!1)!=t.state.field(J,!1)||p(t.startState)!=p(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(e){let n=new s.vB;for(let i of e.viewportLineBlocks){let s=te(e.state,i.from,i.to)?r:Y(e.state,i.from,i.to)?t:null;s&&n.add(i.from,i.from,s)}return n.finish()}}),{domEventHandlers:i}=e;return[n,(0,o.cU)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(n))||void 0===t?void 0:t.markers)||s.om.empty},initialSpacer:()=>new fe(e,!1),domEventHandlers:{...i,click:(e,t,r)=>{if(i.click&&i.click(e,t,r))return!0;let n=te(e.state,t.from,t.to);if(n)return e.dispatch({effects:H.of(n)}),!0;let s=Y(e.state,t.from,t.to);return!!s&&(e.dispatch({effects:G.of(s)}),!0)}}}),le()]}const pe=o.Lz.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ge{constructor(e,t){let r;function n(e){let t=l.G.newName();return(r||(r=Object.create(null)))["."+t]=e,t}this.specs=e;const i="string"==typeof t.all?t.all:t.all?n(t.all):void 0,s=t.scope;this.scope=s instanceof d?e=>e.prop(c)==s.data:s?e=>e==s:void 0,this.style=(0,a.az)(e.map(e=>({tag:e.tag,class:e.class||n(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=r?new l.G(r):null,this.themeType=t.themeType}static define(e,t){return new ge(e,t||{})}}const xe=s.sj.define(),Oe=s.sj.define({combine:e=>e.length?[e[0]]:null});function ve(e){let t=e.facet(xe);return t.length?t:e.facet(Oe)}function ye(e,t){let r,n=[we];return e instanceof ge&&(e.module&&n.push(o.Lz.styleModule.of(e.module)),r=e.themeType),(null===t||void 0===t?void 0:t.fallback)?n.push(Oe.of(e)):r?n.push(xe.computeN([o.Lz.darkTheme],t=>t.facet(o.Lz.darkTheme)==("dark"==r)?[e]:[])):n.push(xe.of(e)),n}class be{constructor(e){this.markCache=Object.create(null),this.tree=p(e.state),this.decorations=this.buildDeco(e,ve(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=p(e.state),r=ve(e.state),n=r!=ve(e.startState),{viewport:i}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!n&&t.type==this.tree.type&&s>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return o.NZ.none;let r=new s.vB;for(let{from:n,to:i}of e.visibleRanges)(0,a.DM)(this.tree,t,(e,t,n)=>{r.add(e,t,this.markCache[n]||(this.markCache[n]=o.NZ.mark({class:n})))},n,i);return r.finish()}}const we=s.Nb.high(o.Z9.fromClass(be,{decorations:e=>e.decorations})),ke=ge.define([{tag:a._A.meta,color:"#404740"},{tag:a._A.link,textDecoration:"underline"},{tag:a._A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a._A.emphasis,fontStyle:"italic"},{tag:a._A.strong,fontWeight:"bold"},{tag:a._A.strikethrough,textDecoration:"line-through"},{tag:a._A.keyword,color:"#708"},{tag:[a._A.atom,a._A.bool,a._A.url,a._A.contentSeparator,a._A.labelName],color:"#219"},{tag:[a._A.literal,a._A.inserted],color:"#164"},{tag:[a._A.string,a._A.deleted],color:"#a11"},{tag:[a._A.regexp,a._A.escape,a._A.special(a._A.string)],color:"#e40"},{tag:a._A.definition(a._A.variableName),color:"#00f"},{tag:a._A.local(a._A.variableName),color:"#30a"},{tag:[a._A.typeName,a._A.namespace],color:"#085"},{tag:a._A.className,color:"#167"},{tag:[a._A.special(a._A.variableName),a._A.macroName],color:"#256"},{tag:a._A.definition(a._A.propertyName),color:"#00c"},{tag:a._A.comment,color:"#940"},{tag:a._A.invalid,color:"#f00"}]),Se=o.Lz.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ne=1e4,je="()[]{}",_e=s.sj.define({combine:e=>(0,s.QR)(e,{afterCursor:!0,brackets:je,maxScanDistance:Ne,renderMatch:Ee})}),Ae=o.NZ.mark({class:"cm-matchingBracket"}),Pe=o.NZ.mark({class:"cm-nonmatchingBracket"});function Ee(e){let t=[],r=e.matched?Ae:Pe;return t.push(r.range(e.start.from,e.start.to)),e.end&&t.push(r.range(e.end.from,e.end.to)),t}const Qe=[s.sU.define({create:()=>o.NZ.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let r=[],n=t.state.facet(_e);for(let i of t.state.selection.ranges){if(!i.empty)continue;let e=$e(t.state,i.head,-1,n)||i.head>0&&$e(t.state,i.head-1,1,n)||n.afterCursor&&($e(t.state,i.head,1,n)||i.head<t.state.doc.length&&$e(t.state,i.head+1,-1,n));e&&(r=r.concat(n.renderMatch(e,t.state)))}return o.NZ.set(r,!0)},provide:e=>o.Lz.decorations.from(e)}),Se];function Ce(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[_e.of(e),Qe]}const Me=new i.uY;function Te(e,t,r){let n=e.prop(t<0?i.uY.openedBy:i.uY.closedBy);if(n)return n;if(1==e.name.length){let n=r.indexOf(e.name);if(n>-1&&n%2==(t<0?1:0))return[r[n+t]]}return null}function Re(e){let t=e.type.prop(Me);return t?t(e.node):e}function $e(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.maxScanDistance||Ne,s=n.brackets||je,o=p(e),a=o.resolveInner(t,r);for(let l=a;l;l=l.parent){let n=Te(l.type,r,s);if(n&&l.from<l.to){let i=Re(l);if(i&&(r>0?t>=i.from&&t<i.to:t>i.from&&t<=i.to))return De(e,t,r,l,i,n,s)}}return function(e,t,r,n,i,s,o){let a=r<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=o.indexOf(a);if(l<0||l%2==0!=r>0)return null;let c={from:r<0?t-1:t,to:r>0?t+1:t},h=e.doc.iterRange(t,r>0?e.doc.length:0),u=0;for(let d=0;!h.next().done&&d<=s;){let e=h.value;r<0&&(d+=e.length);let s=t+d*r;for(let t=r>0?0:e.length-1,a=r>0?e.length:-1;t!=a;t+=r){let a=o.indexOf(e[t]);if(!(a<0||n.resolveInner(s+t,1).type!=i))if(a%2==0==r>0)u++;else{if(1==u)return{start:c,end:{from:s+t,to:s+t+1},matched:a>>1==l>>1};u--}}r>0&&(d+=e.length)}return h.done?{start:c,matched:!1}:null}(e,t,r,o,a.type,i,s)}function De(e,t,r,n,i,s,o){let a=n.parent,l={from:i.from,to:i.to},c=0,h=null===a||void 0===a?void 0:a.cursor();if(h&&(r<0?h.childBefore(n.from):h.childAfter(n.to)))do{if(r<0?h.to<=n.from:h.from>=n.to){if(0==c&&s.indexOf(h.type.name)>-1&&h.from<h.to){let e=Re(h);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(Te(h.type,r,o))c++;else if(Te(h.type,-r,o)){if(0==c){let e=Re(h);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(r<0?h.prevSibling():h.nextSibling());return{start:l,matched:!1}}const Le=Object.create(null),Ie=[i.Z6.none],Ze=[],Be=Object.create(null),ze=Object.create(null);for(let[Xe,Fe]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ze[Xe]=Ue(Le,Fe);function qe(e,t){Ze.indexOf(e)>-1||(Ze.push(e),console.warn(t))}function Ue(e,t){let r=[];for(let i of t.split(" ")){let t=[];for(let r of i.split(".")){let n=e[r]||a._A[r];n?"function"==typeof n?t.length?t=t.map(n):qe(r,`Modifier ${r} used at start of tag`):t.length?qe(r,`Tag ${r} used as modifier`):t=Array.isArray(n)?n:[n]:qe(r,`Unknown highlighting tag ${r}`)}for(let e of t)r.push(e)}if(!r.length)return 0;let n=t.replace(/ /g,"_"),s=n+" "+r.map(e=>e.id),o=Be[s];if(o)return o.id;let l=Be[s]=i.Z6.define({id:Ie.length,name:n,props:[(0,a.pn)({[n]:r})]});return Ie.push(l),l.id}o.OP.RTL,o.OP.LTR},107:(e,t,r)=>{"use strict";r.d(t,{NZ:()=>fe,OP:()=>Ne,Lz:()=>hn,wJ:()=>$i,Z9:()=>ht,xO:()=>ue,HJ:()=>ui,VH:()=>Mn,A:()=>zn,ld:()=>Qi,Eg:()=>Ai,cU:()=>Bi,dz:()=>ei,Wu:()=>os,N$:()=>Gn,Ux:()=>_i,w4:()=>On,$K:()=>rs,c_:()=>ot,qf:()=>ii,D4:()=>li,TS:()=>bn,S7:()=>Ri,DK:()=>bi});for(var n=r(498),i=r(347),s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),c=0;c<10;c++)s[48+c]=s[96+c]=String(c);for(c=1;c<=24;c++)s[c+111]="F"+c;for(c=65;c<=90;c++)s[c]=String.fromCharCode(c+32),o[c]=String.fromCharCode(c);for(var h in s)o.hasOwnProperty(h)||(o[h]=s[h]);function u(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function d(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function f(e,t){if(!t.anchorNode)return!1;try{return d(e,t.anchorNode)}catch(r){return!1}}function m(e){return 3==e.nodeType?_(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function p(e,t,r,n){return!!r&&(O(e,t,r,n,-1)||O(e,t,r,n,1))}function g(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function x(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function O(e,t,r,n,i){for(;;){if(e==r&&t==n)return!0;if(t==(i<0?0:v(e))){if("DIV"==e.nodeName)return!1;let r=e.parentNode;if(!r||1!=r.nodeType)return!1;t=g(e)+(i<0?0:1),e=r}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?v(e):0}}}function v(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function y(e,t){let r=t?e.left:e.right;return{left:r,right:r,top:e.top,bottom:e.bottom}}function b(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function w(e,t){let r=t.width/e.offsetWidth,n=t.height/e.offsetHeight;return(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.width-e.offsetWidth)<1)&&(r=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.height-e.offsetHeight)<1)&&(n=1),{scaleX:r,scaleY:n}}class k{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?v(t):0),r,Math.min(e.focusOffset,r?v(r):0))}set(e,t,r,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=n}}let S,N=null;function j(e){if(e.setActive)return e.setActive();if(N)return e.focus(N);let t=[];for(let r=e;r&&(t.push(r,r.scrollTop,r.scrollLeft),r!=r.ownerDocument);r=r.parentNode);if(e.focus(null==N?{get preventScroll(){return N={preventScroll:!0},!0}}:void 0),!N){N=!1;for(let e=0;e<t.length;){let r=t[e++],n=t[e++],i=t[e++];r.scrollTop!=n&&(r.scrollTop=n),r.scrollLeft!=i&&(r.scrollLeft=i)}}}function _(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=S||(S=document.createRange());return n.setEnd(e,r),n.setStart(e,t),n}function A(e,t,r,n){let i={key:t,code:t,keyCode:r,which:r,cancelable:!0};n&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=n);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,e.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,e.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function P(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function E(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Q(e,t){for(let r=e,n=t;;){if(3==r.nodeType&&n>0)return{node:r,offset:n};if(1==r.nodeType&&n>0){if("false"==r.contentEditable)return null;r=r.childNodes[n-1],n=v(r)}else{if(!r.parentNode||x(r))return null;n=g(r),r=r.parentNode}}}function C(e,t){for(let r=e,n=t;;){if(3==r.nodeType&&n<r.nodeValue.length)return{node:r,offset:n};if(1==r.nodeType&&n<r.childNodes.length){if("false"==r.contentEditable)return null;r=r.childNodes[n],n=0}else{if(!r.parentNode||x(r))return null;n=g(r)+1,r=r.parentNode}}}class M{constructor(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.node=e,this.offset=t,this.precise=r}static before(e,t){return new M(e.parentNode,g(e),t)}static after(e,t){return new M(e.parentNode,g(e)+1,t)}}const T=[];class R{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let r of this.children){if(r==e)return t;t+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let r,n=this.dom,i=null;for(let s of this.children){if(7&s.flags){if(!s.dom&&(r=i?i.nextSibling:n.firstChild)){let e=R.get(r);(!e||!e.parent&&e.canReuseDOM(s))&&s.reuseDOM(r)}s.sync(e,t),s.flags&=-8}if(r=i?i.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&r!=s.dom&&(t.written=!0),s.dom.parentNode==n)for(;r&&r!=s.dom;)r=$(r);else n.insertBefore(s.dom,r);i=s.dom}for(r=i?i.nextSibling:n.firstChild,r&&t&&t.node==n&&(t.written=!0);r;)r=$(r)}else if(1&this.flags)for(let r of this.children)7&r.flags&&(r.sync(e,t),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let r;if(e==this.dom)r=this.dom.childNodes[t];else{let n=0==v(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==n&&t.firstChild!=t.lastChild&&(n=e==t.firstChild?-1:1),e=t}r=n<0?e:e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!R.get(r);)r=r.nextSibling;if(!r)return this.length;for(let n=0,i=0;;n++){let e=this.children[n];if(e.dom==r)return i;i+=e.length+e.breakAfter}}domBoundsAround(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=-1,i=-1,s=-1,o=-1;for(let a=0,l=r,c=r;a<this.children.length;a++){let r=this.children[a],h=l+r.length;if(l<e&&h>t)return r.domBoundsAround(e,t,l);if(h>=e&&-1==n&&(n=a,i=l),l>t&&r.dom.parentNode==this.dom){s=a,o=c;break}c=h,l=h+r.breakAfter}return{from:i,to:o<0?r+this.length:o,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s<this.children.length&&s>=0?this.children[s].dom:null}}markDirty(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T;this.markDirty();for(let n=e;n<t;n++){let e=this.children[n];e.parent==this&&r.indexOf(e)<0&&e.destroy()}r.length<250?this.children.splice(e,t-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(t));for(let n=0;n<r.length;n++)r[n].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length;return new D(this.children,e,this.children.length)}childPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,r,n,i,s){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!(8&(this.flags|e.flags))}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}function $(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}R.prototype.breakAfter=0;class D{constructor(e,t,r){this.children=e,this.pos=t,this.i=r,this.off=0}findPos(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;for(;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function L(e,t,r,n,i,s,o,a,l){let{children:c}=e,h=c.length?c[t]:null,u=s.length?s[s.length-1]:null,d=u?u.breakAfter:o;if(!(t==n&&h&&!o&&!d&&s.length<2&&h.merge(r,i,s.length?u:null,0==r,a,l))){if(n<c.length){let e=c[n];e&&(i<e.length||e.breakAfter&&(null===u||void 0===u?void 0:u.breakAfter))?(t==n&&(e=e.split(i),i=0),!d&&u&&e.merge(0,i,u,!0,0,l)?s[s.length-1]=e:((i||e.children.length&&!e.children[0].length)&&e.merge(0,i,null,!1,0,l),s.push(e))):(null===e||void 0===e?void 0:e.breakAfter)&&(u?u.breakAfter=1:o=1),n++}for(h&&(h.breakAfter=o,r>0&&(!o&&s.length&&h.merge(r,h.length,s[0],!1,a,0)?h.breakAfter=s.shift().breakAfter:(r<h.length||h.children.length&&0==h.children[h.children.length-1].length)&&h.merge(r,h.length,null,!1,a,0),t++));t<n&&s.length;)if(c[n-1].become(s[s.length-1]))n--,s.pop(),l=s.length?0:a;else{if(!c[t].become(s[0]))break;t++,s.shift(),a=s.length?0:l}!s.length&&t&&n<c.length&&!c[t-1].breakAfter&&c[n].merge(0,0,c[t-1],!1,a,l)&&t--,(t<n||s.length)&&e.replaceChildren(t,n,s)}}function I(e,t,r,n,i,s){let o=e.childCursor(),{i:a,off:l}=o.findPos(r,1),{i:c,off:h}=o.findPos(t,-1),u=t-r;for(let d of n)u+=d.length;e.length+=u,L(e,c,h,a,l,n,0,i,s)}let Z="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},B="undefined"!=typeof document?document:{documentElement:{style:{}}};const z=/Edge\/(\d+)/.exec(Z.userAgent),q=/MSIE \d/.test(Z.userAgent),U=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z.userAgent),X=!!(q||U||z),F=!X&&/gecko\/(\d+)/i.test(Z.userAgent),V=!X&&/Chrome\/(\d+)/.exec(Z.userAgent),Y="webkitFontSmoothing"in B.documentElement.style,W=!X&&/Apple Computer/.test(Z.vendor),G=W&&(/Mobile\/\w+/.test(Z.userAgent)||Z.maxTouchPoints>2);var H={mac:G||/Mac/.test(Z.platform),windows:/Win/.test(Z.platform),linux:/Linux|X11/.test(Z.platform),ie:X,ie_version:q?B.documentMode||6:U?+U[1]:z?+z[1]:0,gecko:F,gecko_version:F?+(/Firefox\/(\d+)/.exec(Z.userAgent)||[0,0])[1]:0,chrome:!!V,chrome_version:V?+V[1]:0,ios:G,android:/Android\b/.test(Z.userAgent),webkit:Y,safari:W,webkit_version:Y?+(/\bAppleWebKit\/(\d+)/.exec(Z.userAgent)||[0,0])[1]:0,tabSize:null!=B.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class K extends R{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,r){return!(8&this.flags||r&&(!(r instanceof K)||this.length-(t-e)+r.length>256||8&r.flags))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new K(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new M(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,r){let n=e.nodeValue.length;t>n&&(t=n);let i=t,s=t,o=0;0==t&&r<0||t==n&&r>=0?H.chrome||H.gecko||(t?(i--,o=1):s<n&&(s++,o=-1)):r<0?i--:s<n&&s++;let a=_(e,i,s).getClientRects();if(!a.length)return null;let l=a[(o?o<0:r>=0)?0:a.length-1];H.safari&&!o&&0==l.width&&(l=Array.prototype.find.call(a,e=>e.width)||l);return o?y(l,o<0):l||null}(this.dom,e,t)}}class J extends R{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(),this.mark=e,this.children=t,this.length=r;for(let n of t)n.setParent(this)}setAttrs(e){if(P(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,n,i,s){return(!r||!(!(r instanceof J&&r.mark.eq(this.mark))||e&&i<=0||t<this.length&&s<=0))&&(I(this,e,t,r?r.children.slice():[],i-1,s-1),this.markDirty(),!0)}split(e){let t=[],r=0,n=-1,i=0;for(let o of this.children){let s=r+o.length;s>e&&t.push(r<e?o.split(e-r):o),n<0&&r>=e&&(n=i),r=s,i++}let s=this.length-e;return this.length=e,n>-1&&(this.children.length=n,this.markDirty()),new J(this.mark,t,s)}domAtPos(e){return re(this,e)}coordsAt(e,t){return ie(this,e,t)}}class ee extends R{static create(e,t,r){return new ee(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=ee.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,n,i,s){return!(r&&(!(r instanceof ee&&this.widget.compare(r.widget))||e>0&&i<=0||t<this.length&&s<=0))&&(this.length=e+(r?r.length:0)+(this.length-t),!0)}become(e){return e instanceof ee&&e.side=