@pubann/textae 14.3.0 → 14.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1131 @@
1
+ (()=>{var t={117:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2586),o=i(5765),s=i(4227),r=i(8660),a={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:i,parentSchema:a,data:l,it:c}=t;"all"===c.opts.removeAdditional&&void 0===a.additionalProperties&&r.default.code(new n.KeywordCxt(c,r.default,"additionalProperties"));const h=(0,o.allSchemaProperties)(i);for(const t of h)c.definedProperties.add(t);c.opts.unevaluated&&h.length&&!0!==c.props&&(c.props=s.mergeEvaluated.props(e,(0,s.toHash)(h),c.props));const u=h.filter(t=>!(0,s.alwaysValidSchema)(c,i[t]));if(0===u.length)return;const d=e.name("valid");for(const i of u)f(i)?p(i):(e.if((0,o.propertyInData)(e,l,i,c.opts.ownProperties)),p(i),c.allErrors||e.else().var(d,!0),e.endIf()),t.it.definedProperties.add(i),t.ok(d);function f(t){return c.opts.useDefaults&&!c.compositeRule&&void 0!==i[t].default}function p(e){t.subschema({keyword:"properties",schemaProp:e,dataProp:e},d)}}};e.default=a},208:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const n=i(396),o=i(7887),s=i(8708),r=i(9029),a=i(4227);var l;function c(t){const e=Array.isArray(t)?t:t?[t]:[];if(e.every(n.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}!function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"}(l||(e.DataType=l={})),e.getSchemaTypes=function(t){const e=c(t.type);if(e.includes("null")){if(!1===t.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&void 0!==t.nullable)throw new Error('"nullable" cannot be used without "type"');!0===t.nullable&&e.push("null")}return e},e.getJSONTypes=c,e.coerceAndCheckDataType=function(t,e){const{gen:i,data:n,opts:s}=t,a=function(t,e){return e?t.filter(t=>h.has(t)||"array"===e&&"array"===t):[]}(e,s.coerceTypes),c=e.length>0&&!(0===a.length&&1===e.length&&(0,o.schemaHasRulesForType)(t,e[0]));if(c){const o=d(e,n,s.strictNumbers,l.Wrong);i.if(o,()=>{a.length?function(t,e,i){const{gen:n,data:o,opts:s}=t,a=n.let("dataType",r._`typeof ${o}`),l=n.let("coerced",r._`undefined`);"array"===s.coerceTypes&&n.if(r._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,r._`${o}[0]`).assign(a,r._`typeof ${o}`).if(d(e,o,s.strictNumbers),()=>n.assign(l,o)));n.if(r._`${l} !== undefined`);for(const t of i)(h.has(t)||"array"===t&&"array"===s.coerceTypes)&&c(t);function c(t){switch(t){case"string":return void n.elseIf(r._`${a} == "number" || ${a} == "boolean"`).assign(l,r._`"" + ${o}`).elseIf(r._`${o} === null`).assign(l,r._`""`);case"number":return void n.elseIf(r._`${a} == "boolean" || ${o} === null
2
+ || (${a} == "string" && ${o} && ${o} == +${o})`).assign(l,r._`+${o}`);case"integer":return void n.elseIf(r._`${a} === "boolean" || ${o} === null
3
+ || (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,r._`+${o}`);case"boolean":return void n.elseIf(r._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf(r._`${o} === "true" || ${o} === 1`).assign(l,!0);case"null":return n.elseIf(r._`${o} === "" || ${o} === 0 || ${o} === false`),void n.assign(l,null);case"array":n.elseIf(r._`${a} === "string" || ${a} === "number"
4
+ || ${a} === "boolean" || ${o} === null`).assign(l,r._`[${o}]`)}}n.else(),p(t),n.endIf(),n.if(r._`${l} !== undefined`,()=>{n.assign(o,l),function({gen:t,parentData:e,parentDataProperty:i},n){t.if(r._`${e} !== undefined`,()=>t.assign(r._`${e}[${i}]`,n))}(t,l)})}(t,e,a):p(t)})}return c};const h=new Set(["string","number","integer","boolean","null"]);function u(t,e,i,n=l.Correct){const o=n===l.Correct?r.operators.EQ:r.operators.NEQ;let s;switch(t){case"null":return r._`${e} ${o} null`;case"array":s=r._`Array.isArray(${e})`;break;case"object":s=r._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a(r._`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return r._`typeof ${e} ${o} ${t}`}return n===l.Correct?s:(0,r.not)(s);function a(t=r.nil){return(0,r.and)(r._`typeof ${e} == "number"`,t,i?r._`isFinite(${e})`:r.nil)}}function d(t,e,i,n){if(1===t.length)return u(t[0],e,i,n);let o;const s=(0,a.toHash)(t);if(s.array&&s.object){const t=r._`typeof ${e} != "object"`;o=s.null?t:r._`!${e} || ${t}`,delete s.null,delete s.array,delete s.object}else o=r.nil;s.number&&delete s.integer;for(const t in s)o=(0,r.and)(o,u(t,e,i,n));return o}e.checkDataType=u,e.checkDataTypes=d;const f={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>"string"==typeof t?r._`{type: ${t}}`:r._`{type: ${e}}`};function p(t){const e=function(t){const{gen:e,data:i,schema:n}=t,o=(0,a.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:i,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}(t);(0,s.reportError)(e,f)}e.reportTypeError=p},343:(t,e,i)=>{"use strict";const{isUUID:n}=i(4834),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,s=["http","https","ws","wss","urn","urn:uuid"];function r(t){return!0===t.secure||!1!==t.secure&&(!!t.scheme&&!(3!==t.scheme.length||"w"!==t.scheme[0]&&"W"!==t.scheme[0]||"s"!==t.scheme[1]&&"S"!==t.scheme[1]||"s"!==t.scheme[2]&&"S"!==t.scheme[2]))}function a(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function l(t){const e="https"===String(t.scheme).toLowerCase();return t.port!==(e?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}const c={scheme:"http",domainHost:!0,parse:a,serialize:l},h={scheme:"ws",domainHost:!0,parse:function(t){return t.secure=r(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(t){if(t.port!==(r(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){const[e,i]=t.resourceName.split("?");t.path=e&&"/"!==e?e:void 0,t.query=i,t.resourceName=void 0}return t.fragment=void 0,t}},u={http:c,https:{scheme:"https",domainHost:c.domainHost,parse:a,serialize:l},ws:h,wss:{scheme:"wss",domainHost:h.domainHost,parse:h.parse,serialize:h.serialize},urn:{scheme:"urn",parse:function(t,e){if(!t.path)return t.error="URN can not be parsed",t;const i=t.path.match(o);if(i){const n=e.scheme||t.scheme||"urn";t.nid=i[1].toLowerCase(),t.nss=i[2];const o=d(`${n}:${e.nid||t.nid}`);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t},serialize:function(t,e){if(void 0===t.nid)throw new Error("URN without nid cannot be serialized");const i=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=d(`${i}:${e.nid||n}`);o&&(t=o.serialize(t,e));const s=t,r=t.nss;return s.path=`${n||e.nid}:${r}`,e.skipEscape=!0,s},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(t,e){const i=t;return i.uuid=i.nss,i.nss=void 0,e.tolerant||i.uuid&&n(i.uuid)||(i.error=i.error||"UUID is not valid."),i},serialize:function(t){const e=t;return e.nss=(t.uuid||"").toLowerCase(),e},skipNormalize:!0}};function d(t){return t&&(u[t]||u[t.toLowerCase()])||void 0}Object.setPrototypeOf(u,null),t.exports={wsIsSecure:r,SCHEMES:u,isValidSchemeName:function(t){return-1!==s.indexOf(t)},getSchemeHandler:d}},396:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;const i=new Set(["string","number","integer","boolean","null","object","array"]);e.isJSONType=function(t){return"string"==typeof t&&i.has(t)},e.getRules=function(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}},422:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5765),o=i(9029),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>o.str`must match pattern "${t}"`,params:({schemaCode:t})=>o._`{pattern: ${t}}`},code(t){const{data:e,$data:i,schema:s,schemaCode:r,it:a}=t,l=a.opts.unicodeRegExp?"u":"",c=i?o._`(new RegExp(${r}, ${l}))`:(0,n.usePattern)(t,s);t.fail$data(o._`!${c}.test(${e})`)}};e.default=s},494:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;const n=i(9029),o=i(4227),s=i(5765),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:i}=t;if(Array.isArray(e))return a(t,"additionalItems",e);i.items=!0,(0,o.alwaysValidSchema)(i,e)||t.ok((0,s.validateArray)(t))}};function a(t,e,i=t.schema){const{gen:s,parentSchema:r,data:a,keyword:l,it:c}=t;!function(t){const{opts:n,errSchemaPath:s}=c,r=i.length,a=r===t.minItems&&(r===t.maxItems||!1===t[e]);if(n.strictTuples&&!a){const t=`"${l}" is ${r}-tuple, but minItems or maxItems/${e} are not specified or different at path "${s}"`;(0,o.checkStrictMode)(c,t,n.strictTuples)}}(r),c.opts.unevaluated&&i.length&&!0!==c.items&&(c.items=o.mergeEvaluated.items(s,i.length,c.items));const h=s.name("valid"),u=s.const("len",n._`${a}.length`);i.forEach((e,i)=>{(0,o.alwaysValidSchema)(c,e)||(s.if(n._`${u} > ${i}`,()=>t.subschema({keyword:l,schemaProp:i,dataProp:i},h)),t.ok(h))})}e.validateTuple=a,e.default=r},504:t=>{t.exports=function(t){var e=[];return t=void 0===t?null:t,i.set=function(i){t=i,e.forEach(function(t){t(i)})},i;function i(i){return i?(e.push(i),function(){e.splice(e.indexOf(i),1)}):t}}},617:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(208),o=i(9029),s=i(4227),r=i(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:t,j:e}})=>o.str`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>o._`{i: ${t}, j: ${e}}`},code(t){const{gen:e,data:i,$data:a,schema:l,parentSchema:c,schemaCode:h,it:u}=t;if(!a&&!l)return;const d=e.let("valid"),f=c.items?(0,n.getSchemaTypes)(c.items):[];function p(s,r){const a=e.name("item"),l=(0,n.checkDataTypes)(f,a,u.opts.strictNumbers,n.DataType.Wrong),c=e.const("indices",o._`{}`);e.for(o._`;${s}--;`,()=>{e.let(a,o._`${i}[${s}]`),e.if(l,o._`continue`),f.length>1&&e.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),e.if(o._`typeof ${c}[${a}] == "number"`,()=>{e.assign(r,o._`${c}[${a}]`),t.error(),e.assign(d,!1).break()}).code(o._`${c}[${a}] = ${s}`)})}function m(n,a){const l=(0,s.useFunc)(e,r.default),c=e.name("outer");e.label(c).for(o._`;${n}--;`,()=>e.for(o._`${a} = ${n}; ${a}--;`,()=>e.if(o._`${l}(${i}[${n}], ${i}[${a}])`,()=>{t.error(),e.assign(d,!1).break(c)})))}t.block$data(d,function(){const n=e.let("i",o._`${i}.length`),s=e.let("j");t.setParams({i:n,j:s}),e.assign(d,!0),e.if(o._`${n} > 1`,()=>(f.length>0&&!f.some(t=>"object"===t||"array"===t)?p:m)(n,s))},o._`${h} === false`),t.ok(d)}};e.default=a},724:(t,e,i)=>{var n,o,s;
5
+ /*!
6
+ * jQuery UI Disable Selection 1.14.1
7
+ * https://jqueryui.com
8
+ *
9
+ * Copyright OpenJS Foundation and other contributors
10
+ * Released under the MIT license.
11
+ * https://jquery.org/license
12
+ */!function(){"use strict";o=[i(4692),i(6883)],void 0===(s="function"==typeof(n=function(t){return t.fn.extend({disableSelection:(e="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(e+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});var e})?n.apply(e,o):n)||(t.exports=s)}()},1163:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const i="maxItems"===t?"more":"fewer";return n.str`must NOT have ${i} than ${e} items`},params:({schemaCode:t})=>n._`{limit: ${t}}`},code(t){const{keyword:e,data:i,schemaCode:o}=t,s="maxItems"===e?n.operators.GT:n.operators.LT;t.fail$data(n._`${i}.length ${s} ${o}`)}};e.default=o},1193:(t,e,i)=>{var n,o,s;
13
+ /*!
14
+ * jQuery UI Dialog 1.14.1
15
+ * https://jqueryui.com
16
+ *
17
+ * Copyright OpenJS Foundation and other contributors
18
+ * Released under the MIT license.
19
+ * https://jquery.org/license
20
+ */!function(){"use strict";o=[i(4692),i(8481),i(1758),i(3662),i(8604),i(1255),i(1897),i(4224),i(7144),i(5304),i(6883),i(9139)],n=function(t){t.widget("ui.dialog",{version:"1.14.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;i<0&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,uiDialogTitleHeadingLevel:0,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&!1!==this._trigger("beforeClose",e)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t(this.document[0].activeElement).trigger("blur"),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var n=!1,o=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),s=Math.max.apply(null,o);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),n=!0),n&&!i&&this._trigger("focus",e),n},open:function(){var e=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_restoreTabbableFocus:function(){var e=this.document[0].activeElement;this.uiDialog[0]===e||t.contains(this.uiDialog[0],e)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus()},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog","aria-modal":this.options.modal?"true":null}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),void this.close(e);if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),n=i.first(),o=i.last();e.target!==o[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==n[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){o.trigger("focus")}),e.preventDefault()):(this._delay(function(){n.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}});var i=Number.isInteger(this.options.uiDialogTitleHeadingLevel)&&this.options.uiDialogTitleHeadingLevel>0&&this.options.uiDialogTitleHeadingLevel<=6?"h"+this.options.uiDialogTitleHeadingLevel:"span";e=t("<"+i+">").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||Array.isArray(i)&&!i.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(t.each(i,function(i,n){var o,s;n="function"==typeof n?{click:n,text:i}:n,n=t.extend({type:"button"},n),o=n.click,s={icon:n.icon,iconPosition:n.iconPosition,showLabel:n.showLabel,icons:n.icons,text:n.text},delete n.click,delete n.icon,delete n.iconPosition,delete n.showLabel,delete n.icons,"boolean"==typeof n.text&&delete n.text,t("<button></button>",n).button(s).appendTo(e.uiButtonSet).on("click",function(){o.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var e=this,i=this.options;function n(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,o){e._addClass(t(this),"ui-dialog-dragging"),e._blockFrames(),e._trigger("dragStart",i,n(o))},drag:function(t,i){e._trigger("drag",t,n(i))},stop:function(o,s){var r=s.offset.left-e.document.scrollLeft(),a=s.offset.top-e.document.scrollTop();i.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" top"+(a>=0?"+":"")+a,of:e.window},e._removeClass(t(this),"ui-dialog-dragging"),e._unblockFrames(),e._trigger("dragStop",o,n(s))}})},_makeResizable:function(){var e=this,i=this.options,n=i.resizable,o=this.uiDialog.css("position"),s="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";function r(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:s,start:function(i,n){e._addClass(t(this),"ui-dialog-resizing"),e._blockFrames(),e._trigger("resizeStart",i,r(n))},resize:function(t,i){e._trigger("resize",t,r(i))},stop:function(n,o){var s=e.uiDialog.offset(),a=s.left-e.document.scrollLeft(),l=s.top-e.document.scrollTop();i.height=e.uiDialog.height(),i.width=e.uiDialog.width(),i.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" top"+(l>=0?"+":"")+l,of:e.window},e._removeClass(t(this),"ui-dialog-resizing"),e._unblockFrames(),e._trigger("resizeStop",n,r(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,n=!1,o={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(n=!0),t in i.resizableRelatedOptions&&(o[t]=e)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,i){var n,o,s=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&((n=s.is(":data(ui-draggable)"))&&!i&&s.draggable("destroy"),!n&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&((o=s.is(":data(ui-resizable)"))&&!i&&s.resizable("destroy"),o&&"string"==typeof i&&s.resizable("option","handles",i),o||!1===i||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")),"modal"===e&&s.attr("aria-modal",i?"true":null))},_size:function(){var t,e,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),t=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),e=Math.max(0,n.minHeight-t),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-t):"none","auto"===n.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!t(e.target).closest(".ui-dialog").length||!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){if(!e){var i=this._trackingInstances()[0];i._allowInteraction(t)||(t.preventDefault(),i._focusTabbable())}}.bind(this)),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!0===t.uiBackCompat&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});return t.ui.dialog},void 0===(s="function"==typeof n?n.apply(e,o):n)||(t.exports=s)}()},1239:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(4227),s={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>n.str`must match "${t.ifClause}" schema`,params:({params:t})=>n._`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:i,it:s}=t;void 0===i.then&&void 0===i.else&&(0,o.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const a=r(s,"then"),l=r(s,"else");if(!a&&!l)return;const c=e.let("valid",!0),h=e.name("_valid");if(function(){const e=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);t.mergeEvaluated(e)}(),t.reset(),a&&l){const i=e.let("ifClause");t.setParams({ifClause:i}),e.if(h,u("then",i),u("else",i))}else a?e.if(h,u("then")):e.if((0,n.not)(h),u("else"));function u(i,o){return()=>{const s=t.subschema({keyword:i},h);e.assign(c,h),t.mergeValidEvaluated(s,c),o?e.assign(o,n._`${i}`):t.setParams({ifClause:i})}}t.pass(c,()=>t.error(!0))}};function r(t,e){const i=t.schema[e];return void 0!==i&&!(0,o.alwaysValidSchema)(t,i)}e.default=s},1255:(t,e,i)=>{var n,o,s;
21
+ /*!
22
+ * jQuery UI Focusable 1.14.1
23
+ * https://jqueryui.com
24
+ *
25
+ * Copyright OpenJS Foundation and other contributors
26
+ * Released under the MIT license.
27
+ * https://jquery.org/license
28
+ */!function(){"use strict";o=[i(4692),i(6883)],void 0===(s="function"==typeof(n=function(t){return t.ui.focusable=function(e,i){var n,o,s,r,a,l=e.nodeName.toLowerCase();return"area"===l?(o=(n=e.parentNode).name,!(!e.href||!o||"map"!==n.nodeName.toLowerCase())&&((s=t("img[usemap='#"+o+"']")).length>0&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(l)?(r=!e.disabled)&&(a=t(e).closest("fieldset")[0])&&(r=!a.disabled):r="a"===l&&e.href||i,r&&t(e).is(":visible")&&"visible"===t(e).css("visibility"))},t.extend(t.expr.pseudos,{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable})?n.apply(e,o):n)||(t.exports=s)}()},1520:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class i{}e._CodeOrName=i,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends i{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class o extends i{constructor(t){super(),this._items="string"==typeof t?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const t=this._items[0];return""===t||'""'===t}get str(){var t;return null!==(t=this._str)&&void 0!==t?t:this._str=this._items.reduce((t,e)=>`${t}${e}`,"")}get names(){var t;return null!==(t=this._names)&&void 0!==t?t:this._names=this._items.reduce((t,e)=>(e instanceof n&&(t[e.str]=(t[e.str]||0)+1),t),{})}}function s(t,...e){const i=[t[0]];let n=0;for(;n<e.length;)l(i,e[n]),i.push(t[++n]);return new o(i)}e._Code=o,e.nil=new o(""),e._=s;const r=new o("+");function a(t,...e){const i=[h(t[0])];let n=0;for(;n<e.length;)i.push(r),l(i,e[n]),i.push(r,h(t[++n]));return function(t){let e=1;for(;e<t.length-1;){if(t[e]===r){const i=c(t[e-1],t[e+1]);if(void 0!==i){t.splice(e-1,3,i);continue}t[e++]="+"}e++}}(i),new o(i)}function l(t,e){var i;e instanceof o?t.push(...e._items):e instanceof n?t.push(e):t.push("number"==typeof(i=e)||"boolean"==typeof i||null===i?i:h(Array.isArray(i)?i.join(","):i))}function c(t,e){if('""'===e)return t;if('""'===t)return e;if("string"==typeof t){if(e instanceof n||'"'!==t[t.length-1])return;return"string"!=typeof e?`${t.slice(0,-1)}${e}"`:'"'===e[0]?t.slice(0,-1)+e.slice(1):void 0}return"string"!=typeof e||'"'!==e[0]||t instanceof n?void 0:`"${t}${e.slice(1)}`}function h(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=a,e.addCodeArg=l,e.strConcat=function(t,e){return e.emptyStr()?t:t.emptyStr()?e:a`${t}${e}`},e.stringify=function(t){return new o(h(t))},e.safeStringify=h,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new o(`.${t}`):s`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new o(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(t){return new o(t.toString())}},1758:(t,e,i)=>{var n,o,s;
29
+ /*!
30
+ * jQuery UI Draggable 1.14.1
31
+ * https://jqueryui.com
32
+ *
33
+ * Copyright OpenJS Foundation and other contributors
34
+ * Released under the MIT license.
35
+ * https://jquery.org/license
36
+ */!function(){"use strict";o=[i(4692),i(3662),i(9983),i(2336),i(2299),i(6883),i(9139)],void 0===(s="function"==typeof(n=function(t){return t.widget("ui.draggable",t.ui.mouse,{version:"1.14.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=this.document[0].activeElement;t(e.target).closest(i).length||t(i).trigger("blur")},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var n=this._uiHash();if(!1===this._trigger("drag",e,n))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=n.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,n=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(n=t.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,n)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",e)&&i._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,n="function"==typeof i.helper,o=n?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return o.parents("body").length||o.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n&&o[0]===this.element[0]&&this._setPositionRelative(),o[0]===this.element[0]||/(fixed|absolute)/.test(o.css("position"))||o.css("position","absolute"),o},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),Array.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,n,o=this.options,s=this.document[0];this.relativeContainer=null,o.containment?"window"!==o.containment?"document"!==o.containment?o.containment.constructor!==Array?("parent"===o.containment&&(o.containment=this.helper[0].parentNode),(n=(i=t(o.containment))[0])&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i)):this.containment=o.containment:this.containment=[0,0,t(s).width()-this.helperProportions.width-this.margins.left,(t(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,n=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,n,o,s,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,c=t.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(n=this.relativeContainer.offset(),i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(c=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(c=i[3]+this.offset.click.top)),r.grid&&(o=r.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,c=i?o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3]?o:o-this.offset.click.top>=i[1]?o-r.grid[1]:o+r.grid[1]:o,s=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,l=i?s-this.offset.click.left>=i[0]||s-this.offset.click.left>i[2]?s:s-this.offset.click.left>=i[0]?s-r.grid[0]:s+r.grid[0]:s),"y"===r.axis&&(l=this.originalPageX),"x"===r.axis&&(c=this.originalPageY)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,n){return n=n||this._uiHash(),t.ui.plugin.call(this,e,[i,n,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),n.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,n){var o=t.extend({},i,{item:n.element});n.sortables=[],t(n.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(n.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i,n){var o=t.extend({},i,{item:n.element});n.cancelHelperRemoval=!1,t.each(n.sortables,function(){var t=this;t.isOver?(t.isOver=0,n.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,o))})},drag:function(e,i,n){t.each(n.sortables,function(){var o=!1,s=this;s.positionAbs=n.positionAbs,s.helperProportions=n.helperProportions,s.offset.click=n.offset.click,s._intersectsWith(s.containerCache)&&(o=!0,t.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,this!==s&&this._intersectsWith(this.containerCache)&&t.contains(s.element[0],this.element[0])&&(o=!1),o})),o?(s.isOver||(s.isOver=1,n._parent=i.helper.parent(),s.currentItem=i.helper.appendTo(s.element).data("ui-sortable-item",!0),s.options._helper=s.options.helper,s.options.helper=function(){return i.helper[0]},e.target=s.currentItem[0],s._mouseCapture(e,!0),s._mouseStart(e,!0,!0),s.offset.click.top=n.offset.click.top,s.offset.click.left=n.offset.click.left,s.offset.parent.left-=n.offset.parent.left-s.offset.parent.left,s.offset.parent.top-=n.offset.parent.top-s.offset.parent.top,n._trigger("toSortable",e),n.dropped=s.element,t.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,s.fromOutside=n),s.currentItem&&(s._mouseDrag(e),i.position=s.position)):s.isOver&&(s.isOver=0,s.cancelHelperRemoval=!0,s.options._revert=s.options.revert,s.options.revert=!1,s._trigger("out",e,s._uiHash(s)),s._mouseStop(e,!0),s.options.revert=s.options._revert,s.options.helper=s.options._helper,s.placeholder&&s.placeholder.remove(),i.helper.appendTo(n._parent),n._refreshOffsets(e),i.position=n._generatePosition(e,!0),n._trigger("fromSortable",e),n.dropped=!1,t.each(n.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,n){var o=t("body"),s=n.options;o.css("cursor")&&(s._cursor=o.css("cursor")),o.css("cursor",s.cursor)},stop:function(e,i,n){var o=n.options;o._cursor&&t("body").css("cursor",o._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,n){var o=t(i.helper),s=n.options;o.css("opacity")&&(s._opacity=o.css("opacity")),o.css("opacity",s.opacity)},stop:function(e,i,n){var o=n.options;o._opacity&&t(i.helper).css("opacity",o._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,n){var o=n.options,s=!1,r=n.scrollParentNotHidden[0],a=n.document[0];r!==a&&"HTML"!==r.tagName?(o.axis&&"x"===o.axis||(n.overflowOffset.top+r.offsetHeight-e.pageY<o.scrollSensitivity?r.scrollTop=s=r.scrollTop+o.scrollSpeed:e.pageY-n.overflowOffset.top<o.scrollSensitivity&&(r.scrollTop=s=r.scrollTop-o.scrollSpeed)),o.axis&&"y"===o.axis||(n.overflowOffset.left+r.offsetWidth-e.pageX<o.scrollSensitivity?r.scrollLeft=s=r.scrollLeft+o.scrollSpeed:e.pageX-n.overflowOffset.left<o.scrollSensitivity&&(r.scrollLeft=s=r.scrollLeft-o.scrollSpeed))):(o.axis&&"x"===o.axis||(e.pageY-t(a).scrollTop()<o.scrollSensitivity?s=t(a).scrollTop(t(a).scrollTop()-o.scrollSpeed):t(window).height()-(e.pageY-t(a).scrollTop())<o.scrollSensitivity&&(s=t(a).scrollTop(t(a).scrollTop()+o.scrollSpeed))),o.axis&&"y"===o.axis||(e.pageX-t(a).scrollLeft()<o.scrollSensitivity?s=t(a).scrollLeft(t(a).scrollLeft()-o.scrollSpeed):t(window).width()-(e.pageX-t(a).scrollLeft())<o.scrollSensitivity&&(s=t(a).scrollLeft(t(a).scrollLeft()+o.scrollSpeed)))),!1!==s&&t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(n,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,n){var o=n.options;n.snapElements=[],t(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var e=t(this),i=e.offset();this!==n.element[0]&&n.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,n){var o,s,r,a,l,c,h,u,d,f,p=n.options,m=p.snapTolerance,g=i.offset.left,v=g+n.helperProportions.width,y=i.offset.top,O=y+n.helperProportions.height;for(d=n.snapElements.length-1;d>=0;d--)c=(l=n.snapElements[d].left-n.margins.left)+n.snapElements[d].width,u=(h=n.snapElements[d].top-n.margins.top)+n.snapElements[d].height,v<l-m||g>c+m||O<h-m||y>u+m||!t.contains(n.snapElements[d].item.ownerDocument,n.snapElements[d].item)?(n.snapElements[d].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[d].item})),n.snapElements[d].snapping=!1):("inner"!==p.snapMode&&(o=Math.abs(h-O)<=m,s=Math.abs(u-y)<=m,r=Math.abs(l-v)<=m,a=Math.abs(c-g)<=m,o&&(i.position.top=n._convertPositionTo("relative",{top:h-n.helperProportions.height,left:0}).top),s&&(i.position.top=n._convertPositionTo("relative",{top:u,left:0}).top),r&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l-n.helperProportions.width}).left),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:c}).left)),f=o||s||r||a,"outer"!==p.snapMode&&(o=Math.abs(h-y)<=m,s=Math.abs(u-O)<=m,r=Math.abs(l-g)<=m,a=Math.abs(c-v)<=m,o&&(i.position.top=n._convertPositionTo("relative",{top:h,left:0}).top),s&&(i.position.top=n._convertPositionTo("relative",{top:u-n.helperProportions.height,left:0}).top),r&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l}).left),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:c-n.helperProportions.width}).left)),!n.snapElements[d].snapping&&(o||s||r||a||f)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[d].item})),n.snapElements[d].snapping=o||s||r||a||f)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,n){var o,s=n.options,r=t.makeArray(t(s.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});r.length&&(o=parseInt(t(r[0]).css("zIndex"),10)||0,t(r).each(function(e){t(this).css("zIndex",o+e)}),this.css("zIndex",o+r.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,n){var o=t(i.helper),s=n.options;o.css("zIndex")&&(s._zIndex=o.css("zIndex")),o.css("zIndex",s.zIndex)},stop:function(e,i,n){var o=n.options;o._zIndex&&t(i.helper).css("zIndex",o._zIndex)}}),t.ui.draggable})?n.apply(e,o):n)||(t.exports=s)}()},1897:(t,e,i)=>{var n,o,s;
37
+ /*!
38
+ * jQuery UI Keycode 1.14.1
39
+ * https://jqueryui.com
40
+ *
41
+ * Copyright OpenJS Foundation and other contributors
42
+ * Released under the MIT license.
43
+ * https://jquery.org/license
44
+ */!function(){"use strict";o=[i(4692),i(6883)],void 0===(s="function"==typeof(n=function(t){return t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}})?n.apply(e,o):n)||(t.exports=s)}()},2017:t=>{"use strict";t.exports=function t(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var n,o,s;if(Array.isArray(e)){if((n=e.length)!=i.length)return!1;for(o=n;0!==o--;)if(!t(e[o],i[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if((n=(s=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(i,s[o]))return!1;for(o=n;0!==o--;){var r=s[o];if(!t(e[r],i[r]))return!1}return!0}return e!=e&&i!=i}},2023:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};e.default=o},2079:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2097:(t,e,i)=>{var n,o,s;
45
+ /*!
46
+ * jQuery UI Checkboxradio 1.14.1
47
+ * https://jqueryui.com
48
+ *
49
+ * Copyright OpenJS Foundation and other contributors
50
+ * Released under the MIT license.
51
+ * https://jquery.org/license
52
+ */!function(){"use strict";o=[i(4692),i(7687),i(2420),i(9139)],void 0===(s="function"==typeof(n=function(t){return t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.14.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,n,o=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",(n=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=n.clone().wrapAll("<div></div>").parent().html()),this.originalLabel&&(o.label=this.originalLabel),null!=(e=this.element[0].disabled)&&(o.disabled=e),o},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e=this.element[0].name,i="input[name='"+CSS.escape(e)+"']";return e?(this.form.length?t(this.form[0].elements).filter(i):t(i).filter(function(){return 0===t(t(this).prop("form")).length})).not(this.element):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio})?n.apply(e,o):n)||(t.exports=s)}()},2128:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(3463),o=i(3693),s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,o.default];e.default=s},2299:(t,e,i)=>{var n,o,s;
53
+ /*!
54
+ * jQuery UI Scroll Parent 1.14.1
55
+ * https://jqueryui.com
56
+ *
57
+ * Copyright OpenJS Foundation and other contributors
58
+ * Released under the MIT license.
59
+ * https://jquery.org/license
60
+ */!function(){"use strict";o=[i(4692),i(6883)],void 0===(s="function"==typeof(n=function(t){return t.fn.scrollParent=function(e){var i=this.css("position"),n="absolute"===i,o=e?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var e=t(this);return(!n||"static"!==e.css("position"))&&o.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&s.length?s:t(this[0].ownerDocument||document)}})?n.apply(e,o):n)||(t.exports=s)}()},2336:(t,e,i)=>{var n,o,s;!function(){"use strict";o=[i(4692),i(6883)],n=function(t){return t.ui.plugin={add:function(e,i,n){var o,s=t.ui[e].prototype;for(o in n)s.plugins[o]=s.plugins[o]||[],s.plugins[o].push([i,n[o]])},call:function(t,e,i,n){var o,s=t.plugins[e];if(s&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<s.length;o++)t.options[s[o][0]]&&s[o][1].apply(t.element,i)}}},void 0===(s="function"==typeof n?n.apply(e,o):n)||(t.exports=s)}()},2420:(t,e,i)=>{var n,o,s;
61
+ /*!
62
+ * jQuery UI Labels 1.14.1
63
+ * https://jqueryui.com
64
+ *
65
+ * Copyright OpenJS Foundation and other contributors
66
+ * Released under the MIT license.
67
+ * https://jquery.org/license
68
+ */!function(){"use strict";o=[i(4692),i(6883)],void 0===(s="function"==typeof(n=function(t){return t.fn.labels=function(){var t,e,i,n,o;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),(i=this.attr("id"))&&(o=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),e="label[for='"+CSS.escape(i)+"']",n=n.add(o.find(e).addBack(e))),this.pushStack(n)):this.pushStack([])}})?n.apply(e,o):n)||(t.exports=s)}()},2586:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;const n=i(8727),o=i(208),s=i(7887),r=i(208),a=i(7870),l=i(3673),c=i(4495),h=i(9029),u=i(2023),d=i(6939),f=i(4227),p=i(8708);function m({gen:t,validateName:e,schema:i,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,h._`${u.default.data}, ${u.default.valCxt}`,n.$async,()=>{t.code(h._`"use strict"; ${g(i,o)}`),function(t,e){t.if(u.default.valCxt,()=>{t.var(u.default.instancePath,h._`${u.default.valCxt}.${u.default.instancePath}`),t.var(u.default.parentData,h._`${u.default.valCxt}.${u.default.parentData}`),t.var(u.default.parentDataProperty,h._`${u.default.valCxt}.${u.default.parentDataProperty}`),t.var(u.default.rootData,h._`${u.default.valCxt}.${u.default.rootData}`),e.dynamicRef&&t.var(u.default.dynamicAnchors,h._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{t.var(u.default.instancePath,h._`""`),t.var(u.default.parentData,h._`undefined`),t.var(u.default.parentDataProperty,h._`undefined`),t.var(u.default.rootData,u.default.data),e.dynamicRef&&t.var(u.default.dynamicAnchors,h._`{}`)})}(t,o),t.code(s)}):t.func(e,h._`${u.default.data}, ${function(t){return h._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${t.dynamicRef?h._`, ${u.default.dynamicAnchors}={}`:h.nil}}={}`}(o)}`,n.$async,()=>t.code(g(i,o)).code(s))}function g(t,e){const i="object"==typeof t&&t[e.schemaId];return i&&(e.code.source||e.code.process)?h._`/*# sourceURL=${i} */`:h.nil}function v(t,e){O(t)&&(b(t),y(t))?function(t,e){const{schema:i,gen:n,opts:o}=t;o.$comment&&i.$comment&&w(t);(function(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,d.resolveUrl)(t.opts.uriResolver,t.baseId,e))})(t),function(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}(t);const s=n.const("_errs",u.default.errors);x(t,s),n.var(e,h._`${s} === ${u.default.errors}`)}(t,e):(0,n.boolOrEmptySchema)(t,e)}function y({schema:t,self:e}){if("boolean"==typeof t)return!t;for(const i in t)if(e.RULES.all[i])return!0;return!1}function O(t){return"boolean"!=typeof t.schema}function b(t){(0,f.checkUnknownRules)(t),function(t){const{schema:e,errSchemaPath:i,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${i}"`)}(t)}function x(t,e){if(t.opts.jtd)return _(t,[],!1,e);const i=(0,o.getSchemaTypes)(t.schema);_(t,i,!(0,o.coerceAndCheckDataType)(t,i),e)}function w({gen:t,schemaEnv:e,schema:i,errSchemaPath:n,opts:o}){const s=i.$comment;if(!0===o.$comment)t.code(h._`${u.default.self}.logger.log(${s})`);else if("function"==typeof o.$comment){const i=h.str`${n}/$comment`,o=t.scopeValue("root",{ref:e.root});t.code(h._`${u.default.self}.opts.$comment(${s}, ${i}, ${o}.schema)`)}}function _(t,e,i,n){const{gen:o,schema:a,data:l,allErrors:c,opts:d,self:p}=t,{RULES:m}=p;function g(f){(0,s.shouldUseGroup)(a,f)&&(f.type?(o.if((0,r.checkDataType)(f.type,l,d.strictNumbers)),S(t,f),1===e.length&&e[0]===f.type&&i&&(o.else(),(0,r.reportTypeError)(t)),o.endIf()):S(t,f),c||o.if(h._`${u.default.errors} === ${n||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(a,m)?(d.jtd||function(t,e){if(t.schemaEnv.meta||!t.opts.strictTypes)return;(function(t,e){if(!e.length)return;if(!t.dataTypes.length)return void(t.dataTypes=e);e.forEach(e=>{$(t.dataTypes,e)||T(t,`type "${e}" not allowed by context "${t.dataTypes.join(",")}"`)}),function(t,e){const i=[];for(const n of t.dataTypes)$(e,n)?i.push(n):e.includes("integer")&&"number"===n&&i.push("integer");t.dataTypes=i}(t,e)})(t,e),t.opts.allowUnionTypes||function(t,e){e.length>1&&(2!==e.length||!e.includes("null"))&&T(t,"use allowUnionTypes to allow union type keyword")}(t,e);!function(t,e){const i=t.self.RULES.all;for(const n in i){const o=i[n];if("object"==typeof o&&(0,s.shouldUseRule)(t.schema,o)){const{type:i}=o.definition;i.length&&!i.some(t=>k(e,t))&&T(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}(t,t.dataTypes)}(t,e),o.block(()=>{for(const t of m.rules)g(t);g(m.post)})):o.block(()=>P(t,"$ref",m.all.$ref.definition))}function S(t,e){const{gen:i,schema:n,opts:{useDefaults:o}}=t;o&&(0,a.assignDefaults)(t,e.type),i.block(()=>{for(const i of e.rules)(0,s.shouldUseRule)(n,i)&&P(t,i.keyword,i.definition,e.type)})}function k(t,e){return t.includes(e)||"number"===e&&t.includes("integer")}function $(t,e){return t.includes(e)||"integer"===e&&t.includes("number")}function T(t,e){e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,(0,f.checkStrictMode)(t,e,t.opts.strictTypes)}e.validateFunctionCode=function(t){O(t)&&(b(t),y(t))?function(t){const{schema:e,opts:i,gen:n}=t;m(t,()=>{i.$comment&&e.$comment&&w(t),function(t){const{schema:e,opts:i}=t;void 0!==e.default&&i.useDefaults&&i.strictSchema&&(0,f.checkStrictMode)(t,"default is ignored in the schema root")}(t),n.let(u.default.vErrors,null),n.let(u.default.errors,0),i.unevaluated&&function(t){const{gen:e,validateName:i}=t;t.evaluated=e.const("evaluated",h._`${i}.evaluated`),e.if(h._`${t.evaluated}.dynamicProps`,()=>e.assign(h._`${t.evaluated}.props`,h._`undefined`)),e.if(h._`${t.evaluated}.dynamicItems`,()=>e.assign(h._`${t.evaluated}.items`,h._`undefined`))}(t),x(t),function(t){const{gen:e,schemaEnv:i,validateName:n,ValidationError:o,opts:s}=t;i.$async?e.if(h._`${u.default.errors} === 0`,()=>e.return(u.default.data),()=>e.throw(h._`new ${o}(${u.default.vErrors})`)):(e.assign(h._`${n}.errors`,u.default.vErrors),s.unevaluated&&function({gen:t,evaluated:e,props:i,items:n}){i instanceof h.Name&&t.assign(h._`${e}.props`,i);n instanceof h.Name&&t.assign(h._`${e}.items`,n)}(t),e.return(h._`${u.default.errors} === 0`))}(t)})}(t):m(t,()=>(0,n.topBoolOrEmptySchema)(t))};class C{constructor(t,e,i){if((0,l.validateKeywordUsage)(t,e,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=e.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(t,this.schema,i,this.$data),this.schemaType=e.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=e,this.$data)this.schemaCode=t.gen.const("vSchema",M(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,e.schemaType,e.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(e.schemaType)}`);("code"in e?e.trackErrors:!1!==e.errors)&&(this.errsCount=t.gen.const("_errs",u.default.errors))}result(t,e,i){this.failResult((0,h.not)(t),e,i)}failResult(t,e,i){this.gen.if(t),i?i():this.error(),e?(this.gen.else(),e(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,e){this.failResult((0,h.not)(t),void 0,e)}fail(t){if(void 0===t)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:e}=this;this.fail(h._`${e} !== undefined && (${(0,h.or)(this.invalid$data(),t)})`)}error(t,e,i){if(e)return this.setParams(e),this._error(t,i),void this.setParams({});this._error(t,i)}_error(t,e){(t?p.reportExtraError:p.reportError)(this,this.def.error,e)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,e){e?Object.assign(this.params,t):this.params=t}block$data(t,e,i=h.nil){this.gen.block(()=>{this.check$data(t,i),e()})}check$data(t=h.nil,e=h.nil){if(!this.$data)return;const{gen:i,schemaCode:n,schemaType:o,def:s}=this;i.if((0,h.or)(h._`${n} === undefined`,e)),t!==h.nil&&i.assign(t,!0),(o.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==h.nil&&i.assign(t,!1)),i.else()}invalid$data(){const{gen:t,schemaCode:e,schemaType:i,def:n,it:o}=this;return(0,h.or)(function(){if(i.length){if(!(e instanceof h.Name))throw new Error("ajv implementation error");const t=Array.isArray(i)?i:[i];return h._`${(0,r.checkDataTypes)(t,e,o.opts.strictNumbers,r.DataType.Wrong)}`}return h.nil}(),function(){if(n.validateSchema){const i=t.scopeValue("validate$data",{ref:n.validateSchema});return h._`!${i}(${e})`}return h.nil}())}subschema(t,e){const i=(0,c.getSubschema)(this.it,t);(0,c.extendSubschemaData)(i,this.it,t),(0,c.extendSubschemaMode)(i,t);const n={...this.it,...i,items:void 0,props:void 0};return v(n,e),n}mergeEvaluated(t,e){const{it:i,gen:n}=this;i.opts.unevaluated&&(!0!==i.props&&void 0!==t.props&&(i.props=f.mergeEvaluated.props(n,t.props,i.props,e)),!0!==i.items&&void 0!==t.items&&(i.items=f.mergeEvaluated.items(n,t.items,i.items,e)))}mergeValidEvaluated(t,e){const{it:i,gen:n}=this;if(i.opts.unevaluated&&(!0!==i.props||!0!==i.items))return n.if(e,()=>this.mergeEvaluated(t,h.Name)),!0}}function P(t,e,i,n){const o=new C(t,i,e);"code"in i?i.code(o,n):o.$data&&i.validate?(0,l.funcKeywordCode)(o,i):"macro"in i?(0,l.macroKeywordCode)(o,i):(i.compile||i.validate)&&(0,l.funcKeywordCode)(o,i)}e.KeywordCxt=C;const E=/^\/(?:[^~]|~0|~1)*$/,A=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function M(t,{dataLevel:e,dataNames:i,dataPathArr:n}){let o,s;if(""===t)return u.default.rootData;if("/"===t[0]){if(!E.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=u.default.rootData}else{const r=A.exec(t);if(!r)throw new Error(`Invalid JSON-pointer: ${t}`);const a=+r[1];if(o=r[2],"#"===o){if(a>=e)throw new Error(l("property/index",a));return n[e-a]}if(a>e)throw new Error(l("data",a));if(s=i[e-a],!o)return s}let r=s;const a=o.split("/");for(const t of a)t&&(s=h._`${s}${(0,h.getProperty)((0,f.unescapeJsonPointer)(t))}`,r=h._`${r} && ${s}`);return r;function l(t,i){return`Cannot access ${t} ${i} levels up, current level is ${e}`}}e.getData=M},2628:t=>{var e;self,e=function(){return function(){var t={3099:function(t){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},6077:function(t,e,i){var n=i(111);t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},1223:function(t,e,i){var n=i(5112),o=i(30),s=i(3070),r=n("unscopables"),a=Array.prototype;null==a[r]&&s.f(a,r,{configurable:!0,value:o(null)}),t.exports=function(t){a[r][t]=!0}},1530:function(t,e,i){"use strict";var n=i(8710).charAt;t.exports=function(t,e,i){return e+(i?n(t,e).length:1)}},5787:function(t){t.exports=function(t,e,i){if(!(t instanceof e))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return t}},9670:function(t,e,i){var n=i(111);t.exports=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t}},4019:function(t){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},260:function(t,e,i){"use strict";var n,o=i(4019),s=i(9781),r=i(7854),a=i(111),l=i(6656),c=i(648),h=i(8880),u=i(1320),d=i(3070).f,f=i(9518),p=i(7674),m=i(5112),g=i(9711),v=r.Int8Array,y=v&&v.prototype,O=r.Uint8ClampedArray,b=O&&O.prototype,x=v&&f(v),w=y&&f(y),_=Object.prototype,S=_.isPrototypeOf,k=m("toStringTag"),$=g("TYPED_ARRAY_TAG"),T=o&&!!p&&"Opera"!==c(r.opera),C=!1,P={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},E={BigInt64Array:8,BigUint64Array:8},A=function(t){if(!a(t))return!1;var e=c(t);return l(P,e)||l(E,e)};for(n in P)r[n]||(T=!1);if((!T||"function"!=typeof x||x===Function.prototype)&&(x=function(){throw TypeError("Incorrect invocation")},T))for(n in P)r[n]&&p(r[n],x);if((!T||!w||w===_)&&(w=x.prototype,T))for(n in P)r[n]&&p(r[n].prototype,w);if(T&&f(b)!==w&&p(b,w),s&&!l(w,k))for(n in C=!0,d(w,k,{get:function(){return a(this)?this[$]:void 0}}),P)r[n]&&h(r[n],$,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:C&&$,aTypedArray:function(t){if(A(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(p){if(S.call(x,t))return t}else for(var e in P)if(l(P,n)){var i=r[e];if(i&&(t===i||S.call(i,t)))return t}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i){if(s){if(i)for(var n in P){var o=r[n];o&&l(o.prototype,t)&&delete o.prototype[t]}w[t]&&!i||u(w,t,i?e:T&&y[t]||e)}},exportTypedArrayStaticMethod:function(t,e,i){var n,o;if(s){if(p){if(i)for(n in P)(o=r[n])&&l(o,t)&&delete o[t];if(x[t]&&!i)return;try{return u(x,t,i?e:T&&v[t]||e)}catch(t){}}for(n in P)!(o=r[n])||o[t]&&!i||u(o,t,e)}},isView:function(t){if(!a(t))return!1;var e=c(t);return"DataView"===e||l(P,e)||l(E,e)},isTypedArray:A,TypedArray:x,TypedArrayPrototype:w}},3331:function(t,e,i){"use strict";var n=i(7854),o=i(9781),s=i(4019),r=i(8880),a=i(2248),l=i(7293),c=i(5787),h=i(9958),u=i(7466),d=i(7067),f=i(1179),p=i(9518),m=i(7674),g=i(8006).f,v=i(3070).f,y=i(1285),O=i(8003),b=i(9909),x=b.get,w=b.set,_="ArrayBuffer",S="DataView",k="prototype",$="Wrong index",T=n[_],C=T,P=n[S],E=P&&P[k],A=Object.prototype,M=n.RangeError,Q=f.pack,D=f.unpack,R=function(t){return[255&t]},I=function(t){return[255&t,t>>8&255]},L=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},N=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},j=function(t){return Q(t,23,4)},z=function(t){return Q(t,52,8)},B=function(t,e){v(t[k],e,{get:function(){return x(this)[e]}})},Z=function(t,e,i,n){var o=d(i),s=x(t);if(o+e>s.byteLength)throw M($);var r=x(s.buffer).bytes,a=o+s.byteOffset,l=r.slice(a,a+e);return n?l:l.reverse()},W=function(t,e,i,n,o,s){var r=d(i),a=x(t);if(r+e>a.byteLength)throw M($);for(var l=x(a.buffer).bytes,c=r+a.byteOffset,h=n(+o),u=0;u<e;u++)l[c+u]=h[s?u:e-u-1]};if(s){if(!l(function(){T(1)})||!l(function(){new T(-1)})||l(function(){return new T,new T(1.5),new T(NaN),T.name!=_})){for(var F,X=(C=function(t){return c(this,C),new T(d(t))})[k]=T[k],q=g(T),H=0;q.length>H;)(F=q[H++])in C||r(C,F,T[F]);X.constructor=C}m&&p(E)!==A&&m(E,A);var V=new P(new C(2)),Y=E.setInt8;V.setInt8(0,2147483648),V.setInt8(1,2147483649),!V.getInt8(0)&&V.getInt8(1)||a(E,{setInt8:function(t,e){Y.call(this,t,e<<24>>24)},setUint8:function(t,e){Y.call(this,t,e<<24>>24)}},{unsafe:!0})}else C=function(t){c(this,C,_);var e=d(t);w(this,{bytes:y.call(new Array(e),0),byteLength:e}),o||(this.byteLength=e)},P=function(t,e,i){c(this,P,S),c(t,C,S);var n=x(t).byteLength,s=h(e);if(s<0||s>n)throw M("Wrong offset");if(s+(i=void 0===i?n-s:u(i))>n)throw M("Wrong length");w(this,{buffer:t,byteLength:i,byteOffset:s}),o||(this.buffer=t,this.byteLength=i,this.byteOffset=s)},o&&(B(C,"byteLength"),B(P,"buffer"),B(P,"byteLength"),B(P,"byteOffset")),a(P[k],{getInt8:function(t){return Z(this,1,t)[0]<<24>>24},getUint8:function(t){return Z(this,1,t)[0]},getInt16:function(t){var e=Z(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Z(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return N(Z(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return N(Z(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return D(Z(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return D(Z(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){W(this,1,t,R,e)},setUint8:function(t,e){W(this,1,t,R,e)},setInt16:function(t,e){W(this,2,t,I,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){W(this,2,t,I,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){W(this,4,t,L,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){W(this,4,t,L,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){W(this,4,t,j,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){W(this,8,t,z,e,arguments.length>2?arguments[2]:void 0)}});O(C,_),O(P,S),t.exports={ArrayBuffer:C,DataView:P}},1048:function(t,e,i){"use strict";var n=i(7908),o=i(1400),s=i(7466),r=Math.min;t.exports=[].copyWithin||function(t,e){var i=n(this),a=s(i.length),l=o(t,a),c=o(e,a),h=arguments.length>2?arguments[2]:void 0,u=r((void 0===h?a:o(h,a))-c,a-l),d=1;for(c<l&&l<c+u&&(d=-1,c+=u-1,l+=u-1);u-- >0;)c in i?i[l]=i[c]:delete i[l],l+=d,c+=d;return i}},1285:function(t,e,i){"use strict";var n=i(7908),o=i(1400),s=i(7466);t.exports=function(t){for(var e=n(this),i=s(e.length),r=arguments.length,a=o(r>1?arguments[1]:void 0,i),l=r>2?arguments[2]:void 0,c=void 0===l?i:o(l,i);c>a;)e[a++]=t;return e}},8533:function(t,e,i){"use strict";var n=i(2092).forEach,o=i(9341)("forEach");t.exports=o?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},8457:function(t,e,i){"use strict";var n=i(9974),o=i(7908),s=i(3411),r=i(7659),a=i(7466),l=i(6135),c=i(1246);t.exports=function(t){var e,i,h,u,d,f,p=o(t),m="function"==typeof this?this:Array,g=arguments.length,v=g>1?arguments[1]:void 0,y=void 0!==v,O=c(p),b=0;if(y&&(v=n(v,g>2?arguments[2]:void 0,2)),null==O||m==Array&&r(O))for(i=new m(e=a(p.length));e>b;b++)f=y?v(p[b],b):p[b],l(i,b,f);else for(d=(u=O.call(p)).next,i=new m;!(h=d.call(u)).done;b++)f=y?s(u,v,[h.value,b],!0):h.value,l(i,b,f);return i.length=b,i}},1318:function(t,e,i){var n=i(5656),o=i(7466),s=i(1400),r=function(t){return function(e,i,r){var a,l=n(e),c=o(l.length),h=s(r,c);if(t&&i!=i){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===i)return t||h||0;return!t&&-1}};t.exports={includes:r(!0),indexOf:r(!1)}},2092:function(t,e,i){var n=i(9974),o=i(8361),s=i(7908),r=i(7466),a=i(5417),l=[].push,c=function(t){var e=1==t,i=2==t,c=3==t,h=4==t,u=6==t,d=7==t,f=5==t||u;return function(p,m,g,v){for(var y,O,b=s(p),x=o(b),w=n(m,g,3),_=r(x.length),S=0,k=v||a,$=e?k(p,_):i||d?k(p,0):void 0;_>S;S++)if((f||S in x)&&(O=w(y=x[S],S,b),t))if(e)$[S]=O;else if(O)switch(t){case 3:return!0;case 5:return y;case 6:return S;case 2:l.call($,y)}else switch(t){case 4:return!1;case 7:l.call($,y)}return u?-1:c||h?h:$}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},6583:function(t,e,i){"use strict";var n=i(5656),o=i(9958),s=i(7466),r=i(9341),a=Math.min,l=[].lastIndexOf,c=!!l&&1/[1].lastIndexOf(1,-0)<0,h=r("lastIndexOf"),u=c||!h;t.exports=u?function(t){if(c)return l.apply(this,arguments)||0;var e=n(this),i=s(e.length),r=i-1;for(arguments.length>1&&(r=a(r,o(arguments[1]))),r<0&&(r=i+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}:l},1194:function(t,e,i){var n=i(7293),o=i(5112),s=i(7392),r=o("species");t.exports=function(t){return s>=51||!n(function(){var e=[];return(e.constructor={})[r]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},9341:function(t,e,i){"use strict";var n=i(7293);t.exports=function(t,e){var i=[][t];return!!i&&n(function(){i.call(null,e||function(){throw 1},1)})}},3671:function(t,e,i){var n=i(3099),o=i(7908),s=i(8361),r=i(7466),a=function(t){return function(e,i,a,l){n(i);var c=o(e),h=s(c),u=r(c.length),d=t?u-1:0,f=t?-1:1;if(a<2)for(;;){if(d in h){l=h[d],d+=f;break}if(d+=f,t?d<0:u<=d)throw TypeError("Reduce of empty array with no initial value")}for(;t?d>=0:u>d;d+=f)d in h&&(l=i(l,h[d],d,c));return l}};t.exports={left:a(!1),right:a(!0)}},5417:function(t,e,i){var n=i(111),o=i(3157),s=i(5112)("species");t.exports=function(t,e){var i;return o(t)&&("function"!=typeof(i=t.constructor)||i!==Array&&!o(i.prototype)?n(i)&&null===(i=i[s])&&(i=void 0):i=void 0),new(void 0===i?Array:i)(0===e?0:e)}},3411:function(t,e,i){var n=i(9670),o=i(9212);t.exports=function(t,e,i,s){try{return s?e(n(i)[0],i[1]):e(i)}catch(e){throw o(t),e}}},7072:function(t,e,i){var n=i(5112)("iterator"),o=!1;try{var s=0,r={next:function(){return{done:!!s++}},return:function(){o=!0}};r[n]=function(){return this},Array.from(r,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var i=!1;try{var s={};s[n]=function(){return{next:function(){return{done:i=!0}}}},t(s)}catch(t){}return i}},4326:function(t){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},648:function(t,e,i){var n=i(1694),o=i(4326),s=i(5112)("toStringTag"),r="Arguments"==o(function(){return arguments}());t.exports=n?o:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),s))?i:r?o(e):"Object"==(n=o(e))&&"function"==typeof e.callee?"Arguments":n}},9920:function(t,e,i){var n=i(6656),o=i(3887),s=i(1236),r=i(3070);t.exports=function(t,e){for(var i=o(e),a=r.f,l=s.f,c=0;c<i.length;c++){var h=i[c];n(t,h)||a(t,h,l(e,h))}}},8544:function(t,e,i){var n=i(7293);t.exports=!n(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},4994:function(t,e,i){"use strict";var n=i(3383).IteratorPrototype,o=i(30),s=i(9114),r=i(8003),a=i(7497),l=function(){return this};t.exports=function(t,e,i){var c=e+" Iterator";return t.prototype=o(n,{next:s(1,i)}),r(t,c,!1,!0),a[c]=l,t}},8880:function(t,e,i){var n=i(9781),o=i(3070),s=i(9114);t.exports=n?function(t,e,i){return o.f(t,e,s(1,i))}:function(t,e,i){return t[e]=i,t}},9114:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:function(t,e,i){"use strict";var n=i(7593),o=i(3070),s=i(9114);t.exports=function(t,e,i){var r=n(e);r in t?o.f(t,r,s(0,i)):t[r]=i}},654:function(t,e,i){"use strict";var n=i(2109),o=i(4994),s=i(9518),r=i(7674),a=i(8003),l=i(8880),c=i(1320),h=i(5112),u=i(1913),d=i(7497),f=i(3383),p=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,g=h("iterator"),v="keys",y="values",O="entries",b=function(){return this};t.exports=function(t,e,i,h,f,x,w){o(i,e,h);var _,S,k,$=function(t){if(t===f&&A)return A;if(!m&&t in P)return P[t];switch(t){case v:case y:case O:return function(){return new i(this,t)}}return function(){return new i(this)}},T=e+" Iterator",C=!1,P=t.prototype,E=P[g]||P["@@iterator"]||f&&P[f],A=!m&&E||$(f),M="Array"==e&&P.entries||E;if(M&&(_=s(M.call(new t)),p!==Object.prototype&&_.next&&(u||s(_)===p||(r?r(_,p):"function"!=typeof _[g]&&l(_,g,b)),a(_,T,!0,!0),u&&(d[T]=b))),f==y&&E&&E.name!==y&&(C=!0,A=function(){return E.call(this)}),u&&!w||P[g]===A||l(P,g,A),d[e]=A,f)if(S={values:$(y),keys:x?A:$(v),entries:$(O)},w)for(k in S)(m||C||!(k in P))&&c(P,k,S[k]);else n({target:e,proto:!0,forced:m||C},S);return S}},9781:function(t,e,i){var n=i(7293);t.exports=!n(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},317:function(t,e,i){var n=i(7854),o=i(111),s=n.document,r=o(s)&&o(s.createElement);t.exports=function(t){return r?s.createElement(t):{}}},8324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8113:function(t,e,i){var n=i(5005);t.exports=n("navigator","userAgent")||""},7392:function(t,e,i){var n,o,s=i(7854),r=i(8113),a=s.process,l=a&&a.versions,c=l&&l.v8;c?o=(n=c.split("."))[0]+n[1]:r&&(!(n=r.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=r.match(/Chrome\/(\d+)/))&&(o=n[1]),t.exports=o&&+o},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,e,i){var n=i(7854),o=i(1236).f,s=i(8880),r=i(1320),a=i(3505),l=i(9920),c=i(4705);t.exports=function(t,e){var i,h,u,d,f,p=t.target,m=t.global,g=t.stat;if(i=m?n:g?n[p]||a(p,{}):(n[p]||{}).prototype)for(h in e){if(d=e[h],u=t.noTargetGet?(f=o(i,h))&&f.value:i[h],!c(m?h:p+(g?".":"#")+h,t.forced)&&void 0!==u){if(typeof d==typeof u)continue;l(d,u)}(t.sham||u&&u.sham)&&s(d,"sham",!0),r(i,h,d,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:function(t,e,i){"use strict";i(4916);var n=i(1320),o=i(7293),s=i(5112),r=i(2261),a=i(8880),l=s("species"),c=!o(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),h="$0"==="a".replace(/./,"$0"),u=s("replace"),d=!!/./[u]&&""===/./[u]("a","$0"),f=!o(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2!==i.length||"a"!==i[0]||"b"!==i[1]});t.exports=function(t,e,i,u){var p=s(t),m=!o(function(){var e={};return e[p]=function(){return 7},7!=""[t](e)}),g=m&&!o(function(){var e=!1,i=/a/;return"split"===t&&((i={}).constructor={},i.constructor[l]=function(){return i},i.flags="",i[p]=/./[p]),i.exec=function(){return e=!0,null},i[p](""),!e});if(!m||!g||"replace"===t&&(!c||!h||d)||"split"===t&&!f){var v=/./[p],y=i(p,""[t],function(t,e,i,n,o){return e.exec===r?m&&!o?{done:!0,value:v.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}},{REPLACE_KEEPS_$0:h,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}),O=y[0],b=y[1];n(String.prototype,t,O),n(RegExp.prototype,p,2==e?function(t,e){return b.call(t,this,e)}:function(t){return b.call(t,this)})}u&&a(RegExp.prototype[p],"sham",!0)}},9974:function(t,e,i){var n=i(3099);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 0:return function(){return t.call(e)};case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}}},5005:function(t,e,i){var n=i(857),o=i(7854),s=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?s(n[t])||s(o[t]):n[t]&&n[t][e]||o[t]&&o[t][e]}},1246:function(t,e,i){var n=i(648),o=i(7497),s=i(5112)("iterator");t.exports=function(t){if(null!=t)return t[s]||t["@@iterator"]||o[n(t)]}},8554:function(t,e,i){var n=i(9670),o=i(1246);t.exports=function(t){var e=o(t);if("function"!=typeof e)throw TypeError(String(t)+" is not iterable");return n(e.call(t))}},647:function(t,e,i){var n=i(7908),o=Math.floor,s="".replace,r=/\$([$&'`]|\d\d?|<[^>]*>)/g,a=/\$([$&'`]|\d\d?)/g;t.exports=function(t,e,i,l,c,h){var u=i+t.length,d=l.length,f=a;return void 0!==c&&(c=n(c),f=r),s.call(h,f,function(n,s){var r;switch(s.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,i);case"'":return e.slice(u);case"<":r=c[s.slice(1,-1)];break;default:var a=+s;if(0===a)return n;if(a>d){var h=o(a/10);return 0===h?n:h<=d?void 0===l[h-1]?s.charAt(1):l[h-1]+s.charAt(1):n}r=l[a-1]}return void 0===r?"":r})}},7854:function(t,e,i){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},6656:function(t){var e={}.hasOwnProperty;t.exports=function(t,i){return e.call(t,i)}},3501:function(t){t.exports={}},490:function(t,e,i){var n=i(5005);t.exports=n("document","documentElement")},4664:function(t,e,i){var n=i(9781),o=i(7293),s=i(317);t.exports=!n&&!o(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},1179:function(t){var e=Math.abs,i=Math.pow,n=Math.floor,o=Math.log,s=Math.LN2;t.exports={pack:function(t,r,a){var l,c,h,u=new Array(a),d=8*a-r-1,f=(1<<d)-1,p=f>>1,m=23===r?i(2,-24)-i(2,-77):0,g=t<0||0===t&&1/t<0?1:0,v=0;for((t=e(t))!=t||t===1/0?(c=t!=t?1:0,l=f):(l=n(o(t)/s),t*(h=i(2,-l))<1&&(l--,h*=2),(t+=l+p>=1?m/h:m*i(2,1-p))*h>=2&&(l++,h/=2),l+p>=f?(c=0,l=f):l+p>=1?(c=(t*h-1)*i(2,r),l+=p):(c=t*i(2,p-1)*i(2,r),l=0));r>=8;u[v++]=255&c,c/=256,r-=8);for(l=l<<r|c,d+=r;d>0;u[v++]=255&l,l/=256,d-=8);return u[--v]|=128*g,u},unpack:function(t,e){var n,o=t.length,s=8*o-e-1,r=(1<<s)-1,a=r>>1,l=s-7,c=o-1,h=t[c--],u=127&h;for(h>>=7;l>0;u=256*u+t[c],c--,l-=8);for(n=u&(1<<-l)-1,u>>=-l,l+=e;l>0;n=256*n+t[c],c--,l-=8);if(0===u)u=1-a;else{if(u===r)return n?NaN:h?-1/0:1/0;n+=i(2,e),u-=a}return(h?-1:1)*n*i(2,u-e)}}},8361:function(t,e,i){var n=i(7293),o=i(4326),s="".split;t.exports=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==o(t)?s.call(t,""):Object(t)}:Object},9587:function(t,e,i){var n=i(111),o=i(7674);t.exports=function(t,e,i){var s,r;return o&&"function"==typeof(s=e.constructor)&&s!==i&&n(r=s.prototype)&&r!==i.prototype&&o(t,r),t}},2788:function(t,e,i){var n=i(5465),o=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(t){return o.call(t)}),t.exports=n.inspectSource},9909:function(t,e,i){var n,o,s,r=i(8536),a=i(7854),l=i(111),c=i(8880),h=i(6656),u=i(5465),d=i(6200),f=i(3501),p=a.WeakMap;if(r){var m=u.state||(u.state=new p),g=m.get,v=m.has,y=m.set;n=function(t,e){return e.facade=t,y.call(m,t,e),e},o=function(t){return g.call(m,t)||{}},s=function(t){return v.call(m,t)}}else{var O=d("state");f[O]=!0,n=function(t,e){return e.facade=t,c(t,O,e),e},o=function(t){return h(t,O)?t[O]:{}},s=function(t){return h(t,O)}}t.exports={set:n,get:o,has:s,enforce:function(t){return s(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var i;if(!l(e)||(i=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}}},7659:function(t,e,i){var n=i(5112),o=i(7497),s=n("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||r[s]===t)}},3157:function(t,e,i){var n=i(4326);t.exports=Array.isArray||function(t){return"Array"==n(t)}},4705:function(t,e,i){var n=i(7293),o=/#|\.prototype\./,s=function(t,e){var i=a[r(t)];return i==c||i!=l&&("function"==typeof e?n(e):!!e)},r=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},a=s.data={},l=s.NATIVE="N",c=s.POLYFILL="P";t.exports=s},111:function(t){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},1913:function(t){t.exports=!1},7850:function(t,e,i){var n=i(111),o=i(4326),s=i(5112)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[s])?!!e:"RegExp"==o(t))}},9212:function(t,e,i){var n=i(9670);t.exports=function(t){var e=t.return;if(void 0!==e)return n(e.call(t)).value}},3383:function(t,e,i){"use strict";var n,o,s,r=i(7293),a=i(9518),l=i(8880),c=i(6656),h=i(5112),u=i(1913),d=h("iterator"),f=!1;[].keys&&("next"in(s=[].keys())?(o=a(a(s)))!==Object.prototype&&(n=o):f=!0);var p=null==n||r(function(){var t={};return n[d].call(t)!==t});p&&(n={}),u&&!p||c(n,d)||l(n,d,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},7497:function(t){t.exports={}},133:function(t,e,i){var n=i(7293);t.exports=!!Object.getOwnPropertySymbols&&!n(function(){return!String(Symbol())})},590:function(t,e,i){var n=i(7293),o=i(5112),s=i(1913),r=o("iterator");t.exports=!n(function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,i="";return t.pathname="c%20d",e.forEach(function(t,n){e.delete("b"),i+=n+t}),s&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[r]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host})},8536:function(t,e,i){var n=i(7854),o=i(2788),s=n.WeakMap;t.exports="function"==typeof s&&/native code/.test(o(s))},1574:function(t,e,i){"use strict";var n=i(9781),o=i(7293),s=i(1956),r=i(5181),a=i(5296),l=i(7908),c=i(8361),h=Object.assign,u=Object.defineProperty;t.exports=!h||o(function(){if(n&&1!==h({b:1},h(u({},"a",{enumerable:!0,get:function(){u(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach(function(t){e[t]=t}),7!=h({},t)[i]||s(h({},e)).join("")!=o})?function(t,e){for(var i=l(t),o=arguments.length,h=1,u=r.f,d=a.f;o>h;)for(var f,p=c(arguments[h++]),m=u?s(p).concat(u(p)):s(p),g=m.length,v=0;g>v;)f=m[v++],n&&!d.call(p,f)||(i[f]=p[f]);return i}:h},30:function(t,e,i){var n,o=i(9670),s=i(6048),r=i(748),a=i(3501),l=i(490),c=i(317),h=i(6200),u="prototype",d="script",f=h("IE_PROTO"),p=function(){},m=function(t){return"<"+d+">"+t+"</"+d+">"},g=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e,i;g=n?function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e}(n):(e=c("iframe"),i="java"+d+":",e.style.display="none",l.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F);for(var o=r.length;o--;)delete g[u][r[o]];return g()};a[f]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(p[u]=o(t),i=new p,p[u]=null,i[f]=t):i=g(),void 0===e?i:s(i,e)}},6048:function(t,e,i){var n=i(9781),o=i(3070),s=i(9670),r=i(1956);t.exports=n?Object.defineProperties:function(t,e){s(t);for(var i,n=r(e),a=n.length,l=0;a>l;)o.f(t,i=n[l++],e[i]);return t}},3070:function(t,e,i){var n=i(9781),o=i(4664),s=i(9670),r=i(7593),a=Object.defineProperty;e.f=n?a:function(t,e,i){if(s(t),e=r(e,!0),s(i),o)try{return a(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},1236:function(t,e,i){var n=i(9781),o=i(5296),s=i(9114),r=i(5656),a=i(7593),l=i(6656),c=i(4664),h=Object.getOwnPropertyDescriptor;e.f=n?h:function(t,e){if(t=r(t),e=a(e,!0),c)try{return h(t,e)}catch(t){}if(l(t,e))return s(!o.f.call(t,e),t[e])}},8006:function(t,e,i){var n=i(6324),o=i(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},5181:function(t,e){e.f=Object.getOwnPropertySymbols},9518:function(t,e,i){var n=i(6656),o=i(7908),s=i(6200),r=i(8544),a=s("IE_PROTO"),l=Object.prototype;t.exports=r?Object.getPrototypeOf:function(t){return t=o(t),n(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?l:null}},6324:function(t,e,i){var n=i(6656),o=i(5656),s=i(1318).indexOf,r=i(3501);t.exports=function(t,e){var i,a=o(t),l=0,c=[];for(i in a)!n(r,i)&&n(a,i)&&c.push(i);for(;e.length>l;)n(a,i=e[l++])&&(~s(c,i)||c.push(i));return c}},1956:function(t,e,i){var n=i(6324),o=i(748);t.exports=Object.keys||function(t){return n(t,o)}},5296:function(t,e){"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!i.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:i},7674:function(t,e,i){var n=i(9670),o=i(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(i,[]),e=i instanceof Array}catch(t){}return function(i,s){return n(i),o(s),e?t.call(i,s):i.__proto__=s,i}}():void 0)},288:function(t,e,i){"use strict";var n=i(1694),o=i(648);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},3887:function(t,e,i){var n=i(5005),o=i(8006),s=i(5181),r=i(9670);t.exports=n("Reflect","ownKeys")||function(t){var e=o.f(r(t)),i=s.f;return i?e.concat(i(t)):e}},857:function(t,e,i){var n=i(7854);t.exports=n},2248:function(t,e,i){var n=i(1320);t.exports=function(t,e,i){for(var o in e)n(t,o,e[o],i);return t}},1320:function(t,e,i){var n=i(7854),o=i(8880),s=i(6656),r=i(3505),a=i(2788),l=i(9909),c=l.get,h=l.enforce,u=String(String).split("String");(t.exports=function(t,e,i,a){var l,c=!!a&&!!a.unsafe,d=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof e||s(i,"name")||o(i,"name",e),(l=h(i)).source||(l.source=u.join("string"==typeof e?e:""))),t!==n?(c?!f&&t[e]&&(d=!0):delete t[e],d?t[e]=i:o(t,e,i)):d?t[e]=i:r(e,i)})(Function.prototype,"toString",function(){return"function"==typeof this&&c(this).source||a(this)})},7651:function(t,e,i){var n=i(4326),o=i(2261);t.exports=function(t,e){var i=t.exec;if("function"==typeof i){var s=i.call(t,e);if("object"!=typeof s)throw TypeError("RegExp exec method returned something other than an Object or null");return s}if("RegExp"!==n(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},2261:function(t,e,i){"use strict";var n,o,s=i(7066),r=i(2999),a=RegExp.prototype.exec,l=String.prototype.replace,c=a,h=(n=/a/,o=/b*/g,a.call(n,"a"),a.call(o,"a"),0!==n.lastIndex||0!==o.lastIndex),u=r.UNSUPPORTED_Y||r.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];(h||d||u)&&(c=function(t){var e,i,n,o,r=this,c=u&&r.sticky,f=s.call(r),p=r.source,m=0,g=t;return c&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),g=String(t).slice(r.lastIndex),r.lastIndex>0&&(!r.multiline||r.multiline&&"\n"!==t[r.lastIndex-1])&&(p="(?: "+p+")",g=" "+g,m++),i=new RegExp("^(?:"+p+")",f)),d&&(i=new RegExp("^"+p+"$(?!\\s)",f)),h&&(e=r.lastIndex),n=a.call(c?i:r,g),c?n?(n.input=n.input.slice(m),n[0]=n[0].slice(m),n.index=r.lastIndex,r.lastIndex+=n[0].length):r.lastIndex=0:h&&n&&(r.lastIndex=r.global?n.index+n[0].length:e),d&&n&&n.length>1&&l.call(n[0],i,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)}),n}),t.exports=c},7066:function(t,e,i){"use strict";var n=i(9670);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},2999:function(t,e,i){"use strict";var n=i(7293);function o(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=n(function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")}),e.BROKEN_CARET=n(function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")})},4488:function(t){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},3505:function(t,e,i){var n=i(7854),o=i(8880);t.exports=function(t,e){try{o(n,t,e)}catch(i){n[t]=e}return e}},6340:function(t,e,i){"use strict";var n=i(5005),o=i(3070),s=i(5112),r=i(9781),a=s("species");t.exports=function(t){var e=n(t),i=o.f;r&&e&&!e[a]&&i(e,a,{configurable:!0,get:function(){return this}})}},8003:function(t,e,i){var n=i(3070).f,o=i(6656),s=i(5112)("toStringTag");t.exports=function(t,e,i){t&&!o(t=i?t:t.prototype,s)&&n(t,s,{configurable:!0,value:e})}},6200:function(t,e,i){var n=i(2309),o=i(9711),s=n("keys");t.exports=function(t){return s[t]||(s[t]=o(t))}},5465:function(t,e,i){var n=i(7854),o=i(3505),s="__core-js_shared__",r=n[s]||o(s,{});t.exports=r},2309:function(t,e,i){var n=i(1913),o=i(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.9.0",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:function(t,e,i){var n=i(9670),o=i(3099),s=i(5112)("species");t.exports=function(t,e){var i,r=n(t).constructor;return void 0===r||null==(i=n(r)[s])?e:o(i)}},8710:function(t,e,i){var n=i(9958),o=i(4488),s=function(t){return function(e,i){var s,r,a=String(o(e)),l=n(i),c=a.length;return l<0||l>=c?t?"":void 0:(s=a.charCodeAt(l))<55296||s>56319||l+1===c||(r=a.charCodeAt(l+1))<56320||r>57343?t?a.charAt(l):s:t?a.slice(l,l+2):r-56320+(s-55296<<10)+65536}};t.exports={codeAt:s(!1),charAt:s(!0)}},3197:function(t){"use strict";var e=2147483647,i=/[^\0-\u007E]/,n=/[.\u3002\uFF0E\uFF61]/g,o="Overflow: input needs wider integers to process",s=Math.floor,r=String.fromCharCode,a=function(t){return t+22+75*(t<26)},l=function(t,e,i){var n=0;for(t=i?s(t/700):t>>1,t+=s(t/e);t>455;n+=36)t=s(t/35);return s(n+36*t/(t+38))},c=function(t){var i=[];t=function(t){for(var e=[],i=0,n=t.length;i<n;){var o=t.charCodeAt(i++);if(o>=55296&&o<=56319&&i<n){var s=t.charCodeAt(i++);56320==(64512&s)?e.push(((1023&o)<<10)+(1023&s)+65536):(e.push(o),i--)}else e.push(o)}return e}(t);var n,c,h=t.length,u=128,d=0,f=72;for(n=0;n<t.length;n++)(c=t[n])<128&&i.push(r(c));var p=i.length,m=p;for(p&&i.push("-");m<h;){var g=e;for(n=0;n<t.length;n++)(c=t[n])>=u&&c<g&&(g=c);var v=m+1;if(g-u>s((e-d)/v))throw RangeError(o);for(d+=(g-u)*v,u=g,n=0;n<t.length;n++){if((c=t[n])<u&&++d>e)throw RangeError(o);if(c==u){for(var y=d,O=36;;O+=36){var b=O<=f?1:O>=f+26?26:O-f;if(y<b)break;var x=y-b,w=36-b;i.push(r(a(b+x%w))),y=s(x/w)}i.push(r(a(y))),f=l(d,v,m==p),d=0,++m}}++d,++u}return i.join("")};t.exports=function(t){var e,o,s=[],r=t.toLowerCase().replace(n,".").split(".");for(e=0;e<r.length;e++)o=r[e],s.push(i.test(o)?"xn--"+c(o):o);return s.join(".")}},6091:function(t,e,i){var n=i(7293),o=i(1361);t.exports=function(t){return n(function(){return!!o[t]()||"​…᠎"!="​…᠎"[t]()||o[t].name!==t})}},3111:function(t,e,i){var n=i(4488),o="["+i(1361)+"]",s=RegExp("^"+o+o+"*"),r=RegExp(o+o+"*$"),a=function(t){return function(e){var i=String(n(e));return 1&t&&(i=i.replace(s,"")),2&t&&(i=i.replace(r,"")),i}};t.exports={start:a(1),end:a(2),trim:a(3)}},1400:function(t,e,i){var n=i(9958),o=Math.max,s=Math.min;t.exports=function(t,e){var i=n(t);return i<0?o(i+e,0):s(i,e)}},7067:function(t,e,i){var n=i(9958),o=i(7466);t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=o(e);if(e!==i)throw RangeError("Wrong length or index");return i}},5656:function(t,e,i){var n=i(8361),o=i(4488);t.exports=function(t){return n(o(t))}},9958:function(t){var e=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:e)(t)}},7466:function(t,e,i){var n=i(9958),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},7908:function(t,e,i){var n=i(4488);t.exports=function(t){return Object(n(t))}},4590:function(t,e,i){var n=i(3002);t.exports=function(t,e){var i=n(t);if(i%e)throw RangeError("Wrong offset");return i}},3002:function(t,e,i){var n=i(9958);t.exports=function(t){var e=n(t);if(e<0)throw RangeError("The argument can't be less than 0");return e}},7593:function(t,e,i){var n=i(111);t.exports=function(t,e){if(!n(t))return t;var i,o;if(e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!n(o=i.call(t)))return o;if(!e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},1694:function(t,e,i){var n={};n[i(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},9843:function(t,e,i){"use strict";var n=i(2109),o=i(7854),s=i(9781),r=i(3832),a=i(260),l=i(3331),c=i(5787),h=i(9114),u=i(8880),d=i(7466),f=i(7067),p=i(4590),m=i(7593),g=i(6656),v=i(648),y=i(111),O=i(30),b=i(7674),x=i(8006).f,w=i(7321),_=i(2092).forEach,S=i(6340),k=i(3070),$=i(1236),T=i(9909),C=i(9587),P=T.get,E=T.set,A=k.f,M=$.f,Q=Math.round,D=o.RangeError,R=l.ArrayBuffer,I=l.DataView,L=a.NATIVE_ARRAY_BUFFER_VIEWS,N=a.TYPED_ARRAY_TAG,j=a.TypedArray,z=a.TypedArrayPrototype,B=a.aTypedArrayConstructor,Z=a.isTypedArray,W="BYTES_PER_ELEMENT",F="Wrong length",X=function(t,e){for(var i=0,n=e.length,o=new(B(t))(n);n>i;)o[i]=e[i++];return o},q=function(t,e){A(t,e,{get:function(){return P(this)[e]}})},H=function(t){var e;return t instanceof R||"ArrayBuffer"==(e=v(t))||"SharedArrayBuffer"==e},V=function(t,e){return Z(t)&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Y=function(t,e){return V(t,e=m(e,!0))?h(2,t[e]):M(t,e)},U=function(t,e,i){return!(V(t,e=m(e,!0))&&y(i)&&g(i,"value"))||g(i,"get")||g(i,"set")||i.configurable||g(i,"writable")&&!i.writable||g(i,"enumerable")&&!i.enumerable?A(t,e,i):(t[e]=i.value,t)};s?(L||($.f=Y,k.f=U,q(z,"buffer"),q(z,"byteOffset"),q(z,"byteLength"),q(z,"length")),n({target:"Object",stat:!0,forced:!L},{getOwnPropertyDescriptor:Y,defineProperty:U}),t.exports=function(t,e,i){var s=t.match(/\d+$/)[0]/8,a=t+(i?"Clamped":"")+"Array",l="get"+t,h="set"+t,m=o[a],g=m,v=g&&g.prototype,k={},$=function(t,e){A(t,e,{get:function(){return function(t,e){var i=P(t);return i.view[l](e*s+i.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,n){var o=P(t);i&&(n=(n=Q(n))<0?0:n>255?255:255&n),o.view[h](e*s+o.byteOffset,n,!0)}(this,e,t)},enumerable:!0})};L?r&&(g=e(function(t,e,i,n){return c(t,g,a),C(y(e)?H(e)?void 0!==n?new m(e,p(i,s),n):void 0!==i?new m(e,p(i,s)):new m(e):Z(e)?X(g,e):w.call(g,e):new m(f(e)),t,g)}),b&&b(g,j),_(x(m),function(t){t in g||u(g,t,m[t])}),g.prototype=v):(g=e(function(t,e,i,n){c(t,g,a);var o,r,l,h=0,u=0;if(y(e)){if(!H(e))return Z(e)?X(g,e):w.call(g,e);o=e,u=p(i,s);var m=e.byteLength;if(void 0===n){if(m%s)throw D(F);if((r=m-u)<0)throw D(F)}else if((r=d(n)*s)+u>m)throw D(F);l=r/s}else l=f(e),o=new R(r=l*s);for(E(t,{buffer:o,byteOffset:u,byteLength:r,length:l,view:new I(o)});h<l;)$(t,h++)}),b&&b(g,j),v=g.prototype=O(z)),v.constructor!==g&&u(v,"constructor",g),N&&u(v,N,a),k[a]=g,n({global:!0,forced:g!=m,sham:!L},k),W in g||u(g,W,s),W in v||u(v,W,s),S(a)}):t.exports=function(){}},3832:function(t,e,i){var n=i(7854),o=i(7293),s=i(7072),r=i(260).NATIVE_ARRAY_BUFFER_VIEWS,a=n.ArrayBuffer,l=n.Int8Array;t.exports=!r||!o(function(){l(1)})||!o(function(){new l(-1)})||!s(function(t){new l,new l(null),new l(1.5),new l(t)},!0)||o(function(){return 1!==new l(new a(2),1,void 0).length})},3074:function(t,e,i){var n=i(260).aTypedArrayConstructor,o=i(6707);t.exports=function(t,e){for(var i=o(t,t.constructor),s=0,r=e.length,a=new(n(i))(r);r>s;)a[s]=e[s++];return a}},7321:function(t,e,i){var n=i(7908),o=i(7466),s=i(1246),r=i(7659),a=i(9974),l=i(260).aTypedArrayConstructor;t.exports=function(t){var e,i,c,h,u,d,f=n(t),p=arguments.length,m=p>1?arguments[1]:void 0,g=void 0!==m,v=s(f);if(null!=v&&!r(v))for(d=(u=v.call(f)).next,f=[];!(h=d.call(u)).done;)f.push(h.value);for(g&&p>2&&(m=a(m,arguments[2],2)),i=o(f.length),c=new(l(this))(i),e=0;i>e;e++)c[e]=g?m(f[e],e):f[e];return c}},9711:function(t){var e=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+i).toString(36)}},3307:function(t,e,i){var n=i(133);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5112:function(t,e,i){var n=i(7854),o=i(2309),s=i(6656),r=i(9711),a=i(133),l=i(3307),c=o("wks"),h=n.Symbol,u=l?h:h&&h.withoutSetter||r;t.exports=function(t){return s(c,t)||(a&&s(h,t)?c[t]=h[t]:c[t]=u("Symbol."+t)),c[t]}},1361:function(t){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},8264:function(t,e,i){"use strict";var n=i(2109),o=i(7854),s=i(3331),r=i(6340),a="ArrayBuffer",l=s[a];n({global:!0,forced:o[a]!==l},{ArrayBuffer:l}),r(a)},2222:function(t,e,i){"use strict";var n=i(2109),o=i(7293),s=i(3157),r=i(111),a=i(7908),l=i(7466),c=i(6135),h=i(5417),u=i(1194),d=i(5112),f=i(7392),p=d("isConcatSpreadable"),m=9007199254740991,g="Maximum allowed index exceeded",v=f>=51||!o(function(){var t=[];return t[p]=!1,t.concat()[0]!==t}),y=u("concat"),O=function(t){if(!r(t))return!1;var e=t[p];return void 0!==e?!!e:s(t)};n({target:"Array",proto:!0,forced:!v||!y},{concat:function(t){var e,i,n,o,s,r=a(this),u=h(r,0),d=0;for(e=-1,n=arguments.length;e<n;e++)if(O(s=-1===e?r:arguments[e])){if(d+(o=l(s.length))>m)throw TypeError(g);for(i=0;i<o;i++,d++)i in s&&c(u,d,s[i])}else{if(d>=m)throw TypeError(g);c(u,d++,s)}return u.length=d,u}})},7327:function(t,e,i){"use strict";var n=i(2109),o=i(2092).filter;n({target:"Array",proto:!0,forced:!i(1194)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},2772:function(t,e,i){"use strict";var n=i(2109),o=i(1318).indexOf,s=i(9341),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0,l=s("indexOf");n({target:"Array",proto:!0,forced:a||!l},{indexOf:function(t){return a?r.apply(this,arguments)||0:o(this,t,arguments.length>1?arguments[1]:void 0)}})},6992:function(t,e,i){"use strict";var n=i(5656),o=i(1223),s=i(7497),r=i(9909),a=i(654),l="Array Iterator",c=r.set,h=r.getterFor(l);t.exports=a(Array,"Array",function(t,e){c(this,{type:l,target:n(t),index:0,kind:e})},function(){var t=h(this),e=t.target,i=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},1249:function(t,e,i){"use strict";var n=i(2109),o=i(2092).map;n({target:"Array",proto:!0,forced:!i(1194)("map")},{map:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},7042:function(t,e,i){"use strict";var n=i(2109),o=i(111),s=i(3157),r=i(1400),a=i(7466),l=i(5656),c=i(6135),h=i(5112),u=i(1194)("slice"),d=h("species"),f=[].slice,p=Math.max;n({target:"Array",proto:!0,forced:!u},{slice:function(t,e){var i,n,h,u=l(this),m=a(u.length),g=r(t,m),v=r(void 0===e?m:e,m);if(s(u)&&("function"!=typeof(i=u.constructor)||i!==Array&&!s(i.prototype)?o(i)&&null===(i=i[d])&&(i=void 0):i=void 0,i===Array||void 0===i))return f.call(u,g,v);for(n=new(void 0===i?Array:i)(p(v-g,0)),h=0;g<v;g++,h++)g in u&&c(n,h,u[g]);return n.length=h,n}})},561:function(t,e,i){"use strict";var n=i(2109),o=i(1400),s=i(9958),r=i(7466),a=i(7908),l=i(5417),c=i(6135),h=i(1194)("splice"),u=Math.max,d=Math.min;n({target:"Array",proto:!0,forced:!h},{splice:function(t,e){var i,n,h,f,p,m,g=a(this),v=r(g.length),y=o(t,v),O=arguments.length;if(0===O?i=n=0:1===O?(i=0,n=v-y):(i=O-2,n=d(u(s(e),0),v-y)),v+i-n>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(h=l(g,n),f=0;f<n;f++)(p=y+f)in g&&c(h,f,g[p]);if(h.length=n,i<n){for(f=y;f<v-n;f++)m=f+i,(p=f+n)in g?g[m]=g[p]:delete g[m];for(f=v;f>v-n+i;f--)delete g[f-1]}else if(i>n)for(f=v-n;f>y;f--)m=f+i-1,(p=f+n-1)in g?g[m]=g[p]:delete g[m];for(f=0;f<i;f++)g[f+y]=arguments[f+2];return g.length=v-n+i,h}})},8309:function(t,e,i){var n=i(9781),o=i(3070).f,s=Function.prototype,r=s.toString,a=/^\s*function ([^ (]*)/,l="name";n&&!(l in s)&&o(s,l,{configurable:!0,get:function(){try{return r.call(this).match(a)[1]}catch(t){return""}}})},489:function(t,e,i){var n=i(2109),o=i(7293),s=i(7908),r=i(9518),a=i(8544);n({target:"Object",stat:!0,forced:o(function(){r(1)}),sham:!a},{getPrototypeOf:function(t){return r(s(t))}})},1539:function(t,e,i){var n=i(1694),o=i(1320),s=i(288);n||o(Object.prototype,"toString",s,{unsafe:!0})},4916:function(t,e,i){"use strict";var n=i(2109),o=i(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},9714:function(t,e,i){"use strict";var n=i(1320),o=i(9670),s=i(7293),r=i(7066),a="toString",l=RegExp.prototype,c=l[a],h=s(function(){return"/a/b"!=c.call({source:"a",flags:"b"})}),u=c.name!=a;(h||u)&&n(RegExp.prototype,a,function(){var t=o(this),e=String(t.source),i=t.flags;return"/"+e+"/"+String(void 0===i&&t instanceof RegExp&&!("flags"in l)?r.call(t):i)},{unsafe:!0})},8783:function(t,e,i){"use strict";var n=i(8710).charAt,o=i(9909),s=i(654),r="String Iterator",a=o.set,l=o.getterFor(r);s(String,"String",function(t){a(this,{type:r,string:String(t),index:0})},function(){var t,e=l(this),i=e.string,o=e.index;return o>=i.length?{value:void 0,done:!0}:(t=n(i,o),e.index+=t.length,{value:t,done:!1})})},4723:function(t,e,i){"use strict";var n=i(7007),o=i(9670),s=i(7466),r=i(4488),a=i(1530),l=i(7651);n("match",1,function(t,e,i){return[function(e){var i=r(this),n=null==e?void 0:e[t];return void 0!==n?n.call(e,i):new RegExp(e)[t](String(i))},function(t){var n=i(e,t,this);if(n.done)return n.value;var r=o(t),c=String(this);if(!r.global)return l(r,c);var h=r.unicode;r.lastIndex=0;for(var u,d=[],f=0;null!==(u=l(r,c));){var p=String(u[0]);d[f]=p,""===p&&(r.lastIndex=a(c,s(r.lastIndex),h)),f++}return 0===f?null:d}]})},5306:function(t,e,i){"use strict";var n=i(7007),o=i(9670),s=i(7466),r=i(9958),a=i(4488),l=i(1530),c=i(647),h=i(7651),u=Math.max,d=Math.min,f=function(t){return void 0===t?t:String(t)};n("replace",2,function(t,e,i,n){var p=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,m=n.REPLACE_KEEPS_$0,g=p?"$":"$0";return[function(i,n){var o=a(this),s=null==i?void 0:i[t];return void 0!==s?s.call(i,o,n):e.call(String(o),i,n)},function(t,n){if(!p&&m||"string"==typeof n&&-1===n.indexOf(g)){var a=i(e,t,this,n);if(a.done)return a.value}var v=o(t),y=String(this),O="function"==typeof n;O||(n=String(n));var b=v.global;if(b){var x=v.unicode;v.lastIndex=0}for(var w=[];;){var _=h(v,y);if(null===_)break;if(w.push(_),!b)break;""===String(_[0])&&(v.lastIndex=l(y,s(v.lastIndex),x))}for(var S="",k=0,$=0;$<w.length;$++){_=w[$];for(var T=String(_[0]),C=u(d(r(_.index),y.length),0),P=[],E=1;E<_.length;E++)P.push(f(_[E]));var A=_.groups;if(O){var M=[T].concat(P,C,y);void 0!==A&&M.push(A);var Q=String(n.apply(void 0,M))}else Q=c(T,y,C,P,A,n);C>=k&&(S+=y.slice(k,C)+Q,k=C+T.length)}return S+y.slice(k)}]})},3123:function(t,e,i){"use strict";var n=i(7007),o=i(7850),s=i(9670),r=i(4488),a=i(6707),l=i(1530),c=i(7466),h=i(7651),u=i(2261),d=i(7293),f=[].push,p=Math.min,m=4294967295,g=!d(function(){return!RegExp(m,"y")});n("split",2,function(t,e,i){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,i){var n=String(r(this)),s=void 0===i?m:i>>>0;if(0===s)return[];if(void 0===t)return[n];if(!o(t))return e.call(n,t,s);for(var a,l,c,h=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,g=new RegExp(t.source,d+"g");(a=u.call(g,n))&&!((l=g.lastIndex)>p&&(h.push(n.slice(p,a.index)),a.length>1&&a.index<n.length&&f.apply(h,a.slice(1)),c=a[0].length,p=l,h.length>=s));)g.lastIndex===a.index&&g.lastIndex++;return p===n.length?!c&&g.test("")||h.push(""):h.push(n.slice(p)),h.length>s?h.slice(0,s):h}:"0".split(void 0,0).length?function(t,i){return void 0===t&&0===i?[]:e.call(this,t,i)}:e,[function(e,i){var o=r(this),s=null==e?void 0:e[t];return void 0!==s?s.call(e,o,i):n.call(String(o),e,i)},function(t,o){var r=i(n,t,this,o,n!==e);if(r.done)return r.value;var u=s(t),d=String(this),f=a(u,RegExp),v=u.unicode,y=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(g?"y":"g"),O=new f(g?u:"^(?:"+u.source+")",y),b=void 0===o?m:o>>>0;if(0===b)return[];if(0===d.length)return null===h(O,d)?[d]:[];for(var x=0,w=0,_=[];w<d.length;){O.lastIndex=g?w:0;var S,k=h(O,g?d:d.slice(w));if(null===k||(S=p(c(O.lastIndex+(g?0:w)),d.length))===x)w=l(d,w,v);else{if(_.push(d.slice(x,w)),_.length===b)return _;for(var $=1;$<=k.length-1;$++)if(_.push(k[$]),_.length===b)return _;w=x=S}}return _.push(d.slice(x)),_}]},!g)},3210:function(t,e,i){"use strict";var n=i(2109),o=i(3111).trim;n({target:"String",proto:!0,forced:i(6091)("trim")},{trim:function(){return o(this)}})},2990:function(t,e,i){"use strict";var n=i(260),o=i(1048),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("copyWithin",function(t,e){return o.call(s(this),t,e,arguments.length>2?arguments[2]:void 0)})},8927:function(t,e,i){"use strict";var n=i(260),o=i(2092).every,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",function(t){return o(s(this),t,arguments.length>1?arguments[1]:void 0)})},3105:function(t,e,i){"use strict";var n=i(260),o=i(1285),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("fill",function(t){return o.apply(s(this),arguments)})},5035:function(t,e,i){"use strict";var n=i(260),o=i(2092).filter,s=i(3074),r=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",function(t){var e=o(r(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)})},7174:function(t,e,i){"use strict";var n=i(260),o=i(2092).findIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",function(t){return o(s(this),t,arguments.length>1?arguments[1]:void 0)})},4345:function(t,e,i){"use strict";var n=i(260),o=i(2092).find,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",function(t){return o(s(this),t,arguments.length>1?arguments[1]:void 0)})},2846:function(t,e,i){"use strict";var n=i(260),o=i(2092).forEach,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",function(t){o(s(this),t,arguments.length>1?arguments[1]:void 0)})},4731:function(t,e,i){"use strict";var n=i(260),o=i(1318).includes,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",function(t){return o(s(this),t,arguments.length>1?arguments[1]:void 0)})},7209:function(t,e,i){"use strict";var n=i(260),o=i(1318).indexOf,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",function(t){return o(s(this),t,arguments.length>1?arguments[1]:void 0)})},6319:function(t,e,i){"use strict";var n=i(7854),o=i(260),s=i(6992),r=i(5112)("iterator"),a=n.Uint8Array,l=s.values,c=s.keys,h=s.entries,u=o.aTypedArray,d=o.exportTypedArrayMethod,f=a&&a.prototype[r],p=!!f&&("values"==f.name||null==f.name),m=function(){return l.call(u(this))};d("entries",function(){return h.call(u(this))}),d("keys",function(){return c.call(u(this))}),d("values",m,!p),d(r,m,!p)},8867:function(t,e,i){"use strict";var n=i(260),o=n.aTypedArray,s=n.exportTypedArrayMethod,r=[].join;s("join",function(t){return r.apply(o(this),arguments)})},7789:function(t,e,i){"use strict";var n=i(260),o=i(6583),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",function(t){return o.apply(s(this),arguments)})},3739:function(t,e,i){"use strict";var n=i(260),o=i(2092).map,s=i(6707),r=n.aTypedArray,a=n.aTypedArrayConstructor;(0,n.exportTypedArrayMethod)("map",function(t){return o(r(this),t,arguments.length>1?arguments[1]:void 0,function(t,e){return new(a(s(t,t.constructor)))(e)})})},4483:function(t,e,i){"use strict";var n=i(260),o=i(3671).right,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",function(t){return o(s(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)})},9368:function(t,e,i){"use strict";var n=i(260),o=i(3671).left,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",function(t){return o(s(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)})},2056:function(t,e,i){"use strict";var n=i(260),o=n.aTypedArray,s=n.exportTypedArrayMethod,r=Math.floor;s("reverse",function(){for(var t,e=this,i=o(e).length,n=r(i/2),s=0;s<n;)t=e[s],e[s++]=e[--i],e[i]=t;return e})},3462:function(t,e,i){"use strict";var n=i(260),o=i(7466),s=i(4590),r=i(7908),a=i(7293),l=n.aTypedArray;(0,n.exportTypedArrayMethod)("set",function(t){l(this);var e=s(arguments.length>1?arguments[1]:void 0,1),i=this.length,n=r(t),a=o(n.length),c=0;if(a+e>i)throw RangeError("Wrong length");for(;c<a;)this[e+c]=n[c++]},a(function(){new Int8Array(1).set({})}))},678:function(t,e,i){"use strict";var n=i(260),o=i(6707),s=i(7293),r=n.aTypedArray,a=n.aTypedArrayConstructor,l=n.exportTypedArrayMethod,c=[].slice;l("slice",function(t,e){for(var i=c.call(r(this),t,e),n=o(this,this.constructor),s=0,l=i.length,h=new(a(n))(l);l>s;)h[s]=i[s++];return h},s(function(){new Int8Array(1).slice()}))},7462:function(t,e,i){"use strict";var n=i(260),o=i(2092).some,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",function(t){return o(s(this),t,arguments.length>1?arguments[1]:void 0)})},3824:function(t,e,i){"use strict";var n=i(260),o=n.aTypedArray,s=n.exportTypedArrayMethod,r=[].sort;s("sort",function(t){return r.call(o(this),t)})},5021:function(t,e,i){"use strict";var n=i(260),o=i(7466),s=i(1400),r=i(6707),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",function(t,e){var i=a(this),n=i.length,l=s(t,n);return new(r(i,i.constructor))(i.buffer,i.byteOffset+l*i.BYTES_PER_ELEMENT,o((void 0===e?n:s(e,n))-l))})},2974:function(t,e,i){"use strict";var n=i(7854),o=i(260),s=i(7293),r=n.Int8Array,a=o.aTypedArray,l=o.exportTypedArrayMethod,c=[].toLocaleString,h=[].slice,u=!!r&&s(function(){c.call(new r(1))});l("toLocaleString",function(){return c.apply(u?h.call(a(this)):a(this),arguments)},s(function(){return[1,2].toLocaleString()!=new r([1,2]).toLocaleString()})||!s(function(){r.prototype.toLocaleString.call([1,2])}))},5016:function(t,e,i){"use strict";var n=i(260).exportTypedArrayMethod,o=i(7293),s=i(7854).Uint8Array,r=s&&s.prototype||{},a=[].toString,l=[].join;o(function(){a.call({})})&&(a=function(){return l.call(this)});var c=r.toString!=a;n("toString",a,c)},2472:function(t,e,i){i(9843)("Uint8",function(t){return function(e,i,n){return t(this,e,i,n)}})},4747:function(t,e,i){var n=i(7854),o=i(8324),s=i(8533),r=i(8880);for(var a in o){var l=n[a],c=l&&l.prototype;if(c&&c.forEach!==s)try{r(c,"forEach",s)}catch(t){c.forEach=s}}},3948:function(t,e,i){var n=i(7854),o=i(8324),s=i(6992),r=i(8880),a=i(5112),l=a("iterator"),c=a("toStringTag"),h=s.values;for(var u in o){var d=n[u],f=d&&d.prototype;if(f){if(f[l]!==h)try{r(f,l,h)}catch(t){f[l]=h}if(f[c]||r(f,c,u),o[u])for(var p in s)if(f[p]!==s[p])try{r(f,p,s[p])}catch(t){f[p]=s[p]}}}},1637:function(t,e,i){"use strict";i(6992);var n=i(2109),o=i(5005),s=i(590),r=i(1320),a=i(2248),l=i(8003),c=i(4994),h=i(9909),u=i(5787),d=i(6656),f=i(9974),p=i(648),m=i(9670),g=i(111),v=i(30),y=i(9114),O=i(8554),b=i(1246),x=i(5112),w=o("fetch"),_=o("Headers"),S=x("iterator"),k="URLSearchParams",$=k+"Iterator",T=h.set,C=h.getterFor(k),P=h.getterFor($),E=/\+/g,A=Array(4),M=function(t){return A[t-1]||(A[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},Q=function(t){try{return decodeURIComponent(t)}catch(e){return t}},D=function(t){var e=t.replace(E," "),i=4;try{return decodeURIComponent(e)}catch(t){for(;i;)e=e.replace(M(i--),Q);return e}},R=/[!'()~]|%20/g,I={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},L=function(t){return I[t]},N=function(t){return encodeURIComponent(t).replace(R,L)},j=function(t,e){if(e)for(var i,n,o=e.split("&"),s=0;s<o.length;)(i=o[s++]).length&&(n=i.split("="),t.push({key:D(n.shift()),value:D(n.join("="))}))},z=function(t){this.entries.length=0,j(this.entries,t)},B=function(t,e){if(t<e)throw TypeError("Not enough arguments")},Z=c(function(t,e){T(this,{type:$,iterator:O(C(t).entries),kind:e})},"Iterator",function(){var t=P(this),e=t.kind,i=t.iterator.next(),n=i.value;return i.done||(i.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),i}),W=function(){u(this,W,k);var t,e,i,n,o,s,r,a,l,c=arguments.length>0?arguments[0]:void 0,h=[];if(T(this,{type:k,entries:h,updateURL:function(){},updateSearchParams:z}),void 0!==c)if(g(c))if("function"==typeof(t=b(c)))for(i=(e=t.call(c)).next;!(n=i.call(e)).done;){if((r=(s=(o=O(m(n.value))).next).call(o)).done||(a=s.call(o)).done||!s.call(o).done)throw TypeError("Expected sequence with length 2");h.push({key:r.value+"",value:a.value+""})}else for(l in c)d(c,l)&&h.push({key:l,value:c[l]+""});else j(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},F=W.prototype;a(F,{append:function(t,e){B(arguments.length,2);var i=C(this);i.entries.push({key:t+"",value:e+""}),i.updateURL()},delete:function(t){B(arguments.length,1);for(var e=C(this),i=e.entries,n=t+"",o=0;o<i.length;)i[o].key===n?i.splice(o,1):o++;e.updateURL()},get:function(t){B(arguments.length,1);for(var e=C(this).entries,i=t+"",n=0;n<e.length;n++)if(e[n].key===i)return e[n].value;return null},getAll:function(t){B(arguments.length,1);for(var e=C(this).entries,i=t+"",n=[],o=0;o<e.length;o++)e[o].key===i&&n.push(e[o].value);return n},has:function(t){B(arguments.length,1);for(var e=C(this).entries,i=t+"",n=0;n<e.length;)if(e[n++].key===i)return!0;return!1},set:function(t,e){B(arguments.length,1);for(var i,n=C(this),o=n.entries,s=!1,r=t+"",a=e+"",l=0;l<o.length;l++)(i=o[l]).key===r&&(s?o.splice(l--,1):(s=!0,i.value=a));s||o.push({key:r,value:a}),n.updateURL()},sort:function(){var t,e,i,n=C(this),o=n.entries,s=o.slice();for(o.length=0,i=0;i<s.length;i++){for(t=s[i],e=0;e<i;e++)if(o[e].key>t.key){o.splice(e,0,t);break}e===i&&o.push(t)}n.updateURL()},forEach:function(t){for(var e,i=C(this).entries,n=f(t,arguments.length>1?arguments[1]:void 0,3),o=0;o<i.length;)n((e=i[o++]).value,e.key,this)},keys:function(){return new Z(this,"keys")},values:function(){return new Z(this,"values")},entries:function(){return new Z(this,"entries")}},{enumerable:!0}),r(F,S,F.entries),r(F,"toString",function(){for(var t,e=C(this).entries,i=[],n=0;n<e.length;)t=e[n++],i.push(N(t.key)+"="+N(t.value));return i.join("&")},{enumerable:!0}),l(W,k),n({global:!0,forced:!s},{URLSearchParams:W}),s||"function"!=typeof w||"function"!=typeof _||n({global:!0,enumerable:!0,forced:!0},{fetch:function(t){var e,i,n,o=[t];return arguments.length>1&&(g(e=arguments[1])&&(i=e.body,p(i)===k&&((n=e.headers?new _(e.headers):new _).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),e=v(e,{body:y(0,String(i)),headers:y(0,n)}))),o.push(e)),w.apply(this,o)}}),t.exports={URLSearchParams:W,getState:C}},285:function(t,e,i){"use strict";i(8783);var n,o=i(2109),s=i(9781),r=i(590),a=i(7854),l=i(6048),c=i(1320),h=i(5787),u=i(6656),d=i(1574),f=i(8457),p=i(8710).codeAt,m=i(3197),g=i(8003),v=i(1637),y=i(9909),O=a.URL,b=v.URLSearchParams,x=v.getState,w=y.set,_=y.getterFor("URL"),S=Math.floor,k=Math.pow,$="Invalid scheme",T="Invalid host",C="Invalid port",P=/[A-Za-z]/,E=/[\d+-.A-Za-z]/,A=/\d/,M=/^(0x|0X)/,Q=/^[0-7]+$/,D=/^\d+$/,R=/^[\dA-Fa-f]+$/,I=/[\u0000\t\u000A\u000D #%/:?@[\\]]/,L=/[\u0000\t\u000A\u000D #/:?@[\\]]/,N=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,j=/[\t\u000A\u000D]/g,z=function(t,e){var i,n,o;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return T;if(!(i=Z(e.slice(1,-1))))return T;t.host=i}else if(U(t)){if(e=m(e),I.test(e))return T;if(null===(i=B(e)))return T;t.host=i}else{if(L.test(e))return T;for(i="",n=f(e),o=0;o<n.length;o++)i+=V(n[o],F);t.host=i}},B=function(t){var e,i,n,o,s,r,a,l=t.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(e=l.length)>4)return t;for(i=[],n=0;n<e;n++){if(""==(o=l[n]))return t;if(s=10,o.length>1&&"0"==o.charAt(0)&&(s=M.test(o)?16:8,o=o.slice(8==s?1:2)),""===o)r=0;else{if(!(10==s?D:8==s?Q:R).test(o))return t;r=parseInt(o,s)}i.push(r)}for(n=0;n<e;n++)if(r=i[n],n==e-1){if(r>=k(256,5-e))return null}else if(r>255)return null;for(a=i.pop(),n=0;n<i.length;n++)a+=i[n]*k(256,3-n);return a},Z=function(t){var e,i,n,o,s,r,a,l=[0,0,0,0,0,0,0,0],c=0,h=null,u=0,d=function(){return t.charAt(u)};if(":"==d()){if(":"!=t.charAt(1))return;u+=2,h=++c}for(;d();){if(8==c)return;if(":"!=d()){for(e=i=0;i<4&&R.test(d());)e=16*e+parseInt(d(),16),u++,i++;if("."==d()){if(0==i)return;if(u-=i,c>6)return;for(n=0;d();){if(o=null,n>0){if(!("."==d()&&n<4))return;u++}if(!A.test(d()))return;for(;A.test(d());){if(s=parseInt(d(),10),null===o)o=s;else{if(0==o)return;o=10*o+s}if(o>255)return;u++}l[c]=256*l[c]+o,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==d()){if(u++,!d())return}else if(d())return;l[c++]=e}else{if(null!==h)return;u++,h=++c}}if(null!==h)for(r=c-h,c=7;0!=c&&r>0;)a=l[c],l[c--]=l[h+r-1],l[h+--r]=a;else if(8!=c)return;return l},W=function(t){var e,i,n,o;if("number"==typeof t){for(e=[],i=0;i<4;i++)e.unshift(t%256),t=S(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,i=1,n=null,o=0,s=0;s<8;s++)0!==t[s]?(o>i&&(e=n,i=o),n=null,o=0):(null===n&&(n=s),++o);return o>i&&(e=n,i=o),e}(t),i=0;i<8;i++)o&&0===t[i]||(o&&(o=!1),n===i?(e+=i?":":"::",o=!0):(e+=t[i].toString(16),i<7&&(e+=":")));return"["+e+"]"}return t},F={},X=d({},F,{" ":1,'"':1,"<":1,">":1,"`":1}),q=d({},X,{"#":1,"?":1,"{":1,"}":1}),H=d({},q,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),V=function(t,e){var i=p(t,0);return i>32&&i<127&&!u(e,t)?t:encodeURIComponent(t)},Y={ftp:21,file:null,http:80,https:443,ws:80,wss:443},U=function(t){return u(Y,t.scheme)},G=function(t){return""!=t.username||""!=t.password},K=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},J=function(t,e){var i;return 2==t.length&&P.test(t.charAt(0))&&(":"==(i=t.charAt(1))||!e&&"|"==i)},tt=function(t){var e;return t.length>1&&J(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},et=function(t){var e=t.path,i=e.length;!i||"file"==t.scheme&&1==i&&J(e[0],!0)||e.pop()},it=function(t){return"."===t||"%2e"===t.toLowerCase()},nt=function(t){return".."===(t=t.toLowerCase())||"%2e."===t||".%2e"===t||"%2e%2e"===t},ot={},st={},rt={},at={},lt={},ct={},ht={},ut={},dt={},ft={},pt={},mt={},gt={},vt={},yt={},Ot={},bt={},xt={},wt={},_t={},St={},kt=function(t,e,i,o){var s,r,a,l,c=i||ot,h=0,d="",p=!1,m=!1,g=!1;for(i||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(N,"")),e=e.replace(j,""),s=f(e);h<=s.length;){switch(r=s[h],c){case ot:if(!r||!P.test(r)){if(i)return $;c=rt;continue}d+=r.toLowerCase(),c=st;break;case st:if(r&&(E.test(r)||"+"==r||"-"==r||"."==r))d+=r.toLowerCase();else{if(":"!=r){if(i)return $;d="",c=rt,h=0;continue}if(i&&(U(t)!=u(Y,d)||"file"==d&&(G(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=d,i)return void(U(t)&&Y[t.scheme]==t.port&&(t.port=null));d="","file"==t.scheme?c=vt:U(t)&&o&&o.scheme==t.scheme?c=at:U(t)?c=ut:"/"==s[h+1]?(c=lt,h++):(t.cannotBeABaseURL=!0,t.path.push(""),c=wt)}break;case rt:if(!o||o.cannotBeABaseURL&&"#"!=r)return $;if(o.cannotBeABaseURL&&"#"==r){t.scheme=o.scheme,t.path=o.path.slice(),t.query=o.query,t.fragment="",t.cannotBeABaseURL=!0,c=St;break}c="file"==o.scheme?vt:ct;continue;case at:if("/"!=r||"/"!=s[h+1]){c=ct;continue}c=dt,h++;break;case lt:if("/"==r){c=ft;break}c=xt;continue;case ct:if(t.scheme=o.scheme,r==n)t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query=o.query;else if("/"==r||"\\"==r&&U(t))c=ht;else if("?"==r)t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query="",c=_t;else{if("#"!=r){t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.path.pop(),c=xt;continue}t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query=o.query,t.fragment="",c=St}break;case ht:if(!U(t)||"/"!=r&&"\\"!=r){if("/"!=r){t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,c=xt;continue}c=ft}else c=dt;break;case ut:if(c=dt,"/"!=r||"/"!=d.charAt(h+1))continue;h++;break;case dt:if("/"!=r&&"\\"!=r){c=ft;continue}break;case ft:if("@"==r){p&&(d="%40"+d),p=!0,a=f(d);for(var v=0;v<a.length;v++){var y=a[v];if(":"!=y||g){var O=V(y,H);g?t.password+=O:t.username+=O}else g=!0}d=""}else if(r==n||"/"==r||"?"==r||"#"==r||"\\"==r&&U(t)){if(p&&""==d)return"Invalid authority";h-=f(d).length+1,d="",c=pt}else d+=r;break;case pt:case mt:if(i&&"file"==t.scheme){c=Ot;continue}if(":"!=r||m){if(r==n||"/"==r||"?"==r||"#"==r||"\\"==r&&U(t)){if(U(t)&&""==d)return T;if(i&&""==d&&(G(t)||null!==t.port))return;if(l=z(t,d))return l;if(d="",c=bt,i)return;continue}"["==r?m=!0:"]"==r&&(m=!1),d+=r}else{if(""==d)return T;if(l=z(t,d))return l;if(d="",c=gt,i==mt)return}break;case gt:if(!A.test(r)){if(r==n||"/"==r||"?"==r||"#"==r||"\\"==r&&U(t)||i){if(""!=d){var b=parseInt(d,10);if(b>65535)return C;t.port=U(t)&&b===Y[t.scheme]?null:b,d=""}if(i)return;c=bt;continue}return C}d+=r;break;case vt:if(t.scheme="file","/"==r||"\\"==r)c=yt;else{if(!o||"file"!=o.scheme){c=xt;continue}if(r==n)t.host=o.host,t.path=o.path.slice(),t.query=o.query;else if("?"==r)t.host=o.host,t.path=o.path.slice(),t.query="",c=_t;else{if("#"!=r){tt(s.slice(h).join(""))||(t.host=o.host,t.path=o.path.slice(),et(t)),c=xt;continue}t.host=o.host,t.path=o.path.slice(),t.query=o.query,t.fragment="",c=St}}break;case yt:if("/"==r||"\\"==r){c=Ot;break}o&&"file"==o.scheme&&!tt(s.slice(h).join(""))&&(J(o.path[0],!0)?t.path.push(o.path[0]):t.host=o.host),c=xt;continue;case Ot:if(r==n||"/"==r||"\\"==r||"?"==r||"#"==r){if(!i&&J(d))c=xt;else if(""==d){if(t.host="",i)return;c=bt}else{if(l=z(t,d))return l;if("localhost"==t.host&&(t.host=""),i)return;d="",c=bt}continue}d+=r;break;case bt:if(U(t)){if(c=xt,"/"!=r&&"\\"!=r)continue}else if(i||"?"!=r)if(i||"#"!=r){if(r!=n&&(c=xt,"/"!=r))continue}else t.fragment="",c=St;else t.query="",c=_t;break;case xt:if(r==n||"/"==r||"\\"==r&&U(t)||!i&&("?"==r||"#"==r)){if(nt(d)?(et(t),"/"==r||"\\"==r&&U(t)||t.path.push("")):it(d)?"/"==r||"\\"==r&&U(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&J(d)&&(t.host&&(t.host=""),d=d.charAt(0)+":"),t.path.push(d)),d="","file"==t.scheme&&(r==n||"?"==r||"#"==r))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==r?(t.query="",c=_t):"#"==r&&(t.fragment="",c=St)}else d+=V(r,q);break;case wt:"?"==r?(t.query="",c=_t):"#"==r?(t.fragment="",c=St):r!=n&&(t.path[0]+=V(r,F));break;case _t:i||"#"!=r?r!=n&&("'"==r&&U(t)?t.query+="%27":t.query+="#"==r?"%23":V(r,F)):(t.fragment="",c=St);break;case St:r!=n&&(t.fragment+=V(r,X))}h++}},$t=function(t){var e,i,n=h(this,$t,"URL"),o=arguments.length>1?arguments[1]:void 0,r=String(t),a=w(n,{type:"URL"});if(void 0!==o)if(o instanceof $t)e=_(o);else if(i=kt(e={},String(o)))throw TypeError(i);if(i=kt(a,r,null,e))throw TypeError(i);var l=a.searchParams=new b,c=x(l);c.updateSearchParams(a.query),c.updateURL=function(){a.query=String(l)||null},s||(n.href=Ct.call(n),n.origin=Pt.call(n),n.protocol=Et.call(n),n.username=At.call(n),n.password=Mt.call(n),n.host=Qt.call(n),n.hostname=Dt.call(n),n.port=Rt.call(n),n.pathname=It.call(n),n.search=Lt.call(n),n.searchParams=Nt.call(n),n.hash=jt.call(n))},Tt=$t.prototype,Ct=function(){var t=_(this),e=t.scheme,i=t.username,n=t.password,o=t.host,s=t.port,r=t.path,a=t.query,l=t.fragment,c=e+":";return null!==o?(c+="//",G(t)&&(c+=i+(n?":"+n:"")+"@"),c+=W(o),null!==s&&(c+=":"+s)):"file"==e&&(c+="//"),c+=t.cannotBeABaseURL?r[0]:r.length?"/"+r.join("/"):"",null!==a&&(c+="?"+a),null!==l&&(c+="#"+l),c},Pt=function(){var t=_(this),e=t.scheme,i=t.port;if("blob"==e)try{return new URL(e.path[0]).origin}catch(t){return"null"}return"file"!=e&&U(t)?e+"://"+W(t.host)+(null!==i?":"+i:""):"null"},Et=function(){return _(this).scheme+":"},At=function(){return _(this).username},Mt=function(){return _(this).password},Qt=function(){var t=_(this),e=t.host,i=t.port;return null===e?"":null===i?W(e):W(e)+":"+i},Dt=function(){var t=_(this).host;return null===t?"":W(t)},Rt=function(){var t=_(this).port;return null===t?"":String(t)},It=function(){var t=_(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},Lt=function(){var t=_(this).query;return t?"?"+t:""},Nt=function(){return _(this).searchParams},jt=function(){var t=_(this).fragment;return t?"#"+t:""},zt=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(s&&l(Tt,{href:zt(Ct,function(t){var e=_(this),i=String(t),n=kt(e,i);if(n)throw TypeError(n);x(e.searchParams).updateSearchParams(e.query)}),origin:zt(Pt),protocol:zt(Et,function(t){var e=_(this);kt(e,String(t)+":",ot)}),username:zt(At,function(t){var e=_(this),i=f(String(t));if(!K(e)){e.username="";for(var n=0;n<i.length;n++)e.username+=V(i[n],H)}}),password:zt(Mt,function(t){var e=_(this),i=f(String(t));if(!K(e)){e.password="";for(var n=0;n<i.length;n++)e.password+=V(i[n],H)}}),host:zt(Qt,function(t){var e=_(this);e.cannotBeABaseURL||kt(e,String(t),pt)}),hostname:zt(Dt,function(t){var e=_(this);e.cannotBeABaseURL||kt(e,String(t),mt)}),port:zt(Rt,function(t){var e=_(this);K(e)||(""==(t=String(t))?e.port=null:kt(e,t,gt))}),pathname:zt(It,function(t){var e=_(this);e.cannotBeABaseURL||(e.path=[],kt(e,t+"",bt))}),search:zt(Lt,function(t){var e=_(this);""==(t=String(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",kt(e,t,_t)),x(e.searchParams).updateSearchParams(e.query)}),searchParams:zt(Nt),hash:zt(jt,function(t){var e=_(this);""!=(t=String(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",kt(e,t,St)):e.fragment=null})}),c(Tt,"toJSON",function(){return Ct.call(this)},{enumerable:!0}),c(Tt,"toString",function(){return Ct.call(this)},{enumerable:!0}),O){var Bt=O.createObjectURL,Zt=O.revokeObjectURL;Bt&&c($t,"createObjectURL",function(t){return Bt.apply(O,arguments)}),Zt&&c($t,"revokeObjectURL",function(t){return Zt.apply(O,arguments)})}g($t,"URL"),o({global:!0,forced:!r,sham:!s},{URL:$t})}},e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={exports:{}};return t[n](o,o.exports,i),o.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return function(){"use strict";function t(t,i){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,i){if(t){if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,i):void 0}}(t))||i&&t&&"number"==typeof t.length){n&&(t=n);var o=0,s=function(){};return{s,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}i.r(n),i.d(n,{Dropzone:function(){return b},default:function(){return k}}),i(2222),i(7327),i(2772),i(6992),i(1249),i(7042),i(561),i(8264),i(8309),i(489),i(1539),i(4916),i(9714),i(8783),i(4723),i(5306),i(3123),i(3210),i(2472),i(2990),i(8927),i(3105),i(5035),i(4345),i(7174),i(2846),i(4731),i(7209),i(6319),i(8867),i(7789),i(3739),i(9368),i(4483),i(2056),i(3462),i(678),i(7462),i(3824),i(5021),i(2974),i(5016),i(4747),i(3948),i(285);var s=function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var i,n,s;return i=e,n=[{key:"on",value:function(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this}},{key:"emit",value:function(e){this._callbacks=this._callbacks||{};for(var i=this._callbacks[e],n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];if(i){var r,a=t(i,!0);try{for(a.s();!(r=a.n()).done;)r.value.apply(this,o)}catch(t){a.e(t)}finally{a.f()}}return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+e,{args:o})),this}},{key:"makeEvent",value:function(t,e){var i={bubbles:!0,cancelable:!0,detail:e};if("function"==typeof window.CustomEvent)return new CustomEvent(t,i);var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),n}},{key:"off",value:function(t,e){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1===arguments.length)return delete this._callbacks[t],this;for(var n=0;n<i.length;n++)if(i[n]===e){i.splice(n,1);break}return this}}],n&&o(i.prototype,n),s&&o(i,s),e}();function r(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return a(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,l=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return r=t.done,t},e:function(t){l=!0,s=t},f:function(){try{r||null==i.return||i.return()}finally{if(l)throw s}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var l={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(t,e,i){if(i)return{dzuuid:i.file.upload.uuid,dzchunkindex:i.index,dztotalfilesize:i.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:i.file.upload.totalChunkCount,dzchunkbyteoffset:i.index*this.options.chunkSize}},accept:function(t,e){return e()},chunksUploaded:function(t,e){e()},fallback:function(){var t;this.element.className="".concat(this.element.className," dz-browser-not-supported");var e,i=r(this.element.getElementsByTagName("div"),!0);try{for(i.s();!(e=i.n()).done;){var n=e.value;if(/(^| )dz-message($| )/.test(n.className)){t=n,n.className="dz-message";break}}}catch(t){i.e(t)}finally{i.f()}t||(t=b.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(t));var o=t.getElementsByTagName("span")[0];return o&&(null!=o.textContent?o.textContent=this.options.dictFallbackMessage:null!=o.innerText&&(o.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(t,e,i,n){var o={srcX:0,srcY:0,srcWidth:t.width,srcHeight:t.height},s=t.width/t.height;null==e&&null==i?(e=o.srcWidth,i=o.srcHeight):null==e?e=i*s:null==i&&(i=e/s);var r=(e=Math.min(e,o.srcWidth))/(i=Math.min(i,o.srcHeight));if(o.srcWidth>e||o.srcHeight>i)if("crop"===n)s>r?(o.srcHeight=t.height,o.srcWidth=o.srcHeight*r):(o.srcWidth=t.width,o.srcHeight=o.srcWidth/r);else{if("contain"!==n)throw new Error("Unknown resizeMethod '".concat(n,"'"));s>r?i=e/s:e=i*s}return o.srcX=(t.width-o.srcWidth)/2,o.srcY=(t.height-o.srcHeight)/2,o.trgWidth=e,o.trgHeight=i,o},transformFile:function(t,e){return(this.options.resizeWidth||this.options.resizeHeight)&&t.type.match(/image.*/)?this.resizeImage(t,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,e):e(t)},previewTemplate:'<div class="dz-preview dz-file-preview"> <div class="dz-image"><img data-dz-thumbnail/></div> <div class="dz-details"> <div class="dz-size"><span data-dz-size></span></div> <div class="dz-filename"><span data-dz-name></span></div> </div> <div class="dz-progress"> <span class="dz-upload" data-dz-uploadprogress></span> </div> <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="dz-success-mark"> <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Check</title> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path> </g> </svg> </div> <div class="dz-error-mark"> <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Error</title> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475"> <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path> </g> </g> </svg> </div> </div> ',drop:function(t){return this.element.classList.remove("dz-drag-hover")},dragstart:function(t){},dragend:function(t){return this.element.classList.remove("dz-drag-hover")},dragenter:function(t){return this.element.classList.add("dz-drag-hover")},dragover:function(t){return this.element.classList.add("dz-drag-hover")},dragleave:function(t){return this.element.classList.remove("dz-drag-hover")},paste:function(t){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var e=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){t.previewElement=b.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement);var i,n=r(t.previewElement.querySelectorAll("[data-dz-name]"),!0);try{for(n.s();!(i=n.n()).done;){var o=i.value;o.textContent=t.name}}catch(t){n.e(t)}finally{n.f()}var s,a=r(t.previewElement.querySelectorAll("[data-dz-size]"),!0);try{for(a.s();!(s=a.n()).done;)(o=s.value).innerHTML=this.filesize(t.size)}catch(t){a.e(t)}finally{a.f()}this.options.addRemoveLinks&&(t._removeLink=b.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),t.previewElement.appendChild(t._removeLink));var l,c=function(i){return i.preventDefault(),i.stopPropagation(),t.status===b.UPLOADING?b.confirm(e.options.dictCancelUploadConfirmation,function(){return e.removeFile(t)}):e.options.dictRemoveFileConfirmation?b.confirm(e.options.dictRemoveFileConfirmation,function(){return e.removeFile(t)}):e.removeFile(t)},h=r(t.previewElement.querySelectorAll("[data-dz-remove]"),!0);try{for(h.s();!(l=h.n()).done;)l.value.addEventListener("click",c)}catch(t){h.e(t)}finally{h.f()}}},removedfile:function(t){return null!=t.previewElement&&null!=t.previewElement.parentNode&&t.previewElement.parentNode.removeChild(t.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(t,e){if(t.previewElement){t.previewElement.classList.remove("dz-file-preview");var i,n=r(t.previewElement.querySelectorAll("[data-dz-thumbnail]"),!0);try{for(n.s();!(i=n.n()).done;){var o=i.value;o.alt=t.name,o.src=e}}catch(t){n.e(t)}finally{n.f()}return setTimeout(function(){return t.previewElement.classList.add("dz-image-preview")},1)}},error:function(t,e){if(t.previewElement){t.previewElement.classList.add("dz-error"),"string"!=typeof e&&e.error&&(e=e.error);var i,n=r(t.previewElement.querySelectorAll("[data-dz-errormessage]"),!0);try{for(n.s();!(i=n.n()).done;)i.value.textContent=e}catch(t){n.e(t)}finally{n.f()}}},errormultiple:function(){},processing:function(t){if(t.previewElement&&(t.previewElement.classList.add("dz-processing"),t._removeLink))return t._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(t,e,i){if(t.previewElement){var n,o=r(t.previewElement.querySelectorAll("[data-dz-uploadprogress]"),!0);try{for(o.s();!(n=o.n()).done;){var s=n.value;"PROGRESS"===s.nodeName?s.value=e:s.style.width="".concat(e,"%")}}catch(t){o.e(t)}finally{o.f()}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(t){if(t.previewElement)return t.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(t){return this.emit("error",t,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(t){if(t._removeLink&&(t._removeLink.innerHTML=this.options.dictRemoveFile),t.previewElement)return t.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}};function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function h(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return u(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return r=t.done,t},e:function(t){a=!0,s=t},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw s}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function p(t,e,i){return e&&f(t.prototype,e),i&&f(t,i),t}function m(t,e){return m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},m(t,e)}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var i,n=O(t);if(e){var o=O(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return v(this,i)}}function v(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?y(t):e}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O(t){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},O(t)}var b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m(t,e)}(i,t);var e=g(i);function i(t,n){var o,s,r;if(d(this,i),(o=e.call(this)).element=t,o.version=i.version,o.clickableElements=[],o.listeners=[],o.files=[],"string"==typeof o.element&&(o.element=document.querySelector(o.element)),!o.element||null==o.element.nodeType)throw new Error("Invalid dropzone element.");if(o.element.dropzone)throw new Error("Dropzone already attached.");i.instances.push(y(o)),o.element.dropzone=y(o);var a=null!=(r=i.optionsForElement(o.element))?r:{};if(o.options=i.extend({},l,a,null!=n?n:{}),o.options.previewTemplate=o.options.previewTemplate.replace(/\n*/g,""),o.options.forceFallback||!i.isBrowserSupported())return v(o,o.options.fallback.call(y(o)));if(null==o.options.url&&(o.options.url=o.element.getAttribute("action")),!o.options.url)throw new Error("No URL provided.");if(o.options.acceptedFiles&&o.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(o.options.uploadMultiple&&o.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return o.options.acceptedMimeTypes&&(o.options.acceptedFiles=o.options.acceptedMimeTypes,delete o.options.acceptedMimeTypes),null!=o.options.renameFilename&&(o.options.renameFile=function(t){return o.options.renameFilename.call(y(o),t.name,t)}),"string"==typeof o.options.method&&(o.options.method=o.options.method.toUpperCase()),(s=o.getExistingFallback())&&s.parentNode&&s.parentNode.removeChild(s),!1!==o.options.previewsContainer&&(o.options.previewsContainer?o.previewsContainer=i.getElement(o.options.previewsContainer,"previewsContainer"):o.previewsContainer=o.element),o.options.clickable&&(!0===o.options.clickable?o.clickableElements=[o.element]:o.clickableElements=i.getElements(o.options.clickable,"clickable")),o.init(),o}return p(i,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(t){return t.accepted}).map(function(t){return t})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(t){return!t.accepted}).map(function(t){return t})}},{key:"getFilesWithStatus",value:function(t){return this.files.filter(function(e){return e.status===t}).map(function(t){return t})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(i.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(i.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(i.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(t){return t.status===i.UPLOADING||t.status===i.QUEUED}).map(function(t){return t})}},{key:"init",value:function(){var t=this;"form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(i.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length&&function e(){t.hiddenFileInput&&t.hiddenFileInput.parentNode.removeChild(t.hiddenFileInput),t.hiddenFileInput=document.createElement("input"),t.hiddenFileInput.setAttribute("type","file"),(null===t.options.maxFiles||t.options.maxFiles>1)&&t.hiddenFileInput.setAttribute("multiple","multiple"),t.hiddenFileInput.className="dz-hidden-input",null!==t.options.acceptedFiles&&t.hiddenFileInput.setAttribute("accept",t.options.acceptedFiles),null!==t.options.capture&&t.hiddenFileInput.setAttribute("capture",t.options.capture),t.hiddenFileInput.setAttribute("tabindex","-1"),t.hiddenFileInput.style.visibility="hidden",t.hiddenFileInput.style.position="absolute",t.hiddenFileInput.style.top="0",t.hiddenFileInput.style.left="0",t.hiddenFileInput.style.height="0",t.hiddenFileInput.style.width="0",i.getElement(t.options.hiddenInputContainer,"hiddenInputContainer").appendChild(t.hiddenFileInput),t.hiddenFileInput.addEventListener("change",function(){var i=t.hiddenFileInput.files;if(i.length){var n,o=h(i,!0);try{for(o.s();!(n=o.n()).done;){var s=n.value;t.addFile(s)}}catch(t){o.e(t)}finally{o.f()}}t.emit("addedfiles",i),e()})}(),this.URL=null!==window.URL?window.URL:window.webkitURL;var e,n=h(this.events,!0);try{for(n.s();!(e=n.n()).done;){var o=e.value;this.on(o,this.options[o])}}catch(t){n.e(t)}finally{n.f()}this.on("uploadprogress",function(){return t.updateTotalUploadProgress()}),this.on("removedfile",function(){return t.updateTotalUploadProgress()}),this.on("canceled",function(e){return t.emit("complete",e)}),this.on("complete",function(e){if(0===t.getAddedFiles().length&&0===t.getUploadingFiles().length&&0===t.getQueuedFiles().length)return setTimeout(function(){return t.emit("queuecomplete")},0)});var s=function(t){if(function(t){if(t.dataTransfer.types)for(var e=0;e<t.dataTransfer.types.length;e++)if("Files"===t.dataTransfer.types[e])return!0;return!1}(t))return t.stopPropagation(),t.preventDefault?t.preventDefault():t.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(e){return t.emit("dragstart",e)},dragenter:function(e){return s(e),t.emit("dragenter",e)},dragover:function(e){var i;try{i=e.dataTransfer.effectAllowed}catch(t){}return e.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",s(e),t.emit("dragover",e)},dragleave:function(e){return t.emit("dragleave",e)},drop:function(e){return s(e),t.drop(e)},dragend:function(e){return t.emit("dragend",e)}}}],this.clickableElements.forEach(function(e){return t.listeners.push({element:e,events:{click:function(n){return(e!==t.element||n.target===t.element||i.elementInside(n.target,t.element.querySelector(".dz-message")))&&t.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,i.instances.splice(i.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var t,e=0,i=0;if(this.getActiveFiles().length){var n,o=h(this.getActiveFiles(),!0);try{for(o.s();!(n=o.n()).done;){var s=n.value;e+=s.upload.bytesSent,i+=s.upload.total}}catch(t){o.e(t)}finally{o.f()}t=100*e/i}else t=100;return this.emit("totaluploadprogress",t,i,e)}},{key:"_getParamName",value:function(t){return"function"==typeof this.options.paramName?this.options.paramName(t):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(t,"]"):"")}},{key:"_renameFile",value:function(t){return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)}},{key:"getFallbackForm",value:function(){var t,e;if(t=this.getExistingFallback())return t;var n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+="<p>".concat(this.options.dictFallbackText,"</p>")),n+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var o=i.createElement(n);return"FORM"!==this.element.tagName?(e=i.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>'))).appendChild(o):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=e?e:o}},{key:"getExistingFallback",value:function(){for(var t=function(t){var e,i=h(t,!0);try{for(i.s();!(e=i.n()).done;){var n=e.value;if(/(^| )fallback($| )/.test(n.className))return n}}catch(t){i.e(t)}finally{i.f()}},e=0,i=["div","form"];e<i.length;e++){var n,o=i[e];if(n=t(this.element.getElementsByTagName(o)))return n}}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(t){return function(){var e=[];for(var i in t.events){var n=t.events[i];e.push(t.element.addEventListener(i,n,!1))}return e}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(t){return function(){var e=[];for(var i in t.events){var n=t.events[i];e.push(t.element.removeEventListener(i,n,!1))}return e}()})}},{key:"disable",value:function(){var t=this;return this.clickableElements.forEach(function(t){return t.classList.remove("dz-clickable")}),this.removeEventListeners(),this.disabled=!0,this.files.map(function(e){return t.cancelUpload(e)})}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach(function(t){return t.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(t){var e=0,i="b";if(t>0){for(var n=["tb","gb","mb","kb","b"],o=0;o<n.length;o++){var s=n[o];if(t>=Math.pow(this.options.filesizeBase,4-o)/10){e=t/Math.pow(this.options.filesizeBase,4-o),i=s;break}}e=Math.round(10*e)/10}return"<strong>".concat(e,"</strong> ").concat(this.options.dictFileSizeUnits[i])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(t){if(t.dataTransfer){this.emit("drop",t);for(var e=[],i=0;i<t.dataTransfer.files.length;i++)e[i]=t.dataTransfer.files[i];if(e.length){var n=t.dataTransfer.items;n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(e)}this.emit("addedfiles",e)}}},{key:"paste",value:function(t){if(null!=(e=null!=t?t.clipboardData:void 0,i=function(t){return t.items},null!=e?i(e):void 0)){var e,i;this.emit("paste",t);var n=t.clipboardData.items;return n.length?this._addFilesFromItems(n):void 0}}},{key:"handleFiles",value:function(t){var e,i=h(t,!0);try{for(i.s();!(e=i.n()).done;){var n=e.value;this.addFile(n)}}catch(t){i.e(t)}finally{i.f()}}},{key:"_addFilesFromItems",value:function(t){var e=this;return function(){var i,n=[],o=h(t,!0);try{for(o.s();!(i=o.n()).done;){var s,r=i.value;null!=r.webkitGetAsEntry&&(s=r.webkitGetAsEntry())?s.isFile?n.push(e.addFile(r.getAsFile())):s.isDirectory?n.push(e._addFilesFromDirectory(s,s.name)):n.push(void 0):null==r.getAsFile||null!=r.kind&&"file"!==r.kind?n.push(void 0):n.push(e.addFile(r.getAsFile()))}}catch(t){o.e(t)}finally{o.f()}return n}()}},{key:"_addFilesFromDirectory",value:function(t,e){var i=this,n=t.createReader(),o=function(t){return e=console,i="log",n=function(e){return e.log(t)},null!=e&&"function"==typeof e[i]?n(e,i):void 0;var e,i,n};return function t(){return n.readEntries(function(n){if(n.length>0){var o,s=h(n,!0);try{for(s.s();!(o=s.n()).done;){var r=o.value;r.isFile?r.file(function(t){if(!i.options.ignoreHiddenFiles||"."!==t.name.substring(0,1))return t.fullPath="".concat(e,"/").concat(t.name),i.addFile(t)}):r.isDirectory&&i._addFilesFromDirectory(r,"".concat(e,"/").concat(r.name))}}catch(t){s.e(t)}finally{s.f()}t()}return null},o)}()}},{key:"accept",value:function(t,e){this.options.maxFilesize&&t.size>1024*this.options.maxFilesize*1024?e(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):i.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(e(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,e):e(this.options.dictInvalidFileType)}},{key:"addFile",value:function(t){var e=this;t.upload={uuid:i.uuidv4(),progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)},this.files.push(t),t.status=i.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(i){i?(t.accepted=!1,e._errorProcessing([t],i)):(t.accepted=!0,e.options.autoQueue&&e.enqueueFile(t)),e._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(t){var e,i=h(t,!0);try{for(i.s();!(e=i.n()).done;){var n=e.value;this.enqueueFile(n)}}catch(t){i.e(t)}finally{i.f()}return null}},{key:"enqueueFile",value:function(t){var e=this;if(t.status!==i.ADDED||!0!==t.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(t.status=i.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return e.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(t){var e=this;if(this.options.createImageThumbnails&&t.type.match(/image.*/)&&t.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(t),setTimeout(function(){return e._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var t=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(i){return t.emit("thumbnail",e,i),t._processingThumbnail=!1,t._processThumbnailQueue()})}}},{key:"removeFile",value:function(t){if(t.status===i.UPLOADING&&this.cancelUpload(t),this.files=x(this.files,t),this.emit("removedfile",t),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(t){null==t&&(t=!1);var e,n=h(this.files.slice(),!0);try{for(n.s();!(e=n.n()).done;){var o=e.value;(o.status!==i.UPLOADING||t)&&this.removeFile(o)}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"resizeImage",value:function(t,e,n,o,s){var r=this;return this.createThumbnail(t,e,n,o,!0,function(e,n){if(null==n)return s(t);var o=r.options.resizeMimeType;null==o&&(o=t.type);var a=n.toDataURL(o,r.options.resizeQuality);return"image/jpeg"!==o&&"image/jpg"!==o||(a=S.restore(t.dataURL,a)),s(i.dataURItoBlob(a))})}},{key:"createThumbnail",value:function(t,e,i,n,o,s){var r=this,a=new FileReader;a.onload=function(){t.dataURL=a.result,"image/svg+xml"!==t.type?r.createThumbnailFromUrl(t,e,i,n,o,s):null!=s&&s(a.result)},a.readAsDataURL(t)}},{key:"displayExistingFile",value:function(t,e,i,n){var o=this,s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.emit("addedfile",t),this.emit("complete",t),s?(t.dataURL=e,this.createThumbnailFromUrl(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,function(e){o.emit("thumbnail",t,e),i&&i()},n)):(this.emit("thumbnail",t,e),i&&i())}},{key:"createThumbnailFromUrl",value:function(t,e,i,n,o,s,r){var a=this,l=document.createElement("img");return r&&(l.crossOrigin=r),o="from-image"!=getComputedStyle(document.body).imageOrientation&&o,l.onload=function(){var r=function(t){return t(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&o&&(r=function(t){return EXIF.getData(l,function(){return t(EXIF.getTag(this,"Orientation"))})}),r(function(o){t.width=l.width,t.height=l.height;var r=a.options.resize.call(a,t,e,i,n),c=document.createElement("canvas"),h=c.getContext("2d");switch(c.width=r.trgWidth,c.height=r.trgHeight,o>4&&(c.width=r.trgHeight,c.height=r.trgWidth),o){case 2:h.translate(c.width,0),h.scale(-1,1);break;case 3:h.translate(c.width,c.height),h.rotate(Math.PI);break;case 4:h.translate(0,c.height),h.scale(1,-1);break;case 5:h.rotate(.5*Math.PI),h.scale(1,-1);break;case 6:h.rotate(.5*Math.PI),h.translate(0,-c.width);break;case 7:h.rotate(.5*Math.PI),h.translate(c.height,-c.width),h.scale(-1,1);break;case 8:h.rotate(-.5*Math.PI),h.translate(-c.height,0)}_(h,l,null!=r.srcX?r.srcX:0,null!=r.srcY?r.srcY:0,r.srcWidth,r.srcHeight,null!=r.trgX?r.trgX:0,null!=r.trgY?r.trgY:0,r.trgWidth,r.trgHeight);var u=c.toDataURL("image/png");if(null!=s)return s(u,c)})},null!=s&&(l.onerror=s),l.src=t.dataURL}},{key:"processQueue",value:function(){var t=this.options.parallelUploads,e=this.getUploadingFiles().length,i=e;if(!(e>=t)){var n=this.getQueuedFiles();if(n.length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,t-e));for(;i<t;){if(!n.length)return;this.processFile(n.shift()),i++}}}}},{key:"processFile",value:function(t){return this.processFiles([t])}},{key:"processFiles",value:function(t){var e,n=h(t,!0);try{for(n.s();!(e=n.n()).done;){var o=e.value;o.processing=!0,o.status=i.UPLOADING,this.emit("processing",o)}}catch(t){n.e(t)}finally{n.f()}return this.options.uploadMultiple&&this.emit("processingmultiple",t),this.uploadFiles(t)}},{key:"_getFilesWithXhr",value:function(t){return this.files.filter(function(e){return e.xhr===t}).map(function(t){return t})}},{key:"cancelUpload",value:function(t){if(t.status===i.UPLOADING){var e,n=this._getFilesWithXhr(t.xhr),o=h(n,!0);try{for(o.s();!(e=o.n()).done;)e.value.status=i.CANCELED}catch(t){o.e(t)}finally{o.f()}void 0!==t.xhr&&t.xhr.abort();var s,r=h(n,!0);try{for(r.s();!(s=r.n()).done;){var a=s.value;this.emit("canceled",a)}}catch(t){r.e(t)}finally{r.f()}this.options.uploadMultiple&&this.emit("canceledmultiple",n)}else t.status!==i.ADDED&&t.status!==i.QUEUED||(t.status=i.CANCELED,this.emit("canceled",t),this.options.uploadMultiple&&this.emit("canceledmultiple",[t]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(t){if("function"==typeof t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return t.apply(this,i)}return t}},{key:"uploadFile",value:function(t){return this.uploadFiles([t])}},{key:"uploadFiles",value:function(t){var e=this;this._transformFiles(t,function(n){if(e.options.chunking){var o=n[0];t[0].upload.chunked=e.options.chunking&&(e.options.forceChunking||o.size>e.options.chunkSize),t[0].upload.totalChunkCount=Math.ceil(o.size/e.options.chunkSize)}if(t[0].upload.chunked){var s=t[0],r=n[0];s.upload.chunks=[];var a=function(){for(var n=0;void 0!==s.upload.chunks[n];)n++;if(!(n>=s.upload.totalChunkCount)){var o=n*e.options.chunkSize,a=Math.min(o+e.options.chunkSize,r.size),l={name:e._getParamName(0),data:r.webkitSlice?r.webkitSlice(o,a):r.slice(o,a),filename:s.upload.filename,chunkIndex:n};s.upload.chunks[n]={file:s,index:n,dataBlock:l,status:i.UPLOADING,progress:0,retries:0},e._uploadData(t,[l])}};if(s.upload.finishedChunkUpload=function(n,o){var r=!0;n.status=i.SUCCESS,n.dataBlock=null,n.xhr=null;for(var l=0;l<s.upload.totalChunkCount;l++){if(void 0===s.upload.chunks[l])return a();s.upload.chunks[l].status!==i.SUCCESS&&(r=!1)}r&&e.options.chunksUploaded(s,function(){e._finished(t,o,null)})},e.options.parallelChunkUploads)for(var l=0;l<s.upload.totalChunkCount;l++)a();else a()}else{for(var c=[],h=0;h<t.length;h++)c[h]={name:e._getParamName(h),data:n[h],filename:t[h].upload.filename};e._uploadData(t,c)}})}},{key:"_getChunk",value:function(t,e){for(var i=0;i<t.upload.totalChunkCount;i++)if(void 0!==t.upload.chunks[i]&&t.upload.chunks[i].xhr===e)return t.upload.chunks[i]}},{key:"_uploadData",value:function(t,e){var n,o=this,s=new XMLHttpRequest,r=h(t,!0);try{for(r.s();!(n=r.n()).done;)n.value.xhr=s}catch(t){r.e(t)}finally{r.f()}t[0].upload.chunked&&(t[0].upload.chunks[e[0].chunkIndex].xhr=s);var a=this.resolveOption(this.options.method,t),l=this.resolveOption(this.options.url,t);s.open(a,l,!0),this.resolveOption(this.options.timeout,t)&&(s.timeout=this.resolveOption(this.options.timeout,t)),s.withCredentials=!!this.options.withCredentials,s.onload=function(e){o._finishedUploading(t,s,e)},s.ontimeout=function(){o._handleUploadError(t,s,"Request timedout after ".concat(o.options.timeout/1e3," seconds"))},s.onerror=function(){o._handleUploadError(t,s)},(null!=s.upload?s.upload:s).onprogress=function(e){return o._updateFilesUploadProgress(t,s,e)};var c={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var u in this.options.headers&&i.extend(c,this.options.headers),c){var d=c[u];d&&s.setRequestHeader(u,d)}var f=new FormData;if(this.options.params){var p=this.options.params;for(var m in"function"==typeof p&&(p=p.call(this,t,s,t[0].upload.chunked?this._getChunk(t[0],s):null)),p){var g=p[m];if(Array.isArray(g))for(var v=0;v<g.length;v++)f.append(m,g[v]);else f.append(m,g)}}var y,O=h(t,!0);try{for(O.s();!(y=O.n()).done;){var b=y.value;this.emit("sending",b,s,f)}}catch(t){O.e(t)}finally{O.f()}this.options.uploadMultiple&&this.emit("sendingmultiple",t,s,f),this._addFormElementData(f);for(var x=0;x<e.length;x++){var w=e[x];f.append(w.name,w.data,w.filename)}this.submitRequest(s,f,t)}},{key:"_transformFiles",value:function(t,e){for(var i=this,n=[],o=0,s=function(s){i.options.transformFile.call(i,t[s],function(i){n[s]=i,++o===t.length&&e(n)})},r=0;r<t.length;r++)s(r)}},{key:"_addFormElementData",value:function(t){if("FORM"===this.element.tagName){var e,i=h(this.element.querySelectorAll("input, textarea, select, button"),!0);try{for(i.s();!(e=i.n()).done;){var n=e.value,o=n.getAttribute("name"),s=n.getAttribute("type");if(s&&(s=s.toLowerCase()),null!=o)if("SELECT"===n.tagName&&n.hasAttribute("multiple")){var r,a=h(n.options,!0);try{for(a.s();!(r=a.n()).done;){var l=r.value;l.selected&&t.append(o,l.value)}}catch(t){a.e(t)}finally{a.f()}}else(!s||"checkbox"!==s&&"radio"!==s||n.checked)&&t.append(o,n.value)}}catch(t){i.e(t)}finally{i.f()}}}},{key:"_updateFilesUploadProgress",value:function(t,e,i){if(t[0].upload.chunked){var n=t[0],o=this._getChunk(n,e);i?(o.progress=100*i.loaded/i.total,o.total=i.total,o.bytesSent=i.loaded):(o.progress=100,o.bytesSent=o.total),n.upload.progress=0,n.upload.total=0,n.upload.bytesSent=0;for(var s=0;s<n.upload.totalChunkCount;s++)n.upload.chunks[s]&&void 0!==n.upload.chunks[s].progress&&(n.upload.progress+=n.upload.chunks[s].progress,n.upload.total+=n.upload.chunks[s].total,n.upload.bytesSent+=n.upload.chunks[s].bytesSent);n.upload.progress=n.upload.progress/n.upload.totalChunkCount,this.emit("uploadprogress",n,n.upload.progress,n.upload.bytesSent)}else{var r,a=h(t,!0);try{for(a.s();!(r=a.n()).done;){var l=r.value;l.upload.total&&l.upload.bytesSent&&l.upload.bytesSent==l.upload.total||(i?(l.upload.progress=100*i.loaded/i.total,l.upload.total=i.total,l.upload.bytesSent=i.loaded):(l.upload.progress=100,l.upload.bytesSent=l.upload.total),this.emit("uploadprogress",l,l.upload.progress,l.upload.bytesSent))}}catch(t){a.e(t)}finally{a.f()}}}},{key:"_finishedUploading",value:function(t,e,n){var o;if(t[0].status!==i.CANCELED&&4===e.readyState){if("arraybuffer"!==e.responseType&&"blob"!==e.responseType&&(o=e.responseText,e.getResponseHeader("content-type")&&~e.getResponseHeader("content-type").indexOf("application/json")))try{o=JSON.parse(o)}catch(t){n=t,o="Invalid JSON response from server."}this._updateFilesUploadProgress(t,e),200<=e.status&&e.status<300?t[0].upload.chunked?t[0].upload.finishedChunkUpload(this._getChunk(t[0],e),o):this._finished(t,o,n):this._handleUploadError(t,e,o)}}},{key:"_handleUploadError",value:function(t,e,n){if(t[0].status!==i.CANCELED){if(t[0].upload.chunked&&this.options.retryChunks){var o=this._getChunk(t[0],e);if(o.retries++<this.options.retryChunksLimit)return void this._uploadData(t,[o.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(t,n||this.options.dictResponseError.replace("{{statusCode}}",e.status),e)}}},{key:"submitRequest",value:function(t,e,i){1==t.readyState?t.send(e):console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.")}},{key:"_finished",value:function(t,e,n){var o,s=h(t,!0);try{for(s.s();!(o=s.n()).done;){var r=o.value;r.status=i.SUCCESS,this.emit("success",r,e,n),this.emit("complete",r)}}catch(t){s.e(t)}finally{s.f()}if(this.options.uploadMultiple&&(this.emit("successmultiple",t,e,n),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(t,e,n){var o,s=h(t,!0);try{for(s.s();!(o=s.n()).done;){var r=o.value;r.status=i.ERROR,this.emit("error",r,e,n),this.emit("complete",r)}}catch(t){s.e(t)}finally{s.f()}if(this.options.uploadMultiple&&(this.emit("errormultiple",t,e,n),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"initClass",value:function(){this.prototype.Emitter=s,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];for(var o=0,s=i;o<s.length;o++){var r=s[o];for(var a in r){var l=r[a];t[a]=l}}return t}},{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}}]),i}(s);b.initClass(),b.version="5.9.3",b.options={},b.optionsForElement=function(t){return t.getAttribute("id")?b.options[w(t.getAttribute("id"))]:void 0},b.instances=[],b.forElement=function(t){if("string"==typeof t&&(t=document.querySelector(t)),null==(null!=t?t.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return t.dropzone},b.autoDiscover=!0,b.discover=function(){var t;if(document.querySelectorAll)t=document.querySelectorAll(".dropzone");else{t=[];var e=function(e){return function(){var i,n=[],o=h(e,!0);try{for(o.s();!(i=o.n()).done;){var s=i.value;/(^| )dropzone($| )/.test(s.className)?n.push(t.push(s)):n.push(void 0)}}catch(t){o.e(t)}finally{o.f()}return n}()};e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))}return function(){var e,i=[],n=h(t,!0);try{for(n.s();!(e=n.n()).done;){var o=e.value;!1!==b.optionsForElement(o)?i.push(new b(o)):i.push(void 0)}}catch(t){n.e(t)}finally{n.f()}return i}()},b.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],b.isBrowserSupported=function(){var t=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){void 0!==b.blacklistedBrowsers&&(b.blockedBrowsers=b.blacklistedBrowsers);var e,i=h(b.blockedBrowsers,!0);try{for(i.s();!(e=i.n()).done;)e.value.test(navigator.userAgent)&&(t=!1)}catch(t){i.e(t)}finally{i.f()}}else t=!1;else t=!1;return t},b.dataURItoBlob=function(t){for(var e=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),o=new Uint8Array(n),s=0,r=e.length,a=0<=r;a?s<=r:s>=r;a?s++:s--)o[s]=e.charCodeAt(s);return new Blob([n],{type:i})};var x=function(t,e){return t.filter(function(t){return t!==e}).map(function(t){return t})},w=function(t){return t.replace(/[\-_](\w)/g,function(t){return t.charAt(1).toUpperCase()})};b.createElement=function(t){var e=document.createElement("div");return e.innerHTML=t,e.childNodes[0]},b.elementInside=function(t,e){if(t===e)return!0;for(;t=t.parentNode;)if(t===e)return!0;return!1},b.getElement=function(t,e){var i;if("string"==typeof t?i=document.querySelector(t):null!=t.nodeType&&(i=t),null==i)throw new Error("Invalid `".concat(e,"` option provided. Please provide a CSS selector or a plain HTML element."));return i},b.getElements=function(t,e){var i,n;if(t instanceof Array){n=[];try{var o,s=h(t,!0);try{for(s.s();!(o=s.n()).done;)i=o.value,n.push(this.getElement(i,e))}catch(t){s.e(t)}finally{s.f()}}catch(t){n=null}}else if("string"==typeof t){n=[];var r,a=h(document.querySelectorAll(t),!0);try{for(a.s();!(r=a.n()).done;)i=r.value,n.push(i)}catch(t){a.e(t)}finally{a.f()}}else null!=t.nodeType&&(n=[t]);if(null==n||!n.length)throw new Error("Invalid `".concat(e,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return n},b.confirm=function(t,e,i){return window.confirm(t)?e():null!=i?i():void 0},b.isValidFile=function(t,e){if(!e)return!0;e=e.split(",");var i,n=t.type,o=n.replace(/\/.*$/,""),s=h(e,!0);try{for(s.s();!(i=s.n()).done;){var r=i.value;if("."===(r=r.trim()).charAt(0)){if(-1!==t.name.toLowerCase().indexOf(r.toLowerCase(),t.name.length-r.length))return!0}else if(/\/\*$/.test(r)){if(o===r.replace(/\/.*$/,""))return!0}else if(n===r)return!0}}catch(t){s.e(t)}finally{s.f()}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(t){return this.each(function(){return new b(this,t)})}),b.ADDED="added",b.QUEUED="queued",b.ACCEPTED=b.QUEUED,b.UPLOADING="uploading",b.PROCESSING=b.UPLOADING,b.CANCELED="canceled",b.ERROR="error",b.SUCCESS="success";var _=function(t,e,i,n,o,s,r,a,l,c){var h=function(t){t.naturalWidth;var e=t.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=e;var n=i.getContext("2d");n.drawImage(t,0,0);for(var o=n.getImageData(1,0,1,e).data,s=0,r=e,a=e;a>s;)0===o[4*(a-1)+3]?r=a:s=a,a=r+s>>1;var l=a/e;return 0===l?1:l}(e);return t.drawImage(e,i,n,o,s,r,a,l,c/h)},S=function(){function t(){d(this,t)}return p(t,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(t){for(var e="",i=void 0,n=void 0,o="",s=void 0,r=void 0,a=void 0,l="",c=0;s=(i=t[c++])>>2,r=(3&i)<<4|(n=t[c++])>>4,a=(15&n)<<2|(o=t[c++])>>6,l=63&o,isNaN(n)?a=l=64:isNaN(o)&&(l=64),e=e+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l),i=n=o="",s=r=a=l="",c<t.length;);return e}},{key:"restore",value:function(t,e){if(!t.match("data:image/jpeg;base64,"))return e;var i=this.decode64(t.replace("data:image/jpeg;base64,","")),n=this.slice2Segments(i),o=this.exifManipulation(e,n);return"data:image/jpeg;base64,".concat(this.encode64(o))}},{key:"exifManipulation",value:function(t,e){var i=this.getExifArray(e),n=this.insertExif(t,i);return new Uint8Array(n)}},{key:"getExifArray",value:function(t){for(var e=void 0,i=0;i<t.length;){if(255===(e=t[i])[0]&225===e[1])return e;i++}return[]}},{key:"insertExif",value:function(t,e){var i=t.replace("data:image/jpeg;base64,",""),n=this.decode64(i),o=n.indexOf(255,3),s=n.slice(0,o),r=n.slice(o),a=s;return a=(a=a.concat(e)).concat(r)}},{key:"slice2Segments",value:function(t){for(var e=0,i=[];!(255===t[e]&218===t[e+1]);){if(255===t[e]&216===t[e+1])e+=2;else{var n=e+(256*t[e+2]+t[e+3])+2,o=t.slice(e,n);i.push(o),e=n}if(e>t.length)break}return i}},{key:"decode64",value:function(t){var e=void 0,i=void 0,n="",o=void 0,s=void 0,r="",a=0,l=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(t)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");e=this.KEY_STR.indexOf(t.charAt(a++))<<2|(o=this.KEY_STR.indexOf(t.charAt(a++)))>>4,i=(15&o)<<4|(s=this.KEY_STR.indexOf(t.charAt(a++)))>>2,n=(3&s)<<6|(r=this.KEY_STR.indexOf(t.charAt(a++))),l.push(e),64!==s&&l.push(i),64!==r&&l.push(n),e=i=n="",o=s=r="",a<t.length;);return l}}]),t}();S.initClass(),b._autoDiscoverFunction=function(){if(b.autoDiscover)return b.discover()},function(t,e){var i=!1,n=!0,o=t.document,s=o.documentElement,r=o.addEventListener?"addEventListener":"attachEvent",a=o.addEventListener?"removeEventListener":"detachEvent",l=o.addEventListener?"":"on",c=function n(s){if("readystatechange"!==s.type||"complete"===o.readyState)return("load"===s.type?t:o)[a](l+s.type,n,!1),!i&&(i=!0)?e.call(t,s.type||s):void 0};if("complete"!==o.readyState){if(o.createEventObject&&s.doScroll){try{n=!t.frameElement}catch(t){}n&&function t(){try{s.doScroll("left")}catch(e){return void setTimeout(t,50)}return c("poll")}()}o[r](l+"DOMContentLoaded",c,!1),o[r](l+"readystatechange",c,!1),t[r](l+"load",c,!1)}}(window,b._autoDiscoverFunction),window.Dropzone=b;var k=b}(),n}()},t.exports=e()},2661:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(4227),s={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:e}})=>void 0===e?n.str`must contain at least ${t} valid item(s)`:n.str`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>void 0===e?n._`{minContains: ${t}}`:n._`{minContains: ${t}, maxContains: ${e}}`},code(t){const{gen:e,schema:i,parentSchema:s,data:r,it:a}=t;let l,c;const{minContains:h,maxContains:u}=s;a.opts.next?(l=void 0===h?1:h,c=u):l=1;const d=e.const("len",n._`${r}.length`);if(t.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void t.fail();if((0,o.alwaysValidSchema)(a,i)){let e=n._`${d} >= ${l}`;return void 0!==c&&(e=n._`${e} && ${d} <= ${c}`),void t.pass(e)}a.items=!0;const f=e.name("valid");function p(){const t=e.name("_valid"),i=e.let("count",0);m(t,()=>e.if(t,()=>function(t){e.code(n._`${t}++`),void 0===c?e.if(n._`${t} >= ${l}`,()=>e.assign(f,!0).break()):(e.if(n._`${t} > ${c}`,()=>e.assign(f,!1).break()),1===l?e.assign(f,!0):e.if(n._`${t} >= ${l}`,()=>e.assign(f,!0)))}(i)))}function m(i,n){e.forRange("i",0,d,e=>{t.subschema({keyword:"contains",dataProp:e,dataPropType:o.Type.Num,compositeRule:!0},i),n()})}void 0===c&&1===l?m(f,()=>e.if(f,()=>e.break())):0===l?(e.let(f,!0),void 0!==c&&e.if(n._`${r}.length > 0`,p)):(e.let(f,!1),p()),t.result(f,()=>t.reset())}};e.default=s},3025:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const n=i(9029),o=i(4227),s=i(5765);e.error={message:({params:{property:t,depsCount:e,deps:i}})=>{const o=1===e?"property":"properties";return n.str`must have ${o} ${i} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:i,missingProperty:o}})=>n._`{property: ${t},
69
+ missingProperty: ${o},
70
+ depsCount: ${e},
71
+ deps: ${i}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(t){const[e,i]=function({schema:t}){const e={},i={};for(const n in t){if("__proto__"===n)continue;(Array.isArray(t[n])?e:i)[n]=t[n]}return[e,i]}(t);a(t,e),l(t,i)}};function a(t,e=t.schema){const{gen:i,data:o,it:r}=t;if(0===Object.keys(e).length)return;const a=i.let("missing");for(const l in e){const c=e[l];if(0===c.length)continue;const h=(0,s.propertyInData)(i,o,l,r.opts.ownProperties);t.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),r.allErrors?i.if(h,()=>{for(const e of c)(0,s.checkReportMissingProp)(t,e)}):(i.if(n._`${h} && (${(0,s.checkMissingProp)(t,c,a)})`),(0,s.reportMissingProp)(t,a),i.else())}}function l(t,e=t.schema){const{gen:i,data:n,keyword:r,it:a}=t,l=i.name("valid");for(const c in e)(0,o.alwaysValidSchema)(a,e[c])||(i.if((0,s.propertyInData)(i,n,c,a.opts.ownProperties),()=>{const e=t.subschema({keyword:r,schemaProp:c},l);t.mergeValidEvaluated(e,l)},()=>i.var(l,!0)),t.ok(l))}e.validatePropertyDeps=a,e.validateSchemaDeps=l,e.default=r},3036:t=>{if("undefined"!=typeof Element&&!Element.prototype.matches){var e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},3053:function(t,e){var i;!function(n){"use strict";var o=":not(:disabled):not(.ajs-reset)",s=13,r=27,a=112,l=123,c=37,h=39,u=9,d={autoReset:!0,basic:!1,closable:!0,closableByDimmer:!0,invokeOnCloseOff:!1,frameless:!1,defaultFocusOff:!1,maintainFocus:!0,maximizable:!0,modal:!0,movable:!0,moveBounded:!1,overflow:!0,padding:!0,pinnable:!0,pinned:!0,preventBodyShift:!1,resizable:!0,startMaximized:!1,transition:"pulse",transitionOff:!1,tabbable:["button","[href]","input","select","textarea",'[tabindex]:not([tabindex^="-"])'+o].join(o+","),notifier:{delay:5,position:"bottom-right",closeButton:!1,classes:{base:"alertify-notifier",prefix:"ajs-",message:"ajs-message",top:"ajs-top",right:"ajs-right",bottom:"ajs-bottom",left:"ajs-left",center:"ajs-center",visible:"ajs-visible",hidden:"ajs-hidden",close:"ajs-close"}},glossary:{title:"AlertifyJS",ok:"OK",cancel:"Cancel",acccpt:"Accept",deny:"Deny",confirm:"Confirm",decline:"Decline",close:"Close",maximize:"Maximize",restore:"Restore"},theme:{input:"ajs-input",ok:"ajs-ok",cancel:"ajs-cancel"},hooks:{preinit:function(){},postinit:function(){}}},f=[];function p(t,e){t.className+=" "+e}function m(t,e){for(var i=t.className.split(" "),n=e.split(" "),o=0;o<n.length;o+=1){var s=i.indexOf(n[o]);s>-1&&i.splice(s,1)}t.className=i.join(" ")}function g(){return"rtl"===n.getComputedStyle(document.body).direction}function v(){return document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}function y(){return document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft}function O(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function b(t){return"[object String]"===Object.prototype.toString.call(t)}function x(t){if(null===t)return t;var e;if(Array.isArray(t)){e=[];for(var i=0;i<t.length;i+=1)e.push(x(t[i]));return e}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return(e=new RegExp(t.source)).global=t.global,e.ignoreCase=t.ignoreCase,e.multiline=t.multiline,e.lastIndex=t.lastIndex,e;if("object"==typeof t){for(var n in e={},t)t.hasOwnProperty(n)&&(e[n]=x(t[n]));return e}return t}function w(t,e){if(t.elements){var i=t.elements.root;i.parentNode.removeChild(i),delete t.elements,t.settings=x(t.__settings),t.__init=e,delete t.__internal}}var _=!1;try{var S=Object.defineProperty({},"passive",{get:function(){_=!0}});n.addEventListener("test",S,S),n.removeEventListener("test",S,S)}catch(t){}var k=function(t,e,i,n,o){t.addEventListener(e,i,_?{capture:n,passive:o}:!0===n)},$=function(t,e,i,n,o){t.removeEventListener(e,i,_?{capture:n,passive:o}:!0===n)},T=function(){var t,e,i=!1,n={animation:"animationend",OAnimation:"oAnimationEnd oanimationend",msAnimation:"MSAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in n)if(void 0!==document.documentElement.style[t]){e=n[t],i=!0;break}return{type:e,supported:i}}();function C(t,e){return function(){if(arguments.length>0){for(var i=[],n=0;n<arguments.length;n+=1)i.push(arguments[n]);return i.push(t),e.apply(t,i)}return e.apply(t,[null,t])}}function P(t,e){return{index:t,button:e,cancel:!1}}function E(t,e){if("function"==typeof e.get(t))return e.get(t).call(e)}var A=function(){var t,e,i=[],o=!1,s=n.navigator.userAgent.indexOf("Safari")>-1&&n.navigator.userAgent.indexOf("Chrome")<0,_='<div class="ajs-dimmer"></div>',S='<div class="ajs-modal" tabindex="0"></div>',A='<div class="ajs-dialog" tabindex="0"></div>',M='<button class="ajs-reset"></button>',D='<div class="ajs-commands"><button class="ajs-pin"></button><button class="ajs-maximize"></button><button class="ajs-close"></button></div>',R='<div class="ajs-header"></div>',I='<div class="ajs-body"></div>',L='<div class="ajs-content"></div>',N='<div class="ajs-footer"></div>',j={primary:'<div class="ajs-primary ajs-buttons"></div>',auxiliary:'<div class="ajs-auxiliary ajs-buttons"></div>'},z='<button class="ajs-button"></button>',B='<div class="ajs-handle"></div>',Z="ajs-in",W="ajs-out",F="alertify",X="ajs-basic",q="ajs-capture",H="ajs-closable",V="ajs-fixed",Y="ajs-frameless",U="ajs-hidden",G="ajs-maximized",K="ajs-maximizable",J="ajs-modeless",tt="ajs-movable",et="ajs-no-selection",it="ajs-no-overflow",nt="ajs-no-padding",ot="ajs-pinnable",st="ajs-",rt="ajs-resizable",at="ajs-shake",lt="ajs-unpinned",ct="ajs-no-transition";function ht(t){if(!t.__internal){var e;Q.defaults.hooks.preinit(t),delete t.__init,t.__settings||(t.__settings=x(t.settings)),"function"==typeof t.setup?((e=t.setup()).options=e.options||{},e.focus=e.focus||{}):e={buttons:[],focus:{element:null,select:!1},options:{}},"object"!=typeof t.hooks&&(t.hooks={});var n=[];if(Array.isArray(e.buttons))for(var o=0;o<e.buttons.length;o+=1){var s=e.buttons[o],r={};for(var a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);n.push(r)}var l=t.__internal={isOpen:!1,activeElement:document.body,timerIn:void 0,timerOut:void 0,buttons:n,focus:e.focus,options:{title:void 0,modal:void 0,basic:void 0,frameless:void 0,defaultFocusOff:void 0,pinned:void 0,movable:void 0,moveBounded:void 0,resizable:void 0,autoReset:void 0,closable:void 0,closableByDimmer:void 0,invokeOnCloseOff:void 0,maximizable:void 0,startMaximized:void 0,pinnable:void 0,transition:void 0,transitionOff:void 0,padding:void 0,overflow:void 0,onshow:void 0,onclosing:void 0,onclose:void 0,onfocus:void 0,onmove:void 0,onmoved:void 0,onresize:void 0,onresized:void 0,onmaximize:void 0,onmaximized:void 0,onrestore:void 0,onrestored:void 0},resetHandler:void 0,beginMoveHandler:void 0,beginResizeHandler:void 0,bringToFrontHandler:void 0,modalClickHandler:void 0,buttonsClickHandler:void 0,commandsClickHandler:void 0,transitionInHandler:void 0,transitionOutHandler:void 0,destroy:void 0},c={};c.root=document.createElement("div"),c.root.style.display="none",c.root.className=F+" "+U+" ",c.root.innerHTML=_+S,c.dimmer=c.root.firstChild,c.modal=c.root.lastChild,c.modal.innerHTML=A,c.dialog=c.modal.firstChild,c.dialog.innerHTML=M+D+R+I+N+B+M,c.reset=[],c.reset.push(c.dialog.firstChild),c.reset.push(c.dialog.lastChild),c.commands={},c.commands.container=c.reset[0].nextSibling,c.commands.pin=c.commands.container.firstChild,c.commands.maximize=c.commands.pin.nextSibling,c.commands.close=c.commands.maximize.nextSibling,c.header=c.commands.container.nextSibling,c.body=c.header.nextSibling,c.body.innerHTML=L,c.content=c.body.firstChild,c.footer=c.body.nextSibling,c.footer.innerHTML=j.auxiliary+j.primary,c.resizeHandle=c.footer.nextSibling,c.buttons={},c.buttons.auxiliary=c.footer.firstChild,c.buttons.primary=c.buttons.auxiliary.nextSibling,c.buttons.primary.innerHTML=z,c.buttonTemplate=c.buttons.primary.firstChild,c.buttons.primary.removeChild(c.buttonTemplate);for(var h=0;h<t.__internal.buttons.length;h+=1){var u=t.__internal.buttons[h];for(var d in i.indexOf(u.key)<0&&i.push(u.key),u.element=c.buttonTemplate.cloneNode(),u.element.innerHTML=u.text,"string"==typeof u.className&&""!==u.className&&p(u.element,u.className),u.attrs)"className"!==d&&u.attrs.hasOwnProperty(d)&&u.element.setAttribute(d,u.attrs[d]);"auxiliary"===u.scope?c.buttons.auxiliary.appendChild(u.element):c.buttons.primary.appendChild(u.element)}for(var f in t.elements=c,l.resetHandler=C(t,Nt),l.beginMoveHandler=C(t,Jt),l.beginResizeHandler=C(t,le),l.bringToFrontHandler=C(t,gt),l.modalClickHandler=C(t,Et),l.buttonsClickHandler=C(t,Dt),l.commandsClickHandler=C(t,bt),l.transitionInHandler=C(t,Bt),l.transitionOutHandler=C(t,Zt),l.options)void 0!==e.options[f]?t.set(f,e.options[f]):Q.defaults.hasOwnProperty(f)?t.set(f,Q.defaults[f]):"title"===f&&t.set(f,Q.defaults.glossary[f]);"function"==typeof t.build&&t.build(),Q.defaults.hooks.postinit(t)}document.body.appendChild(t.elements.root)}function ut(){n.scrollTo(t,e)}function dt(){for(var t=0,e=0;e<f.length;e+=1){var i=f[e];(i.isModal()||i.isMaximized())&&(t+=1)}0===t&&document.body.className.indexOf(it)>=0?(m(document.body,it),mt(!1)):t>0&&document.body.className.indexOf(it)<0&&(mt(!0),p(document.body,it))}var ft="",pt=0;function mt(t){Q.defaults.preventBodyShift&&(t&&document.documentElement.scrollHeight>document.documentElement.clientHeight?(pt=e,ft=n.getComputedStyle(document.body).top,p(document.body,V),document.body.style.top=-e+"px"):t||(e=pt,document.body.style.top=ft,m(document.body,V),ut()))}function gt(t,e){for(var i=f.indexOf(e)+1;i<f.length;i+=1)if(f[i].isModal())return;return document.body.lastChild!==e.elements.root&&(document.body.appendChild(e.elements.root),f.splice(f.indexOf(e),1),f.push(e),Lt(e)),!1}function vt(t,e,i,n){switch(e){case"title":t.setHeader(n);break;case"modal":!function(t){t.get("modal")?(m(t.elements.root,J),t.isOpen()&&(pe(t),Tt(t),dt())):(p(t.elements.root,J),t.isOpen()&&(fe(t),Tt(t),dt()))}(t);break;case"basic":!function(t){t.get("basic")?p(t.elements.root,X):m(t.elements.root,X)}(t);break;case"frameless":!function(t){t.get("frameless")?p(t.elements.root,Y):m(t.elements.root,Y)}(t);break;case"pinned":!function(t){t.get("pinned")?(m(t.elements.root,lt),t.isOpen()&&$t(t)):(p(t.elements.root,lt),t.isOpen()&&!t.isModal()&&kt(t))}(t);break;case"closable":!function(t){t.get("closable")?(p(t.elements.root,H),function(t){k(t.elements.modal,"click",t.__internal.modalClickHandler)}(t)):(m(t.elements.root,H),function(t){$(t.elements.modal,"click",t.__internal.modalClickHandler)}(t))}(t);break;case"maximizable":!function(t){t.get("maximizable")?p(t.elements.root,K):m(t.elements.root,K)}(t);break;case"pinnable":!function(t){t.get("pinnable")?p(t.elements.root,ot):m(t.elements.root,ot)}(t);break;case"movable":!function(t){t.get("movable")?(p(t.elements.root,tt),t.isOpen()&&me(t)):(ie(t),m(t.elements.root,tt),t.isOpen()&&ge(t))}(t);break;case"resizable":!function(t){t.get("resizable")?(p(t.elements.root,rt),t.isOpen()&&ve(t)):(ue(t),m(t.elements.root,rt),t.isOpen()&&ye(t))}(t);break;case"padding":n?m(t.elements.root,nt):t.elements.root.className.indexOf(nt)<0&&p(t.elements.root,nt);break;case"overflow":n?m(t.elements.root,it):t.elements.root.className.indexOf(it)<0&&p(t.elements.root,it);break;case"transition":!function(t,e,i){b(i)&&m(t.elements.root,st+i),p(t.elements.root,st+e),t.elements.root.offsetWidth}(t,n,i);break;case"transitionOff":!function(t){t.get("transitionOff")?p(t.elements.root,ct):m(t.elements.root,ct)}(t)}"function"==typeof t.hooks.onupdate&&t.hooks.onupdate.call(t,e,i,n)}function yt(t,e,i,n,o){var s,r={op:void 0,items:[]};if(void 0===o&&"string"==typeof n)r.op="get",e.hasOwnProperty(n)?(r.found=!0,r.value=e[n]):(r.found=!1,r.value=void 0);else if(r.op="set","object"==typeof n){var a=n;for(var l in a)e.hasOwnProperty(l)?(e[l]!==a[l]&&(s=e[l],e[l]=a[l],i.call(t,l,s,a[l])),r.items.push({key:l,value:a[l],found:!0})):r.items.push({key:l,value:a[l],found:!1})}else{if("string"!=typeof n)throw new Error("args must be a string or object");e.hasOwnProperty(n)?(e[n]!==o&&(s=e[n],e[n]=o,i.call(t,n,s,o)),r.items.push({key:n,value:o,found:!0})):r.items.push({key:n,value:o,found:!1})}return r}function Ot(t){var e;Qt(t,function(i){return e=!0!==t.get("invokeOnCloseOff")&&!0===i.invokeOnClose}),!e&&t.isOpen()&&t.close()}function bt(t,e){switch(t.srcElement||t.target){case e.elements.commands.pin:e.isPinned()?wt(e):xt(e);break;case e.elements.commands.maximize:e.isMaximized()?St(e):_t(e);break;case e.elements.commands.close:Ot(e)}return!1}function xt(t){t.set("pinned",!0)}function wt(t){t.set("pinned",!1)}function _t(t){E("onmaximize",t),p(t.elements.root,G),t.isOpen()&&dt(),E("onmaximized",t)}function St(t){E("onrestore",t),m(t.elements.root,G),t.isOpen()&&dt(),E("onrestored",t)}function kt(t){var e=y();t.elements.modal.style.marginTop=v()+"px",t.elements.modal.style.marginLeft=e+"px",t.elements.modal.style.marginRight=-e+"px"}function $t(t){var e=parseInt(t.elements.modal.style.marginTop,10),i=parseInt(t.elements.modal.style.marginLeft,10);if(t.elements.modal.style.marginTop="",t.elements.modal.style.marginLeft="",t.elements.modal.style.marginRight="",t.isOpen()){var n=0,o=0;""!==t.elements.dialog.style.top&&(n=parseInt(t.elements.dialog.style.top,10)),t.elements.dialog.style.top=n+(e-v())+"px",""!==t.elements.dialog.style.left&&(o=parseInt(t.elements.dialog.style.left,10)),t.elements.dialog.style.left=o+(i-y())+"px"}}function Tt(t){t.get("modal")||t.get("pinned")?$t(t):kt(t)}var Ct=!1,Pt=0;function Et(t,e){if(t.timeStamp-Pt>200&&(Pt=t.timeStamp)&&!Ct){var i=t.srcElement||t.target;!0===e.get("closableByDimmer")&&i===e.elements.modal&&Ot(e)}Ct=!1}var At=0,Mt=!1;function Qt(t,e){if(Date.now()-At>200&&(At=Date.now()))for(var i=0;i<t.__internal.buttons.length;i+=1){var n=t.__internal.buttons[i];if(!n.element.disabled&&e(n)){var o=P(i,n);"function"==typeof t.callback&&t.callback.apply(t,[o]),!1===o.cancel&&t.close();break}}}function Dt(t,e){var i=t.srcElement||t.target;Qt(e,function(t){return t.element.contains(i)&&(Mt=!0)})}function Rt(t){if(!Mt){var e=f[f.length-1],n=t.keyCode;return 0===e.__internal.buttons.length&&n===r&&!0===e.get("closable")?(Ot(e),!1):i.indexOf(n)>-1?(Qt(e,function(t){return t.key===n}),!1):void 0}Mt=!1}function It(t){var e=f[f.length-1],n=t.keyCode;if(n===c||n===h){for(var o=e.__internal.buttons,s=0;s<o.length;s+=1)if(document.activeElement===o[s].element)switch(n){case c:return void o[(s||o.length)-1].element.focus();case h:return void o[(s+1)%o.length].element.focus()}}else if(n<l+1&&n>a-1&&i.indexOf(n)>-1)return t.preventDefault(),t.stopPropagation(),Qt(e,function(t){return t.key===n}),!1}function Lt(t,e){if(e)e.focus();else{var i=t.__internal.focus,n=i.element;switch(typeof i.element){case"number":t.__internal.buttons.length>i.element&&(n=!0===t.get("basic")?t.elements.reset[0]:t.__internal.buttons[i.element].element);break;case"string":n=t.elements.body.querySelector(i.element);break;case"function":n=i.element.call(t)}(!0===t.get("defaultFocusOff")||null==n&&0===t.__internal.buttons.length)&&(n=t.elements.reset[0]),n&&n.focus&&(n.focus(),i.select&&n.select&&n.select())}}function Nt(t,e){if(!e)for(var i=f.length-1;i>-1;i-=1)if(f[i].isModal()){e=f[i];break}if(e&&e.isModal()){var n,o=e.elements.reset[0],s=e.elements.reset[1],r=t.relatedTarget,a=e.elements.root.contains(r),l=t.srcElement||t.target;if(l===o&&!a||l===s&&r===o)return;l===s||l===document.body?n=o:l===o&&r===s?n=jt(e):l===o&&a&&(n=jt(e,!0)),Lt(e,n)}}function jt(t,e){var i=[].slice.call(t.elements.dialog.querySelectorAll(d.tabbable));e&&i.reverse();for(var n=0;n<i.length;n+=1){var o=i[n];if(o.offsetParent||o.offsetWidth||o.offsetHeight||o.getClientRects().length)return o}}function zt(t){var e=f[f.length-1];e&&t.shiftKey&&t.keyCode===u&&e.elements.reset[1].focus()}function Bt(t,e){clearTimeout(e.__internal.timerIn),Lt(e),Mt=!1,E("onfocus",e),$(e.elements.dialog,T.type,e.__internal.transitionInHandler),m(e.elements.root,Z)}function Zt(t,e){clearTimeout(e.__internal.timerOut),$(e.elements.dialog,T.type,e.__internal.transitionOutHandler),ie(e),ue(e),e.isMaximized()&&!e.get("startMaximized")&&St(e),"function"==typeof e.__internal.destroy&&e.__internal.destroy.apply(e)}var Wt=null,Ft=0,Xt=0,qt="pageX",Ht="pageY",Vt=null,Yt=!1,Ut=null;function Gt(t,e){var i=t[qt]-Ft,n=t[Ht]-Xt;Yt&&(n-=document.body.scrollTop),e.style.left=i+"px",e.style.top=n+"px"}function Kt(t,e){var i=t[qt]-Ft,n=t[Ht]-Xt;Yt&&(n-=document.body.scrollTop),e.style.left=Math.min(Vt.maxLeft,Math.max(Vt.minLeft,i))+"px",e.style.top=Yt?Math.min(Vt.maxTop,Math.max(Vt.minTop,n))+"px":Math.max(Vt.minTop,n)+"px"}function Jt(t,e){if(null===ne&&!e.isMaximized()&&e.get("movable")){var i,n=0,o=0;if("touchstart"===t.type?(t.preventDefault(),i=t.targetTouches[0],qt="clientX",Ht="clientY"):0===t.button&&(i=t),i){var s=e.elements.dialog;if(p(s,q),s.style.left&&(n=parseInt(s.style.left,10)),s.style.top&&(o=parseInt(s.style.top,10)),Ft=i[qt]-n,Xt=i[Ht]-o,e.isModal()?Xt+=e.elements.modal.scrollTop:e.isPinned()&&(Xt-=document.body.scrollTop),e.get("moveBounded")){var r=s,a=-n,l=-o;do{a+=r.offsetLeft,l+=r.offsetTop}while(r=r.offsetParent);Vt={maxLeft:a,minLeft:-a,maxTop:document.documentElement.clientHeight-s.clientHeight-l,minTop:-l},Ut=Kt}else Vt=null,Ut=Gt;return E("onmove",e),Yt=!e.isModal()&&e.isPinned(),Wt=e,Ut(i,s),p(document.body,et),!1}}}function te(t){var e;Wt&&("touchmove"===t.type?(t.preventDefault(),e=t.targetTouches[0]):0===t.button&&(e=t),e&&Ut(e,Wt.elements.dialog))}function ee(){if(Wt){var t=Wt;Wt=Vt=null,m(document.body,et),m(t.elements.dialog,q),E("onmoved",t)}}function ie(t){Wt=null;var e=t.elements.dialog;e.style.left=e.style.top=""}var ne=null,oe=Number.Nan,se=0,re=0,ae=0;function le(t,e){var i;if(!e.isMaximized()&&("touchstart"===t.type?(t.preventDefault(),i=t.targetTouches[0]):0===t.button&&(i=t),i)){E("onresize",e),ne=e,ae=e.elements.resizeHandle.offsetHeight/2;var n=e.elements.dialog;return p(n,q),oe=parseInt(n.style.left,10),n.style.height=n.offsetHeight+"px",n.style.minHeight=e.elements.header.offsetHeight+e.elements.footer.offsetHeight+"px",n.style.width=(se=n.offsetWidth)+"px","none"!==n.style.maxWidth&&(n.style.minWidth=(re=n.offsetWidth)+"px"),n.style.maxWidth="none",p(document.body,et),!1}}function ce(t){var e;ne&&("touchmove"===t.type?(t.preventDefault(),e=t.targetTouches[0]):0===t.button&&(e=t),e&&function(t,e,i){var n,o,s=e,r=0,a=0;do{r+=s.offsetLeft,a+=s.offsetTop}while(s=s.offsetParent);!0===i?(n=t.pageX,o=t.pageY):(n=t.clientX,o=t.clientY);var l=g();if(l&&(n=document.body.offsetWidth-n,isNaN(oe)||(r=document.body.offsetWidth-r-e.offsetWidth)),e.style.height=o-a+ae+"px",e.style.width=n-r+ae+"px",!isNaN(oe)){var c=.5*Math.abs(e.offsetWidth-se);l&&(c*=-1),e.offsetWidth>se?e.style.left=oe+c+"px":e.offsetWidth>=re&&(e.style.left=oe-c+"px")}}(e,ne.elements.dialog,!ne.get("modal")&&!ne.get("pinned")))}function he(){if(ne){var t=ne;ne=null,m(document.body,et),m(t.elements.dialog,q),Ct=!0,E("onresized",t)}}function ue(t){ne=null;var e=t.elements.dialog;"none"===e.style.maxWidth&&(e.style.maxWidth=e.style.minWidth=e.style.width=e.style.height=e.style.minHeight=e.style.left="",oe=Number.Nan,se=re=ae=0)}function de(){for(var t=0;t<f.length;t+=1){var e=f[t];e.get("autoReset")&&(ie(e),ue(e))}}function fe(t){k(t.elements.dialog,"focus",t.__internal.bringToFrontHandler,!0)}function pe(t){$(t.elements.dialog,"focus",t.__internal.bringToFrontHandler,!0)}function me(t){k(t.elements.header,"mousedown",t.__internal.beginMoveHandler),k(t.elements.header,"touchstart",t.__internal.beginMoveHandler,!1,!1)}function ge(t){$(t.elements.header,"mousedown",t.__internal.beginMoveHandler),$(t.elements.header,"touchstart",t.__internal.beginMoveHandler,!1,!1)}function ve(t){k(t.elements.resizeHandle,"mousedown",t.__internal.beginResizeHandler),k(t.elements.resizeHandle,"touchstart",t.__internal.beginResizeHandler,!1,!1)}function ye(t){$(t.elements.resizeHandle,"mousedown",t.__internal.beginResizeHandler),$(t.elements.resizeHandle,"touchstart",t.__internal.beginResizeHandler,!1,!1)}return{__init:ht,isOpen:function(){return this.__internal.isOpen},isModal:function(){return this.elements.root.className.indexOf(J)<0},isMaximized:function(){return this.elements.root.className.indexOf(G)>-1},isPinned:function(){return this.elements.root.className.indexOf(lt)<0},maximize:function(){return this.isMaximized()||_t(this),this},restore:function(){return this.isMaximized()&&St(this),this},pin:function(){return this.isPinned()||xt(this),this},unpin:function(){return this.isPinned()&&wt(this),this},bringToFront:function(){return gt(0,this),this},moveTo:function(t,e){if(!isNaN(t)&&!isNaN(e)){E("onmove",this);var i=this.elements.dialog,n=i,o=0,s=0;i.style.left&&(o-=parseInt(i.style.left,10)),i.style.top&&(s-=parseInt(i.style.top,10));do{o+=n.offsetLeft,s+=n.offsetTop}while(n=n.offsetParent);var r=t-o,a=e-s;g()&&(r*=-1),i.style.left=r+"px",i.style.top=a+"px",E("onmoved",this)}return this},resizeTo:function(t,e){var i=parseFloat(t),n=parseFloat(e),o=/(\d*\.\d+|\d+)%/;if(!isNaN(i)&&!isNaN(n)&&!0===this.get("resizable")){E("onresize",this),(""+t).match(o)&&(i=i/100*document.documentElement.clientWidth),(""+e).match(o)&&(n=n/100*document.documentElement.clientHeight);var s=this.elements.dialog;"none"!==s.style.maxWidth&&(s.style.minWidth=(re=s.offsetWidth)+"px"),s.style.maxWidth="none",s.style.minHeight=this.elements.header.offsetHeight+this.elements.footer.offsetHeight+"px",s.style.width=i+"px",s.style.height=n+"px",E("onresized",this)}return this},setting:function(t,e){var i=this,n=yt(this,this.__internal.options,function(t,e,n){vt(i,t,e,n)},t,e);if("get"===n.op)return n.found?n.value:void 0!==this.settings?yt(this,this.settings,this.settingUpdated||function(){},t,e).value:void 0;if("set"===n.op){if(n.items.length>0)for(var o=this.settingUpdated||function(){},s=0;s<n.items.length;s+=1){var r=n.items[s];r.found||void 0===this.settings||yt(this,this.settings,o,r.key,r.value)}return this}},set:function(t,e){return this.setting(t,e),this},get:function(t){return this.setting(t)},setHeader:function(t){return b(t)?(O(this.elements.header),this.elements.header.innerHTML=t):t instanceof n.HTMLElement&&this.elements.header.firstChild!==t&&(O(this.elements.header),this.elements.header.appendChild(t)),this},setContent:function(t){return b(t)?(O(this.elements.content),this.elements.content.innerHTML=t):t instanceof n.HTMLElement&&this.elements.content.firstChild!==t&&(O(this.elements.content),this.elements.content.appendChild(t)),this},showModal:function(t){return this.show(!0,t)},show:function(i,r){if(ht(this),this.__internal.isOpen){ie(this),ue(this),p(this.elements.dialog,at);var a=this;setTimeout(function(){m(a.elements.dialog,at)},200)}else{if(this.__internal.isOpen=!0,f.push(this),Q.defaults.maintainFocus&&(this.__internal.activeElement=document.activeElement),document.body.hasAttribute("tabindex")||document.body.setAttribute("tabindex",o="0"),"function"==typeof this.prepare&&this.prepare(),c=this,1===f.length&&(k(n,"resize",de),k(document.body,"keyup",Rt),k(document.body,"keydown",It),k(document.body,"focus",Nt),k(document.documentElement,"mousemove",te),k(document.documentElement,"touchmove",te,!1,!1),k(document.documentElement,"mouseup",ee),k(document.documentElement,"touchend",ee),k(document.documentElement,"mousemove",ce),k(document.documentElement,"touchmove",ce,!1,!1),k(document.documentElement,"mouseup",he),k(document.documentElement,"touchend",he)),k(c.elements.commands.container,"click",c.__internal.commandsClickHandler),k(c.elements.footer,"click",c.__internal.buttonsClickHandler),k(c.elements.reset[0],"focusin",c.__internal.resetHandler),k(c.elements.reset[0],"keydown",zt),k(c.elements.reset[1],"focusin",c.__internal.resetHandler),Mt=!0,k(c.elements.dialog,T.type,c.__internal.transitionInHandler),c.get("modal")||fe(c),c.get("resizable")&&ve(c),c.get("movable")&&me(c),void 0!==i&&this.set("modal",i),t=y(),e=v(),dt(),"string"==typeof r&&""!==r&&(this.__internal.className=r,p(this.elements.root,r)),this.get("startMaximized")?this.maximize():this.isMaximized()&&St(this),Tt(this),this.elements.root.removeAttribute("style"),m(this.elements.root,W),p(this.elements.root,Z),clearTimeout(this.__internal.timerIn),this.__internal.timerIn=setTimeout(this.__internal.transitionInHandler,T.supported?1e3:100),s){var l=this.elements.root;l.style.display="none",setTimeout(function(){l.style.display="block"},0)}this.elements.root.offsetWidth,m(this.elements.root,U),ut(),"function"==typeof this.hooks.onshow&&this.hooks.onshow.call(this),E("onshow",this)}var c;return this},close:function(){var t;return this.__internal.isOpen&&!1!==E("onclosing",this)&&(t=this,1===f.length&&($(n,"resize",de),$(document.body,"keyup",Rt),$(document.body,"keydown",It),$(document.body,"focus",Nt),$(document.documentElement,"mousemove",te),$(document.documentElement,"mouseup",ee),$(document.documentElement,"mousemove",ce),$(document.documentElement,"mouseup",he)),$(t.elements.commands.container,"click",t.__internal.commandsClickHandler),$(t.elements.footer,"click",t.__internal.buttonsClickHandler),$(t.elements.reset[0],"focusin",t.__internal.resetHandler),$(t.elements.reset[0],"keydown",zt),$(t.elements.reset[1],"focusin",t.__internal.resetHandler),k(t.elements.dialog,T.type,t.__internal.transitionOutHandler),t.get("modal")||pe(t),t.get("movable")&&ge(t),t.get("resizable")&&ye(t),m(this.elements.root,Z),p(this.elements.root,W),clearTimeout(this.__internal.timerOut),this.__internal.timerOut=setTimeout(this.__internal.transitionOutHandler,T.supported?1e3:100),p(this.elements.root,U),this.elements.modal.offsetWidth,Q.defaults.maintainFocus&&this.__internal.activeElement&&(this.__internal.activeElement.focus(),this.__internal.activeElement=null),void 0!==this.__internal.className&&""!==this.__internal.className&&m(this.elements.root,this.__internal.className),"function"==typeof this.hooks.onclose&&this.hooks.onclose.call(this),E("onclose",this),f.splice(f.indexOf(this),1),this.__internal.isOpen=!1,dt()),f.length||"0"!==o||document.body.removeAttribute("tabindex"),this},closeOthers:function(){return Q.closeAll(this),this},destroy:function(){return this.__internal&&(this.__internal.isOpen?(this.__internal.destroy=function(){w(this,ht)},this.close()):this.__internal.destroy||w(this,ht)),this}}}(),M=function(){var t,e=[],i=d.notifier.classes,o=i.base;function s(e){e.__internal||(e.__internal={position:Q.defaults.notifier.position,delay:Q.defaults.notifier.delay},t=document.createElement("DIV"),("transitionOff"in d.notifier?d.notifier.transitionOff:d.transitionOff)&&(o=i.base+" ajs-no-transition"),r(e));t.parentNode!==document.body&&document.body.appendChild(t)}function r(e){switch(t.className=o,e.__internal.position){case"top-right":p(t,i.top+" "+i.right);break;case"top-left":p(t,i.top+" "+i.left);break;case"top-center":p(t,i.top+" "+i.center);break;case"bottom-left":p(t,i.bottom+" "+i.left);break;case"bottom-center":p(t,i.bottom+" "+i.center);break;default:p(t,i.bottom+" "+i.right)}}function a(o,s){function r(t,e){e.__internal.closeButton&&"true"!==t.target.getAttribute("data-close")||e.dismiss(!0)}function a(e,i){$(i.element,T.type,a),t.removeChild(i.element)}function l(t){clearTimeout(t.__internal.timer),clearTimeout(t.__internal.transitionTimeout)}return c={element:o,push:function(n,o){if(!this.__internal.pushed){var s,r;switch((a=this).__internal.pushed=!0,e.push(a),l(this),arguments.length){case 0:r=this.__internal.delay;break;case 1:"number"==typeof n?r=n:(s=n,r=this.__internal.delay);break;case 2:s=n,r=o}return this.__internal.closeButton=Q.defaults.notifier.closeButton,void 0!==s&&this.setContent(s),M.__internal.position.indexOf("top")<0?t.appendChild(this.element):t.insertBefore(this.element,t.firstChild),this.element.offsetWidth,p(this.element,i.visible),k(this.element,"click",this.__internal.clickHandler),this.delay(r)}var a;return this},ondismiss:function(){},callback:s,dismiss:function(n){var o;return this.__internal.pushed&&(l(this),"function"==typeof this.ondismiss&&!1===this.ondismiss.call(this)||($(this.element,"click",this.__internal.clickHandler),void 0!==this.element&&this.element.parentNode===t&&(this.__internal.transitionTimeout=setTimeout(this.__internal.transitionEndHandler,T.supported?1e3:100),m(this.element,i.visible),"function"==typeof this.callback&&this.callback.call(this,n)),o=this,e.splice(e.indexOf(o),1),o.__internal.pushed=!1)),this},delay:function(t){if(l(this),this.__internal.delay=void 0===t||isNaN(+t)?M.__internal.delay:+t,this.__internal.delay>0){var e=this;this.__internal.timer=setTimeout(function(){e.dismiss()},1e3*this.__internal.delay)}return this},setContent:function(t){if(b(t)?(O(this.element),this.element.innerHTML=t):t instanceof n.HTMLElement&&this.element.firstChild!==t&&(O(this.element),this.element.appendChild(t)),this.__internal.closeButton){var e=document.createElement("span");p(e,i.close),e.setAttribute("data-close",!0),this.element.appendChild(e)}return this},dismissOthers:function(){return M.dismissAll(this),this}},c.__internal||(c.__internal={pushed:!1,delay:void 0,timer:void 0,clickHandler:void 0,transitionEndHandler:void 0,transitionTimeout:void 0},c.__internal.clickHandler=C(c,r),c.__internal.transitionEndHandler=C(c,a)),c;var c}return{setting:function(t,e){if(s(this),void 0===e)return this.__internal[t];switch(t){case"position":this.__internal.position=e,r(this);break;case"delay":this.__internal.delay=e}return this},set:function(t,e){return this.setting(t,e),this},get:function(t){return this.setting(t)},create:function(t,e){s(this);var n=document.createElement("div");return n.className=i.message+("string"==typeof t&&""!==t?" "+i.prefix+t:""),a(n,e)},dismissAll:function(t){for(var i=e.slice(0),n=0;n<i.length;n+=1){var o=i[n];void 0!==t&&t===o||o.dismiss()}}}}();var Q=new function(){var t={};function e(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function i(e){var i=t[e].dialog;return i&&"function"==typeof i.__init&&i.__init(i),i}return{defaults:d,dialog:function(n,o,s,r){if("function"!=typeof o)return i(n);if(this.hasOwnProperty(n))throw new Error("alertify.dialog: name already exists");var a=function(i,n,o,s){var r={dialog:null,factory:n};return void 0!==s&&(r.factory=function(){return e(new t[s].factory,new n)}),o||(r.dialog=e(new r.factory,A)),t[i]=r}(n,o,s,r);this[n]=s?function(){if(0===arguments.length)return a.dialog;var t=e(new a.factory,A);return t&&"function"==typeof t.__init&&t.__init(t),t.main.apply(t,arguments),t.show.apply(t)}:function(){if(a.dialog&&"function"==typeof a.dialog.__init&&a.dialog.__init(a.dialog),0===arguments.length)return a.dialog;var t=a.dialog;return t.main.apply(a.dialog,arguments),t.show.apply(a.dialog)}},closeAll:function(t){for(var e=f.slice(0),i=0;i<e.length;i+=1){var n=e[i];void 0!==t&&t===n||n.close()}},setting:function(t,e,n){if("notifier"===t)return M.setting(e,n);var o=i(t);return o?o.setting(e,n):void 0},set:function(t,e,i){return this.setting(t,e,i)},get:function(t,e){return this.setting(t,e)},notify:function(t,e,i,n){return M.create(e,n).push(t,i)},message:function(t,e,i){return M.create(null,i).push(t,e)},success:function(t,e,i){return M.create("success",i).push(t,e)},error:function(t,e,i){return M.create("error",i).push(t,e)},warning:function(t,e,i){return M.create("warning",i).push(t,e)},dismissAll:function(){M.dismissAll()}}};Q.dialog("alert",function(){return{main:function(t,e,i){var n,o,s;switch(arguments.length){case 1:o=t;break;case 2:"function"==typeof e?(o=t,s=e):(n=t,o=e);break;case 3:n=t,o=e,s=i}return this.set("title",n),this.set("message",o),this.set("onok",s),this},setup:function(){return{buttons:[{text:Q.defaults.glossary.ok,key:r,invokeOnClose:!0,className:Q.defaults.theme.ok}],focus:{element:0,select:!1},options:{maximizable:!1,resizable:!1}}},build:function(){},prepare:function(){},setMessage:function(t){this.setContent(t)},settings:{message:void 0,onok:void 0,label:void 0},settingUpdated:function(t,e,i){switch(t){case"message":this.setMessage(i);break;case"label":this.__internal.buttons[0].element&&(this.__internal.buttons[0].element.innerHTML=i)}},callback:function(t){if("function"==typeof this.get("onok")){var e=this.get("onok").call(this,t);void 0!==e&&(t.cancel=!e)}}}}),Q.dialog("confirm",function(){var t={timer:null,index:null,text:null,duration:null,task:function(i,n){if(n.isOpen()){if(n.__internal.buttons[t.index].element.innerHTML=t.text+" (&#8207;"+t.duration+"&#8207;) ",t.duration-=1,-1===t.duration){e(n);var o=n.__internal.buttons[t.index],s=P(t.index,o);"function"==typeof n.callback&&n.callback.apply(n,[s]),!1!==s.close&&n.close()}}else e(n)}};function e(e){null!==t.timer&&(clearInterval(t.timer),t.timer=null,e.__internal.buttons[t.index].element.innerHTML=t.text)}function i(i,n,o){e(i),t.duration=o,t.index=n,t.text=i.__internal.buttons[n].element.innerHTML,t.timer=setInterval(C(i,t.task),1e3),t.task(null,i)}return{main:function(t,e,i,n){var o,s,r,a;switch(arguments.length){case 1:s=t;break;case 2:s=t,r=e;break;case 3:s=t,r=e,a=i;break;case 4:o=t,s=e,r=i,a=n}return this.set("title",o),this.set("message",s),this.set("onok",r),this.set("oncancel",a),this},setup:function(){return{buttons:[{text:Q.defaults.glossary.ok,key:s,className:Q.defaults.theme.ok},{text:Q.defaults.glossary.cancel,key:r,invokeOnClose:!0,className:Q.defaults.theme.cancel}],focus:{element:0,select:!1},options:{maximizable:!1,resizable:!1}}},build:function(){},prepare:function(){},setMessage:function(t){this.setContent(t)},settings:{message:null,labels:null,onok:null,oncancel:null,defaultFocus:null,reverseButtons:null},settingUpdated:function(t,e,i){switch(t){case"message":this.setMessage(i);break;case"labels":"ok"in i&&this.__internal.buttons[0].element&&(this.__internal.buttons[0].text=i.ok,this.__internal.buttons[0].element.innerHTML=i.ok),"cancel"in i&&this.__internal.buttons[1].element&&(this.__internal.buttons[1].text=i.cancel,this.__internal.buttons[1].element.innerHTML=i.cancel);break;case"reverseButtons":!0===i?this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element):this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element);break;case"defaultFocus":this.__internal.focus.element="ok"===i?0:1}},callback:function(t){var i;switch(e(this),t.index){case 0:"function"==typeof this.get("onok")&&void 0!==(i=this.get("onok").call(this,t))&&(t.cancel=!i);break;case 1:"function"==typeof this.get("oncancel")&&void 0!==(i=this.get("oncancel").call(this,t))&&(t.cancel=!i)}},autoOk:function(t){return i(this,0,t),this},autoCancel:function(t){return i(this,1,t),this}}}),Q.dialog("prompt",function(){var t=document.createElement("INPUT"),e=document.createElement("P");return{main:function(t,e,i,n,o){var s,r,a,l,c;switch(arguments.length){case 1:r=t;break;case 2:r=t,a=e;break;case 3:r=t,a=e,l=i;break;case 4:r=t,a=e,l=i,c=n;break;case 5:s=t,r=e,a=i,l=n,c=o}return this.set("title",s),this.set("message",r),this.set("value",a),this.set("onok",l),this.set("oncancel",c),this},setup:function(){return{buttons:[{text:Q.defaults.glossary.ok,key:s,className:Q.defaults.theme.ok},{text:Q.defaults.glossary.cancel,key:r,invokeOnClose:!0,className:Q.defaults.theme.cancel}],focus:{element:t,select:!0},options:{maximizable:!1,resizable:!1}}},build:function(){t.className=Q.defaults.theme.input,t.setAttribute("type","text"),t.value=this.get("value"),this.elements.content.appendChild(e),this.elements.content.appendChild(t)},prepare:function(){},setMessage:function(t){b(t)?(O(e),e.innerHTML=t):t instanceof n.HTMLElement&&e.firstChild!==t&&(O(e),e.appendChild(t))},settings:{message:void 0,labels:void 0,onok:void 0,oncancel:void 0,value:"",type:"text",reverseButtons:void 0},settingUpdated:function(e,i,n){switch(e){case"message":this.setMessage(n);break;case"value":t.value=n;break;case"type":switch(n){case"text":case"color":case"date":case"datetime-local":case"email":case"month":case"number":case"password":case"search":case"tel":case"time":case"week":t.type=n;break;default:t.type="text"}break;case"labels":n.ok&&this.__internal.buttons[0].element&&(this.__internal.buttons[0].element.innerHTML=n.ok),n.cancel&&this.__internal.buttons[1].element&&(this.__internal.buttons[1].element.innerHTML=n.cancel);break;case"reverseButtons":!0===n?this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element):this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element)}},callback:function(e){var i;switch(e.index){case 0:this.settings.value=t.value,"function"==typeof this.get("onok")&&void 0!==(i=this.get("onok").call(this,e,this.settings.value))&&(e.cancel=!i);break;case 1:"function"==typeof this.get("oncancel")&&void 0!==(i=this.get("oncancel").call(this,e))&&(e.cancel=!i),e.cancel||(t.value=this.settings.value)}}}}),"object"==typeof t.exports?t.exports=Q:void 0===(i=function(){return Q}.apply(e,[]))||(t.exports=i)}("undefined"!=typeof window?window:this)},3282:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const n=i(4042),o=i(6144),s=i(6653),r=i(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(r,a):r;this.addMetaSchema(t,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var h=i(2586);Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var u=i(9029);Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=i(3558);Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=i(4551);Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},3439:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>n.str`must be multiple of ${t}`,params:({schemaCode:t})=>n._`{multipleOf: ${t}}`},code(t){const{gen:e,data:i,schemaCode:o,it:s}=t,r=s.opts.multipleOfPrecision,a=e.let("res"),l=r?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${r}`:n._`${a} !== parseInt(${a})`;t.fail$data(n._`(${o} === 0 || (${a} = ${i}/${o}, ${l}))`)}};e.default=o},3463:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=i},3558:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}e.default=i},3662:(t,e,i)=>{var n,o,s;
72
+ /*!
73
+ * jQuery UI Mouse 1.14.1
74
+ * https://jqueryui.com
75
+ *
76
+ * Copyright OpenJS Foundation and other contributors
77
+ * Released under the MIT license.
78
+ * https://jquery.org/license
79
+ */!function(){"use strict";o=[i(4692),i(6883),i(9139)],void 0===(s="function"==typeof(n=function(t){var e=!1;return t(document).on("mouseup",function(){e=!1}),t.widget("ui.mouse",{version:"1.14.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent"))return t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,o=1===i.which,s="string"==typeof this.options.cancel&&t(i.target).closest(this.options.cancel).length;return!(o&&!s&&this._mouseCapture(i))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(i),!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0))}},_mouseMove:function(t){if(this._mouseMoved&&!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t);return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(i){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,i.target===this._mouseDownEvent.target&&t.data(i.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(i)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,e=!1,i.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})?n.apply(e,o):n)||(t.exports=s)}()},3673:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;const n=i(9029),o=i(2023),s=i(5765),r=i(8708);function a(t){const{gen:e,data:i,it:o}=t;e.if(o.parentData,()=>e.assign(i,n._`${o.parentData}[${o.parentDataProperty}]`))}function l(t,e,i){if(void 0===i)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword","function"==typeof i?{ref:i}:{ref:i,code:(0,n.stringify)(i)})}e.macroKeywordCode=function(t,e){const{gen:i,keyword:o,schema:s,parentSchema:r,it:a}=t,c=e.macro.call(a.self,s,r,a),h=l(i,o,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const u=i.name("valid");t.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:h,compositeRule:!0},u),t.pass(u,()=>t.error(!0))},e.funcKeywordCode=function(t,e){var i;const{gen:c,keyword:h,schema:u,parentSchema:d,$data:f,it:p}=t;!function({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}(p,e);const m=!f&&e.compile?e.compile.call(p.self,u,d,p):e.validate,g=l(c,h,m),v=c.let("valid");function y(i=(e.async?n._`await `:n.nil)){const r=p.opts.passContext?o.default.this:o.default.self,a=!("compile"in e&&!f||!1===e.schema);c.assign(v,n._`${i}${(0,s.callValidateCode)(t,g,r,a)}`,e.modifying)}function O(t){var i;c.if((0,n.not)(null!==(i=e.valid)&&void 0!==i?i:v),t)}t.block$data(v,function(){if(!1===e.errors)y(),e.modifying&&a(t),O(()=>t.error());else{const i=e.async?function(){const t=c.let("ruleErrs",null);return c.try(()=>y(n._`await `),e=>c.assign(v,!1).if(n._`${e} instanceof ${p.ValidationError}`,()=>c.assign(t,n._`${e}.errors`),()=>c.throw(e))),t}():function(){const t=n._`${g}.errors`;return c.assign(t,null),y(n.nil),t}();e.modifying&&a(t),O(()=>function(t,e){const{gen:i}=t;i.if(n._`Array.isArray(${e})`,()=>{i.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${e} : ${o.default.vErrors}.concat(${e})`).assign(o.default.errors,n._`${o.default.vErrors}.length`),(0,r.extendErrors)(t)},()=>t.error())}(t,i))}}),t.ok(null!==(i=e.valid)&&void 0!==i?i:v)},e.validSchemaType=function(t,e,i=!1){return!e.length||e.some(e=>"array"===e?Array.isArray(t):"object"===e?t&&"object"==typeof t&&!Array.isArray(t):typeof t==e||i&&void 0===t)},e.validateKeywordUsage=function({schema:t,opts:e,self:i,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");const r=o.dependencies;if(null==r?void 0:r.some(e=>!Object.prototype.hasOwnProperty.call(t,e)))throw new Error(`parent schema must have dependencies of ${s}: ${r.join(",")}`);if(o.validateSchema){if(!o.validateSchema(t[s])){const t=`keyword "${s}" value is invalid at path "${n}": `+i.errorsText(o.validateSchema.errors);if("log"!==e.validateSchema)throw new Error(t);i.logger.error(t)}}}},3693:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;const n=i(4551),o=i(5765),s=i(9029),r=i(2023),a=i(3835),l=i(4227),c={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:i,it:o}=t,{baseId:r,schemaEnv:l,validateName:c,opts:d,self:f}=o,{root:p}=l;if(("#"===i||"#/"===i)&&r===p.baseId)return function(){if(l===p)return u(t,c,l,l.$async);const i=e.scopeValue("root",{ref:p});return u(t,s._`${i}.validate`,p,p.$async)}();const m=a.resolveRef.call(f,p,r,i);if(void 0===m)throw new n.default(o.opts.uriResolver,r,i);return m instanceof a.SchemaEnv?function(e){const i=h(t,e);u(t,i,e,e.$async)}(m):function(n){const o=e.scopeValue("schema",!0===d.code.source?{ref:n,code:(0,s.stringify)(n)}:{ref:n}),r=e.name("valid"),a=t.subschema({schema:n,dataTypes:[],schemaPath:s.nil,topSchemaRef:o,errSchemaPath:i},r);t.mergeEvaluated(a),t.ok(r)}(m)}};function h(t,e){const{gen:i}=t;return e.validate?i.scopeValue("validate",{ref:e.validate}):s._`${i.scopeValue("wrapper",{ref:e})}.validate`}function u(t,e,i,n){const{gen:a,it:c}=t,{allErrors:h,schemaEnv:u,opts:d}=c,f=d.passContext?r.default.this:s.nil;function p(t){const e=s._`${t}.errors`;a.assign(r.default.vErrors,s._`${r.default.vErrors} === null ? ${e} : ${r.default.vErrors}.concat(${e})`),a.assign(r.default.errors,s._`${r.default.vErrors}.length`)}function m(t){var e;if(!c.opts.unevaluated)return;const n=null===(e=null==i?void 0:i.validate)||void 0===e?void 0:e.evaluated;if(!0!==c.props)if(n&&!n.dynamicProps)void 0!==n.props&&(c.props=l.mergeEvaluated.props(a,n.props,c.props));else{const e=a.var("props",s._`${t}.evaluated.props`);c.props=l.mergeEvaluated.props(a,e,c.props,s.Name)}if(!0!==c.items)if(n&&!n.dynamicItems)void 0!==n.items&&(c.items=l.mergeEvaluated.items(a,n.items,c.items));else{const e=a.var("items",s._`${t}.evaluated.items`);c.items=l.mergeEvaluated.items(a,e,c.items,s.Name)}}n?function(){if(!u.$async)throw new Error("async schema referenced by sync schema");const i=a.let("valid");a.try(()=>{a.code(s._`await ${(0,o.callValidateCode)(t,e,f)}`),m(e),h||a.assign(i,!0)},t=>{a.if(s._`!(${t} instanceof ${c.ValidationError})`,()=>a.throw(t)),p(t),h||a.assign(i,!1)}),t.ok(i)}():t.result((0,o.callValidateCode)(t,e,f),()=>m(e),()=>p(e))}e.getValidate=h,e.callRef=u,e.default=c},3835:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;const n=i(9029),o=i(3558),s=i(2023),r=i(6939),a=i(4227),l=i(2586);class c{constructor(t){var e;let i;this.refs={},this.dynamicAnchors={},"object"==typeof t.schema&&(i=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!==(e=t.baseId)&&void 0!==e?e:(0,r.normalizeId)(null==i?void 0:i[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==i?void 0:i.$async,this.refs={}}}function h(t){const e=d.call(this,t);if(e)return e;const i=(0,r.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,u=new n.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let f;t.$async&&(f=u.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const p=u.scopeName("validate");t.validateName=p;const m={gen:u,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.scopeValue("schema",!0===this.opts.code.source?{ref:t.schema,code:(0,n.stringify)(t.schema)}:{ref:t.schema}),validateName:p,ValidationError:f,schema:t.schema,schemaEnv:t,rootId:i,baseId:t.baseId||i,schemaPath:n.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(t),(0,l.validateFunctionCode)(m),u.optimize(this.opts.code.optimize);const e=u.toString();g=`${u.scopeRefs(s.default.scope)}return ${e}`,this.opts.code.process&&(g=this.opts.code.process(g,t));const i=new Function(`${s.default.self}`,`${s.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:i}),i.errors=null,i.schema=t.schema,i.schemaEnv=t,t.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:p,validateCode:e,scopeValues:u._values}),this.opts.unevaluated){const{props:t,items:e}=m;i.evaluated={props:t instanceof n.Name?void 0:t,items:e instanceof n.Name?void 0:e,dynamicProps:t instanceof n.Name,dynamicItems:e instanceof n.Name},i.source&&(i.source.evaluated=(0,n.stringify)(i.evaluated))}return t.validate=i,t}catch(e){throw delete t.validate,delete t.validateName,g&&this.logger.error("Error compiling schema, function code:",g),e}finally{this._compilations.delete(t)}}function u(t){return(0,r.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:h.call(this,t)}function d(t){for(const e of this._compilations)if(f(e,t))return e}function f(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function p(t,e){let i;for(;"string"==typeof(i=this.refs[e]);)e=i;return i||this.schemas[e]||m.call(this,t,e)}function m(t,e){const i=this.opts.uriResolver.parse(e),n=(0,r._getFullPath)(this.opts.uriResolver,i);let o=(0,r.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return v.call(this,i,t);const s=(0,r.normalizeId)(n),a=this.refs[s]||this.schemas[s];if("string"==typeof a){const e=m.call(this,t,a);if("object"!=typeof(null==e?void 0:e.schema))return;return v.call(this,i,e)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||h.call(this,a),s===(0,r.normalizeId)(e)){const{schema:e}=a,{schemaId:i}=this.opts,n=e[i];return n&&(o=(0,r.resolveUrl)(this.opts.uriResolver,o,n)),new c({schema:e,schemaId:i,root:t,baseId:o})}return v.call(this,i,a)}}e.SchemaEnv=c,e.compileSchema=h,e.resolveRef=function(t,e,i){var n;i=(0,r.resolveUrl)(this.opts.uriResolver,e,i);const o=t.refs[i];if(o)return o;let s=p.call(this,t,i);if(void 0===s){const o=null===(n=t.localRefs)||void 0===n?void 0:n[i],{schemaId:r}=this.opts;o&&(s=new c({schema:o,schemaId:r,root:t,baseId:e}))}return void 0!==s?t.refs[i]=u.call(this,s):void 0},e.getCompilingSchema=d,e.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function v(t,{baseId:e,schema:i,root:n}){var o;if("/"!==(null===(o=t.fragment)||void 0===o?void 0:o[0]))return;for(const n of t.fragment.slice(1).split("/")){if("boolean"==typeof i)return;const t=i[(0,a.unescapeFragment)(n)];if(void 0===t)return;const o="object"==typeof(i=t)&&i[this.opts.schemaId];!g.has(n)&&o&&(e=(0,r.resolveUrl)(this.opts.uriResolver,e,o))}let s;if("boolean"!=typeof i&&i.$ref&&!(0,a.schemaHasRulesButRef)(i,this.RULES)){const t=(0,r.resolveUrl)(this.opts.uriResolver,e,i.$ref);s=m.call(this,n,t)}const{schemaId:l}=this.opts;return s=s||new c({schema:i,schemaId:l,root:n,baseId:e}),s.schema!==s.root.schema?s:void 0}},3837:t=>{"use strict";t.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3853:(t,e)=>{"use strict";function i(t){const e=t.length;let i,n=0,o=0;for(;o<e;)n++,i=t.charCodeAt(o++),i>=55296&&i<=56319&&o<e&&(i=t.charCodeAt(o),56320==(64512&i)&&o++);return n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,i.code='require("ajv/dist/runtime/ucs2length").default'},3966:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(4227),s=i(5765),r=i(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>n.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>n._`{limit: ${t}}`},code(t){const{schema:e,parentSchema:i,it:n}=t,{prefixItems:a}=i;n.items=!0,(0,o.alwaysValidSchema)(n,e)||(a?(0,r.validateAdditionalItems)(t,a):t.ok((0,s.validateArray)(t)))}};e.default=a},4003:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5765),o=i(9029),s=i(4227),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>o.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>o._`{missingProperty: ${t}}`},code(t){const{gen:e,schema:i,schemaCode:r,data:a,$data:l,it:c}=t,{opts:h}=c;if(!l&&0===i.length)return;const u=i.length>=h.loopRequired;if(c.allErrors?function(){if(u||l)t.block$data(o.nil,d);else for(const e of i)(0,n.checkReportMissingProp)(t,e)}():function(){const s=e.let("missing");if(u||l){const i=e.let("valid",!0);t.block$data(i,()=>function(i,s){t.setParams({missingProperty:i}),e.forOf(i,r,()=>{e.assign(s,(0,n.propertyInData)(e,a,i,h.ownProperties)),e.if((0,o.not)(s),()=>{t.error(),e.break()})},o.nil)}(s,i)),t.ok(i)}else e.if((0,n.checkMissingProp)(t,i,s)),(0,n.reportMissingProp)(t,s),e.else()}(),h.strictRequired){const e=t.parentSchema.properties,{definedProperties:n}=t.it;for(const t of i)if(void 0===(null==e?void 0:e[t])&&!n.has(t)){const e=`required property "${t}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,s.checkStrictMode)(c,e,c.opts.strictRequired)}}function d(){e.forOf("prop",r,i=>{t.setParams({missingProperty:i}),e.if((0,n.noPropertyInData)(e,a,i,h.ownProperties),()=>t.error())})}}};e.default=r},4018:(t,e)=>{"use strict";function i(t,e){return{validate:t,compare:e}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:i(s,r),time:i(l(!0),c),"date-time":i(d(!0),f),"iso-time":i(l(),h),"iso-date-time":i(d(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H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[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(t){if(x.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(t){return v.lastIndex=0,v.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=O&&t>=y}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:b},double:{type:"number",validate:b},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:i(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,r),time:i(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":i(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"iso-time":i(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),"iso-date-time":i(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(t){const e=n.exec(t);if(!e)return!1;const i=+e[1],s=+e[2],r=+e[3];return s>=1&&s<=12&&r>=1&&r<=(2===s&&function(t){return t%4==0&&(t%100!=0||t%400==0)}(i)?29:o[s])}function r(t,e){if(t&&e)return t>e?1:t<e?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(t){return function(e){const i=a.exec(e);if(!i)return!1;const n=+i[1],o=+i[2],s=+i[3],r=i[4],l="-"===i[5]?-1:1,c=+(i[6]||0),h=+(i[7]||0);if(c>23||h>59||t&&!r)return!1;if(n<=23&&o<=59&&s<60)return!0;const u=o-h*l,d=n-c*l-(u<0?1:0);return(23===d||-1===d)&&(59===u||-1===u)&&s<61}}function c(t,e){if(!t||!e)return;const i=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();return i&&n?i-n:void 0}function h(t,e){if(!t||!e)return;const i=a.exec(t),n=a.exec(e);return i&&n?(t=i[1]+i[2]+i[3])>(e=n[1]+n[2]+n[3])?1:t<e?-1:0:void 0}const u=/t|\s/i;function d(t){const e=l(t);return function(t){const i=t.split(u);return 2===i.length&&s(i[0])&&e(i[1])}}function f(t,e){if(!t||!e)return;const i=new Date(t).valueOf(),n=new Date(e).valueOf();return i&&n?i-n:void 0}function p(t,e){if(!t||!e)return;const[i,n]=t.split(u),[o,s]=e.split(u),a=r(i,o);return void 0!==a?a||c(n,s):void 0}const m=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-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use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var n=i(2586);Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var o=i(9029);Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const s=i(3558),r=i(4551),a=i(396),l=i(3835),c=i(9029),h=i(6939),u=i(208),d=i(4227),f=i(3837),p=i(5944),m=(t,e)=>new RegExp(t,e);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},O={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function b(t){var e,i,n,o,s,r,a,l,c,h,u,d,f,g,v,y,O,b,x,w,_,S,k,$,T;const C=t.strict,P=null===(e=t.code)||void 0===e?void 0:e.optimize,E=!0===P||void 0===P?1:P||0,A=null!==(n=null===(i=t.code)||void 0===i?void 0:i.regExp)&&void 0!==n?n:m,M=null!==(o=t.uriResolver)&&void 0!==o?o:p.default;return{strictSchema:null===(r=null!==(s=t.strictSchema)&&void 0!==s?s:C)||void 0===r||r,strictNumbers:null===(l=null!==(a=t.strictNumbers)&&void 0!==a?a:C)||void 0===l||l,strictTypes:null!==(h=null!==(c=t.strictTypes)&&void 0!==c?c:C)&&void 0!==h?h:"log",strictTuples:null!==(d=null!==(u=t.strictTuples)&&void 0!==u?u:C)&&void 0!==d?d:"log",strictRequired:null!==(g=null!==(f=t.strictRequired)&&void 0!==f?f:C)&&void 0!==g&&g,code:t.code?{...t.code,optimize:E,regExp:A}:{optimize:E,regExp:A},loopRequired:null!==(v=t.loopRequired)&&void 0!==v?v:200,loopEnum:null!==(y=t.loopEnum)&&void 0!==y?y:200,meta:null===(O=t.meta)||void 0===O||O,messages:null===(b=t.messages)||void 0===b||b,inlineRefs:null===(x=t.inlineRefs)||void 0===x||x,schemaId:null!==(w=t.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(_=t.addUsedSchema)||void 0===_||_,validateSchema:null===(S=t.validateSchema)||void 0===S||S,validateFormats:null===(k=t.validateFormats)||void 0===k||k,unicodeRegExp:null===($=t.unicodeRegExp)||void 0===$||$,int32range:null===(T=t.int32range)||void 0===T||T,uriResolver:M}}class x{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...b(t)};const{es5:e,lines:i}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:v,es5:e,lines:i}),this.logger=function(t){if(!1===t)return C;if(void 0===t)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}(t.logger);const n=t.validateFormats;t.validateFormats=!1,this.RULES=(0,a.getRules)(),w.call(this,y,t,"NOT SUPPORTED"),w.call(this,O,t,"DEPRECATED","warn"),this._metaOpts=T.call(this),t.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&$.call(this,t.keywords),"object"==typeof t.meta&&this.addMetaSchema(t.meta),S.call(this),t.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:e,schemaId:i}=this.opts;let n=f;"id"===i&&(n={...f},n.id=n.$id,delete n.$id),e&&t&&this.addMetaSchema(n,n[i],!1)}defaultMeta(){const{meta:t,schemaId:e}=this.opts;return this.opts.defaultMeta="object"==typeof t?t[e]||t:void 0}validate(t,e){let i;if("string"==typeof t){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);const n=i(e);return"$async"in i||(this.errors=i.errors),n}compile(t,e){const i=this._addSchema(t,e);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,e){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:i}=this.opts;return n.call(this,t,e);async function n(t,e){await o.call(this,t.$schema);const i=this._addSchema(t,e);return i.validate||s.call(this,i)}async function o(t){t&&!this.getSchema(t)&&await n.call(this,{$ref:t},!0)}async function s(t){try{return this._compileSchemaEnv(t)}catch(e){if(!(e instanceof r.default))throw e;return a.call(this,e),await l.call(this,e.missingSchema),s.call(this,t)}}function a({missingSchema:t,missingRef:e}){if(this.refs[t])throw new Error(`AnySchema ${t} is loaded but ${e} cannot be resolved`)}async function l(t){const i=await c.call(this,t);this.refs[t]||await o.call(this,i.$schema),this.refs[t]||this.addSchema(i,t,e)}async function c(t){const e=this._loading[t];if(e)return e;try{return await(this._loading[t]=i(t))}finally{delete this._loading[t]}}}addSchema(t,e,i,n=this.opts.validateSchema){if(Array.isArray(t)){for(const e of t)this.addSchema(e,void 0,i,n);return this}let o;if("object"==typeof t){const{schemaId:e}=this.opts;if(o=t[e],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${e} must be string`)}return e=(0,h.normalizeId)(e||o),this._checkUnique(e),this.schemas[e]=this._addSchema(t,i,e,n,!0),this}addMetaSchema(t,e,i=this.opts.validateSchema){return this.addSchema(t,e,!0,i),this}validateSchema(t,e){if("boolean"==typeof t)return!0;let i;if(i=t.$schema,void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(i,t);if(!n&&e){const t="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(t);this.logger.error(t)}return n}getSchema(t){let e;for(;"string"==typeof(e=_.call(this,t));)t=e;if(void 0===e){const{schemaId:i}=this.opts,n=new l.SchemaEnv({schema:{},schemaId:i});if(e=l.resolveSchema.call(this,n,t),!e)return;this.refs[t]=e}return e.validate||this._compileSchemaEnv(e)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const e=_.call(this,t);return"object"==typeof e&&this._cache.delete(e.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{const e=t;this._cache.delete(e);let i=t[this.opts.schemaId];return i&&(i=(0,h.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const e of t)this.addKeyword(e);return this}addKeyword(t,e){let i;if("string"==typeof t)i=t,"object"==typeof e&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),e.keyword=i);else{if("object"!=typeof t||void 0!==e)throw new Error("invalid addKeywords parameters");if(i=(e=t).keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(E.call(this,i,e),!e)return(0,d.eachItem)(i,t=>A.call(this,t)),this;Q.call(this,e);const n={...e,type:(0,u.getJSONTypes)(e.type),schemaType:(0,u.getJSONTypes)(e.schemaType)};return(0,d.eachItem)(i,0===n.type.length?t=>A.call(this,t,n):t=>n.type.forEach(e=>A.call(this,t,n,e))),this}getKeyword(t){const e=this.RULES.all[t];return"object"==typeof e?e.definition:!!e}removeKeyword(t){const{RULES:e}=this;delete e.keywords[t],delete e.all[t];for(const i of e.rules){const e=i.rules.findIndex(e=>e.keyword===t);e>=0&&i.rules.splice(e,1)}return this}addFormat(t,e){return"string"==typeof e&&(e=new RegExp(e)),this.formats[t]=e,this}errorsText(t=this.errors,{separator:e=", ",dataVar:i="data"}={}){return t&&0!==t.length?t.map(t=>`${i}${t.instancePath} ${t.message}`).reduce((t,i)=>t+e+i):"No errors"}$dataMetaSchema(t,e){const i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const n of e){const e=n.split("/").slice(1);let o=t;for(const t of e)o=o[t];for(const t in i){const e=i[t];if("object"!=typeof e)continue;const{$data:n}=e.definition,s=o[t];n&&s&&(o[t]=R(s))}}return t}_removeAllSchemas(t,e){for(const i in t){const n=t[i];e&&!e.test(i)||("string"==typeof n?delete t[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete t[i]))}}_addSchema(t,e,i,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let s;const{schemaId:r}=this.opts;if("object"==typeof t)s=t[r];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof t)throw new Error("schema must be object or boolean")}let a=this._cache.get(t);if(void 0!==a)return a;i=(0,h.normalizeId)(s||i);const c=h.getSchemaRefs.call(this,t,i);return a=new l.SchemaEnv({schema:t,schemaId:r,meta:e,baseId:i,localRefs:c}),this._cache.set(a.schema,a),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=a),n&&this.validateSchema(t,!0),a}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):l.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const e=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,t)}finally{this.opts=e}}}function w(t,e,i,n="error"){for(const o in t){const s=o;s in e&&this.logger[n](`${i}: option ${o}. ${t[s]}`)}}function _(t){return t=(0,h.normalizeId)(t),this.schemas[t]||this.refs[t]}function S(){const t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(const e in t)this.addSchema(t[e],e)}function k(){for(const t in this.opts.formats){const e=this.opts.formats[t];e&&this.addFormat(t,e)}}function $(t){if(Array.isArray(t))this.addVocabulary(t);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const e in t){const i=t[e];i.keyword||(i.keyword=e),this.addKeyword(i)}}}function T(){const t={...this.opts};for(const e of g)delete t[e];return t}x.ValidationError=s.default,x.MissingRefError=r.default,e.default=x;const C={log(){},warn(){},error(){}};const P=/^[a-z_$][a-z0-9_$:-]*$/i;function E(t,e){const{RULES:i}=this;if((0,d.eachItem)(t,t=>{if(i.keywords[t])throw new Error(`Keyword ${t} is already defined`);if(!P.test(t))throw new Error(`Keyword ${t} has invalid name`)}),e&&e.$data&&!("code"in e)&&!("validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function A(t,e,i){var n;const o=null==e?void 0:e.post;if(i&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let r=o?s.post:s.rules.find(({type:t})=>t===i);if(r||(r={type:i,rules:[]},s.rules.push(r)),s.keywords[t]=!0,!e)return;const a={keyword:t,definition:{...e,type:(0,u.getJSONTypes)(e.type),schemaType:(0,u.getJSONTypes)(e.schemaType)}};e.before?M.call(this,r,a,e.before):r.rules.push(a),s.all[t]=a,null===(n=e.implements)||void 0===n||n.forEach(t=>this.addKeyword(t))}function M(t,e,i){const n=t.rules.findIndex(t=>t.keyword===i);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${i} is not defined`))}function Q(t){let{metaSchema:e}=t;void 0!==e&&(t.$data&&this.opts.$data&&(e=R(e)),t.validateSchema=this.compile(e,!0))}const D={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function R(t){return{anyOf:[t,D]}}},4224:(t,e,i)=>{var n,o,s;
80
+ /*!
81
+ * jQuery UI Position 1.14.1
82
+ * https://jqueryui.com
83
+ *
84
+ * Copyright OpenJS Foundation and other contributors
85
+ * Released under the MIT license.
86
+ * https://jquery.org/license
87
+ *
88
+ * https://api.jqueryui.com/position/
89
+ */!function(){"use strict";o=[i(4692),i(6883)],n=function(t){return function(){var e,i=Math.max,n=Math.abs,o=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,l=/%$/,c=t.fn.position;function h(t,e,i){return[parseFloat(t[0])*(l.test(t[0])?e/100:1),parseFloat(t[1])*(l.test(t[1])?i/100:1)]}function u(e,i){return parseInt(t.css(e,i),10)||0}function d(t){return null!=t&&t===t.window}function f(t){var e=t[0];return 9===e.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:d(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}t.position={scrollbarWidth:function(){if(void 0!==e)return e;var i,n,o=t("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),s=o.children()[0];return t("body").append(o),i=s.offsetWidth,o.css("overflow","scroll"),i===(n=s.offsetWidth)&&(n=o[0].clientWidth),o.remove(),e=i-n},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),n=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),o="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:o?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),n=d(i[0]),o=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:n,isDocument:o,offset:!n&&!o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return c.apply(this,arguments);var l,d,p,m,g,v,y="string"==typeof(e=t.extend({},e)).of?t(document).find(e.of):t(e.of),O=t.position.getWithinInfo(e.within),b=t.position.getScrollInfo(O),x=(e.collision||"flip").split(" "),w={};return v=f(y),y[0].preventDefault&&(e.at="left top"),d=v.width,p=v.height,m=v.offset,g=t.extend({},m),t.each(["my","at"],function(){var t,i,n=(e[this]||"").split(" ");1===n.length&&(n=o.test(n[0])?n.concat(["center"]):s.test(n[0])?["center"].concat(n):["center","center"]),n[0]=o.test(n[0])?n[0]:"center",n[1]=s.test(n[1])?n[1]:"center",t=r.exec(n[0]),i=r.exec(n[1]),w[this]=[t?t[0]:0,i?i[0]:0],e[this]=[a.exec(n[0])[0],a.exec(n[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?g.left+=d:"center"===e.at[0]&&(g.left+=d/2),"bottom"===e.at[1]?g.top+=p:"center"===e.at[1]&&(g.top+=p/2),l=h(w.at,d,p),g.left+=l[0],g.top+=l[1],this.each(function(){var o,s,r=t(this),a=r.outerWidth(),c=r.outerHeight(),f=u(this,"marginLeft"),v=u(this,"marginTop"),_=a+f+u(this,"marginRight")+b.width,S=c+v+u(this,"marginBottom")+b.height,k=t.extend({},g),$=h(w.my,r.outerWidth(),r.outerHeight());"right"===e.my[0]?k.left-=a:"center"===e.my[0]&&(k.left-=a/2),"bottom"===e.my[1]?k.top-=c:"center"===e.my[1]&&(k.top-=c/2),k.left+=$[0],k.top+=$[1],o={marginLeft:f,marginTop:v},t.each(["left","top"],function(i,n){t.ui.position[x[i]]&&t.ui.position[x[i]][n](k,{targetWidth:d,targetHeight:p,elemWidth:a,elemHeight:c,collisionPosition:o,collisionWidth:_,collisionHeight:S,offset:[l[0]+$[0],l[1]+$[1]],my:e.my,at:e.at,within:O,elem:r})}),e.using&&(s=function(t){var o=m.left-k.left,s=o+d-a,l=m.top-k.top,h=l+p-c,u={target:{element:y,left:m.left,top:m.top,width:d,height:p},element:{element:r,left:k.left,top:k.top,width:a,height:c},horizontal:s<0?"left":o>0?"right":"center",vertical:h<0?"top":l>0?"bottom":"middle"};d<a&&n(o+s)<d&&(u.horizontal="center"),p<c&&n(l+h)<p&&(u.vertical="middle"),i(n(o),n(s))>i(n(l),n(h))?u.important="horizontal":u.important="vertical",e.using.call(this,t,u)}),r.offset(t.extend(k,{using:s}))})},t.ui.position={fit:{left:function(t,e){var n,o=e.within,s=o.isWindow?o.scrollLeft:o.offset.left,r=o.width,a=t.left-e.collisionPosition.marginLeft,l=s-a,c=a+e.collisionWidth-r-s;e.collisionWidth>r?l>0&&c<=0?(n=t.left+l+e.collisionWidth-r-s,t.left+=l-n):t.left=c>0&&l<=0?s:l>c?s+r-e.collisionWidth:s:l>0?t.left+=l:c>0?t.left-=c:t.left=i(t.left-a,t.left)},top:function(t,e){var n,o=e.within,s=o.isWindow?o.scrollTop:o.offset.top,r=e.within.height,a=t.top-e.collisionPosition.marginTop,l=s-a,c=a+e.collisionHeight-r-s;e.collisionHeight>r?l>0&&c<=0?(n=t.top+l+e.collisionHeight-r-s,t.top+=l-n):t.top=c>0&&l<=0?s:l>c?s+r-e.collisionHeight:s:l>0?t.top+=l:c>0?t.top-=c:t.top=i(t.top-a,t.top)}},flip:{left:function(t,e){var i,o,s=e.within,r=s.offset.left+s.scrollLeft,a=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,c=t.left-e.collisionPosition.marginLeft,h=c-l,u=c+e.collisionWidth-a-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,f="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];h<0?((i=t.left+d+f+p+e.collisionWidth-a-r)<0||i<n(h))&&(t.left+=d+f+p):u>0&&((o=t.left-e.collisionPosition.marginLeft+d+f+p-l)>0||n(o)<u)&&(t.left+=d+f+p)},top:function(t,e){var i,o,s=e.within,r=s.offset.top+s.scrollTop,a=s.height,l=s.isWindow?s.scrollTop:s.offset.top,c=t.top-e.collisionPosition.marginTop,h=c-l,u=c+e.collisionHeight-a-l,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,p=-2*e.offset[1];h<0?((o=t.top+d+f+p+e.collisionHeight-a-r)<0||o<n(h))&&(t.top+=d+f+p):u>0&&((i=t.top-e.collisionPosition.marginTop+d+f+p-l)>0||n(i)<u)&&(t.top+=d+f+p)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position},void 0===(s="function"==typeof n?n.apply(e,o):n)||(t.exports=s)}()},4227:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const n=i(9029),o=i(1520);function s(t,e=t.schema){const{opts:i,self:n}=t;if(!i.strictSchema)return;if("boolean"==typeof e)return;const o=n.RULES.keywords;for(const i in e)o[i]||p(t,`unknown keyword: "${i}"`)}function r(t,e){if("boolean"==typeof t)return!t;for(const i in t)if(e[i])return!0;return!1}function a(t){return"number"==typeof t?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}function l(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:t,mergeToName:e,mergeValues:i,resultToName:o}){return(s,r,a,l)=>{const c=void 0===a?r:a instanceof n.Name?(r instanceof n.Name?t(s,r,a):e(s,r,a),a):r instanceof n.Name?(e(s,a,r),r):i(r,a);return l!==n.Name||c instanceof n.Name?c:o(s,c)}}function h(t,e){if(!0===e)return t.var("props",!0);const i=t.var("props",n._`{}`);return void 0!==e&&u(t,i,e),i}function u(t,e,i){Object.keys(i).forEach(i=>t.assign(n._`${e}${(0,n.getProperty)(i)}`,!0))}e.toHash=function(t){const e={};for(const i of t)e[i]=!0;return e},e.alwaysValidSchema=function(t,e){return"boolean"==typeof e?e:0===Object.keys(e).length||(s(t,e),!r(e,t.self.RULES.all))},e.checkUnknownRules=s,e.schemaHasRules=r,e.schemaHasRulesButRef=function(t,e){if("boolean"==typeof t)return!t;for(const i in t)if("$ref"!==i&&e.all[i])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:t,schemaPath:e},i,o,s){if(!s){if("number"==typeof i||"boolean"==typeof i)return i;if("string"==typeof i)return n._`${i}`}return n._`${t}${e}${(0,n.getProperty)(o)}`},e.unescapeFragment=function(t){return l(decodeURIComponent(t))},e.escapeFragment=function(t){return encodeURIComponent(a(t))},e.escapeJsonPointer=a,e.unescapeJsonPointer=l,e.eachItem=function(t,e){if(Array.isArray(t))for(const i of t)e(i);else e(t)},e.mergeEvaluated={props:c({mergeNames:(t,e,i)=>t.if(n._`${i} !== true && ${e} !== undefined`,()=>{t.if(n._`${e} === true`,()=>t.assign(i,!0),()=>t.assign(i,n._`${i} || {}`).code(n._`Object.assign(${i}, ${e})`))}),mergeToName:(t,e,i)=>t.if(n._`${i} !== true`,()=>{!0===e?t.assign(i,!0):(t.assign(i,n._`${i} || {}`),u(t,i,e))}),mergeValues:(t,e)=>!0===t||{...t,...e},resultToName:h}),items:c({mergeNames:(t,e,i)=>t.if(n._`${i} !== true && ${e} !== undefined`,()=>t.assign(i,n._`${e} === true ? true : ${i} > ${e} ? ${i} : ${e}`)),mergeToName:(t,e,i)=>t.if(n._`${i} !== true`,()=>t.assign(i,!0===e||n._`${i} > ${e} ? ${i} : ${e}`)),mergeValues:(t,e)=>!0===t||Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})},e.evaluatedPropsToName=h,e.setEvaluated=u;const d={};var f;function p(t,e,i=t.opts.strictSchema){if(i){if(e=`strict mode: ${e}`,!0===i)throw new Error(e);t.self.logger.warn(e)}}e.useFunc=function(t,e){return t.scopeValue("func",{ref:e,code:d[e.code]||(d[e.code]=new o._Code(e.code))})},function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"}(f||(e.Type=f={})),e.getErrorPath=function(t,e,i){if(t instanceof n.Name){const o=e===f.Num;return i?o?n._`"[" + ${t} + "]"`:n._`"['" + ${t} + "']"`:o?n._`"/" + ${t}`:n._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,n.getProperty)(t).toString():"/"+a(t)},e.checkStrictMode=p},4426:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4227),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:i}){void 0===e.if&&(0,n.checkStrictMode)(i,`"${t}" without "if" is ignored`)}};e.default=o},4486:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const i="maxProperties"===t?"more":"fewer";return n.str`must NOT have ${i} than ${e} properties`},params:({schemaCode:t})=>n._`{limit: ${t}}`},code(t){const{keyword:e,data:i,schemaCode:o}=t,s="maxProperties"===e?n.operators.GT:n.operators.LT;t.fail$data(n._`Object.keys(${i}).length ${s} ${o}`)}};e.default=o},4495:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;const n=i(9029),o=i(4227);e.getSubschema=function(t,{keyword:e,schemaProp:i,schema:s,schemaPath:r,errSchemaPath:a,topSchemaRef:l}){if(void 0!==e&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==e){const s=t.schema[e];return void 0===i?{schema:s,schemaPath:n._`${t.schemaPath}${(0,n.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:s[i],schemaPath:n._`${t.schemaPath}${(0,n.getProperty)(e)}${(0,n.getProperty)(i)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,o.escapeFragment)(i)}`}}if(void 0!==s){if(void 0===r||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:r,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(t,e,{dataProp:i,dataPropType:s,data:r,dataTypes:a,propertyName:l}){if(void 0!==r&&void 0!==i)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=e;if(void 0!==i){const{errorPath:r,dataPathArr:a,opts:l}=e;h(c.let("data",n._`${e.data}${(0,n.getProperty)(i)}`,!0)),t.errorPath=n.str`${r}${(0,o.getErrorPath)(i,s,l.jsPropertySyntax)}`,t.parentDataProperty=n._`${i}`,t.dataPathArr=[...a,t.parentDataProperty]}if(void 0!==r){h(r instanceof n.Name?r:c.let("data",r,!0)),void 0!==l&&(t.propertyName=l)}function h(i){t.data=i,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,i]}a&&(t.dataTypes=a)},e.extendSubschemaMode=function(t,{jtdDiscriminator:e,jtdMetadata:i,compositeRule:n,createErrors:o,allErrors:s}){void 0!==n&&(t.compositeRule=n),void 0!==o&&(t.createErrors=o),void 0!==s&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=i}},4551:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(6939);class o extends Error{constructor(t,e,i,o){super(o||`can't resolve reference ${i} from id ${e}`),this.missingRef=(0,n.resolveUrl)(t,e,i),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(t,this.missingRef))}}e.default=o},4692:function(t,e){var i;
90
+ /*!
91
+ * jQuery JavaScript Library v3.7.1
92
+ * https://jquery.com/
93
+ *
94
+ * Copyright OpenJS Foundation and other contributors
95
+ * Released under the MIT license
96
+ * https://jquery.org/license
97
+ *
98
+ * Date: 2023-08-28T13:37Z
99
+ */!function(e,i){"use strict";"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,function(n,o){"use strict";var s=[],r=Object.getPrototypeOf,a=s.slice,l=s.flat?function(t){return s.flat.call(t)}:function(t){return s.concat.apply([],t)},c=s.push,h=s.indexOf,u={},d=u.toString,f=u.hasOwnProperty,p=f.toString,m=p.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},O=n.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,i){var n,o,s=(i=i||O).createElement("script");if(s.text=t,e)for(n in b)(o=e[n]||e.getAttribute&&e.getAttribute(n))&&s.setAttribute(n,o);i.head.appendChild(s).parentNode.removeChild(s)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?u[d.call(t)]||"object":typeof t}var _="3.7.1",S=/HTML$/i,k=function(t,e){return new k.fn.init(t,e)};function $(t){var e=!!t&&"length"in t&&t.length,i=w(t);return!v(t)&&!y(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function T(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}k.fn=k.prototype={jquery:_,constructor:k,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=k.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return k.each(this,t)},map:function(t){return this.pushStack(k.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(k.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:s.sort,splice:s.splice},k.extend=k.fn.extend=function(){var t,e,i,n,o,s,r=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof r&&(c=r,r=arguments[a]||{},a++),"object"==typeof r||v(r)||(r={}),a===l&&(r=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)n=t[e],"__proto__"!==e&&r!==n&&(c&&n&&(k.isPlainObject(n)||(o=Array.isArray(n)))?(i=r[e],s=o&&!Array.isArray(i)?[]:o||k.isPlainObject(i)?i:{},o=!1,r[e]=k.extend(c,s,n)):void 0!==n&&(r[e]=n));return r},k.extend({expando:"jQuery"+(_+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==d.call(t))&&(!(e=r(t))||"function"==typeof(i=f.call(e,"constructor")&&e.constructor)&&p.call(i)===m)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,i){x(t,{nonce:e&&e.nonce},i)},each:function(t,e){var i,n=0;if($(t))for(i=t.length;n<i&&!1!==e.call(t[n],n,t[n]);n++);else for(n in t)if(!1===e.call(t[n],n,t[n]))break;return t},text:function(t){var e,i="",n=0,o=t.nodeType;if(!o)for(;e=t[n++];)i+=k.text(e);return 1===o||11===o?t.textContent:9===o?t.documentElement.textContent:3===o||4===o?t.nodeValue:i},makeArray:function(t,e){var i=e||[];return null!=t&&($(Object(t))?k.merge(i,"string"==typeof t?[t]:t):c.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:h.call(e,t,i)},isXMLDoc:function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!S.test(e||i&&i.nodeName||"HTML")},merge:function(t,e){for(var i=+e.length,n=0,o=t.length;n<i;n++)t[o++]=e[n];return t.length=o,t},grep:function(t,e,i){for(var n=[],o=0,s=t.length,r=!i;o<s;o++)!e(t[o],o)!==r&&n.push(t[o]);return n},map:function(t,e,i){var n,o,s=0,r=[];if($(t))for(n=t.length;s<n;s++)null!=(o=e(t[s],s,i))&&r.push(o);else for(s in t)null!=(o=e(t[s],s,i))&&r.push(o);return l(r)},guid:1,support:g}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=s[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){u["[object "+e+"]"]=e.toLowerCase()});var C=s.pop,P=s.sort,E=s.splice,A="[\\x20\\t\\r\\n\\f]",M=new RegExp("^"+A+"+|((?:^|[^\\\\])(?:\\\\.)*)"+A+"+$","g");k.contains=function(t,e){var i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(t.contains?t.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))};var Q=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function D(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}k.escapeSelector=function(t){return(t+"").replace(Q,D)};var R=O,I=c;!function(){var t,e,i,o,r,l,c,u,d,p,m=I,v=k.expando,y=0,O=0,b=tt(),x=tt(),w=tt(),_=tt(),S=function(t,e){return t===e&&(r=!0),0},$="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",Q="(?:\\\\[\\da-fA-F]{1,6}"+A+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",D="\\["+A+"*("+Q+")(?:"+A+"*([*^$|!~]?=)"+A+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Q+"))|)"+A+"*\\]",L=":("+Q+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+D+")*)|.*)\\)|)",N=new RegExp(A+"+","g"),j=new RegExp("^"+A+"*,"+A+"*"),z=new RegExp("^"+A+"*([>+~]|"+A+")"+A+"*"),B=new RegExp(A+"|>"),Z=new RegExp(L),W=new RegExp("^"+Q+"$"),F={ID:new RegExp("^#("+Q+")"),CLASS:new RegExp("^\\.("+Q+")"),TAG:new RegExp("^("+Q+"|[*])"),ATTR:new RegExp("^"+D),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+A+"*(even|odd|(([+-]|)(\\d*)n|)"+A+"*(?:([+-]|)"+A+"*(\\d+)|))"+A+"*\\)|)","i"),bool:new RegExp("^(?:"+$+")$","i"),needsContext:new RegExp("^"+A+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+A+"*((?:-\\d)?\\d*)"+A+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,H=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,V=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+A+"?|\\\\([^\\r\\n\\f])","g"),U=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},G=function(){lt()},K=dt(function(t){return!0===t.disabled&&T(t,"fieldset")},{dir:"parentNode",next:"legend"});try{m.apply(s=a.call(R.childNodes),R.childNodes),s[R.childNodes.length].nodeType}catch(t){m={apply:function(t,e){I.apply(t,a.call(e))},call:function(t){I.apply(t,a.call(arguments,1))}}}function J(t,e,i,n){var o,s,r,a,c,h,f,p=e&&e.ownerDocument,y=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==y&&9!==y&&11!==y)return i;if(!n&&(lt(e),e=e||l,u)){if(11!==y&&(c=H.exec(t)))if(o=c[1]){if(9===y){if(!(r=e.getElementById(o)))return i;if(r.id===o)return m.call(i,r),i}else if(p&&(r=p.getElementById(o))&&J.contains(e,r)&&r.id===o)return m.call(i,r),i}else{if(c[2])return m.apply(i,e.getElementsByTagName(t)),i;if((o=c[3])&&e.getElementsByClassName)return m.apply(i,e.getElementsByClassName(o)),i}if(!(_[t+" "]||d&&d.test(t))){if(f=t,p=e,1===y&&(B.test(t)||z.test(t))){for((p=V.test(t)&&at(e.parentNode)||e)==e&&g.scope||((a=e.getAttribute("id"))?a=k.escapeSelector(a):e.setAttribute("id",a=v)),s=(h=ht(t)).length;s--;)h[s]=(a?"#"+a:":scope")+" "+ut(h[s]);f=h.join(",")}try{return m.apply(i,p.querySelectorAll(f)),i}catch(e){_(t,!0)}finally{a===v&&e.removeAttribute("id")}}}return yt(t.replace(M,"$1"),e,i,n)}function tt(){var t=[];return function i(n,o){return t.push(n+" ")>e.cacheLength&&delete i[t.shift()],i[n+" "]=o}}function et(t){return t[v]=!0,t}function it(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function nt(t){return function(e){return T(e,"input")&&e.type===t}}function ot(t){return function(e){return(T(e,"input")||T(e,"button"))&&e.type===t}}function st(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&K(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function rt(t){return et(function(e){return e=+e,et(function(i,n){for(var o,s=t([],i.length,e),r=s.length;r--;)i[o=s[r]]&&(i[o]=!(n[o]=i[o]))})})}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var i,n=t?t.ownerDocument||t:R;return n!=l&&9===n.nodeType&&n.documentElement?(c=(l=n).documentElement,u=!k.isXMLDoc(l),p=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&R!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",G),g.getById=it(function(t){return c.appendChild(t).id=k.expando,!l.getElementsByName||!l.getElementsByName(k.expando).length}),g.disconnectedMatch=it(function(t){return p.call(t,"*")}),g.scope=it(function(){return l.querySelectorAll(":scope")}),g.cssHas=it(function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}}),g.getById?(e.filter.ID=function(t){var e=t.replace(Y,U);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i=e.getElementById(t);return i?[i]:[]}}):(e.filter.ID=function(t){var e=t.replace(Y,U);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i,n,o,s=e.getElementById(t);if(s){if((i=s.getAttributeNode("id"))&&i.value===t)return[s];for(o=e.getElementsByName(t),n=0;s=o[n++];)if((i=s.getAttributeNode("id"))&&i.value===t)return[s]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&u)return e.getElementsByClassName(t)},d=[],it(function(t){var e;c.appendChild(t).innerHTML="<a id='"+v+"' href='' disabled='disabled'></a><select id='"+v+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||d.push("\\["+A+"*(?:value|"+$+")"),t.querySelectorAll("[id~="+v+"-]").length||d.push("~="),t.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||d.push("\\["+A+"*name"+A+"*="+A+"*(?:''|\"\")")}),g.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),S=function(t,e){if(t===e)return r=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===i?t===l||t.ownerDocument==R&&J.contains(R,t)?-1:e===l||e.ownerDocument==R&&J.contains(R,e)?1:o?h.call(o,t)-h.call(o,e):0:4&i?-1:1)},l):l}for(t in J.matches=function(t,e){return J(t,null,null,e)},J.matchesSelector=function(t,e){if(lt(t),u&&!_[e+" "]&&(!d||!d.test(e)))try{var i=p.call(t,e);if(i||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){_(e,!0)}return J(e,l,null,[t]).length>0},J.contains=function(t,e){return(t.ownerDocument||t)!=l&&lt(t),k.contains(t,e)},J.attr=function(t,i){(t.ownerDocument||t)!=l&&lt(t);var n=e.attrHandle[i.toLowerCase()],o=n&&f.call(e.attrHandle,i.toLowerCase())?n(t,i,!u):void 0;return void 0!==o?o:t.getAttribute(i)},J.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},k.uniqueSort=function(t){var e,i=[],n=0,s=0;if(r=!g.sortStable,o=!g.sortStable&&a.call(t,0),P.call(t,S),r){for(;e=t[s++];)e===t[s]&&(n=i.push(s));for(;n--;)E.call(t,i[n],1)}return o=null,t},k.fn.uniqueSort=function(){return this.pushStack(k.uniqueSort(a.apply(this)))},e=k.expr={cacheLength:50,createPseudo:et,match:F,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Y,U),t[3]=(t[3]||t[4]||t[5]||"").replace(Y,U),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||J.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&J.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return F.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&Z.test(i)&&(e=ht(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Y,U).toLowerCase();return"*"===t?function(){return!0}:function(t){return T(t,e)}},CLASS:function(t){var e=b[t+" "];return e||(e=new RegExp("(^|"+A+")"+t+"("+A+"|$)"))&&b(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,i){return function(n){var o=J.attr(n,t);return null==o?"!="===e:!e||(o+="","="===e?o===i:"!="===e?o!==i:"^="===e?i&&0===o.indexOf(i):"*="===e?i&&o.indexOf(i)>-1:"$="===e?i&&o.slice(-i.length)===i:"~="===e?(" "+o.replace(N," ")+" ").indexOf(i)>-1:"|="===e&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,o){var s="nth"!==t.slice(0,3),r="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===o?function(t){return!!t.parentNode}:function(e,i,l){var c,h,u,d,f,p=s!==r?"nextSibling":"previousSibling",m=e.parentNode,g=a&&e.nodeName.toLowerCase(),O=!l&&!a,b=!1;if(m){if(s){for(;p;){for(u=e;u=u[p];)if(a?T(u,g):1===u.nodeType)return!1;f=p="only"===t&&!f&&"nextSibling"}return!0}if(f=[r?m.firstChild:m.lastChild],r&&O){for(b=(d=(c=(h=m[v]||(m[v]={}))[t]||[])[0]===y&&c[1])&&c[2],u=d&&m.childNodes[d];u=++d&&u&&u[p]||(b=d=0)||f.pop();)if(1===u.nodeType&&++b&&u===e){h[t]=[y,d,b];break}}else if(O&&(b=d=(c=(h=e[v]||(e[v]={}))[t]||[])[0]===y&&c[1]),!1===b)for(;(u=++d&&u&&u[p]||(b=d=0)||f.pop())&&(!(a?T(u,g):1===u.nodeType)||!++b||(O&&((h=u[v]||(u[v]={}))[t]=[y,b]),u!==e)););return(b-=o)===n||b%n===0&&b/n>=0}}},PSEUDO:function(t,i){var n,o=e.pseudos[t]||e.setFilters[t.toLowerCase()]||J.error("unsupported pseudo: "+t);return o[v]?o(i):o.length>1?(n=[t,t,"",i],e.setFilters.hasOwnProperty(t.toLowerCase())?et(function(t,e){for(var n,s=o(t,i),r=s.length;r--;)t[n=h.call(t,s[r])]=!(e[n]=s[r])}):function(t){return o(t,0,n)}):o}},pseudos:{not:et(function(t){var e=[],i=[],n=vt(t.replace(M,"$1"));return n[v]?et(function(t,e,i,o){for(var s,r=n(t,null,o,[]),a=t.length;a--;)(s=r[a])&&(t[a]=!(e[a]=s))}):function(t,o,s){return e[0]=t,n(e,null,s,i),e[0]=null,!i.pop()}}),has:et(function(t){return function(e){return J(t,e).length>0}}),contains:et(function(t){return t=t.replace(Y,U),function(e){return(e.textContent||k.text(e)).indexOf(t)>-1}}),lang:et(function(t){return W.test(t||"")||J.error("unsupported lang: "+t),t=t.replace(Y,U).toLowerCase(),function(e){var i;do{if(i=u?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(t){var e=n.location&&n.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:st(!1),disabled:st(!0),checked:function(t){return T(t,"input")&&!!t.checked||T(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return q.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){return T(t,"input")&&"button"===t.type||T(t,"button")},text:function(t){var e;return T(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:rt(function(){return[0]}),last:rt(function(t,e){return[e-1]}),eq:rt(function(t,e,i){return[i<0?i+e:i]}),even:rt(function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t}),odd:rt(function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t}),lt:rt(function(t,e,i){var n;for(n=i<0?i+e:i>e?e:i;--n>=0;)t.push(n);return t}),gt:rt(function(t,e,i){for(var n=i<0?i+e:i;++n<e;)t.push(n);return t})}},e.pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=nt(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=ot(t);function ct(){}function ht(t,i){var n,o,s,r,a,l,c,h=x[t+" "];if(h)return i?0:h.slice(0);for(a=t,l=[],c=e.preFilter;a;){for(r in n&&!(o=j.exec(a))||(o&&(a=a.slice(o[0].length)||a),l.push(s=[])),n=!1,(o=z.exec(a))&&(n=o.shift(),s.push({value:n,type:o[0].replace(M," ")}),a=a.slice(n.length)),e.filter)!(o=F[r].exec(a))||c[r]&&!(o=c[r](o))||(n=o.shift(),s.push({value:n,type:r,matches:o}),a=a.slice(n.length));if(!n)break}return i?a.length:a?J.error(t):x(t,l).slice(0)}function ut(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function dt(t,e,i){var n=e.dir,o=e.next,s=o||n,r=i&&"parentNode"===s,a=O++;return e.first?function(e,i,o){for(;e=e[n];)if(1===e.nodeType||r)return t(e,i,o);return!1}:function(e,i,l){var c,h,u=[y,a];if(l){for(;e=e[n];)if((1===e.nodeType||r)&&t(e,i,l))return!0}else for(;e=e[n];)if(1===e.nodeType||r)if(h=e[v]||(e[v]={}),o&&T(e,o))e=e[n]||e;else{if((c=h[s])&&c[0]===y&&c[1]===a)return u[2]=c[2];if(h[s]=u,u[2]=t(e,i,l))return!0}return!1}}function ft(t){return t.length>1?function(e,i,n){for(var o=t.length;o--;)if(!t[o](e,i,n))return!1;return!0}:t[0]}function pt(t,e,i,n,o){for(var s,r=[],a=0,l=t.length,c=null!=e;a<l;a++)(s=t[a])&&(i&&!i(s,n,o)||(r.push(s),c&&e.push(a)));return r}function mt(t,e,i,n,o,s){return n&&!n[v]&&(n=mt(n)),o&&!o[v]&&(o=mt(o,s)),et(function(s,r,a,l){var c,u,d,f,p=[],g=[],v=r.length,y=s||function(t,e,i){for(var n=0,o=e.length;n<o;n++)J(t,e[n],i);return i}(e||"*",a.nodeType?[a]:a,[]),O=!t||!s&&e?y:pt(y,p,t,a,l);if(i?i(O,f=o||(s?t:v||n)?[]:r,a,l):f=O,n)for(c=pt(f,g),n(c,[],a,l),u=c.length;u--;)(d=c[u])&&(f[g[u]]=!(O[g[u]]=d));if(s){if(o||t){if(o){for(c=[],u=f.length;u--;)(d=f[u])&&c.push(O[u]=d);o(null,f=[],c,l)}for(u=f.length;u--;)(d=f[u])&&(c=o?h.call(s,d):p[u])>-1&&(s[c]=!(r[c]=d))}}else f=pt(f===r?f.splice(v,f.length):f),o?o(null,r,f,l):m.apply(r,f)})}function gt(t){for(var n,o,s,r=t.length,a=e.relative[t[0].type],l=a||e.relative[" "],c=a?1:0,u=dt(function(t){return t===n},l,!0),d=dt(function(t){return h.call(n,t)>-1},l,!0),f=[function(t,e,o){var s=!a&&(o||e!=i)||((n=e).nodeType?u(t,e,o):d(t,e,o));return n=null,s}];c<r;c++)if(o=e.relative[t[c].type])f=[dt(ft(f),o)];else{if((o=e.filter[t[c].type].apply(null,t[c].matches))[v]){for(s=++c;s<r&&!e.relative[t[s].type];s++);return mt(c>1&&ft(f),c>1&&ut(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(M,"$1"),o,c<s&&gt(t.slice(c,s)),s<r&&gt(t=t.slice(s)),s<r&&ut(t))}f.push(o)}return ft(f)}function vt(t,n){var o,s=[],r=[],a=w[t+" "];if(!a){for(n||(n=ht(t)),o=n.length;o--;)(a=gt(n[o]))[v]?s.push(a):r.push(a);a=w(t,function(t,n){var o=n.length>0,s=t.length>0,r=function(r,a,c,h,d){var f,p,g,v=0,O="0",b=r&&[],x=[],w=i,_=r||s&&e.find.TAG("*",d),S=y+=null==w?1:Math.random()||.1,$=_.length;for(d&&(i=a==l||a||d);O!==$&&null!=(f=_[O]);O++){if(s&&f){for(p=0,a||f.ownerDocument==l||(lt(f),c=!u);g=t[p++];)if(g(f,a||l,c)){m.call(h,f);break}d&&(y=S)}o&&((f=!g&&f)&&v--,r&&b.push(f))}if(v+=O,o&&O!==v){for(p=0;g=n[p++];)g(b,x,a,c);if(r){if(v>0)for(;O--;)b[O]||x[O]||(x[O]=C.call(h));x=pt(x)}m.apply(h,x),d&&!r&&x.length>0&&v+n.length>1&&k.uniqueSort(h)}return d&&(y=S,i=w),b};return o?et(r):r}(r,s)),a.selector=t}return a}function yt(t,i,n,o){var s,r,a,l,c,h="function"==typeof t&&t,d=!o&&ht(t=h.selector||t);if(n=n||[],1===d.length){if((r=d[0]=d[0].slice(0)).length>2&&"ID"===(a=r[0]).type&&9===i.nodeType&&u&&e.relative[r[1].type]){if(!(i=(e.find.ID(a.matches[0].replace(Y,U),i)||[])[0]))return n;h&&(i=i.parentNode),t=t.slice(r.shift().value.length)}for(s=F.needsContext.test(t)?0:r.length;s--&&(a=r[s],!e.relative[l=a.type]);)if((c=e.find[l])&&(o=c(a.matches[0].replace(Y,U),V.test(r[0].type)&&at(i.parentNode)||i))){if(r.splice(s,1),!(t=o.length&&ut(r)))return m.apply(n,o),n;break}}return(h||vt(t,d))(o,i,!u,n,!i||V.test(t)&&at(i.parentNode)||i),n}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,g.sortStable=v.split("").sort(S).join("")===v,lt(),g.sortDetached=it(function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))}),k.find=J,k.expr[":"]=k.expr.pseudos,k.unique=k.uniqueSort,J.compile=vt,J.select=yt,J.setDocument=lt,J.tokenize=ht,J.escape=k.escapeSelector,J.getText=k.text,J.isXML=k.isXMLDoc,J.selectors=k.expr,J.support=k.support,J.uniqueSort=k.uniqueSort}();var L=function(t,e,i){for(var n=[],o=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&k(t).is(i))break;n.push(t)}return n},N=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},j=k.expr.match.needsContext,z=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function B(t,e,i){return v(e)?k.grep(t,function(t,n){return!!e.call(t,n,t)!==i}):e.nodeType?k.grep(t,function(t){return t===e!==i}):"string"!=typeof e?k.grep(t,function(t){return h.call(e,t)>-1!==i}):k.filter(e,t,i)}k.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?k.find.matchesSelector(n,t)?[n]:[]:k.find.matches(t,k.grep(e,function(t){return 1===t.nodeType}))},k.fn.extend({find:function(t){var e,i,n=this.length,o=this;if("string"!=typeof t)return this.pushStack(k(t).filter(function(){for(e=0;e<n;e++)if(k.contains(o[e],this))return!0}));for(i=this.pushStack([]),e=0;e<n;e++)k.find(t,o[e],i);return n>1?k.uniqueSort(i):i},filter:function(t){return this.pushStack(B(this,t||[],!1))},not:function(t){return this.pushStack(B(this,t||[],!0))},is:function(t){return!!B(this,"string"==typeof t&&j.test(t)?k(t):t||[],!1).length}});var Z,W=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(t,e,i){var n,o;if(!t)return this;if(i=i||Z,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:W.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof k?e[0]:e,k.merge(this,k.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:O,!0)),z.test(n[1])&&k.isPlainObject(e))for(n in e)v(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(o=O.getElementById(n[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==i.ready?i.ready(t):t(k):k.makeArray(t,this)}).prototype=k.fn,Z=k(O);var F=/^(?:parents|prev(?:Until|All))/,X={children:!0,contents:!0,next:!0,prev:!0};function q(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}k.fn.extend({has:function(t){var e=k(t,this),i=e.length;return this.filter(function(){for(var t=0;t<i;t++)if(k.contains(this,e[t]))return!0})},closest:function(t,e){var i,n=0,o=this.length,s=[],r="string"!=typeof t&&k(t);if(!j.test(t))for(;n<o;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(r?r.index(i)>-1:1===i.nodeType&&k.find.matchesSelector(i,t))){s.push(i);break}return this.pushStack(s.length>1?k.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?h.call(k(t),this[0]):h.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),k.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return L(t,"parentNode")},parentsUntil:function(t,e,i){return L(t,"parentNode",i)},next:function(t){return q(t,"nextSibling")},prev:function(t){return q(t,"previousSibling")},nextAll:function(t){return L(t,"nextSibling")},prevAll:function(t){return L(t,"previousSibling")},nextUntil:function(t,e,i){return L(t,"nextSibling",i)},prevUntil:function(t,e,i){return L(t,"previousSibling",i)},siblings:function(t){return N((t.parentNode||{}).firstChild,t)},children:function(t){return N(t.firstChild)},contents:function(t){return null!=t.contentDocument&&r(t.contentDocument)?t.contentDocument:(T(t,"template")&&(t=t.content||t),k.merge([],t.childNodes))}},function(t,e){k.fn[t]=function(i,n){var o=k.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(o=k.filter(n,o)),this.length>1&&(X[t]||k.uniqueSort(o),F.test(t)&&o.reverse()),this.pushStack(o)}});var H=/[^\x20\t\r\n\f]+/g;function V(t){return t}function Y(t){throw t}function U(t,e,i,n){var o;try{t&&v(o=t.promise)?o.call(t).done(e).fail(i):t&&v(o=t.then)?o.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}k.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return k.each(t.match(H)||[],function(t,i){e[i]=!0}),e}(t):k.extend({},t);var e,i,n,o,s=[],r=[],a=-1,l=function(){for(o=o||t.once,n=e=!0;r.length;a=-1)for(i=r.shift();++a<s.length;)!1===s[a].apply(i[0],i[1])&&t.stopOnFalse&&(a=s.length,i=!1);t.memory||(i=!1),e=!1,o&&(s=i?[]:"")},c={add:function(){return s&&(i&&!e&&(a=s.length-1,r.push(i)),function e(i){k.each(i,function(i,n){v(n)?t.unique&&c.has(n)||s.push(n):n&&n.length&&"string"!==w(n)&&e(n)})}(arguments),i&&!e&&l()),this},remove:function(){return k.each(arguments,function(t,e){for(var i;(i=k.inArray(e,s,i))>-1;)s.splice(i,1),i<=a&&a--}),this},has:function(t){return t?k.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return o=r=[],s=i="",this},disabled:function(){return!s},lock:function(){return o=r=[],i||e||(s=i=""),this},locked:function(){return!!o},fireWith:function(t,i){return o||(i=[t,(i=i||[]).slice?i.slice():i],r.push(i),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},k.extend({Deferred:function(t){var e=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",o={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return k.Deferred(function(i){k.each(e,function(e,n){var o=v(t[n[4]])&&t[n[4]];s[n[1]](function(){var t=o&&o.apply(this,arguments);t&&v(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[n[0]+"With"](this,o?[t]:arguments)})}),t=null}).promise()},then:function(t,i,o){var s=0;function r(t,e,i,o){return function(){var a=this,l=arguments,c=function(){var n,c;if(!(t<s)){if((n=i.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==typeof n||"function"==typeof n)&&n.then,v(c)?o?c.call(n,r(s,e,V,o),r(s,e,Y,o)):(s++,c.call(n,r(s,e,V,o),r(s,e,Y,o),r(s,e,V,e.notifyWith))):(i!==V&&(a=void 0,l=[n]),(o||e.resolveWith)(a,l))}},h=o?c:function(){try{c()}catch(n){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(n,h.error),t+1>=s&&(i!==Y&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?h():(k.Deferred.getErrorHook?h.error=k.Deferred.getErrorHook():k.Deferred.getStackHook&&(h.error=k.Deferred.getStackHook()),n.setTimeout(h))}}return k.Deferred(function(n){e[0][3].add(r(0,n,v(o)?o:V,n.notifyWith)),e[1][3].add(r(0,n,v(t)?t:V)),e[2][3].add(r(0,n,v(i)?i:Y))}).promise()},promise:function(t){return null!=t?k.extend(t,o):o}},s={};return k.each(e,function(t,n){var r=n[2],a=n[5];o[n[1]]=r.add,a&&r.add(function(){i=a},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),r.add(n[3].fire),s[n[0]]=function(){return s[n[0]+"With"](this===s?void 0:this,arguments),this},s[n[0]+"With"]=r.fireWith}),o.promise(s),t&&t.call(s,s),s},when:function(t){var e=arguments.length,i=e,n=Array(i),o=a.call(arguments),s=k.Deferred(),r=function(t){return function(i){n[t]=this,o[t]=arguments.length>1?a.call(arguments):i,--e||s.resolveWith(n,o)}};if(e<=1&&(U(t,s.done(r(i)).resolve,s.reject,!e),"pending"===s.state()||v(o[i]&&o[i].then)))return s.then();for(;i--;)U(o[i],r(i),s.reject);return s.promise()}});var G=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&G.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},k.readyException=function(t){n.setTimeout(function(){throw t})};var K=k.Deferred();function J(){O.removeEventListener("DOMContentLoaded",J),n.removeEventListener("load",J),k.ready()}k.fn.ready=function(t){return K.then(t).catch(function(t){k.readyException(t)}),this},k.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==t&&--k.readyWait>0||K.resolveWith(O,[k]))}}),k.ready.then=K.then,"complete"===O.readyState||"loading"!==O.readyState&&!O.documentElement.doScroll?n.setTimeout(k.ready):(O.addEventListener("DOMContentLoaded",J),n.addEventListener("load",J));var tt=function(t,e,i,n,o,s,r){var a=0,l=t.length,c=null==i;if("object"===w(i))for(a in o=!0,i)tt(t,e,a,i[a],!0,s,r);else if(void 0!==n&&(o=!0,v(n)||(r=!0),c&&(r?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(k(t),i)})),e))for(;a<l;a++)e(t[a],i,r?n:n.call(t[a],a,e(t[a],i)));return o?t:c?e.call(t):l?e(t[0],i):s},et=/^-ms-/,it=/-([a-z])/g;function nt(t,e){return e.toUpperCase()}function ot(t){return t.replace(et,"ms-").replace(it,nt)}var st=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function rt(){this.expando=k.expando+rt.uid++}rt.uid=1,rt.prototype={cache:function(t){var e=t[this.expando];return e||(e={},st(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,o=this.cache(t);if("string"==typeof e)o[ot(e)]=i;else for(n in e)o[ot(n)]=e[n];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][ot(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){i=(e=Array.isArray(e)?e.map(ot):(e=ot(e))in n?[e]:e.match(H)||[]).length;for(;i--;)delete n[e[i]]}(void 0===e||k.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!k.isEmptyObject(e)}};var at=new rt,lt=new rt,ct=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ht=/[A-Z]/g;function ut(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(ht,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:ct.test(t)?JSON.parse(t):t)}(i)}catch(t){}lt.set(t,e,i)}else i=void 0;return i}k.extend({hasData:function(t){return lt.hasData(t)||at.hasData(t)},data:function(t,e,i){return lt.access(t,e,i)},removeData:function(t,e){lt.remove(t,e)},_data:function(t,e,i){return at.access(t,e,i)},_removeData:function(t,e){at.remove(t,e)}}),k.fn.extend({data:function(t,e){var i,n,o,s=this[0],r=s&&s.attributes;if(void 0===t){if(this.length&&(o=lt.get(s),1===s.nodeType&&!at.get(s,"hasDataAttrs"))){for(i=r.length;i--;)r[i]&&0===(n=r[i].name).indexOf("data-")&&(n=ot(n.slice(5)),ut(s,n,o[n]));at.set(s,"hasDataAttrs",!0)}return o}return"object"==typeof t?this.each(function(){lt.set(this,t)}):tt(this,function(e){var i;if(s&&void 0===e)return void 0!==(i=lt.get(s,t))||void 0!==(i=ut(s,t))?i:void 0;this.each(function(){lt.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){lt.remove(this,t)})}}),k.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=at.get(t,e),i&&(!n||Array.isArray(i)?n=at.access(t,e,k.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=k.queue(t,e),n=i.length,o=i.shift(),s=k._queueHooks(t,e);"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===e&&i.unshift("inprogress"),delete s.stop,o.call(t,function(){k.dequeue(t,e)},s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return at.get(t,i)||at.access(t,i,{empty:k.Callbacks("once memory").add(function(){at.remove(t,[e+"queue",i])})})}}),k.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?k.queue(this[0],t):void 0===e?this:this.each(function(){var i=k.queue(this,t,e);k._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&k.dequeue(this,t)})},dequeue:function(t){return this.each(function(){k.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,o=k.Deferred(),s=this,r=this.length,a=function(){--n||o.resolveWith(s,[s])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";r--;)(i=at.get(s[r],t+"queueHooks"))&&i.empty&&(n++,i.empty.add(a));return a(),o.promise(e)}});var dt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ft=new RegExp("^(?:([+-])=|)("+dt+")([a-z%]*)$","i"),pt=["Top","Right","Bottom","Left"],mt=O.documentElement,gt=function(t){return k.contains(t.ownerDocument,t)},vt={composed:!0};mt.getRootNode&&(gt=function(t){return k.contains(t.ownerDocument,t)||t.getRootNode(vt)===t.ownerDocument});var yt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&gt(t)&&"none"===k.css(t,"display")};function Ot(t,e,i,n){var o,s,r=20,a=n?function(){return n.cur()}:function(){return k.css(t,e,"")},l=a(),c=i&&i[3]||(k.cssNumber[e]?"":"px"),h=t.nodeType&&(k.cssNumber[e]||"px"!==c&&+l)&&ft.exec(k.css(t,e));if(h&&h[3]!==c){for(l/=2,c=c||h[3],h=+l||1;r--;)k.style(t,e,h+c),(1-s)*(1-(s=a()/l||.5))<=0&&(r=0),h/=s;h*=2,k.style(t,e,h+c),i=i||[]}return i&&(h=+h||+l||0,o=i[1]?h+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=h,n.end=o)),o}var bt={};function xt(t){var e,i=t.ownerDocument,n=t.nodeName,o=bt[n];return o||(e=i.body.appendChild(i.createElement(n)),o=k.css(e,"display"),e.parentNode.removeChild(e),"none"===o&&(o="block"),bt[n]=o,o)}function wt(t,e){for(var i,n,o=[],s=0,r=t.length;s<r;s++)(n=t[s]).style&&(i=n.style.display,e?("none"===i&&(o[s]=at.get(n,"display")||null,o[s]||(n.style.display="")),""===n.style.display&&yt(n)&&(o[s]=xt(n))):"none"!==i&&(o[s]="none",at.set(n,"display",i)));for(s=0;s<r;s++)null!=o[s]&&(t[s].style.display=o[s]);return t}k.fn.extend({show:function(){return wt(this,!0)},hide:function(){return wt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){yt(this)?k(this).show():k(this).hide()})}});var _t,St,kt=/^(?:checkbox|radio)$/i,$t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Tt=/^$|^module$|\/(?:java|ecma)script/i;_t=O.createDocumentFragment().appendChild(O.createElement("div")),(St=O.createElement("input")).setAttribute("type","radio"),St.setAttribute("checked","checked"),St.setAttribute("name","t"),_t.appendChild(St),g.checkClone=_t.cloneNode(!0).cloneNode(!0).lastChild.checked,_t.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!_t.cloneNode(!0).lastChild.defaultValue,_t.innerHTML="<option></option>",g.option=!!_t.lastChild;var Ct={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Pt(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&T(t,e)?k.merge([t],i):i}function Et(t,e){for(var i=0,n=t.length;i<n;i++)at.set(t[i],"globalEval",!e||at.get(e[i],"globalEval"))}Ct.tbody=Ct.tfoot=Ct.colgroup=Ct.caption=Ct.thead,Ct.th=Ct.td,g.option||(Ct.optgroup=Ct.option=[1,"<select multiple='multiple'>","</select>"]);var At=/<|&#?\w+;/;function Mt(t,e,i,n,o){for(var s,r,a,l,c,h,u=e.createDocumentFragment(),d=[],f=0,p=t.length;f<p;f++)if((s=t[f])||0===s)if("object"===w(s))k.merge(d,s.nodeType?[s]:s);else if(At.test(s)){for(r=r||u.appendChild(e.createElement("div")),a=($t.exec(s)||["",""])[1].toLowerCase(),l=Ct[a]||Ct._default,r.innerHTML=l[1]+k.htmlPrefilter(s)+l[2],h=l[0];h--;)r=r.lastChild;k.merge(d,r.childNodes),(r=u.firstChild).textContent=""}else d.push(e.createTextNode(s));for(u.textContent="",f=0;s=d[f++];)if(n&&k.inArray(s,n)>-1)o&&o.push(s);else if(c=gt(s),r=Pt(u.appendChild(s),"script"),c&&Et(r),i)for(h=0;s=r[h++];)Tt.test(s.type||"")&&i.push(s);return u}var Qt=/^([^.]*)(?:\.(.+)|)/;function Dt(){return!0}function Rt(){return!1}function It(t,e,i,n,o,s){var r,a;if("object"==typeof e){for(a in"string"!=typeof i&&(n=n||i,i=void 0),e)It(t,a,i,n,e[a],s);return t}if(null==n&&null==o?(o=i,n=i=void 0):null==o&&("string"==typeof i?(o=n,n=void 0):(o=n,n=i,i=void 0)),!1===o)o=Rt;else if(!o)return t;return 1===s&&(r=o,o=function(t){return k().off(t),r.apply(this,arguments)},o.guid=r.guid||(r.guid=k.guid++)),t.each(function(){k.event.add(this,e,o,n,i)})}function Lt(t,e,i){i?(at.set(t,e,!1),k.event.add(t,e,{namespace:!1,handler:function(t){var i,n=at.get(this,e);if(1&t.isTrigger&&this[e]){if(n)(k.event.special[e]||{}).delegateType&&t.stopPropagation();else if(n=a.call(arguments),at.set(this,e,n),this[e](),i=at.get(this,e),at.set(this,e,!1),n!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else n&&(at.set(this,e,k.event.trigger(n[0],n.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Dt)}})):void 0===at.get(t,e)&&k.event.add(t,e,Dt)}k.event={global:{},add:function(t,e,i,n,o){var s,r,a,l,c,h,u,d,f,p,m,g=at.get(t);if(st(t))for(i.handler&&(i=(s=i).handler,o=s.selector),o&&k.find.matchesSelector(mt,o),i.guid||(i.guid=k.guid++),(l=g.events)||(l=g.events=Object.create(null)),(r=g.handle)||(r=g.handle=function(e){return void 0!==k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(H)||[""]).length;c--;)f=m=(a=Qt.exec(e[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(u=k.event.special[f]||{},f=(o?u.delegateType:u.bindType)||f,u=k.event.special[f]||{},h=k.extend({type:f,origType:m,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&k.expr.match.needsContext.test(o),namespace:p.join(".")},s),(d=l[f])||((d=l[f]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,n,p,r)||t.addEventListener&&t.addEventListener(f,r)),u.add&&(u.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),o?d.splice(d.delegateCount++,0,h):d.push(h),k.event.global[f]=!0)},remove:function(t,e,i,n,o){var s,r,a,l,c,h,u,d,f,p,m,g=at.hasData(t)&&at.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(H)||[""]).length;c--;)if(f=m=(a=Qt.exec(e[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(u=k.event.special[f]||{},d=l[f=(n?u.delegateType:u.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=s=d.length;s--;)h=d[s],!o&&m!==h.origType||i&&i.guid!==h.guid||a&&!a.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(d.splice(s,1),h.selector&&d.delegateCount--,u.remove&&u.remove.call(t,h));r&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,p,g.handle)||k.removeEvent(t,f,g.handle),delete l[f])}else for(f in l)k.event.remove(t,f+e[c],i,n,!0);k.isEmptyObject(l)&&at.remove(t,"handle events")}},dispatch:function(t){var e,i,n,o,s,r,a=new Array(arguments.length),l=k.event.fix(t),c=(at.get(this,"events")||Object.create(null))[l.type]||[],h=k.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){for(r=k.event.handlers.call(this,l,c),e=0;(o=r[e++])&&!l.isPropagationStopped();)for(l.currentTarget=o.elem,i=0;(s=o.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==s.namespace&&!l.rnamespace.test(s.namespace)||(l.handleObj=s,l.data=s.data,void 0!==(n=((k.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,a))&&!1===(l.result=n)&&(l.preventDefault(),l.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(t,e){var i,n,o,s,r,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(s=[],r={},i=0;i<l;i++)void 0===r[o=(n=e[i]).selector+" "]&&(r[o]=n.needsContext?k(o,this).index(c)>-1:k.find(o,this,null,[c]).length),r[o]&&s.push(n);s.length&&a.push({elem:c,handlers:s})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[k.expando]?t:new k.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return kt.test(e.type)&&e.click&&T(e,"input")&&Lt(e,"click",!0),!1},trigger:function(t){var e=this||t;return kt.test(e.type)&&e.click&&T(e,"input")&&Lt(e,"click"),!0},_default:function(t){var e=t.target;return kt.test(e.type)&&e.click&&T(e,"input")&&at.get(e,"click")||T(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},k.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},k.Event=function(t,e){if(!(this instanceof k.Event))return new k.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Dt:Rt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&k.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Rt,isPropagationStopped:Rt,isImmediatePropagationStopped:Rt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Dt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Dt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Dt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(t,e){function i(t){if(O.documentMode){var i=at.get(this,"handle"),n=k.event.fix(t);n.type="focusin"===t.type?"focus":"blur",n.isSimulated=!0,i(t),n.target===n.currentTarget&&i(n)}else k.event.simulate(e,t.target,k.event.fix(t))}k.event.special[t]={setup:function(){var n;if(Lt(this,t,!0),!O.documentMode)return!1;(n=at.get(this,e))||this.addEventListener(e,i),at.set(this,e,(n||0)+1)},trigger:function(){return Lt(this,t),!0},teardown:function(){var t;if(!O.documentMode)return!1;(t=at.get(this,e)-1)?at.set(this,e,t):(this.removeEventListener(e,i),at.remove(this,e))},_default:function(e){return at.get(e.target,t)},delegateType:e},k.event.special[e]={setup:function(){var n=this.ownerDocument||this.document||this,o=O.documentMode?this:n,s=at.get(o,e);s||(O.documentMode?this.addEventListener(e,i):n.addEventListener(t,i,!0)),at.set(o,e,(s||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,o=O.documentMode?this:n,s=at.get(o,e)-1;s?at.set(o,e,s):(O.documentMode?this.removeEventListener(e,i):n.removeEventListener(t,i,!0),at.remove(o,e))}}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){k.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=t.relatedTarget,o=t.handleObj;return n&&(n===this||k.contains(this,n))||(t.type=o.origType,i=o.handler.apply(this,arguments),t.type=e),i}}}),k.fn.extend({on:function(t,e,i,n){return It(this,t,e,i,n)},one:function(t,e,i,n){return It(this,t,e,i,n,1)},off:function(t,e,i){var n,o;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,k(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Rt),this.each(function(){k.event.remove(this,t,i,e)})}});var Nt=/<script|<style|<link/i,jt=/checked\s*(?:[^=]|=\s*.checked.)/i,zt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Bt(t,e){return T(t,"table")&&T(11!==e.nodeType?e:e.firstChild,"tr")&&k(t).children("tbody")[0]||t}function Zt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Wt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ft(t,e){var i,n,o,s,r,a;if(1===e.nodeType){if(at.hasData(t)&&(a=at.get(t).events))for(o in at.remove(e,"handle events"),a)for(i=0,n=a[o].length;i<n;i++)k.event.add(e,o,a[o][i]);lt.hasData(t)&&(s=lt.access(t),r=k.extend({},s),lt.set(e,r))}}function Xt(t,e){var i=e.nodeName.toLowerCase();"input"===i&&kt.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function qt(t,e,i,n){e=l(e);var o,s,r,a,c,h,u=0,d=t.length,f=d-1,p=e[0],m=v(p);if(m||d>1&&"string"==typeof p&&!g.checkClone&&jt.test(p))return t.each(function(o){var s=t.eq(o);m&&(e[0]=p.call(this,o,s.html())),qt(s,e,i,n)});if(d&&(s=(o=Mt(e,t[0].ownerDocument,!1,t,n)).firstChild,1===o.childNodes.length&&(o=s),s||n)){for(a=(r=k.map(Pt(o,"script"),Zt)).length;u<d;u++)c=o,u!==f&&(c=k.clone(c,!0,!0),a&&k.merge(r,Pt(c,"script"))),i.call(t[u],c,u);if(a)for(h=r[r.length-1].ownerDocument,k.map(r,Wt),u=0;u<a;u++)c=r[u],Tt.test(c.type||"")&&!at.access(c,"globalEval")&&k.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?k._evalUrl&&!c.noModule&&k._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},h):x(c.textContent.replace(zt,""),c,h))}return t}function Ht(t,e,i){for(var n,o=e?k.filter(e,t):t,s=0;null!=(n=o[s]);s++)i||1!==n.nodeType||k.cleanData(Pt(n)),n.parentNode&&(i&&gt(n)&&Et(Pt(n,"script")),n.parentNode.removeChild(n));return t}k.extend({htmlPrefilter:function(t){return t},clone:function(t,e,i){var n,o,s,r,a=t.cloneNode(!0),l=gt(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||k.isXMLDoc(t)))for(r=Pt(a),n=0,o=(s=Pt(t)).length;n<o;n++)Xt(s[n],r[n]);if(e)if(i)for(s=s||Pt(t),r=r||Pt(a),n=0,o=s.length;n<o;n++)Ft(s[n],r[n]);else Ft(t,a);return(r=Pt(a,"script")).length>0&&Et(r,!l&&Pt(t,"script")),a},cleanData:function(t){for(var e,i,n,o=k.event.special,s=0;void 0!==(i=t[s]);s++)if(st(i)){if(e=i[at.expando]){if(e.events)for(n in e.events)o[n]?k.event.remove(i,n):k.removeEvent(i,n,e.handle);i[at.expando]=void 0}i[lt.expando]&&(i[lt.expando]=void 0)}}}),k.fn.extend({detach:function(t){return Ht(this,t,!0)},remove:function(t){return Ht(this,t)},text:function(t){return tt(this,function(t){return void 0===t?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return qt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Bt(this,t).appendChild(t)})},prepend:function(){return qt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Bt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return qt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return qt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(k.cleanData(Pt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return k.clone(this,t,e)})},html:function(t){return tt(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Nt.test(t)&&!Ct[($t.exec(t)||["",""])[1].toLowerCase()]){t=k.htmlPrefilter(t);try{for(;i<n;i++)1===(e=this[i]||{}).nodeType&&(k.cleanData(Pt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return qt(this,arguments,function(e){var i=this.parentNode;k.inArray(this,t)<0&&(k.cleanData(Pt(this)),i&&i.replaceChild(e,this))},t)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){k.fn[t]=function(t){for(var i,n=[],o=k(t),s=o.length-1,r=0;r<=s;r++)i=r===s?this:this.clone(!0),k(o[r])[e](i),c.apply(n,i.get());return this.pushStack(n)}});var Vt=new RegExp("^("+dt+")(?!px)[a-z%]+$","i"),Yt=/^--/,Ut=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Gt=function(t,e,i){var n,o,s={};for(o in e)s[o]=t.style[o],t.style[o]=e[o];for(o in n=i.call(t),e)t.style[o]=s[o];return n},Kt=new RegExp(pt.join("|"),"i");function Jt(t,e,i){var n,o,s,r,a=Yt.test(e),l=t.style;return(i=i||Ut(t))&&(r=i.getPropertyValue(e)||i[e],a&&r&&(r=r.replace(M,"$1")||void 0),""!==r||gt(t)||(r=k.style(t,e)),!g.pixelBoxStyles()&&Vt.test(r)&&Kt.test(e)&&(n=l.width,o=l.minWidth,s=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=i.width,l.width=n,l.minWidth=o,l.maxWidth=s)),void 0!==r?r+"":r}function te(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(h){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",mt.appendChild(c).appendChild(h);var t=n.getComputedStyle(h);i="1%"!==t.top,l=12===e(t.marginLeft),h.style.right="60%",r=36===e(t.right),o=36===e(t.width),h.style.position="absolute",s=12===e(h.offsetWidth/3),mt.removeChild(c),h=null}}function e(t){return Math.round(parseFloat(t))}var i,o,s,r,a,l,c=O.createElement("div"),h=O.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===h.style.backgroundClip,k.extend(g,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),r},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),s},reliableTrDimensions:function(){var t,e,i,o;return null==a&&(t=O.createElement("table"),e=O.createElement("tr"),i=O.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="box-sizing:content-box;border:1px solid",e.style.height="1px",i.style.height="9px",i.style.display="block",mt.appendChild(t).appendChild(e).appendChild(i),o=n.getComputedStyle(e),a=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===e.offsetHeight,mt.removeChild(t)),a}}))}();var ee=["Webkit","Moz","ms"],ie=O.createElement("div").style,ne={};function oe(t){var e=k.cssProps[t]||ne[t];return e||(t in ie?t:ne[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),i=ee.length;i--;)if((t=ee[i]+e)in ie)return t}(t)||t)}var se=/^(none|table(?!-c[ea]).+)/,re={position:"absolute",visibility:"hidden",display:"block"},ae={letterSpacing:"0",fontWeight:"400"};function le(t,e,i){var n=ft.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function ce(t,e,i,n,o,s){var r="width"===e?1:0,a=0,l=0,c=0;if(i===(n?"border":"content"))return 0;for(;r<4;r+=2)"margin"===i&&(c+=k.css(t,i+pt[r],!0,o)),n?("content"===i&&(l-=k.css(t,"padding"+pt[r],!0,o)),"margin"!==i&&(l-=k.css(t,"border"+pt[r]+"Width",!0,o))):(l+=k.css(t,"padding"+pt[r],!0,o),"padding"!==i?l+=k.css(t,"border"+pt[r]+"Width",!0,o):a+=k.css(t,"border"+pt[r]+"Width",!0,o));return!n&&s>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-l-a-.5))||0),l+c}function he(t,e,i){var n=Ut(t),o=(!g.boxSizingReliable()||i)&&"border-box"===k.css(t,"boxSizing",!1,n),s=o,r=Jt(t,e,n),a="offset"+e[0].toUpperCase()+e.slice(1);if(Vt.test(r)){if(!i)return r;r="auto"}return(!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&T(t,"tr")||"auto"===r||!parseFloat(r)&&"inline"===k.css(t,"display",!1,n))&&t.getClientRects().length&&(o="border-box"===k.css(t,"boxSizing",!1,n),(s=a in t)&&(r=t[a])),(r=parseFloat(r)||0)+ce(t,e,i||(o?"border":"content"),s,n,r)+"px"}function ue(t,e,i,n,o){return new ue.prototype.init(t,e,i,n,o)}k.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Jt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,s,r,a=ot(e),l=Yt.test(e),c=t.style;if(l||(e=oe(a)),r=k.cssHooks[e]||k.cssHooks[a],void 0===i)return r&&"get"in r&&void 0!==(o=r.get(t,!1,n))?o:c[e];"string"===(s=typeof i)&&(o=ft.exec(i))&&o[1]&&(i=Ot(t,e,o),s="number"),null!=i&&i==i&&("number"!==s||l||(i+=o&&o[3]||(k.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==i||0!==e.indexOf("background")||(c[e]="inherit"),r&&"set"in r&&void 0===(i=r.set(t,i,n))||(l?c.setProperty(e,i):c[e]=i))}},css:function(t,e,i,n){var o,s,r,a=ot(e);return Yt.test(e)||(e=oe(a)),(r=k.cssHooks[e]||k.cssHooks[a])&&"get"in r&&(o=r.get(t,!0,i)),void 0===o&&(o=Jt(t,e,n)),"normal"===o&&e in ae&&(o=ae[e]),""===i||i?(s=parseFloat(o),!0===i||isFinite(s)?s||0:o):o}}),k.each(["height","width"],function(t,e){k.cssHooks[e]={get:function(t,i,n){if(i)return!se.test(k.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?he(t,e,n):Gt(t,re,function(){return he(t,e,n)})},set:function(t,i,n){var o,s=Ut(t),r=!g.scrollboxSize()&&"absolute"===s.position,a=(r||n)&&"border-box"===k.css(t,"boxSizing",!1,s),l=n?ce(t,e,n,a,s):0;return a&&r&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-ce(t,e,"border",!1,s)-.5)),l&&(o=ft.exec(i))&&"px"!==(o[3]||"px")&&(t.style[e]=i,i=k.css(t,e)),le(0,i,l)}}}),k.cssHooks.marginLeft=te(g.reliableMarginLeft,function(t,e){if(e)return(parseFloat(Jt(t,"marginLeft"))||t.getBoundingClientRect().left-Gt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(t,e){k.cssHooks[t+e]={expand:function(i){for(var n=0,o={},s="string"==typeof i?i.split(" "):[i];n<4;n++)o[t+pt[n]+e]=s[n]||s[n-2]||s[0];return o}},"margin"!==t&&(k.cssHooks[t+e].set=le)}),k.fn.extend({css:function(t,e){return tt(this,function(t,e,i){var n,o,s={},r=0;if(Array.isArray(e)){for(n=Ut(t),o=e.length;r<o;r++)s[e[r]]=k.css(t,e[r],!1,n);return s}return void 0!==i?k.style(t,e,i):k.css(t,e)},t,e,arguments.length>1)}}),k.Tween=ue,ue.prototype={constructor:ue,init:function(t,e,i,n,o,s){this.elem=t,this.prop=i,this.easing=o||k.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(k.cssNumber[i]?"":"px")},cur:function(){var t=ue.propHooks[this.prop];return t&&t.get?t.get(this):ue.propHooks._default.get(this)},run:function(t){var e,i=ue.propHooks[this.prop];return this.options.duration?this.pos=e=k.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):ue.propHooks._default.set(this),this}},ue.prototype.init.prototype=ue.prototype,ue.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=k.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){k.fx.step[t.prop]?k.fx.step[t.prop](t):1!==t.elem.nodeType||!k.cssHooks[t.prop]&&null==t.elem.style[oe(t.prop)]?t.elem[t.prop]=t.now:k.style(t.elem,t.prop,t.now+t.unit)}}},ue.propHooks.scrollTop=ue.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},k.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},k.fx=ue.prototype.init,k.fx.step={};var de,fe,pe=/^(?:toggle|show|hide)$/,me=/queueHooks$/;function ge(){fe&&(!1===O.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ge):n.setTimeout(ge,k.fx.interval),k.fx.tick())}function ve(){return n.setTimeout(function(){de=void 0}),de=Date.now()}function ye(t,e){var i,n=0,o={height:t};for(e=e?1:0;n<4;n+=2-e)o["margin"+(i=pt[n])]=o["padding"+i]=t;return e&&(o.opacity=o.width=t),o}function Oe(t,e,i){for(var n,o=(be.tweeners[e]||[]).concat(be.tweeners["*"]),s=0,r=o.length;s<r;s++)if(n=o[s].call(i,e,t))return n}function be(t,e,i){var n,o,s=0,r=be.prefilters.length,a=k.Deferred().always(function(){delete l.elem}),l=function(){if(o)return!1;for(var e=de||ve(),i=Math.max(0,c.startTime+c.duration-e),n=1-(i/c.duration||0),s=0,r=c.tweens.length;s<r;s++)c.tweens[s].run(n);return a.notifyWith(t,[c,n,i]),n<1&&r?i:(r||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},i),originalProperties:e,originalOptions:i,startTime:de||ve(),duration:i.duration,tweens:[],createTween:function(e,i){var n=k.Tween(t,c.opts,e,i,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(n),n},stop:function(e){var i=0,n=e?c.tweens.length:0;if(o)return this;for(o=!0;i<n;i++)c.tweens[i].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),h=c.props;for(!function(t,e){var i,n,o,s,r;for(i in t)if(o=e[n=ot(i)],s=t[i],Array.isArray(s)&&(o=s[1],s=t[i]=s[0]),i!==n&&(t[n]=s,delete t[i]),(r=k.cssHooks[n])&&"expand"in r)for(i in s=r.expand(s),delete t[n],s)i in t||(t[i]=s[i],e[i]=o);else e[n]=o}(h,c.opts.specialEasing);s<r;s++)if(n=be.prefilters[s].call(c,t,h,c.opts))return v(n.stop)&&(k._queueHooks(c.elem,c.opts.queue).stop=n.stop.bind(n)),n;return k.map(h,Oe,c),v(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),k.fx.timer(k.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}k.Animation=k.extend(be,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return Ot(i.elem,t,ft.exec(e),i),i}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(H);for(var i,n=0,o=t.length;n<o;n++)i=t[n],be.tweeners[i]=be.tweeners[i]||[],be.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var n,o,s,r,a,l,c,h,u="width"in e||"height"in e,d=this,f={},p=t.style,m=t.nodeType&&yt(t),g=at.get(t,"fxshow");for(n in i.queue||(null==(r=k._queueHooks(t,"fx")).unqueued&&(r.unqueued=0,a=r.empty.fire,r.empty.fire=function(){r.unqueued||a()}),r.unqueued++,d.always(function(){d.always(function(){r.unqueued--,k.queue(t,"fx").length||r.empty.fire()})})),e)if(o=e[n],pe.test(o)){if(delete e[n],s=s||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||!g||void 0===g[n])continue;m=!0}f[n]=g&&g[n]||k.style(t,n)}if((l=!k.isEmptyObject(e))||!k.isEmptyObject(f))for(n in u&&1===t.nodeType&&(i.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=g&&g.display)&&(c=at.get(t,"display")),"none"===(h=k.css(t,"display"))&&(c?h=c:(wt([t],!0),c=t.style.display||c,h=k.css(t,"display"),wt([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===k.css(t,"float")&&(l||(d.done(function(){p.display=c}),null==c&&(h=p.display,c="none"===h?"":h)),p.display="inline-block")),i.overflow&&(p.overflow="hidden",d.always(function(){p.overflow=i.overflow[0],p.overflowX=i.overflow[1],p.overflowY=i.overflow[2]})),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=at.access(t,"fxshow",{display:c}),s&&(g.hidden=!m),m&&wt([t],!0),d.done(function(){for(n in m||wt([t]),at.remove(t,"fxshow"),f)k.style(t,n,f[n])})),l=Oe(m?g[n]:0,n,d),n in g||(g[n]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?be.prefilters.unshift(t):be.prefilters.push(t)}}),k.speed=function(t,e,i){var n=t&&"object"==typeof t?k.extend({},t):{complete:i||!i&&e||v(t)&&t,duration:t,easing:i&&e||e&&!v(e)&&e};return k.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in k.fx.speeds?n.duration=k.fx.speeds[n.duration]:n.duration=k.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){v(n.old)&&n.old.call(this),n.queue&&k.dequeue(this,n.queue)},n},k.fn.extend({fadeTo:function(t,e,i,n){return this.filter(yt).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var o=k.isEmptyObject(t),s=k.speed(e,i,n),r=function(){var e=be(this,k.extend({},t),s);(o||at.get(this,"finish"))&&e.stop(!0)};return r.finish=r,o||!1===s.queue?this.each(r):this.queue(s.queue,r)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each(function(){var e=!0,o=null!=t&&t+"queueHooks",s=k.timers,r=at.get(this);if(o)r[o]&&r[o].stop&&n(r[o]);else for(o in r)r[o]&&r[o].stop&&me.test(o)&&n(r[o]);for(o=s.length;o--;)s[o].elem!==this||null!=t&&s[o].queue!==t||(s[o].anim.stop(i),e=!1,s.splice(o,1));!e&&i||k.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,i=at.get(this),n=i[t+"queue"],o=i[t+"queueHooks"],s=k.timers,r=n?n.length:0;for(i.finish=!0,k.queue(this,t,[]),o&&o.stop&&o.stop.call(this,!0),e=s.length;e--;)s[e].elem===this&&s[e].queue===t&&(s[e].anim.stop(!0),s.splice(e,1));for(e=0;e<r;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish})}}),k.each(["toggle","show","hide"],function(t,e){var i=k.fn[e];k.fn[e]=function(t,n,o){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(ye(e,!0),t,n,o)}}),k.each({slideDown:ye("show"),slideUp:ye("hide"),slideToggle:ye("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){k.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}}),k.timers=[],k.fx.tick=function(){var t,e=0,i=k.timers;for(de=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||k.fx.stop(),de=void 0},k.fx.timer=function(t){k.timers.push(t),k.fx.start()},k.fx.interval=13,k.fx.start=function(){fe||(fe=!0,ge())},k.fx.stop=function(){fe=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(t,e){return t=k.fx&&k.fx.speeds[t]||t,e=e||"fx",this.queue(e,function(e,i){var o=n.setTimeout(e,t);i.stop=function(){n.clearTimeout(o)}})},function(){var t=O.createElement("input"),e=O.createElement("select").appendChild(O.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=O.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var xe,we=k.expr.attrHandle;k.fn.extend({attr:function(t,e){return tt(this,k.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){k.removeAttr(this,t)})}}),k.extend({attr:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?k.prop(t,e,i):(1===s&&k.isXMLDoc(t)||(o=k.attrHooks[e.toLowerCase()]||(k.expr.match.bool.test(e)?xe:void 0)),void 0!==i?null===i?void k.removeAttr(t,e):o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:(t.setAttribute(e,i+""),i):o&&"get"in o&&null!==(n=o.get(t,e))?n:null==(n=k.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&T(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,o=e&&e.match(H);if(o&&1===t.nodeType)for(;i=o[n++];)t.removeAttribute(i)}}),xe={set:function(t,e,i){return!1===e?k.removeAttr(t,i):t.setAttribute(i,i),i}},k.each(k.expr.match.bool.source.match(/\w+/g),function(t,e){var i=we[e]||k.find.attr;we[e]=function(t,e,n){var o,s,r=e.toLowerCase();return n||(s=we[r],we[r]=o,o=null!=i(t,e,n)?r:null,we[r]=s),o}});var _e=/^(?:input|select|textarea|button)$/i,Se=/^(?:a|area)$/i;function ke(t){return(t.match(H)||[]).join(" ")}function $e(t){return t.getAttribute&&t.getAttribute("class")||""}function Te(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(H)||[]}k.fn.extend({prop:function(t,e){return tt(this,k.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[k.propFix[t]||t]})}}),k.extend({prop:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&k.isXMLDoc(t)||(e=k.propFix[e]||e,o=k.propHooks[e]),void 0!==i?o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:t[e]=i:o&&"get"in o&&null!==(n=o.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=k.find.attr(t,"tabindex");return e?parseInt(e,10):_e.test(t.nodeName)||Se.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(k.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,i,n,o,s,r;return v(t)?this.each(function(e){k(this).addClass(t.call(this,e,$e(this)))}):(e=Te(t)).length?this.each(function(){if(n=$e(this),i=1===this.nodeType&&" "+ke(n)+" "){for(s=0;s<e.length;s++)o=e[s],i.indexOf(" "+o+" ")<0&&(i+=o+" ");r=ke(i),n!==r&&this.setAttribute("class",r)}}):this},removeClass:function(t){var e,i,n,o,s,r;return v(t)?this.each(function(e){k(this).removeClass(t.call(this,e,$e(this)))}):arguments.length?(e=Te(t)).length?this.each(function(){if(n=$e(this),i=1===this.nodeType&&" "+ke(n)+" "){for(s=0;s<e.length;s++)for(o=e[s];i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r=ke(i),n!==r&&this.setAttribute("class",r)}}):this:this.attr("class","")},toggleClass:function(t,e){var i,n,o,s,r=typeof t,a="string"===r||Array.isArray(t);return v(t)?this.each(function(i){k(this).toggleClass(t.call(this,i,$e(this),e),e)}):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(i=Te(t),this.each(function(){if(a)for(s=k(this),o=0;o<i.length;o++)n=i[o],s.hasClass(n)?s.removeClass(n):s.addClass(n);else void 0!==t&&"boolean"!==r||((n=$e(this))&&at.set(this,"__className__",n),this.setAttribute&&this.setAttribute("class",n||!1===t?"":at.get(this,"__className__")||""))}))},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+ke($e(i))+" ").indexOf(e)>-1)return!0;return!1}});var Ce=/\r/g;k.fn.extend({val:function(t){var e,i,n,o=this[0];return arguments.length?(n=v(t),this.each(function(i){var o;1===this.nodeType&&(null==(o=n?t.call(this,i,k(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=k.map(o,function(t){return null==t?"":t+""})),(e=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))})):o?(e=k.valHooks[o.type]||k.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(o,"value"))?i:"string"==typeof(i=o.value)?i.replace(Ce,""):null==i?"":i:void 0}}),k.extend({valHooks:{option:{get:function(t){var e=k.find.attr(t,"value");return null!=e?e:ke(k.text(t))}},select:{get:function(t){var e,i,n,o=t.options,s=t.selectedIndex,r="select-one"===t.type,a=r?null:[],l=r?s+1:o.length;for(n=s<0?l:r?s:0;n<l;n++)if(((i=o[n]).selected||n===s)&&!i.disabled&&(!i.parentNode.disabled||!T(i.parentNode,"optgroup"))){if(e=k(i).val(),r)return e;a.push(e)}return a},set:function(t,e){for(var i,n,o=t.options,s=k.makeArray(e),r=o.length;r--;)((n=o[r]).selected=k.inArray(k.valHooks.option.get(n),s)>-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=k.inArray(k(t).val(),e)>-1}},g.checkOn||(k.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Pe=n.location,Ee={guid:Date.now()},Ae=/\?/;k.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||k.error("Invalid XML: "+(i?k.map(i.childNodes,function(t){return t.textContent}).join("\n"):t)),e};var Me=/^(?:focusinfocus|focusoutblur)$/,Qe=function(t){t.stopPropagation()};k.extend(k.event,{trigger:function(t,e,i,o){var s,r,a,l,c,h,u,d,p=[i||O],m=f.call(t,"type")?t.type:t,g=f.call(t,"namespace")?t.namespace.split("."):[];if(r=d=a=i=i||O,3!==i.nodeType&&8!==i.nodeType&&!Me.test(m+k.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[k.expando]?t:new k.Event(m,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:k.makeArray(e,[t]),u=k.event.special[m]||{},o||!u.trigger||!1!==u.trigger.apply(i,e))){if(!o&&!u.noBubble&&!y(i)){for(l=u.delegateType||m,Me.test(l+m)||(r=r.parentNode);r;r=r.parentNode)p.push(r),a=r;a===(i.ownerDocument||O)&&p.push(a.defaultView||a.parentWindow||n)}for(s=0;(r=p[s++])&&!t.isPropagationStopped();)d=r,t.type=s>1?l:u.bindType||m,(h=(at.get(r,"events")||Object.create(null))[t.type]&&at.get(r,"handle"))&&h.apply(r,e),(h=c&&r[c])&&h.apply&&st(r)&&(t.result=h.apply(r,e),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(p.pop(),e)||!st(i)||c&&v(i[m])&&!y(i)&&((a=i[c])&&(i[c]=null),k.event.triggered=m,t.isPropagationStopped()&&d.addEventListener(m,Qe),i[m](),t.isPropagationStopped()&&d.removeEventListener(m,Qe),k.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(t,e,i){var n=k.extend(new k.Event,i,{type:t,isSimulated:!0});k.event.trigger(n,null,e)}}),k.fn.extend({trigger:function(t,e){return this.each(function(){k.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return k.event.trigger(t,e,i,!0)}});var De=/\[\]$/,Re=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Le=/^(?:input|select|textarea|keygen)/i;function Ne(t,e,i,n){var o;if(Array.isArray(e))k.each(e,function(e,o){i||De.test(t)?n(t,o):Ne(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,i,n)});else if(i||"object"!==w(e))n(t,e);else for(o in e)Ne(t+"["+o+"]",e[o],i,n)}k.param=function(t,e){var i,n=[],o=function(t,e){var i=v(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!k.isPlainObject(t))k.each(t,function(){o(this.name,this.value)});else for(i in t)Ne(i,t[i],e,o);return n.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=k.prop(this,"elements");return t?k.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!k(this).is(":disabled")&&Le.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!kt.test(t))}).map(function(t,e){var i=k(this).val();return null==i?null:Array.isArray(i)?k.map(i,function(t){return{name:e.name,value:t.replace(Re,"\r\n")}}):{name:e.name,value:i.replace(Re,"\r\n")}}).get()}});var je=/%20/g,ze=/#.*$/,Be=/([?&])_=[^&]*/,Ze=/^(.*?):[ \t]*([^\r\n]*)$/gm,We=/^(?:GET|HEAD)$/,Fe=/^\/\//,Xe={},qe={},He="*/".concat("*"),Ve=O.createElement("a");function Ye(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,o=0,s=e.toLowerCase().match(H)||[];if(v(i))for(;n=s[o++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Ue(t,e,i,n){var o={},s=t===qe;function r(a){var l;return o[a]=!0,k.each(t[a]||[],function(t,a){var c=a(e,i,n);return"string"!=typeof c||s||o[c]?s?!(l=c):void 0:(e.dataTypes.unshift(c),r(c),!1)}),l}return r(e.dataTypes[0])||!o["*"]&&r("*")}function Ge(t,e){var i,n,o=k.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((o[i]?t:n||(n={}))[i]=e[i]);return n&&k.extend(!0,t,n),t}Ve.href=Pe.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Pe.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Pe.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":He,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ge(Ge(t,k.ajaxSettings),e):Ge(k.ajaxSettings,t)},ajaxPrefilter:Ye(Xe),ajaxTransport:Ye(qe),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,o,s,r,a,l,c,h,u,d,f=k.ajaxSetup({},e),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?k(p):k.event,g=k.Deferred(),v=k.Callbacks("once memory"),y=f.statusCode||{},b={},x={},w="canceled",_={readyState:0,getResponseHeader:function(t){var e;if(c){if(!r)for(r={};e=Ze.exec(s);)r[e[1].toLowerCase()+" "]=(r[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=r[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(t,e){return null==c&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==c&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)_.always(t[_.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||w;return i&&i.abort(e),S(0,e),this}};if(g.promise(_),f.url=((t||f.url||Pe.href)+"").replace(Fe,Pe.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(H)||[""],null==f.crossDomain){l=O.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ve.protocol+"//"+Ve.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=k.param(f.data,f.traditional)),Ue(Xe,f,e,_),c)return _;for(u in(h=k.event&&f.global)&&0===k.active++&&k.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!We.test(f.type),o=f.url.replace(ze,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(je,"+")):(d=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(Ae.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(Be,"$1"),d=(Ae.test(o)?"&":"?")+"_="+Ee.guid+++d),f.url=o+d),f.ifModified&&(k.lastModified[o]&&_.setRequestHeader("If-Modified-Since",k.lastModified[o]),k.etag[o]&&_.setRequestHeader("If-None-Match",k.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&_.setRequestHeader("Content-Type",f.contentType),_.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+He+"; q=0.01":""):f.accepts["*"]),f.headers)_.setRequestHeader(u,f.headers[u]);if(f.beforeSend&&(!1===f.beforeSend.call(p,_,f)||c))return _.abort();if(w="abort",v.add(f.complete),_.done(f.success),_.fail(f.error),i=Ue(qe,f,e,_)){if(_.readyState=1,h&&m.trigger("ajaxSend",[_,f]),c)return _;f.async&&f.timeout>0&&(a=n.setTimeout(function(){_.abort("timeout")},f.timeout));try{c=!1,i.send(b,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,r,l){var u,d,O,b,x,w=e;c||(c=!0,a&&n.clearTimeout(a),i=void 0,s=l||"",_.readyState=t>0?4:0,u=t>=200&&t<300||304===t,r&&(b=function(t,e,i){for(var n,o,s,r,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(o in a)if(a[o]&&a[o].test(n)){l.unshift(o);break}if(l[0]in i)s=l[0];else{for(o in i){if(!l[0]||t.converters[o+" "+l[0]]){s=o;break}r||(r=o)}s=s||r}if(s)return s!==l[0]&&l.unshift(s),i[s]}(f,_,r)),!u&&k.inArray("script",f.dataTypes)>-1&&k.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(t,e,i,n){var o,s,r,a,l,c={},h=t.dataTypes.slice();if(h[1])for(r in t.converters)c[r.toLowerCase()]=t.converters[r];for(s=h.shift();s;)if(t.responseFields[s]&&(i[t.responseFields[s]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=h.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(r=c[l+" "+s]||c["* "+s]))for(o in c)if((a=o.split(" "))[1]===s&&(r=c[l+" "+a[0]]||c["* "+a[0]])){!0===r?r=c[o]:!0!==c[o]&&(s=a[0],h.unshift(a[1]));break}if(!0!==r)if(r&&t.throws)e=r(e);else try{e=r(e)}catch(t){return{state:"parsererror",error:r?t:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}(f,b,_,u),u?(f.ifModified&&((x=_.getResponseHeader("Last-Modified"))&&(k.lastModified[o]=x),(x=_.getResponseHeader("etag"))&&(k.etag[o]=x)),204===t||"HEAD"===f.type?w="nocontent":304===t?w="notmodified":(w=b.state,d=b.data,u=!(O=b.error))):(O=w,!t&&w||(w="error",t<0&&(t=0))),_.status=t,_.statusText=(e||w)+"",u?g.resolveWith(p,[d,w,_]):g.rejectWith(p,[_,w,O]),_.statusCode(y),y=void 0,h&&m.trigger(u?"ajaxSuccess":"ajaxError",[_,f,u?d:O]),v.fireWith(p,[_,w]),h&&(m.trigger("ajaxComplete",[_,f]),--k.active||k.event.trigger("ajaxStop")))}return _},getJSON:function(t,e,i){return k.get(t,e,i,"json")},getScript:function(t,e){return k.get(t,void 0,e,"script")}}),k.each(["get","post"],function(t,e){k[e]=function(t,i,n,o){return v(i)&&(o=o||n,n=i,i=void 0),k.ajax(k.extend({url:t,type:e,dataType:o,data:i,success:n},k.isPlainObject(t)&&t))}}),k.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),k._evalUrl=function(t,e,i){return k.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){k.globalEval(t,e,i)}})},k.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=k(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return v(t)?this.each(function(e){k(this).wrapInner(t.call(this,e))}):this.each(function(){var e=k(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=v(t);return this.each(function(i){k(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(t){return!k.expr.pseudos.visible(t)},k.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ke={0:200,1223:204},Je=k.ajaxSettings.xhr();g.cors=!!Je&&"withCredentials"in Je,g.ajax=Je=!!Je,k.ajaxTransport(function(t){var e,i;if(g.cors||Je&&!t.crossDomain)return{send:function(o,s){var r,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];for(r in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)a.setRequestHeader(r,o[r]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Ke[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){e&&i()})},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),k.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return k.globalEval(t),t}}}),k.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),k.ajaxTransport("script",function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,o){e=k("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&o("error"===t.type?404:200,t.type)}),O.head.appendChild(e[0])},abort:function(){i&&i()}}});var ti,ei=[],ii=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=ei.pop()||k.expando+"_"+Ee.guid++;return this[t]=!0,t}}),k.ajaxPrefilter("json jsonp",function(t,e,i){var o,s,r,a=!1!==t.jsonp&&(ii.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ii.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(ii,"$1"+o):!1!==t.jsonp&&(t.url+=(Ae.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return r||k.error(o+" was not called"),r[0]},t.dataTypes[0]="json",s=n[o],n[o]=function(){r=arguments},i.always(function(){void 0===s?k(n).removeProp(o):n[o]=s,t[o]&&(t.jsonpCallback=e.jsonpCallback,ei.push(o)),r&&v(s)&&s(r[0]),r=s=void 0}),"script"}),g.createHTMLDocument=((ti=O.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===ti.childNodes.length),k.parseHTML=function(t,e,i){return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(g.createHTMLDocument?((n=(e=O.implementation.createHTMLDocument("")).createElement("base")).href=O.location.href,e.head.appendChild(n)):e=O),s=!i&&[],(o=z.exec(t))?[e.createElement(o[1])]:(o=Mt([t],e,s),s&&s.length&&k(s).remove(),k.merge([],o.childNodes)));var n,o,s},k.fn.load=function(t,e,i){var n,o,s,r=this,a=t.indexOf(" ");return a>-1&&(n=ke(t.slice(a)),t=t.slice(0,a)),v(e)?(i=e,e=void 0):e&&"object"==typeof e&&(o="POST"),r.length>0&&k.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done(function(t){s=arguments,r.html(n?k("<div>").append(k.parseHTML(t)).find(n):t)}).always(i&&function(t,e){r.each(function(){i.apply(this,s||[t.responseText,e,t])})}),this},k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(t,e,i){var n,o,s,r,a,l,c=k.css(t,"position"),h=k(t),u={};"static"===c&&(t.style.position="relative"),a=h.offset(),s=k.css(t,"top"),l=k.css(t,"left"),("absolute"===c||"fixed"===c)&&(s+l).indexOf("auto")>-1?(r=(n=h.position()).top,o=n.left):(r=parseFloat(s)||0,o=parseFloat(l)||0),v(e)&&(e=e.call(t,i,k.extend({},a))),null!=e.top&&(u.top=e.top-a.top+r),null!=e.left&&(u.left=e.left-a.left+o),"using"in e?e.using.call(t,u):h.css(u)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,i,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,n=this[0],o={top:0,left:0};if("fixed"===k.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),i=n.ownerDocument,t=n.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===k.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&((o=k(t).offset()).top+=k.css(t,"borderTopWidth",!0),o.left+=k.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-k.css(n,"marginTop",!0),left:e.left-o.left-k.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===k.css(t,"position");)t=t.offsetParent;return t||mt})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i="pageYOffset"===e;k.fn[t]=function(n){return tt(this,function(t,n,o){var s;if(y(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===o)return s?s[e]:t[n];s?s.scrollTo(i?s.pageXOffset:o,i?o:s.pageYOffset):t[n]=o},t,n,arguments.length)}}),k.each(["top","left"],function(t,e){k.cssHooks[e]=te(g.pixelPosition,function(t,i){if(i)return i=Jt(t,e),Vt.test(i)?k(t).position()[e]+"px":i})}),k.each({Height:"height",Width:"width"},function(t,e){k.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){k.fn[n]=function(o,s){var r=arguments.length&&(i||"boolean"!=typeof o),a=i||(!0===o||!0===s?"margin":"border");return tt(this,function(e,i,o){var s;return y(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===o?k.css(e,i,a):k.style(e,i,o,a)},e,r?o:void 0,r)}})}),k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){k.fn[e]=function(t){return this.on(e,t)}}),k.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.on("mouseenter",t).on("mouseleave",e||t)}}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){k.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}});var ni=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;k.proxy=function(t,e){var i,n,o;if("string"==typeof e&&(i=t[e],e=t,t=i),v(t))return n=a.call(arguments,2),o=function(){return t.apply(e||this,n.concat(a.call(arguments)))},o.guid=t.guid=t.guid||k.guid++,o},k.holdReady=function(t){t?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=T,k.isFunction=v,k.isWindow=y,k.camelCase=ot,k.type=w,k.now=Date.now,k.isNumeric=function(t){var e=k.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},k.trim=function(t){return null==t?"":(t+"").replace(ni,"$1")},void 0===(i=function(){return k}.apply(e,[]))||(t.exports=i);var oi=n.jQuery,si=n.$;return k.noConflict=function(t){return n.$===k&&(n.$=si),t&&n.jQuery===k&&(n.jQuery=oi),k},void 0===o&&(n.jQuery=n.$=k),k})},4737:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>n.str`must match format "${t}"`,params:({schemaCode:t})=>n._`{format: ${t}}`},code(t,e){const{gen:i,data:o,$data:s,schema:r,schemaCode:a,it:l}=t,{opts:c,errSchemaPath:h,schemaEnv:u,self:d}=l;c.validateFormats&&(s?function(){const s=i.scopeValue("formats",{ref:d.formats,code:c.code.formats}),r=i.const("fDef",n._`${s}[${a}]`),l=i.let("fType"),h=i.let("format");i.if(n._`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>i.assign(l,n._`${r}.type || "string"`).assign(h,n._`${r}.validate`),()=>i.assign(l,n._`"string"`).assign(h,r)),t.fail$data((0,n.or)(!1===c.strictSchema?n.nil:n._`${a} && !${h}`,function(){const t=u.$async?n._`(${r}.async ? await ${h}(${o}) : ${h}(${o}))`:n._`${h}(${o})`,i=n._`(typeof ${h} == "function" ? ${t} : ${h}.test(${o}))`;return n._`${h} && ${h} !== true && ${l} === ${e} && !${i}`}()))}():function(){const s=d.formats[r];if(!s)return void function(){if(!1===c.strictSchema)return void d.logger.warn(t());throw new Error(t());function t(){return`unknown format "${r}" ignored in schema at path "${h}"`}}();if(!0===s)return;const[a,l,f]=function(t){const e=t instanceof RegExp?(0,n.regexpCode)(t):c.code.formats?n._`${c.code.formats}${(0,n.getProperty)(r)}`:void 0,o=i.scopeValue("formats",{key:r,ref:t,code:e});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,n._`${o}.validate`];return["string",t,o]}(s);a===e&&t.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!u.$async)throw new Error("async format in sync schema");return n._`await ${f}(${o})`}return"function"==typeof l?n._`${f}(${o})`:n._`${f}.test(${o})`}())}())}};e.default=o},4834:t=>{"use strict";const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),i=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(t){let e="",i=0,n=0;for(n=0;n<t.length;n++)if(i=t[n].charCodeAt(0),48!==i){if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(i=t[n].charCodeAt(0),!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";e+=t[n]}return e}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(t){return t.length=0,!0}function r(t,e,i){if(t.length){const o=n(t);if(""===o)return i.error=!0,!1;e.push(o),t.length=0}return!0}function a(t){if(function(t,e){let i=0;for(let n=0;n<t.length;n++)t[n]===e&&i++;return i}(t,":")<2)return{host:t,isIPV6:!1};const e=function(t){let e=0;const i={error:!1,address:"",zone:""},o=[],a=[];let l=!1,c=!1,h=r;for(let n=0;n<t.length;n++){const r=t[n];if("["!==r&&"]"!==r)if(":"!==r)if("%"===r){if(!h(a,o,i))break;h=s}else a.push(r);else{if(!0===l&&(c=!0),!h(a,o,i))break;if(++e>7){i.error=!0;break}n>0&&":"===t[n-1]&&(l=!0),o.push(":")}}return a.length&&(h===s?i.zone=a.join(""):c?o.push(a.join("")):o.push(n(a))),i.address=o.join(""),i}(t);if(e.error)return{host:t,isIPV6:!1};{let t=e.address,i=e.address;return e.zone&&(t+="%"+e.zone,i+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:i}}}t.exports={nonSimpleDomain:o,recomposeAuthority:function(t){const e=[];if(void 0!==t.userinfo&&(e.push(t.userinfo),e.push("@")),void 0!==t.host){let n=unescape(t.host);if(!i(n)){const e=a(n);n=!0===e.isIPV6?`[${e.escapedHost}]`:t.host}e.push(n)}return"number"!=typeof t.port&&"string"!=typeof t.port||(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0},normalizeComponentEncoding:function(t,e){const i=!0!==e?escape:unescape;return void 0!==t.scheme&&(t.scheme=i(t.scheme)),void 0!==t.userinfo&&(t.userinfo=i(t.userinfo)),void 0!==t.host&&(t.host=i(t.host)),void 0!==t.path&&(t.path=i(t.path)),void 0!==t.query&&(t.query=i(t.query)),void 0!==t.fragment&&(t.fragment=i(t.fragment)),t},removeDotSegments:function(t){let e=t;const i=[];let n=-1,o=0;for(;o=e.length;){if(1===o){if("."===e)break;if("/"===e){i.push("/");break}i.push(e);break}if(2===o){if("."===e[0]){if("."===e[1])break;if("/"===e[1]){e=e.slice(2);continue}}else if("/"===e[0]&&("."===e[1]||"/"===e[1])){i.push("/");break}}else if(3===o&&"/.."===e){0!==i.length&&i.pop(),i.push("/");break}if("."===e[0]){if("."===e[1]){if("/"===e[2]){e=e.slice(3);continue}}else if("/"===e[1]){e=e.slice(2);continue}}else if("/"===e[0]&&"."===e[1]){if("/"===e[2]){e=e.slice(2);continue}if("."===e[2]&&"/"===e[3]){e=e.slice(3),0!==i.length&&i.pop();continue}}if(-1===(n=e.indexOf("/",1))){i.push(e);break}i.push(e.slice(0,n)),e=e.slice(n)}return i.join("")},isIPv4:i,isUUID:e,normalizeIPv6:a,stringArrayToHexStripped:n}},5304:(t,e,i)=>{var n,o,s;
100
+ /*!
101
+ * jQuery UI Unique ID 1.14.1
102
+ * https://jqueryui.com
103
+ *
104
+ * Copyright OpenJS Foundation and other contributors
105
+ * Released under the MIT license.
106
+ * https://jquery.org/license
107
+ */!function(){"use strict";o=[i(4692),i(6883)],void 0===(s="function"==typeof(n=function(t){return t.fn.extend({uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}});var e})?n.apply(e,o):n)||(t.exports=s)}()},5333:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5765),o=i(9029),s=i(4227),r=i(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:i,data:a,parentSchema:l,it:c}=t,{opts:h}=c,u=(0,n.allSchemaProperties)(i),d=u.filter(t=>(0,s.alwaysValidSchema)(c,i[t]));if(0===u.length||d.length===u.length&&(!c.opts.unevaluated||!0===c.props))return;const f=h.strictSchema&&!h.allowMatchingProperties&&l.properties,p=e.name("valid");!0===c.props||c.props instanceof o.Name||(c.props=(0,r.evaluatedPropsToName)(e,c.props));const{props:m}=c;function g(t){for(const e in f)new RegExp(t).test(e)&&(0,s.checkStrictMode)(c,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function v(i){e.forIn("key",a,s=>{e.if(o._`${(0,n.usePattern)(t,i)}.test(${s})`,()=>{const n=d.includes(i);n||t.subschema({keyword:"patternProperties",schemaProp:i,dataProp:s,dataPropType:r.Type.Str},p),c.opts.unevaluated&&!0!==m?e.assign(o._`${m}[${s}]`,!0):n||c.allErrors||e.if((0,o.not)(p),()=>e.break())})})}!function(){for(const t of u)f&&g(t),c.allErrors?v(t):(e.var(p,!0),v(t),e.if(p))}()}};e.default=a},5354:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(494),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,n.validateTuple)(t,"items")};e.default=o},5385:(t,e,i)=>{t.exports=i(7146)},5408:t=>{t.exports=function(t,e){if("function"!=typeof t)throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);let i,n=0;return function(...o){clearTimeout(i);const s=Date.now(),r=e-(s-n);r<=0?(n=s,t.apply(this,o)):i=setTimeout(()=>{n=Date.now(),t.apply(this,o)},r)}}},5457:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;const n=i(9029),o=i(4227),s={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>n.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>n._`{limit: ${t}}`},code(t){const{parentSchema:e,it:i}=t,{items:n}=e;Array.isArray(n)?r(t,n):(0,o.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(t,e){const{gen:i,schema:s,data:r,keyword:a,it:l}=t;l.items=!0;const c=i.const("len",n._`${r}.length`);if(!1===s)t.setParams({len:e.length}),t.pass(n._`${c} <= ${e.length}`);else if("object"==typeof s&&!(0,o.alwaysValidSchema)(l,s)){const s=i.var("valid",n._`${c} <= ${e.length}`);i.if((0,n.not)(s),()=>function(s){i.forRange("i",e.length,c,e=>{t.subschema({keyword:a,dataProp:e,dataPropType:o.Type.Num},s),l.allErrors||i.if((0,n.not)(s),()=>i.break())})}(s)),t.ok(s)}}e.validateAdditionalItems=r,e.default=s},5765:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;const n=i(9029),o=i(4227),s=i(2023),r=i(4227);function a(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function l(t,e,i){return n._`${a(t)}.call(${e}, ${i})`}function c(t,e,i,o){const s=n._`${e}${(0,n.getProperty)(i)} === undefined`;return o?(0,n.or)(s,(0,n.not)(l(t,e,i))):s}function h(t){return t?Object.keys(t).filter(t=>"__proto__"!==t):[]}e.checkReportMissingProp=function(t,e){const{gen:i,data:o,it:s}=t;i.if(c(i,o,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:n._`${e}`},!0),t.error()})},e.checkMissingProp=function({gen:t,data:e,it:{opts:i}},o,s){return(0,n.or)(...o.map(o=>(0,n.and)(c(t,e,o,i.ownProperties),n._`${s} = ${o}`)))},e.reportMissingProp=function(t,e){t.setParams({missingProperty:e},!0),t.error()},e.hasPropFunc=a,e.isOwnProperty=l,e.propertyInData=function(t,e,i,o){const s=n._`${e}${(0,n.getProperty)(i)} !== undefined`;return o?n._`${s} && ${l(t,e,i)}`:s},e.noPropertyInData=c,e.allSchemaProperties=h,e.schemaProperties=function(t,e){return h(e).filter(i=>!(0,o.alwaysValidSchema)(t,e[i]))},e.callValidateCode=function({schemaCode:t,data:e,it:{gen:i,topSchemaRef:o,schemaPath:r,errorPath:a},it:l},c,h,u){const d=u?n._`${t}, ${e}, ${o}${r}`:e,f=[[s.default.instancePath,(0,n.strConcat)(s.default.instancePath,a)],[s.default.parentData,l.parentData],[s.default.parentDataProperty,l.parentDataProperty],[s.default.rootData,s.default.rootData]];l.opts.dynamicRef&&f.push([s.default.dynamicAnchors,s.default.dynamicAnchors]);const p=n._`${d}, ${i.object(...f)}`;return h!==n.nil?n._`${c}.call(${h}, ${p})`:n._`${c}(${p})`};const u=n._`new RegExp`;e.usePattern=function({gen:t,it:{opts:e}},i){const o=e.unicodeRegExp?"u":"",{regExp:s}=e.code,a=s(i,o);return t.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===s.code?u:(0,r.useFunc)(t,s)}(${i}, ${o})`})},e.validateArray=function(t){const{gen:e,data:i,keyword:s,it:r}=t,a=e.name("valid");if(r.allErrors){const t=e.let("valid",!0);return l(()=>e.assign(t,!1)),t}return e.var(a,!0),l(()=>e.break()),a;function l(r){const l=e.const("len",n._`${i}.length`);e.forRange("i",0,l,i=>{t.subschema({keyword:s,dataProp:i,dataPropType:o.Type.Num},a),e.if((0,n.not)(a),r)})}},e.validateUnion=function(t){const{gen:e,schema:i,keyword:s,it:r}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");if(i.some(t=>(0,o.alwaysValidSchema)(r,t))&&!r.opts.unevaluated)return;const a=e.let("valid",!1),l=e.name("_valid");e.block(()=>i.forEach((i,o)=>{const r=t.subschema({keyword:s,schemaProp:o,compositeRule:!0},l);e.assign(a,n._`${a} || ${l}`);t.mergeValidEvaluated(r,l)||e.if((0,n.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}},5844:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4227),o={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:i,it:o}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");const s=e.name("valid");i.forEach((e,i)=>{if((0,n.alwaysValidSchema)(o,e))return;const r=t.subschema({keyword:"allOf",schemaProp:i},s);t.ok(s),t.mergeEvaluated(r)})}};e.default=o},5882:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=n.operators,s={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},r={message:({keyword:t,schemaCode:e})=>n.str`must be ${s[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>n._`{comparison: ${s[t].okStr}, limit: ${e}}`},a={keyword:Object.keys(s),type:"number",schemaType:"number",$data:!0,error:r,code(t){const{keyword:e,data:i,schemaCode:o}=t;t.fail$data(n._`${i} ${s[e].fail} ${o} || isNaN(${i})`)}};e.default=a},5944:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(8343);n.code='require("ajv/dist/runtime/uri").default',e.default=n},6144:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2128),o=i(7060),s=i(6378),r=i(7532),a=i(9857),l=[n.default,o.default,(0,s.default)(),r.default,a.metadataVocabulary,a.contentVocabulary];e.default=l},6163:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(4227),s={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>n._`{passingSchemas: ${t.passing}}`},code(t){const{gen:e,schema:i,parentSchema:s,it:r}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");if(r.opts.discriminator&&s.discriminator)return;const a=i,l=e.let("valid",!1),c=e.let("passing",null),h=e.name("_valid");t.setParams({passing:c}),e.block(function(){a.forEach((i,s)=>{let a;(0,o.alwaysValidSchema)(r,i)?e.var(h,!0):a=t.subschema({keyword:"oneOf",schemaProp:s,compositeRule:!0},h),s>0&&e.if(n._`${h} && ${l}`).assign(l,!1).assign(c,n._`[${c}, ${s}]`).else(),e.if(h,()=>{e.assign(l,!0),e.assign(c,s),a&&t.mergeEvaluated(a,n.Name)})})}),t.result(l,()=>t.reset(),()=>t.error(!0))}};e.default=s},6250:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2017);n.code='require("ajv/dist/runtime/equal").default',e.default=n},6378:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5457),o=i(5354),s=i(494),r=i(3966),a=i(2661),l=i(3025),c=i(9713),h=i(8660),u=i(117),d=i(5333),f=i(7923),p=i(6505),m=i(6163),g=i(5844),v=i(1239),y=i(4426);e.default=function(t=!1){const e=[f.default,p.default,m.default,g.default,v.default,y.default,c.default,h.default,l.default,u.default,d.default];return t?e.push(o.default,r.default):e.push(n.default,s.default),e.push(a.default),e}},6379:function(t){function e(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}
108
+ /**
109
+ * Sticky.js
110
+ * Library for sticky elements written in vanilla javascript. With this library you can easily set sticky elements on your website. It's also responsive.
111
+ *
112
+ * @version 1.3.0
113
+ * @author Rafal Galus <biuro@rafalgalus.pl>
114
+ * @website https://rgalus.github.io/sticky-js/
115
+ * @repo https://github.com/rgalus/sticky-js
116
+ * @license https://github.com/rgalus/sticky-js/blob/master/LICENSE
117
+ */
118
+ var i,n=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.selector=e,this.elements=[],this.version="1.3.0",this.vp=this.getViewportSize(),this.body=document.querySelector("body"),this.options={wrap:i.wrap||!1,wrapWith:i.wrapWith||"<span></span>",marginTop:i.marginTop||0,marginBottom:i.marginBottom||0,stickyFor:i.stickyFor||0,stickyClass:i.stickyClass||null,stickyContainer:i.stickyContainer||"body"},this.updateScrollTopPosition=this.updateScrollTopPosition.bind(this),this.updateScrollTopPosition(),window.addEventListener("load",this.updateScrollTopPosition),window.addEventListener("scroll",this.updateScrollTopPosition),this.run()}var i,n,o;return i=t,(n=[{key:"run",value:function(){var t=this,e=setInterval(function(){if("complete"===document.readyState){clearInterval(e);var i=document.querySelectorAll(t.selector);t.forEach(i,function(e){return t.renderElement(e)})}},10)}},{key:"renderElement",value:function(t){var e=this;t.sticky={},t.sticky.active=!1,t.sticky.marginTop=parseInt(t.getAttribute("data-margin-top"))||this.options.marginTop,t.sticky.marginBottom=parseInt(t.getAttribute("data-margin-bottom"))||this.options.marginBottom,t.sticky.stickyFor=parseInt(t.getAttribute("data-sticky-for"))||this.options.stickyFor,t.sticky.stickyClass=t.getAttribute("data-sticky-class")||this.options.stickyClass,t.sticky.wrap=!!t.hasAttribute("data-sticky-wrap")||this.options.wrap,t.sticky.stickyContainer=this.options.stickyContainer,t.sticky.container=this.getStickyContainer(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect=this.getRectangle(t),"img"===t.tagName.toLowerCase()&&(t.onload=function(){return t.sticky.rect=e.getRectangle(t)}),t.sticky.wrap&&this.wrapElement(t),this.activate(t)}},{key:"wrapElement",value:function(t){t.insertAdjacentHTML("beforebegin",t.getAttribute("data-sticky-wrapWith")||this.options.wrapWith),t.previousSibling.appendChild(t)}},{key:"activate",value:function(t){t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active&&(t.sticky.active=!0),this.elements.indexOf(t)<0&&this.elements.push(t),t.sticky.resizeEvent||(this.initResizeEvents(t),t.sticky.resizeEvent=!0),t.sticky.scrollEvent||(this.initScrollEvents(t),t.sticky.scrollEvent=!0),this.setPosition(t)}},{key:"initResizeEvents",value:function(t){var e=this;t.sticky.resizeListener=function(){return e.onResizeEvents(t)},window.addEventListener("resize",t.sticky.resizeListener)}},{key:"destroyResizeEvents",value:function(t){window.removeEventListener("resize",t.sticky.resizeListener)}},{key:"onResizeEvents",value:function(t){this.vp=this.getViewportSize(),t.sticky.rect=this.getRectangle(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active?t.sticky.active=!0:(t.sticky.rect.top+t.sticky.rect.height>=t.sticky.container.rect.top+t.sticky.container.rect.height||t.sticky.stickyFor>=this.vp.width&&t.sticky.active)&&(t.sticky.active=!1),this.setPosition(t)}},{key:"initScrollEvents",value:function(t){var e=this;t.sticky.scrollListener=function(){return e.onScrollEvents(t)},window.addEventListener("scroll",t.sticky.scrollListener)}},{key:"destroyScrollEvents",value:function(t){window.removeEventListener("scroll",t.sticky.scrollListener)}},{key:"onScrollEvents",value:function(t){t.sticky&&t.sticky.active&&this.setPosition(t)}},{key:"setPosition",value:function(t){this.css(t,{position:"",width:"",top:"",left:""}),this.vp.height<t.sticky.rect.height||!t.sticky.active||(t.sticky.rect.width||(t.sticky.rect=this.getRectangle(t)),t.sticky.wrap&&this.css(t.parentNode,{display:"block",width:t.sticky.rect.width+"px",height:t.sticky.rect.height+"px"}),0===t.sticky.rect.top&&t.sticky.container===this.body?(this.css(t,{position:"fixed",top:t.sticky.rect.top+"px",left:t.sticky.rect.left+"px",width:t.sticky.rect.width+"px"}),t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass)):this.scrollTop>t.sticky.rect.top-t.sticky.marginTop?(this.css(t,{position:"fixed",width:t.sticky.rect.width+"px",left:t.sticky.rect.left+"px"}),this.scrollTop+t.sticky.rect.height+t.sticky.marginTop>t.sticky.container.rect.top+t.sticky.container.offsetHeight-t.sticky.marginBottom?(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{top:t.sticky.container.rect.top+t.sticky.container.offsetHeight-(this.scrollTop+t.sticky.rect.height+t.sticky.marginBottom)+"px"})):(t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass),this.css(t,{top:t.sticky.marginTop+"px"}))):(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{position:"",width:"",top:"",left:""}),t.sticky.wrap&&this.css(t.parentNode,{display:"",width:"",height:""})))}},{key:"update",value:function(){var t=this;this.forEach(this.elements,function(e){e.sticky.rect=t.getRectangle(e),e.sticky.container.rect=t.getRectangle(e.sticky.container),t.activate(e),t.setPosition(e)})}},{key:"destroy",value:function(){var t=this;window.removeEventListener("load",this.updateScrollTopPosition),window.removeEventListener("scroll",this.updateScrollTopPosition),this.forEach(this.elements,function(e){t.destroyResizeEvents(e),t.destroyScrollEvents(e),delete e.sticky})}},{key:"getStickyContainer",value:function(t){for(var e=t.parentNode;!e.hasAttribute("data-sticky-container")&&!e.parentNode.querySelector(t.sticky.stickyContainer)&&e!==this.body;)e=e.parentNode;return e}},{key:"getRectangle",value:function(t){this.css(t,{position:"",width:"",top:"",left:""});var e=Math.max(t.offsetWidth,t.clientWidth,t.scrollWidth),i=Math.max(t.offsetHeight,t.clientHeight,t.scrollHeight),n=0,o=0;do{n+=t.offsetTop||0,o+=t.offsetLeft||0,t=t.offsetParent}while(t);return{top:n,left:o,width:e,height:i}}},{key:"getViewportSize",value:function(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}},{key:"updateScrollTopPosition",value:function(){this.scrollTop=(window.pageYOffset||document.scrollTop)-(document.clientTop||0)||0}},{key:"forEach",value:function(t,e){for(var i=0,n=t.length;i<n;i++)e(t[i])}},{key:"css",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}}])&&e(i.prototype,n),o&&e(i,o),t}();i=n,t.exports=i},6438:(t,e,i)=>{var n=i(6379);t.exports=n},6461:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const n=i(3282),o=i(9029),s=o.operators,r={formatMaximum:{okStr:"<=",ok:s.LTE,fail:s.GT},formatMinimum:{okStr:">=",ok:s.GTE,fail:s.LT},formatExclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},formatExclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},a={message:({keyword:t,schemaCode:e})=>o.str`should be ${r[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>o._`{comparison: ${r[t].okStr}, limit: ${e}}`};e.formatLimitDefinition={keyword:Object.keys(r),type:"string",schemaType:"string",$data:!0,error:a,code(t){const{gen:e,data:i,schemaCode:s,keyword:a,it:l}=t,{opts:c,self:h}=l;if(!c.validateFormats)return;const u=new n.KeywordCxt(l,h.RULES.all.format.definition,"format");function d(t){return o._`${t}.compare(${i}, ${s}) ${r[a].fail} 0`}u.$data?function(){const i=e.scopeValue("formats",{ref:h.formats,code:c.code.formats}),n=e.const("fmt",o._`${i}[${u.schemaCode}]`);t.fail$data((0,o.or)(o._`typeof ${n} != "object"`,o._`${n} instanceof RegExp`,o._`typeof ${n}.compare != "function"`,d(n)))}():function(){const i=u.schema,n=h.formats[i];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${i}" does not define "compare" function`);const s=e.scopeValue("formats",{key:i,ref:n,code:c.code.formats?o._`${c.code.formats}${(0,o.getProperty)(i)}`:void 0});t.fail$data(d(s))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)},6505:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:i(5765).validateUnion,error:{message:"must match a schema in anyOf"}};e.default=n},6605:(t,e,i)=>{var n,o,s;
119
+ /*!
120
+ * jQuery UI Controlgroup 1.14.1
121
+ * https://jqueryui.com
122
+ *
123
+ * Copyright OpenJS Foundation and other contributors
124
+ * Released under the MIT license.
125
+ * https://jquery.org/license
126
+ */!function(){"use strict";o=[i(4692),i(9139)],void 0===(s="function"==typeof(n=function(t){var e=/ui-corner-([a-z]){2,6}/g;return t.widget("ui.controlgroup",{version:"1.14.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(n,o){var s,r={};if(o)return"controlgroupLabel"===n?((s=e.element.find(o)).each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(s,null,"ui-widget ui-widget-content ui-state-default"),void(i=i.concat(s.get()))):void(t.fn[n]&&(r=e["_"+n+"Options"]?e["_"+n+"Options"]("middle"):{classes:{}},e.element.find(o).each(function(){var o=t(this),s=o[n]("instance"),a=t.widget.extend({},r);if("button"!==n||!o.parent(".ui-spinner").length){s||(s=o[n]()[n]("instance")),s&&(a.classes=e._resolveClassesValues(a.classes,s)),o[n](a);var l=o[n]("widget");t.data(l[0],"ui-controlgroup-data",s||o[n]("instance")),i.push(l[0])}})))}),this.childWidgets=t(t.uniqueSort(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this).data("ui-controlgroup-data");i&&i[e]&&i[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",n=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,n)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,n={classes:{}};return n.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],n},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,n){var o={};return t.each(i,function(t){var s=n.options.classes[t]||"";s=String.prototype.trim.call(s.replace(e,"")),o[t]=(s+" "+i[t]).replace(/\s+/g," ")}),o},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,n){var o=e[n]().data("ui-controlgroup-data");if(o&&i["_"+o.widgetName+"Options"]){var s=i["_"+o.widgetName+"Options"](1===e.length?"only":n);s.classes=i._resolveClassesValues(s.classes,o),o.element[o.widgetName](s)}else i._updateCornerClass(e[n](),n)}),this._callChildMethod("refresh"))}})})?n.apply(e,o):n)||(t.exports=s)}()},6653:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(7652),s=i(3835),r=i(4551),a=i(4227),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===o.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:i}})=>n._`{error: ${t}, tag: ${i}, tagValue: ${e}}`},code(t){const{gen:e,data:i,schema:l,parentSchema:c,it:h}=t,{oneOf:u}=c;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=l.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!u)throw new Error("discriminator: requires oneOf keyword");const f=e.let("valid",!1),p=e.const("tag",n._`${i}${(0,n.getProperty)(d)}`);function m(i){const o=e.name("valid"),s=t.subschema({keyword:"oneOf",schemaProp:i},o);return t.mergeEvaluated(s,n.Name),o}e.if(n._`typeof ${p} == "string"`,()=>function(){const i=function(){var t;const e={},i=o(c);let n=!0;for(let e=0;e<u.length;e++){let c=u[e];if((null==c?void 0:c.$ref)&&!(0,a.schemaHasRulesButRef)(c,h.self.RULES)){const t=c.$ref;if(c=s.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,t),c instanceof s.SchemaEnv&&(c=c.schema),void 0===c)throw new r.default(h.opts.uriResolver,h.baseId,t)}const f=null===(t=null==c?void 0:c.properties)||void 0===t?void 0:t[d];if("object"!=typeof f)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(i||o(c)),l(f,e)}if(!n)throw new Error(`discriminator: "${d}" must be required`);return e;function o({required:t}){return Array.isArray(t)&&t.includes(d)}function l(t,e){if(t.const)f(t.const,e);else{if(!t.enum)throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);for(const i of t.enum)f(i,e)}}function f(t,i){if("string"!=typeof t||t in e)throw new Error(`discriminator: "${d}" values must be unique strings`);e[t]=i}}();e.if(!1);for(const t in i)e.elseIf(n._`${p} === ${t}`),e.assign(f,m(i[t]));e.else(),t.error(!1,{discrError:o.DiscrError.Mapping,tag:p,tagName:d}),e.endIf()}(),()=>t.error(!1,{discrError:o.DiscrError.Tag,tag:p,tagName:d})),t.ok(f)}};e.default=l},6883:(t,e,i)=>{var n,o,s;!function(){"use strict";o=[i(4692)],void 0===(s="function"==typeof(n=function(t){return t.ui=t.ui||{},t.ui.version="1.14.1"})?n.apply(e,o):n)||(t.exports=s)}()},6939:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;const n=i(4227),o=i(2017),s=i(7106),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(t,e=!0){return"boolean"==typeof t||(!0===e?!l(t):!!e&&c(t)<=e)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(t){for(const e in t){if(a.has(e))return!0;const i=t[e];if(Array.isArray(i)&&i.some(l))return!0;if("object"==typeof i&&l(i))return!0}return!1}function c(t){let e=0;for(const i in t){if("$ref"===i)return 1/0;if(e++,!r.has(i)&&("object"==typeof t[i]&&(0,n.eachItem)(t[i],t=>e+=c(t)),e===1/0))return 1/0}return e}function h(t,e="",i){!1!==i&&(e=f(e));const n=t.parse(e);return u(t,n)}function u(t,e){return t.serialize(e).split("#")[0]+"#"}e.getFullPath=h,e._getFullPath=u;const d=/#\/?$/;function f(t){return t?t.replace(d,""):""}e.normalizeId=f,e.resolveUrl=function(t,e,i){return i=f(i),t.resolve(e,i)};const p=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(t,e){if("boolean"==typeof t)return{};const{schemaId:i,uriResolver:n}=this.opts,r=f(t[i]||e),a={"":r},l=h(n,r,!1),c={},u=new Set;return s(t,{allKeys:!0},(t,e,n,o)=>{if(void 0===o)return;const s=l+e;let r=a[o];function h(e){const i=this.opts.uriResolver.resolve;if(e=f(r?i(r,e):e),u.has(e))throw m(e);u.add(e);let n=this.refs[e];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?d(t,n.schema,e):e!==f(s)&&("#"===e[0]?(d(t,c[e],e),c[e]=t):this.refs[e]=s),e}function g(t){if("string"==typeof t){if(!p.test(t))throw new Error(`invalid anchor "${t}"`);h.call(this,`#${t}`)}}"string"==typeof t[i]&&(r=h.call(this,t[i])),g.call(this,t.$anchor),g.call(this,t.$dynamicAnchor),a[e]=r}),c;function d(t,e,i){if(void 0!==e&&!o(t,e))throw m(i)}function m(t){return new Error(`reference "${t}" resolves to more than one schema`)}}},6998:t=>{function e(t,e=100,i={}){if("function"!=typeof t)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");const{immediate:n}="boolean"==typeof i?{immediate:i}:i;let o,s,r,a,l;function c(){const e=o,i=s;return o=void 0,s=void 0,l=t.apply(e,i),l}function h(){const t=Date.now()-a;t<e&&t>=0?r=setTimeout(h,e-t):(r=void 0,n||(l=c()))}const u=function(...t){if(o&&this!==o&&Object.getPrototypeOf(this)===Object.getPrototypeOf(o))throw new Error("Debounced method called with different contexts of the same prototype.");o=this,s=t,a=Date.now();const i=n&&!r;return r||(r=setTimeout(h,e)),i&&(l=c()),l};return Object.defineProperty(u,"isPending",{get:()=>void 0!==r}),u.clear=()=>{r&&(clearTimeout(r),r=void 0)},u.flush=()=>{r&&u.trigger()},u.trigger=()=>{l=c(),u.clear()},u}t.exports.debounce=e,t.exports=e},7007:t=>{"use strict";var e,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};e=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise(function(i,n){function o(i){t.removeListener(e,s),n(i)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",o),i([].slice.call(arguments))}m(t,e,s,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&m(t,"error",e,i)}(t,o,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var r=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function c(t,e,i,n){var o,s,r,c;if(a(i),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),r=s[e]),void 0===r)r=s[e]=i,++t._eventsCount;else if("function"==typeof r?r=s[e]=n?[i,r]:[r,i]:n?r.unshift(i):r.push(i),(o=l(t))>0&&r.length>o&&!r.warned){r.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=r.length,c=h,console&&console.warn&&console.warn(c)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},o=h.bind(n);return o.listener=i,n.wrapFn=o,o}function d(t,e,i){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?i?[o.listener||o]:[o]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(o):p(o,o.length)}function f(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function p(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function m(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function o(s){n.once&&t.removeEventListener(e,o),i(s)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");r=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var o="error"===t,s=this._events;if(void 0!==s)o=o&&void 0===s.error;else if(!o)return!1;if(o){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var a=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw a.context=r,a}var l=s[t];if(void 0===l)return!1;if("function"==typeof l)n(l,this,e);else{var c=l.length,h=p(l,c);for(i=0;i<c;++i)n(h[i],this,e)}return!0},s.prototype.addListener=function(t,e){return c(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return c(this,t,e,!0)},s.prototype.once=function(t,e){return a(e),this.on(t,u(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,u(this,t,e)),this},s.prototype.removeListener=function(t,e){var i,n,o,s,r;if(a(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===e||i[s].listener===e){r=i[s].listener,o=s;break}if(o<0)return this;0===o?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,o),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,r||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var o,s=Object.keys(i);for(n=0;n<s.length;++n)"removeListener"!==(o=s[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},7060:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5882),o=i(3439),s=i(7307),r=i(422),a=i(4486),l=i(4003),c=i(1163),h=i(617),u=i(7935),d=i(8643),f=[n.default,o.default,s.default,r.default,a.default,l.default,c.default,h.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];e.default=f},7106:t=>{"use strict";var e=t.exports=function(t,e,n){"function"==typeof e&&(n=e,e={}),i(e,"function"==typeof(n=e.cb||n)?n:n.pre||function(){},n.post||function(){},t,"",t)};function i(t,o,s,r,a,l,c,h,u,d){if(r&&"object"==typeof r&&!Array.isArray(r)){for(var f in o(r,a,l,c,h,u,d),r){var p=r[f];if(Array.isArray(p)){if(f in e.arrayKeywords)for(var m=0;m<p.length;m++)i(t,o,s,p[m],a+"/"+f+"/"+m,l,a,f,r,m)}else if(f in e.propsKeywords){if(p&&"object"==typeof p)for(var g in p)i(t,o,s,p[g],a+"/"+f+"/"+n(g),l,a,f,r,g)}else(f in e.keywords||t.allKeys&&!(f in e.skipKeywords))&&i(t,o,s,p,a+"/"+f,l,a,f,r)}s(r,a,l,c,h,u,d)}}function n(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7144:(t,e,i)=>{var n,o,s;
127
+ /*!
128
+ * jQuery UI Tabbable 1.14.1
129
+ * https://jqueryui.com
130
+ *
131
+ * Copyright OpenJS Foundation and other contributors
132
+ * Released under the MIT license.
133
+ * https://jquery.org/license
134
+ */!function(){"use strict";o=[i(4692),i(6883),i(1255)],void 0===(s="function"==typeof(n=function(t){return t.extend(t.expr.pseudos,{tabbable:function(e){var i=t.attr(e,"tabindex"),n=null!=i;return(!n||i>=0)&&t.ui.focusable(e,n)}})})?n.apply(e,o):n)||(t.exports=s)}()},7146:t=>{var e={create:function(t){var e;if(t=t.trim(),/<.*>/g.test(t)){var i=document.createElement("div");i.innerHTML=t,e=i.firstChild}else e=document.createElement(t);if(!this.isValidNode(e))throw new Error("Element not valid");return e},isValidNode:function(t){return t&&"nodeType"in t},render:function(t,e){var i;if(e=null==(i=e)?[]:Array.isArray(i)?i:[i],!this.isValidNode(t))throw new Error("Require a valid HTML Element");return e.forEach(function(e){t.appendChild(e)}),t}};t.exports=e},7307:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(4227),s=i(3853),r={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const i="maxLength"===t?"more":"fewer";return n.str`must NOT have ${i} than ${e} characters`},params:({schemaCode:t})=>n._`{limit: ${t}}`},code(t){const{keyword:e,data:i,schemaCode:r,it:a}=t,l="maxLength"===e?n.operators.GT:n.operators.LT,c=!1===a.opts.unicode?n._`${i}.length`:n._`${(0,o.useFunc)(t.gen,s.default)}(${i})`;t.fail$data(n._`${c} ${l} ${r}`)}};e.default=r},7512:(t,e,i)=>{var n=i(3036);function o(t,e,i,n,o){var r=s.apply(this,arguments);return t.addEventListener(i,r,o),{destroy:function(){t.removeEventListener(i,r,o)}}}function s(t,e,i,o){return function(i){i.delegateTarget=n(i.target,e),i.delegateTarget&&o.call(t,i)}}t.exports=function(t,e,i,n,s){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof i?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,i,n,s)}))}},7532:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=[i(4737).default];e.default=n},7652:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(i||(e.DiscrError=i={}))},7687:(t,e,i)=>{var n,o,s;
135
+ /*!
136
+ * jQuery UI Form Reset Mixin 1.14.1
137
+ * https://jqueryui.com
138
+ *
139
+ * Copyright OpenJS Foundation and other contributors
140
+ * Released under the MIT license.
141
+ * https://jquery.org/license
142
+ */!function(){"use strict";o=[i(4692),i(6883)],void 0===(s="function"==typeof(n=function(t){return t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=t(this.element.prop("form")),this.form.length){var e=this.form.data("ui-form-reset-instances")||[];e.length||this.form.on("reset.ui-form-reset",this._formResetHandler),e.push(this),this.form.data("ui-form-reset-instances",e)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}}})?n.apply(e,o):n)||(t.exports=s)}()},7845:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const n=i(1520);class o extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}}var s;!function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"}(s||(e.UsedValueState=s={})),e.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class r{constructor({prefixes:t,parent:e}={}){this._names={},this._prefixes=t,this._parent=e}toName(t){return t instanceof n.Name?t:this.name(t)}name(t){return new n.Name(this._newName(t))}_newName(t){return`${t}${(this._names[t]||this._nameGroup(t)).index++}`}_nameGroup(t){var e,i;if((null===(i=null===(e=this._parent)||void 0===e?void 0:e._prefixes)||void 0===i?void 0:i.has(t))||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}}e.Scope=r;class a extends n.Name{constructor(t,e){super(e),this.prefix=t}setValue(t,{property:e,itemIndex:i}){this.value=t,this.scopePath=n._`.${new n.Name(e)}[${i}]`}}e.ValueScopeName=a;const l=n._`\n`;e.ValueScope=class extends r{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?l:n.nil}}get(){return this._scope}name(t){return new a(t,this._newName(t))}value(t,e){var i;if(void 0===e.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(t),{prefix:o}=n,s=null!==(i=e.key)&&void 0!==i?i:e.ref;let r=this._values[o];if(r){const t=r.get(s);if(t)return t}else r=this._values[o]=new Map;r.set(s,n);const a=this._scope[o]||(this._scope[o]=[]),l=a.length;return a[l]=e.ref,n.setValue(e,{property:o,itemIndex:l}),n}getValue(t,e){const i=this._values[t];if(i)return i.get(e)}scopeRefs(t,e=this._values){return this._reduceValues(e,e=>{if(void 0===e.scopePath)throw new Error(`CodeGen: name "${e}" has no value`);return n._`${t}${e.scopePath}`})}scopeCode(t=this._values,e,i){return this._reduceValues(t,t=>{if(void 0===t.value)throw new Error(`CodeGen: name "${t}" has no value`);return t.value.code},e,i)}_reduceValues(t,i,r={},a){let l=n.nil;for(const c in t){const h=t[c];if(!h)continue;const u=r[c]=r[c]||new Map;h.forEach(t=>{if(u.has(t))return;u.set(t,s.Started);let r=i(t);if(r){const i=this.opts.es5?e.varKinds.var:e.varKinds.const;l=n._`${l}${i} ${t} = ${r};${this.opts._n}`}else{if(!(r=null==a?void 0:a(t)))throw new o(t);l=n._`${l}${r}${this.opts._n}`}u.set(t,s.Completed)})}return l}}},7870:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;const n=i(9029),o=i(4227);function s(t,e,i){const{gen:s,compositeRule:r,data:a,opts:l}=t;if(void 0===i)return;const c=n._`${a}${(0,n.getProperty)(e)}`;if(r)return void(0,o.checkStrictMode)(t,`default is ignored for: ${c}`);let h=n._`${c} === undefined`;"empty"===l.useDefaults&&(h=n._`${h} || ${c} === null || ${c} === ""`),s.if(h,n._`${c} = ${(0,n.stringify)(i)}`)}e.assignDefaults=function(t,e){const{properties:i,items:n}=t.schema;if("object"===e&&i)for(const e in i)s(t,e,i[e].default);else"array"===e&&Array.isArray(n)&&n.forEach((e,i)=>s(t,i,e.default))}},7887:(t,e)=>{"use strict";function i(t,e){return e.rules.some(e=>n(t,e))}function n(t,e){var i;return void 0!==t[e.keyword]||(null===(i=e.definition.implements)||void 0===i?void 0:i.some(e=>void 0!==t[e]))}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0,e.schemaHasRulesForType=function({schema:t,self:e},n){const o=e.RULES.types[n];return o&&!0!==o&&i(t,o)},e.shouldUseGroup=i,e.shouldUseRule=n},7901:(t,e,i)=>{var n="[object Symbol]",o=/[&<>"'`]/g,s=RegExp(o.source),r="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,a="object"==typeof self&&self&&self.Object===Object&&self,l=r||a||Function("return this")();var c,h=(c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(t){return null==c?void 0:c[t]}),u=Object.prototype.toString,d=l.Symbol,f=d?d.prototype:void 0,p=f?f.toString:void 0;function m(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&u.call(t)==n}(t))return p?p.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}t.exports=function(t){var e;return(t=null==(e=t)?"":m(e))&&s.test(t)?t.replace(o,h):t}},7923:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:i,it:o}=t;if((0,n.alwaysValidSchema)(o,i))return void t.fail();const s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};e.default=o},7935:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(4227),s=i(6250),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>n._`{allowedValue: ${t}}`},code(t){const{gen:e,data:i,$data:r,schemaCode:a,schema:l}=t;r||l&&"object"==typeof l?t.fail$data(n._`!${(0,o.useFunc)(e,s.default)}(${i}, ${a})`):t.fail(n._`${l} !== ${i}`)}};e.default=r},7975:t=>{"use strict";function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function i(t,e){for(var i,n="",o=0,s=-1,r=0,a=0;a<=t.length;++a){if(a<t.length)i=t.charCodeAt(a);else{if(47===i)break;i=47}if(47===i){if(s===a-1||1===r);else if(s!==a-1&&2===r){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),s=a,r=0;continue}}else if(2===n.length||1===n.length){n="",o=0,s=a,r=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),o=a-s-1;s=a,r=0}else 46===i&&-1!==r?++r:r=-1}return n}var n={resolve:function(){for(var t,n="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var r;s>=0?r=arguments[s]:(void 0===t&&(t=process.cwd()),r=t),e(r),0!==r.length&&(n=r+"/"+n,o=47===r.charCodeAt(0))}return n=i(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(t){if(e(t),0===t.length)return".";var n=47===t.charCodeAt(0),o=47===t.charCodeAt(t.length-1);return 0!==(t=i(t,!n)).length||n||(t="."),t.length>0&&o&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,i=0;i<arguments.length;++i){var o=arguments[i];e(o),o.length>0&&(void 0===t?t=o:t+="/"+o)}return void 0===t?".":n.normalize(t)},relative:function(t,i){if(e(t),e(i),t===i)return"";if((t=n.resolve(t))===(i=n.resolve(i)))return"";for(var o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var s=t.length,r=s-o,a=1;a<i.length&&47===i.charCodeAt(a);++a);for(var l=i.length-a,c=r<l?r:l,h=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===i.charCodeAt(a+u))return i.slice(a+u+1);if(0===u)return i.slice(a+u)}else r>c&&(47===t.charCodeAt(o+u)?h=u:0===u&&(h=0));break}var d=t.charCodeAt(o+u);if(d!==i.charCodeAt(a+u))break;47===d&&(h=u)}var f="";for(u=o+h+1;u<=s;++u)u!==s&&47!==t.charCodeAt(u)||(0===f.length?f+="..":f+="/..");return f.length>0?f+i.slice(a+h):(a+=h,47===i.charCodeAt(a)&&++a,i.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(e(t),0===t.length)return".";for(var i=t.charCodeAt(0),n=47===i,o=-1,s=!0,r=t.length-1;r>=1;--r)if(47===(i=t.charCodeAt(r))){if(!s){o=r;break}}else s=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,i){if(void 0!==i&&"string"!=typeof i)throw new TypeError('"ext" argument must be a string');e(t);var n,o=0,s=-1,r=!0;if(void 0!==i&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var a=i.length-1,l=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!r){o=n+1;break}}else-1===l&&(r=!1,l=n+1),a>=0&&(c===i.charCodeAt(a)?-1===--a&&(s=n):(a=-1,s=l))}return o===s?s=l:-1===s&&(s=t.length),t.slice(o,s)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!r){o=n+1;break}}else-1===s&&(r=!1,s=n+1);return-1===s?"":t.slice(o,s)},extname:function(t){e(t);for(var i=-1,n=0,o=-1,s=!0,r=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(47!==l)-1===o&&(s=!1,o=a+1),46===l?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1);else if(!s){n=a+1;break}}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":t.slice(i,o)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}("/",t)},parse:function(t){e(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return i;var n,o=t.charCodeAt(0),s=47===o;s?(i.root="/",n=1):n=0;for(var r=-1,a=0,l=-1,c=!0,h=t.length-1,u=0;h>=n;--h)if(47!==(o=t.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===o?-1===r?r=h:1!==u&&(u=1):-1!==r&&(u=-1);else if(!c){a=h+1;break}return-1===r||-1===l||0===u||1===u&&r===l-1&&r===a+1?-1!==l&&(i.base=i.name=0===a&&s?t.slice(1,l):t.slice(a,l)):(0===a&&s?(i.name=t.slice(1,r),i.base=t.slice(1,l)):(i.name=t.slice(a,r),i.base=t.slice(a,l)),i.ext=t.slice(r,l)),a>0?i.dir=t.slice(0,a-1):s&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,t.exports=n},8182:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4018),o=i(6461),s=i(9029),r=new s.Name("fullFormats"),a=new s.Name("fastFormats"),l=(t,e={keywords:!0})=>{if(Array.isArray(e))return c(t,e,n.fullFormats,r),t;const[i,s]="fast"===e.mode?[n.fastFormats,a]:[n.fullFormats,r];return c(t,e.formats||n.formatNames,i,s),e.keywords&&(0,o.default)(t),t};function c(t,e,i,n){var o,r;null!==(o=(r=t.opts.code).formats)&&void 0!==o||(r.formats=s._`require("ajv-formats/dist/formats").${n}`);for(const n of e)t.addFormat(n,i[n])}l.get=(t,e="full")=>{const i=("fast"===e?n.fastFormats:n.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i},t.exports=e=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},8343:(t,e,i)=>{"use strict";const{normalizeIPv6:n,removeDotSegments:o,recomposeAuthority:s,normalizeComponentEncoding:r,isIPv4:a,nonSimpleDomain:l}=i(4834),{SCHEMES:c,getSchemeHandler:h}=i(343);function u(t,e,i,n){const s={};return n||(t=p(d(t,i),i),e=p(d(e,i),i)),!(i=i||{}).tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=o(e.path||""),s.query=e.query):(void 0!==e.userinfo||void 0!==e.host||void 0!==e.port?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=o(e.path||""),s.query=e.query):(e.path?("/"===e.path[0]?s.path=o(e.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path:s.path="/"+e.path,s.path=o(s.path)),s.query=e.query):(s.path=t.path,void 0!==e.query?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function d(t,e){const i={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),r=[],a=h(n.scheme||i.scheme);a&&a.serialize&&a.serialize(i,n),void 0!==i.path&&(n.skipEscape?i.path=unescape(i.path):(i.path=escape(i.path),void 0!==i.scheme&&(i.path=i.path.split("%3A").join(":")))),"suffix"!==n.reference&&i.scheme&&r.push(i.scheme,":");const l=s(i);if(void 0!==l&&("suffix"!==n.reference&&r.push("//"),r.push(l),i.path&&"/"!==i.path[0]&&r.push("/")),void 0!==i.path){let t=i.path;n.absolutePath||a&&a.absolutePath||(t=o(t)),void 0===l&&"/"===t[0]&&"/"===t[1]&&(t="/%2F"+t.slice(2)),r.push(t)}return void 0!==i.query&&r.push("?",i.query),void 0!==i.fragment&&r.push("#",i.fragment),r.join("")}const f=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(t,e){const i=Object.assign({},e),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let s=!1;"suffix"===i.reference&&(t=i.scheme?i.scheme+":"+t:"//"+t);const r=t.match(f);if(r){if(o.scheme=r[1],o.userinfo=r[3],o.host=r[4],o.port=parseInt(r[5],10),o.path=r[6]||"",o.query=r[7],o.fragment=r[8],isNaN(o.port)&&(o.port=r[5]),o.host){if(!1===a(o.host)){const t=n(o.host);o.host=t.host.toLowerCase(),s=t.isIPV6}else s=!0}void 0!==o.scheme||void 0!==o.userinfo||void 0!==o.host||void 0!==o.port||void 0!==o.query||o.path?void 0===o.scheme?o.reference="relative":void 0===o.fragment?o.reference="absolute":o.reference="uri":o.reference="same-document",i.reference&&"suffix"!==i.reference&&i.reference!==o.reference&&(o.error=o.error||"URI is not a "+i.reference+" reference.");const e=h(i.scheme||o.scheme);if(!(i.unicodeSupport||e&&e.unicodeSupport)&&o.host&&(i.domainHost||e&&e.domainHost)&&!1===s&&l(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(t){o.error=o.error||"Host's domain name can not be converted to ASCII: "+t}(!e||e&&!e.skipNormalize)&&(-1!==t.indexOf("%")&&(void 0!==o.scheme&&(o.scheme=unescape(o.scheme)),void 0!==o.host&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),e&&e.parse&&e.parse(o,i)}else o.error=o.error||"URI can not be parsed.";return o}const m={SCHEMES:c,normalize:function(t,e){return"string"==typeof t?t=d(p(t,e),e):"object"==typeof t&&(t=p(d(t,e),e)),t},resolve:function(t,e,i){const n=i?Object.assign({scheme:"null"},i):{scheme:"null"},o=u(p(t,n),p(e,n),n,!0);return n.skipEscape=!0,d(o,n)},resolveComponent:u,equal:function(t,e,i){return"string"==typeof t?(t=unescape(t),t=d(r(p(t,i),!0),{...i,skipEscape:!0})):"object"==typeof t&&(t=d(r(t,!0),{...i,skipEscape:!0})),"string"==typeof e?(e=unescape(e),e=d(r(p(e,i),!0),{...i,skipEscape:!0})):"object"==typeof e&&(e=d(r(e,!0),{...i,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()},serialize:d,parse:p};t.exports=m,t.exports.default=m,t.exports.fastUri=m},8481:(t,e,i)=>{var n,o,s;
143
+ /*!
144
+ * jQuery UI Button 1.14.1
145
+ * https://jqueryui.com
146
+ *
147
+ * Copyright OpenJS Foundation and other contributors
148
+ * Released under the MIT license.
149
+ * https://jquery.org/license
150
+ */!function(){"use strict";o=[i(4692),i(6605),i(2097),i(1897),i(9139)],n=function(t){t.widget("ui.button",{version:"1.14.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var n="iconPosition"!==e,o=n?this.options.iconPosition:i,s="top"===o||"bottom"===o;this.icon?n&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),n&&this._addClass(this.icon,null,i),this._attachIcon(o),s?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(o))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.trigger("blur"))},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!0===t.uiBackCompat&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),t.fn.button=(e=t.fn.button,function(i){var n="string"==typeof i,o=Array.prototype.slice.call(arguments,1),s=this;return n?this.length||"instance"!==i?this.each(function(){var e,n=t(this).attr("type"),r="checkbox"!==n&&"radio"!==n?"button":"checkboxradio",a=t.data(this,"ui-"+r);return"instance"===i?(s=a,!1):a?"function"!=typeof a[i]||"_"===i.charAt(0)?t.error("no such method '"+i+"' for button widget instance"):(e=a[i].apply(a,o))!==a&&void 0!==e?(s=e&&e.jquery?s.pushStack(e.get()):e,!1):void 0:t.error("cannot call methods on button prior to initialization; attempted to call method '"+i+"'")}):s=void 0:(o.length&&(i=t.widget.extend.apply(null,[i].concat(o))),this.each(function(){var n=t(this).attr("type"),o="checkbox"!==n&&"radio"!==n?"button":"checkboxradio",s=t.data(this,"ui-"+o);if(s)s.option(i||{}),s._init&&s._init();else{if("button"===o)return void e.call(t(this),i);t(this).checkboxradio(t.extend({icon:!1},i))}})),s}),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var e;return t.ui.button},void 0===(s="function"==typeof n?n.apply(e,o):n)||(t.exports=s)}()},8604:(t,e,i)=>{var n,o,s;
151
+ /*!
152
+ * jQuery UI Resizable 1.14.1
153
+ * https://jqueryui.com
154
+ *
155
+ * Copyright OpenJS Foundation and other contributors
156
+ * Released under the MIT license.
157
+ * https://jquery.org/license
158
+ */!function(){"use strict";o=[i(4692),i(3662),i(724),i(2336),i(6883),i(9139)],n=function(t){return t.widget("ui.resizable",t.ui.mouse,{version:"1.14.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){var n,o=!1,s=t(e).css("overflow");if("hidden"===s)return!1;if("scroll"===s)return!0;if(e[n=i&&"left"===i?"scrollLeft":"scrollTop"]>0)return!0;try{e[n]=1,o=e[n]>0,e[n]=0}catch(t){}return o},_create:function(){var e,i=this.options,n=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(n._removeClass("ui-resizable-autohide"),n._handles.show())}).on("mouseleave",function(){i.disabled||n.resizing||(n._addClass("ui-resizable-autohide"),n._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable")};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var e,i,n,o,s,r=this.options,a=this;if(this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this._addedHandles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i<n.length;i++)o="ui-resizable-"+(e=String.prototype.trim.call(n[i])),s=t("<div>"),this._addClass(s,"ui-resizable-handle "+o),s.css({zIndex:r.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.children(this.handles[e]).length||(this.element.append(s),this._addedHandles=this._addedHandles.add(s));this._renderAxis=function(e){var i,n,o,s;for(i in e=e||this.element,this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(n=t(this.handles[i],this.element),s=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),o=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(o,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(s=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=s&&s[1]?s[1]:"se")}),r.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(e){var i,n,o=!1;for(i in this.handles)((n=t(this.handles[i])[0])===e.target||t.contains(n,e.target))&&(o=!0);return!this.options.disabled&&o},_mouseStart:function(e){var i,n,o,s,r=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),n=this._num(this.helper.css("top")),r.containment&&(i+=t(r.containment).scrollLeft()||0,n+=t(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:n},this._helper||(s=this._calculateAdjustedElementDimensions(a)),this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:s.width,height:s.height},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:s.width,height:s.height},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:n},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===o?this.axis+"-resize":o),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,n,o=this.originalMousePosition,s=this.axis,r=e.pageX-o.left||0,a=e.pageY-o.top||0,l=this._change[s];return this._updatePrevProperties(),!!l&&(i=l.apply(this,[e,r,a]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),n=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1)},_mouseStop:function(e){this.resizing=!1;var i,n,o,s,r,a,l,c=this.options,h=this;return this._helper&&(o=(n=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:h.sizeDiff.height,s=n?0:h.sizeDiff.width,r={width:h.helper.width()-s,height:h.helper.height()-o},a=parseFloat(h.element.css("left"))+(h.position.left-h.originalPosition.left)||null,l=parseFloat(h.element.css("top"))+(h.position.top-h.originalPosition.top)||null,c.animate||this.element.css(t.extend(r,{top:l,left:a})),h.helper.height(h.size.height),h.helper.width(h.size.width),this._helper&&!c.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.helper.css(t),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px",this.helper.width(t.width)),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px",this.helper.height(t.height)),t},_updateVirtualBoundaries:function(t){var e,i,n,o,s,r=this.options;s={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:1/0,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=s.minHeight*this.aspectRatio,n=s.minWidth/this.aspectRatio,i=s.maxHeight*this.aspectRatio,o=s.maxWidth/this.aspectRatio,e>s.minWidth&&(s.minWidth=e),n>s.minHeight&&(s.minHeight=n),i<s.maxWidth&&(s.maxWidth=i),o<s.maxHeight&&(s.maxHeight=o)),this._vBoundaries=s},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,n=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,n=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,s=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,c=/sw|nw|w/.test(i),h=/nw|ne|n/.test(i);return s&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),s&&c&&(t.left=a-e.minWidth),n&&c&&(t.left=a-e.maxWidth),r&&h&&(t.top=l-e.minHeight),o&&h&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],n=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],o=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(n[e])||0,i[e]+=parseFloat(o[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_calculateAdjustedElementDimensions:function(t){var e,i,n,o=t.get(0);return"content-box"!==t.css("box-sizing")||!this._hasScroll(o)&&!this._hasScroll(o,"left")?{height:parseFloat(t.css("height")),width:parseFloat(t.css("width"))}:(e=parseFloat(o.style.width),i=parseFloat(o.style.height),n=this._getPaddingPlusBorderDimensions(t),e=isNaN(e)?this._getElementTheoreticalSize(t,n,"width"):e,{height:i=isNaN(i)?this._getElementTheoreticalSize(t,n,"height"):i,width:e})},_getElementTheoreticalSize:function(t,e,i){return Math.max(0,Math.ceil(t.get(0)["offset"+i[0].toUpperCase()+i.slice(1)]-e[i]-.5))||0},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var n=this.originalSize;return{top:this.originalPosition.top+i,height:n.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,n){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,n]))},sw:function(e,i,n){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,n]))},ne:function(e,i,n){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,n]))},nw:function(e,i,n){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,n]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),n=i.options,o=i._proportionallyResizeElements,s=o.length&&/textarea/i.test(o[0].nodeName),r=s&&i._hasScroll(o[0],"left")?0:i.sizeDiff.height,a=s?0:i.sizeDiff.width,l={width:i.size.width-a,height:i.size.height-r},c=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,h=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,h&&c?{top:h,left:c}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};o&&o.length&&t(o[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,n,o,s,r,a,l=t(this).resizable("instance"),c=l.options,h=l.element,u=c.containment,d=u instanceof t?u.get(0):/parent/.test(u)?h.parent().get(0):u;d&&(l.containerElement=t(d),/document/.test(u)||u===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){i[t]=l._num(e.css("padding"+n))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},n=l.containerOffset,o=l.containerSize.height,s=l.containerSize.width,r=l._hasScroll(d,"left")?d.scrollWidth:s,a=l._hasScroll(d)?d.scrollHeight:o,l.parentData={element:d,left:n.left,top:n.top,width:r,height:a}))},resize:function(e){var i,n,o,s,r=t(this).resizable("instance"),a=r.options,l=r.containerOffset,c=r.position,h=r._aspectRatio||e.shiftKey,u={top:0,left:0},d=r.containerElement,f=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=l),c.left<(r._helper?l.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-l.left:r.position.left-u.left),h&&(r.size.height=r.size.width/r.aspectRatio,f=!1),r.position.left=a.helper?l.left:0),c.top<(r._helper?l.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-l.top:r.position.top),h&&(r.size.width=r.size.height*r.aspectRatio,f=!1),r.position.top=r._helper?l.top:0),o=r.containerElement.get(0)===r.element.parent().get(0),s=/relative|absolute/.test(r.containerElement.css("position")),o&&s?(r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top):(r.offset.left=r.element.offset().left,r.offset.top=r.element.offset().top),i=Math.abs(r.sizeDiff.width+(r._helper?r.offset.left-u.left:r.offset.left-l.left)),n=Math.abs(r.sizeDiff.height+(r._helper?r.offset.top-u.top:r.offset.top-l.top)),i+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-i,h&&(r.size.height=r.size.width/r.aspectRatio,f=!1)),n+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-n,h&&(r.size.width=r.size.height*r.aspectRatio,f=!1)),f||(r.position.left=r.prevPosition.left,r.position.top=r.prevPosition.top,r.size.width=r.prevSize.width,r.size.height=r.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,n=e.containerOffset,o=e.containerPosition,s=e.containerElement,r=t(e.helper),a=r.offset(),l=r.outerWidth()-e.sizeDiff.width,c=r.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(s.css("position"))&&t(this).css({left:a.left-o.left-n.left,width:l,height:c}),e._helper&&!i.animate&&/static/.test(s.css("position"))&&t(this).css({left:a.left-o.left-n.left,width:l,height:c})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var i=t(this),n=e._calculateAdjustedElementDimensions(i);i.data("ui-resizable-alsoresize",{width:n.width,height:n.height,left:parseFloat(i.css("left")),top:parseFloat(i.css("top"))})})},resize:function(e,i){var n=t(this).resizable("instance"),o=n.options,s=n.originalSize,r=n.originalPosition,a={height:n.size.height-s.height||0,width:n.size.width-s.width||0,top:n.position.top-r.top||0,left:n.position.left-r.left||0};t(o.alsoResize).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),o={},s=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(s,function(t,e){var i=(n[e]||0)+(a[e]||0);i&&i>=0&&(o[e]=i||null)}),e.css(o)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),!0===t.uiBackCompat&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),n=i.options,o=i.size,s=i.originalSize,r=i.originalPosition,a=i.axis,l="number"==typeof n.grid?[n.grid,n.grid]:n.grid,c=l[0]||1,h=l[1]||1,u=Math.round((o.width-s.width)/c)*c,d=Math.round((o.height-s.height)/h)*h,f=s.width+u,p=s.height+d,m=n.maxWidth&&n.maxWidth<f,g=n.maxHeight&&n.maxHeight<p,v=n.minWidth&&n.minWidth>f,y=n.minHeight&&n.minHeight>p;n.grid=l,v&&(f+=c),y&&(p+=h),m&&(f-=c),g&&(p-=h),/^(se|s|e)$/.test(a)?(i.size.width=f,i.size.height=p):/^(ne)$/.test(a)?(i.size.width=f,i.size.height=p,i.position.top=r.top-d):/^(sw)$/.test(a)?(i.size.width=f,i.size.height=p,i.position.left=r.left-u):((p-h<=0||f-c<=0)&&(e=i._getPaddingPlusBorderDimensions(this)),p-h>0?(i.size.height=p,i.position.top=r.top-d):(p=h-e.height,i.size.height=p,i.position.top=r.top+s.height-p),f-c>0?(i.size.width=f,i.position.left=r.left-u):(f=c-e.width,i.size.width=f,i.position.left=r.left+s.width-f))}}),t.ui.resizable},void 0===(s="function"==typeof n?n.apply(e,o):n)||(t.exports=s)}()},8643:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(4227),s=i(6250),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>n._`{allowedValues: ${t}}`},code(t){const{gen:e,data:i,$data:r,schema:a,schemaCode:l,it:c}=t;if(!r&&0===a.length)throw new Error("enum must have non-empty array");const h=a.length>=c.opts.loopEnum;let u;const d=()=>null!=u?u:u=(0,o.useFunc)(e,s.default);let f;if(h||r)f=e.let("valid"),t.block$data(f,function(){e.assign(f,!1),e.forOf("v",l,t=>e.if(n._`${d()}(${i}, ${t})`,()=>e.assign(f,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const t=e.const("vSchema",l);f=(0,n.or)(...a.map((e,o)=>function(t,e){const o=a[e];return"object"==typeof o&&null!==o?n._`${d()}(${i}, ${t}[${e}])`:n._`${i} === ${o}`}(t,o)))}t.pass(f)}};e.default=r},8660:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5765),o=i(9029),s=i(2023),r=i(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>o._`{additionalProperty: ${t.additionalProperty}}`},code(t){const{gen:e,schema:i,parentSchema:a,data:l,errsCount:c,it:h}=t;if(!c)throw new Error("ajv implementation error");const{allErrors:u,opts:d}=h;if(h.props=!0,"all"!==d.removeAdditional&&(0,r.alwaysValidSchema)(h,i))return;const f=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function m(t){e.code(o._`delete ${l}[${t}]`)}function g(n){if("all"===d.removeAdditional||d.removeAdditional&&!1===i)m(n);else{if(!1===i)return t.setParams({additionalProperty:n}),t.error(),void(u||e.break());if("object"==typeof i&&!(0,r.alwaysValidSchema)(h,i)){const i=e.name("valid");"failing"===d.removeAdditional?(v(n,i,!1),e.if((0,o.not)(i),()=>{t.reset(),m(n)})):(v(n,i),u||e.if((0,o.not)(i),()=>e.break()))}}}function v(e,i,n){const o={keyword:"additionalProperties",dataProp:e,dataPropType:r.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(o,i)}e.forIn("key",l,i=>{f.length||p.length?e.if(function(i){let s;if(f.length>8){const t=(0,r.schemaRefOrVal)(h,a.properties,"properties");s=(0,n.isOwnProperty)(e,t,i)}else s=f.length?(0,o.or)(...f.map(t=>o._`${i} === ${t}`)):o.nil;return p.length&&(s=(0,o.or)(s,...p.map(e=>o._`${(0,n.usePattern)(t,e)}.test(${i})`))),(0,o.not)(s)}(i),()=>g(i)):g(i)}),t.ok(o._`${c} === ${s.default.errors}`)}};e.default=a},8708:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const n=i(9029),o=i(4227),s=i(2023);function r(t,e){const i=t.const("err",e);t.if(n._`${s.default.vErrors} === null`,()=>t.assign(s.default.vErrors,n._`[${i}]`),n._`${s.default.vErrors}.push(${i})`),t.code(n._`${s.default.errors}++`)}function a(t,e){const{gen:i,validateName:o,schemaEnv:s}=t;s.$async?i.throw(n._`new ${t.ValidationError}(${e})`):(i.assign(n._`${o}.errors`,e),i.return(!1))}e.keywordError={message:({keyword:t})=>n.str`must pass "${t}" keyword validation`},e.keyword$DataError={message:({keyword:t,schemaType:e})=>e?n.str`"${t}" keyword must be ${e} ($data)`:n.str`"${t}" keyword is invalid ($data)`},e.reportError=function(t,i=e.keywordError,o,s){const{it:l}=t,{gen:h,compositeRule:u,allErrors:d}=l,f=c(t,i,o);(null!=s?s:u||d)?r(h,f):a(l,n._`[${f}]`)},e.reportExtraError=function(t,i=e.keywordError,n){const{it:o}=t,{gen:l,compositeRule:h,allErrors:u}=o;r(l,c(t,i,n)),h||u||a(o,s.default.vErrors)},e.resetErrorsCount=function(t,e){t.assign(s.default.errors,e),t.if(n._`${s.default.vErrors} !== null`,()=>t.if(e,()=>t.assign(n._`${s.default.vErrors}.length`,e),()=>t.assign(s.default.vErrors,null)))},e.extendErrors=function({gen:t,keyword:e,schemaValue:i,data:o,errsCount:r,it:a}){if(void 0===r)throw new Error("ajv implementation error");const l=t.name("err");t.forRange("i",r,s.default.errors,r=>{t.const(l,n._`${s.default.vErrors}[${r}]`),t.if(n._`${l}.instancePath === undefined`,()=>t.assign(n._`${l}.instancePath`,(0,n.strConcat)(s.default.instancePath,a.errorPath))),t.assign(n._`${l}.schemaPath`,n.str`${a.errSchemaPath}/${e}`),a.opts.verbose&&(t.assign(n._`${l}.schema`,i),t.assign(n._`${l}.data`,o))})};const l={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function c(t,e,i){const{createErrors:o}=t.it;return!1===o?n._`{}`:function(t,e,i={}){const{gen:o,it:r}=t,a=[h(r,i),u(t,i)];return function(t,{params:e,message:i},o){const{keyword:r,data:a,schemaValue:c,it:h}=t,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:p}=h;o.push([l.keyword,r],[l.params,"function"==typeof e?e(t):e||n._`{}`]),u.messages&&o.push([l.message,"function"==typeof i?i(t):i]);u.verbose&&o.push([l.schema,c],[l.parentSchema,n._`${f}${p}`],[s.default.data,a]);d&&o.push([l.propertyName,d])}(t,e,a),o.object(...a)}(t,e,i)}function h({errorPath:t},{instancePath:e}){const i=e?n.str`${t}${(0,o.getErrorPath)(e,o.Type.Str)}`:t;return[s.default.instancePath,(0,n.strConcat)(s.default.instancePath,i)]}function u({keyword:t,it:{errSchemaPath:e}},{schemaPath:i,parentSchema:s}){let r=s?e:n.str`${e}/${t}`;return i&&(r=n.str`${r}${(0,o.getErrorPath)(i,o.Type.Str)}`),[l.schemaPath,r]}},8727:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;const n=i(8708),o=i(9029),s=i(2023),r={message:"boolean schema is false"};function a(t,e){const{gen:i,data:o}=t,s={gen:i,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,n.reportError)(s,r,void 0,e)}e.topBoolOrEmptySchema=function(t){const{gen:e,schema:i,validateName:n}=t;!1===i?a(t,!1):"object"==typeof i&&!0===i.$async?e.return(s.default.data):(e.assign(o._`${n}.errors`,null),e.return(!0))},e.boolOrEmptySchema=function(t,e){const{gen:i,schema:n}=t;!1===n?(i.var(e,!1),a(t)):i.var(e,!0)}},9029:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const n=i(1520),o=i(7845);var s=i(1520);Object.defineProperty(e,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return s.Name}});var r=i(7845);Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),e.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(t,e){return this}}class l extends a{constructor(t,e,i){super(),this.varKind=t,this.name=e,this.rhs=i}render({es5:t,_n:e}){const i=t?o.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+e}optimizeNames(t,e){if(t[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,t,e)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(t,e,i){super(),this.lhs=t,this.rhs=e,this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,e){if(!(this.lhs instanceof n.Name)||t[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,t,e),this}get names(){return E(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class h extends c{constructor(t,e,i,n){super(t,i,n),this.op=e}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class u extends a{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}}class d extends a{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}}class f extends a{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}}class p extends a{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,e){return this.code=A(this.code,t,e),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends a{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((e,i)=>e+i.render(t),"")}optimizeNodes(){const{nodes:t}=this;let e=t.length;for(;e--;){const i=t[e].optimizeNodes();Array.isArray(i)?t.splice(e,1,...i):i?t[e]=i:t.splice(e,1)}return t.length>0?this:void 0}optimizeNames(t,e){const{nodes:i}=this;let n=i.length;for(;n--;){const o=i[n];o.optimizeNames(t,e)||(M(t,o.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((t,e)=>P(t,e.names),{})}}class g extends m{render(t){return"{"+t._n+super.render(t)+"}"+t._n}}class v extends m{}class y extends g{}y.kind="else";class O extends g{constructor(t,e){super(e),this.condition=t}render(t){let e=`if(${this.condition})`+super.render(t);return this.else&&(e+="else "+this.else.render(t)),e}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(!0===t)return this.nodes;let e=this.else;if(e){const t=e.optimizeNodes();e=this.else=Array.isArray(t)?new y(t):t}return e?!1===t?e instanceof O?e:e.nodes:this.nodes.length?this:new O(Q(t),e instanceof O?[e]:e.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(t,e){var i;if(this.else=null===(i=this.else)||void 0===i?void 0:i.optimizeNames(t,e),super.optimizeNames(t,e)||this.else)return this.condition=A(this.condition,t,e),this}get names(){const t=super.names;return E(t,this.condition),this.else&&P(t,this.else.names),t}}O.kind="if";class b extends g{}b.kind="for";class x extends b{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,e){if(super.optimizeNames(t,e))return this.iteration=A(this.iteration,t,e),this}get names(){return P(super.names,this.iteration.names)}}class w extends b{constructor(t,e,i,n){super(),this.varKind=t,this.name=e,this.from=i,this.to=n}render(t){const e=t.es5?o.varKinds.var:this.varKind,{name:i,from:n,to:s}=this;return`for(${e} ${i}=${n}; ${i}<${s}; ${i}++)`+super.render(t)}get names(){const t=E(super.names,this.from);return E(t,this.to)}}class _ extends b{constructor(t,e,i,n){super(),this.loop=t,this.varKind=e,this.name=i,this.iterable=n}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,e){if(super.optimizeNames(t,e))return this.iterable=A(this.iterable,t,e),this}get names(){return P(super.names,this.iterable.names)}}class S extends g{constructor(t,e,i){super(),this.name=t,this.args=e,this.async=i}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}S.kind="func";class k extends m{render(t){return"return "+super.render(t)}}k.kind="return";class $ extends g{render(t){let e="try"+super.render(t);return this.catch&&(e+=this.catch.render(t)),this.finally&&(e+=this.finally.render(t)),e}optimizeNodes(){var t,e;return super.optimizeNodes(),null===(t=this.catch)||void 0===t||t.optimizeNodes(),null===(e=this.finally)||void 0===e||e.optimizeNodes(),this}optimizeNames(t,e){var i,n;return super.optimizeNames(t,e),null===(i=this.catch)||void 0===i||i.optimizeNames(t,e),null===(n=this.finally)||void 0===n||n.optimizeNames(t,e),this}get names(){const t=super.names;return this.catch&&P(t,this.catch.names),this.finally&&P(t,this.finally.names),t}}class T extends g{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}T.kind="catch";class C extends g{render(t){return"finally"+super.render(t)}}C.kind="finally";function P(t,e){for(const i in e)t[i]=(t[i]||0)+(e[i]||0);return t}function E(t,e){return e instanceof n._CodeOrName?P(t,e.names):t}function A(t,e,i){return t instanceof n.Name?s(t):(o=t)instanceof n._Code&&o._items.some(t=>t instanceof n.Name&&1===e[t.str]&&void 0!==i[t.str])?new n._Code(t._items.reduce((t,e)=>(e instanceof n.Name&&(e=s(e)),e instanceof n._Code?t.push(...e._items):t.push(e),t),[])):t;var o;function s(t){const n=i[t.str];return void 0===n||1!==e[t.str]?t:(delete e[t.str],n)}}function M(t,e){for(const i in e)t[i]=(t[i]||0)-(e[i]||0)}function Q(t){return"boolean"==typeof t||"number"==typeof t||null===t?!t:n._`!${L(t)}`}e.CodeGen=class{constructor(t,e={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...e,_n:e.lines?"\n":""},this._extScope=t,this._scope=new o.Scope({parent:t}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,e){const i=this._extScope.value(t,e);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(t,e){return this._extScope.getValue(t,e)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,e,i,n){const o=this._scope.toName(e);return void 0!==i&&n&&(this._constants[o.str]=i),this._leafNode(new l(t,o,i)),o}const(t,e,i){return this._def(o.varKinds.const,t,e,i)}let(t,e,i){return this._def(o.varKinds.let,t,e,i)}var(t,e,i){return this._def(o.varKinds.var,t,e,i)}assign(t,e,i){return this._leafNode(new c(t,e,i))}add(t,i){return this._leafNode(new h(t,e.operators.ADD,i))}code(t){return"function"==typeof t?t():t!==n.nil&&this._leafNode(new p(t)),this}object(...t){const e=["{"];for(const[i,o]of t)e.length>1&&e.push(","),e.push(i),(i!==o||this.opts.es5)&&(e.push(":"),(0,n.addCodeArg)(e,o));return e.push("}"),new n._Code(e)}if(t,e,i){if(this._blockNode(new O(t)),e&&i)this.code(e).else().code(i).endIf();else if(e)this.code(e).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new O(t))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(O,y)}_for(t,e){return this._blockNode(t),e&&this.code(e).endFor(),this}for(t,e){return this._for(new x(t),e)}forRange(t,e,i,n,s=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const r=this._scope.toName(t);return this._for(new w(s,r,e,i),()=>n(r))}forOf(t,e,i,s=o.varKinds.const){const r=this._scope.toName(t);if(this.opts.es5){const t=e instanceof n.Name?e:this.var("_arr",e);return this.forRange("_i",0,n._`${t}.length`,e=>{this.var(r,n._`${t}[${e}]`),i(r)})}return this._for(new _("of",s,r,e),()=>i(r))}forIn(t,e,i,s=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(t,n._`Object.keys(${e})`,i);const r=this._scope.toName(t);return this._for(new _("in",s,r,e),()=>i(r))}endFor(){return this._endBlockNode(b)}label(t){return this._leafNode(new u(t))}break(t){return this._leafNode(new d(t))}return(t){const e=new k;if(this._blockNode(e),this.code(t),1!==e.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(t,e,i){if(!e&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new $;if(this._blockNode(n),this.code(t),e){const t=this.name("e");this._currNode=n.catch=new T(t),e(t)}return i&&(this._currNode=n.finally=new C,this.code(i)),this._endBlockNode(T,C)}throw(t){return this._leafNode(new f(t))}block(t,e){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(e),this}endBlock(t){const e=this._blockStarts.pop();if(void 0===e)throw new Error("CodeGen: not in self-balancing block");const i=this._nodes.length-e;if(i<0||void 0!==t&&i!==t)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`);return this._nodes.length=e,this}func(t,e=n.nil,i,o){return this._blockNode(new S(t,e,i)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,e){const i=this._currNode;if(i instanceof t||e&&i instanceof e)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${e?`${t.kind}/${e.kind}`:t.kind}"`)}_elseNode(t){const e=this._currNode;if(!(e instanceof O))throw new Error('CodeGen: "else" without "if"');return this._currNode=e.else=t,this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const e=this._nodes;e[e.length-1]=t}},e.not=Q;const D=I(e.operators.AND);e.and=function(...t){return t.reduce(D)};const R=I(e.operators.OR);function I(t){return(e,i)=>e===n.nil?i:i===n.nil?e:n._`${L(e)} ${t} ${L(i)}`}function L(t){return t instanceof n.Name?t:n._`(${t})`}e.or=function(...t){return t.reduce(R)}},9139:(t,e,i)=>{var n,o,s;
159
+ /*!
160
+ * jQuery UI Widget 1.14.1
161
+ * https://jqueryui.com
162
+ *
163
+ * Copyright OpenJS Foundation and other contributors
164
+ * Released under the MIT license.
165
+ * https://jquery.org/license
166
+ */!function(){"use strict";o=[i(4692),i(6883)],n=function(t){var e=0,i=Array.prototype.hasOwnProperty,n=Array.prototype.slice;return t.cleanData=function(e){return function(i){var n,o,s;for(s=0;null!=(o=i[s]);s++)(n=t._data(o,"events"))&&n.remove&&t(o).triggerHandler("remove");e(i)}}(t.cleanData),t.widget=function(e,i,n){var o,s,r,a={},l=e.split(".")[0];if("__proto__"===(e=e.split(".")[1])||"constructor"===e)return t.error("Invalid widget name: "+e);var c=l+"-"+e;return n||(n=i,i=t.Widget),Array.isArray(n)&&(n=t.extend.apply(null,[{}].concat(n))),t.expr.pseudos[c.toLowerCase()]=function(e){return!!t.data(e,c)},t[l]=t[l]||{},o=t[l][e],s=t[l][e]=function(t,e){if(!this||!this._createWidget)return new s(t,e);arguments.length&&this._createWidget(t,e)},t.extend(s,o,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),(r=new i).options=t.widget.extend({},r.options),t.each(n,function(t,e){a[t]="function"==typeof e?function(){function n(){return i.prototype[t].apply(this,arguments)}function o(e){return i.prototype[t].apply(this,e)}return function(){var t,i=this._super,s=this._superApply;return this._super=n,this._superApply=o,t=e.apply(this,arguments),this._super=i,this._superApply=s,t}}():e}),s.prototype=t.widget.extend(r,{widgetEventPrefix:o&&r.widgetEventPrefix||e},a,{constructor:s,namespace:l,widgetName:e,widgetFullName:c}),o?(t.each(o._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,s,i._proto)}),delete o._childConstructors):i._childConstructors.push(s),t.widget.bridge(e,s),s},t.widget.extend=function(e){for(var o,s,r=n.call(arguments,1),a=0,l=r.length;a<l;a++)for(o in r[a])s=r[a][o],i.call(r[a],o)&&void 0!==s&&(t.isPlainObject(s)?e[o]=t.isPlainObject(e[o])?t.widget.extend({},e[o],s):t.widget.extend({},s):e[o]=s);return e},t.widget.bridge=function(e,i){var o=i.prototype.widgetFullName||e;t.fn[e]=function(s){var r="string"==typeof s,a=n.call(arguments,1),l=this;return r?this.length||"instance"!==s?this.each(function(){var i,n=t.data(this,o);return"instance"===s?(l=n,!1):n?"function"!=typeof n[s]||"_"===s.charAt(0)?t.error("no such method '"+s+"' for "+e+" widget instance"):(i=n[s].apply(n,a))!==n&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0:t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+s+"'")}):l=void 0:(a.length&&(s=t.widget.extend.apply(null,[s].concat(a))),this.each(function(){var e=t.data(this,o);e?(e.option(s||{}),e._init&&e._init()):t.data(this,o,new i(s,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var n,o,s,r=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(r={},n=e.split("."),e=n.shift(),n.length){for(o=r[e]=t.widget.extend({},this.options[e]),s=0;s<n.length-1;s++)o[n[s]]=o[n[s]]||{},o=o[n[s]];if(e=n.pop(),1===arguments.length)return void 0===o[e]?null:o[e];o[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];r[e]=i}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,n,o;for(i in e)o=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&o&&o.length&&(n=t(o.get()),this._removeClass(o,i),n.addClass(this._classes({element:n,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var i=[],n=this;function o(){var i=[];e.element.each(function(e,o){t.map(n.classesElementLookup,function(t){return t}).some(function(t){return t.is(o)})||i.push(o)}),n._on(t(i),{remove:"_untrackClassesElement"})}function s(s,r){var a,l;for(l=0;l<s.length;l++)a=n.classesElementLookup[s[l]]||t(),e.add?(o(),a=t(t.uniqueSort(a.get().concat(e.element.get())))):a=t(a.not(e.element).get()),n.classesElementLookup[s[l]]=a,i.push(s[l]),r&&e.classes[s[l]]&&i.push(e.classes[s[l]])}return(e=t.extend({element:this.element,classes:this.options.classes||{}},e)).keys&&s(e.keys.match(/\S+/g)||[],!0),e.extra&&s(e.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(n,o){-1!==t.inArray(e.target,o)&&(i.classesElementLookup[n]=t(o.not(e.target).get()))}),this._off(t(e.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){n="boolean"==typeof n?n:i;var o="string"==typeof t||null===t,s={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:n};return s.element.toggleClass(this._classes(s),n),this},_on:function(e,i,n){var o,s=this;"boolean"!=typeof e&&(n=i,i=e,e=!1),n?(i=o=t(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,o=this.widget()),t.each(n,function(n,r){function a(){if(e||!0!==s.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof r?s[r]:r).apply(s,arguments)}"string"!=typeof r&&(a.guid=r.guid=r.guid||a.guid||t.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),c=l[1]+s.eventNamespace,h=l[2];h?o.on(c,h,a):i.on(c,a)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?n[t]:t).apply(n,arguments)}var n=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,n){var o,s,r=this.options[e];if(n=n||{},(i=t.Event(i)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],s=i.originalEvent)for(o in s)o in i||(i[o]=s[o]);return this.element.trigger(i,n),!("function"==typeof r&&!1===r.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(n,o,s){var r;"string"==typeof o&&(o={effect:o});var a=o?!0===o||"number"==typeof o?i:o.effect||i:e;"number"==typeof(o=o||{})?o={duration:o}:!0===o&&(o={}),r=!t.isEmptyObject(o),o.complete=s,o.delay&&n.delay(o.delay),r&&t.effects&&t.effects.effect[a]?n[e](o):a!==e&&n[a]?n[a](o.duration,o.easing,s):n.queue(function(i){t(this)[e](),s&&s.call(n[0]),i()})}}),t.widget},void 0===(s="function"==typeof n?n.apply(e,o):n)||(t.exports=s)}()},9713:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),o=i(4227),s={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>n._`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:i,data:s,it:r}=t;if((0,o.alwaysValidSchema)(r,i))return;const a=e.name("valid");e.forIn("key",s,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},a),e.if((0,n.not)(a),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(a)}};e.default=s},9857:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},9983:(t,e,i)=>{var n,o,s;
167
+ /*!
168
+ * jQuery UI :data 1.14.1
169
+ * https://jqueryui.com
170
+ *
171
+ * Copyright OpenJS Foundation and other contributors
172
+ * Released under the MIT license.
173
+ * https://jquery.org/license
174
+ */!function(){"use strict";o=[i(4692),i(6883)],void 0===(s="function"==typeof(n=function(t){return t.extend(t.expr.pseudos,{data:t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}})})})?n.apply(e,o):n)||(t.exports=s)}()}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t="14.3.2";var e=i(3053),n=i.n(e);class o{constructor(t){this._editor=t}set annotation(t){this._editor.load(t)}set inspectCallback(t){this._editor.setInspector(t)}set lastSelectedDenotationIDCallback(t){this._editor.setLastSelectedDenotationIDCallback(t)}set autocompletionCallback(t){this._editor.setAutocompletionFunction(t)}get id(){return this._editor.HTMLElementID}focusDenotation(t){this._editor.focusDenotation(t)}selectDenotation(t){this._editor.selectDenotation(t)}}var s=i(5408),r=i.n(s);function a(t,e=100,i={}){if("function"!=typeof t)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");if("boolean"==typeof i)throw new TypeError("The `options` parameter must be an object, not a boolean. Use `{immediate: true}` instead.");const{immediate:n}=i;let o,s,r,a,l;function c(){const e=o,i=s;return o=void 0,s=void 0,l=t.apply(e,i),l}function h(){const t=Date.now()-a;t<e&&t>=0?r=setTimeout(h,e-t):(r=void 0,n||(l=c()))}const u=function(...t){if(o&&this!==o&&Object.getPrototypeOf(this)===Object.getPrototypeOf(o))throw new Error("Debounced method called with different contexts of the same prototype.");o=this,s=t,a=Date.now();const i=n&&!r;if(r||(r=setTimeout(h,e)),i)return l=c(),l};return Object.defineProperty(u,"isPending",{get:()=>void 0!==r}),u.clear=()=>{r&&(clearTimeout(r),r=void 0,o=void 0,s=void 0)},u.flush=()=>{r&&u.trigger()},u.trigger=()=>{l=c(),u.clear()},u}var l=i(7512),c=i.n(l),h=(i(1193),i(5385)),u=i.n(h),d=i(4692),f=i.n(d);class p{constructor(t,e,i={}){this._el=u().create(`\n <div title="${t}">\n ${e}\n </div>\n `),this._$dialog=f()(this._el),this._$dialog.on("dialogclose",()=>{requestAnimationFrame(()=>this._$dialog.dialog("destroy"))}),this._option=i}get el(){return this._el}get button(){return this._$dialog.dialog("widget")[0].querySelector(".ui-dialog-buttonpane button")}open(){this._$dialog.dialog({classes:{"ui-dialog":"textae-editor__dialog"},height:"auto",modal:!0,resizable:!1,width:"calc(100% - 10px)",create:t=>{f()(t.target.parentElement).css("maxWidth",`${this._option.maxWidth||550}px`)},...this._option})}close(){this._$dialog.dialog("close")}}class m extends p{constructor(){super("Help (Keyboard short-cuts)",'<div class="textae-tool__key-help"></div>\n <ul>\n <li>\n cut\n : Ctrl+x\n </li>\n <li>\n copy\n : Ctrl+c\n </li>\n <li>\n paste\n : Ctrl+v\n </li>\n </ul>\n ',{maxWidth:523})}}function g(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement}const v=new m,y=new class extends p{constructor(){super("For security reason, the shortcut keys for cut/copy/paste are changed as follows:",'<table class="textae-editor__tips-dialog__table">\n <thead>\n <tr><th></th><th>before</th><th>after</th></tr>\n </thead>\n <tbody>\n <tr><td>cut</td><td>x</td><td>Ctrl-x</td></tr>\n <tr><td>copy</td><td>c</td><td>Ctrl-c</td></tr>\n <tr><td>paste</td><td>v</td><td>Ctrl-v</td></tr>\n </tbody>\n </table>\n ',{maxWidth:785})}};class O{#t;#e;#i;constructor(){this.#t=new Map,this.#e=null,this.#i=0,c()(window,".textae-editor","keyup",t=>{if(this.selected)switch(t.key){case"h":v.open();break;case"c":case"x":case"v":t.ctrlKey||t.metaKey||y.open()}}),this.#n()}set(t,e){this.#t.set(t,e),this.#i++}remove(t){this.#t.get(t).dispose(),this.#t.delete(t),this.selected===t&&(this.#e=null)}get selected(){return this.#e}set selected(t){null===t?(this.#o.deactivate(),this.#e=null):(this.#e=t,this.#o.activate())}drawGridsInSight(){for(const t of this.#t.values())t.drawGridsInSight()}updateDenotationEntitiesWidth(){for(const t of this.#t.values())t.updateDenotationEntitiesWidth()}reLayout(){for(const t of this.#t.values())t.reLayout()}has(t){return this.#t.has(t)}get nextID(){return`editor${this.#i}`}#n(){document.addEventListener("scroll",r()(()=>{this.drawGridsInSight()},300)),document.addEventListener("copy",t=>{g(t.target)||this.selected&&this.#t.get(this.selected).copyEntitiesToSystemClipboard(t)}),document.addEventListener("cut",t=>{g(t.target)||this.selected&&this.#t.get(this.selected).cutEntitiesToSystemClipboard(t)}),document.addEventListener("paste",t=>{g(t.target)||this.selected&&this.#t.get(this.selected).pasteEntitiesFromSystemClipboard(t)}),document.addEventListener("selectionchange",a(()=>{this.selected&&this.#t.get(this.selected).applyTextSelectionWithTouchDevice()},100)),document.addEventListener("contextmenu",()=>{this.selected&&this.#t.get(this.selected).applyTextSelectionWithTouchDevice()}),document.addEventListener("click",t=>{if(3!==t.which)for(const t of this.#t.values())t.hideContextMenu()}),document.addEventListener("contextmenu",t=>{for(const t of this.#t.values())t.hideContextMenu();const e=t.target.closest(".textae-editor");if(e===this.#e){if(e.classList.contains("textae-editor__mode--view-with-relation")||e.classList.contains("textae-editor__mode--view-without-relation"))return;t.preventDefault(),this.#o.showContextMenu(t)}})}get#o(){return this.#t.get(this.#e)}}const b={};document.querySelector("html").addEventListener("mousemove",t=>{b.clientY=t.clientY,b.pageY=t.pageY,b.clientX=t.clientX});const x={attributes:!0,attributeFilter:["class"]};class w{#s;#r;constructor(){this.#s=new Set}setObserver(t){this.#r||(this.#r=u().create('<div class="textae-editor-veil" style="display: none;"></div>'),document.body.appendChild(this.#r)),new MutationObserver(t=>this._mutationCallback(t)).observe(t,x)}_mutationCallback(t){this._collectWaitingEditors(t),this.#s.size>0?this._show():this._hide()}_collectWaitingEditors(t){t.forEach(({target:t})=>{t.classList.contains("textae-editor--wait")?this.#s.add(t):this.#s.delete(t)})}_show(){this.#r.style.display="block"}_hide(){this.#r.style.display="none"}}var _=i(7007);class S{constructor(t,e){this.valueType=t,this.pred=e}get values(){return console.assert(this._values,"this._values to return!"),this._values}get externalFormat(){return{pred:this.pred}}get _valuesClone(){if(console.assert(this._values,"this._values is necessary to clone!"),Array.isArray(this._values)&&0===this._values.length)return;const t=[];for(const e of this._values)t.push({...e});return t}}function k(t,e){return t<e}function $(t,e){return t<=e}function T(t){if(t.startsWith("["))return e=>$(new Number(t.replace("[","")),e);if(t.startsWith("("))return e=>k(new Number(t.replace("(","")),e);throw`${t} is not valid interval notation`}function C(t){if(t.endsWith("]"))return e=>$(e,new Number(t.replace("]","")));if(t.endsWith(")"))return e=>k(e,new Number(t.replace(")","")));throw`${t} is not valid interval notation`}class P{constructor(t){const[e,i]=t.split(",");if(i?(this._lowwerCond=T(e),this._upperCond=C(i)):((e.startsWith("[")||e.startsWith("("))&&(this._lowwerCond=T(e),this._upperCond=t=>!0),(e.endsWith("]")||e.endsWith(")"))&&(this._lowwerCond=t=>!0,this._upperCond=C(e))),!this._lowwerCond||!this._upperCond)throw`${t} is not valid interval notation`}test(t){return this._lowwerCond(t)&&this._upperCond(t)}}function E(t){return!Number.isNaN(parseFloat(t))}class A extends S{constructor(t,e){super(t,e.pred),this.default=E(e.default)?parseFloat(e.default):0,E(e.min)&&(this.min=parseFloat(e.min)),E(e.max)&&(this.max=parseFloat(e.max)),this.step=E(e.step)?parseFloat(e.step):2,this._values=e.values||[]}getLabel(t){const e=this.#a(t);if(e&&e.label)return e.label}getDisplayName(t){return this.getLabel(t)||String(t)}getColor(t){const e=this.#a(t);return e&&e.color?e.color:null}#a(t){const e=this._values.filter(t=>"default"!==t.range).find(e=>new P(e.range).test(t));if(e)return e;const i=this._values.find(t=>"default"===t.range);return i||null}get externalFormat(){return{...super.externalFormat,"value type":"numeric",default:this.default,min:this.min,max:this.max,step:this.step,values:super._valuesClone}}}class M extends S{constructor(t,e){super(t,e.pred),this.default=!0,this.label=e.label,this.color=e.color}getLabel(){return this.label}getDisplayName(){return this.label?this.label:this.pred}getColor(){return this.color}get externalFormat(){return{...super.externalFormat,"value type":"flag",default:this.default,label:this.label,color:this.color}}}class Q extends S{constructor(t,e){super(t,e.pred),this._values=e.values||[]}get default(){return this.values.find(t=>t.default).id}getLabel(t){const e=this.#a(t);if(e&&e.label)return e.label}getDisplayName(t){return this.getLabel(t)}getColor(t){const e=this.#a(t);return e&&e.color?e.color:null}get values(){return this._values}get hasOnlyOneValue(){return 1===this._values.length}#a(t){return this.values.find(e=>e.id==t)}get externalFormat(){return{...super.externalFormat,"value type":"selection",values:super._valuesClone}}}class D extends S{constructor(t,e){super(t,e.pred),this.autocompletionWs=e.autocompletion_ws,this.default=e.default,E(e["media height"])&&(this.mediaHeight=parseFloat(e["media height"])),this._values=e.values||[]}getLabel(t){const e=this.#a(t);if(e&&e.label)return e.label}getDisplayName(t){return this.getLabel(t)}getColor(t){const e=this.#a(t);return e&&e.color?e.color:null}#a(t){const e=this._values.filter(t=>"default"!==t.pattern).find(e=>new RegExp(e.pattern).test(t));if(e)return e;const i=this._values.find(t=>"default"===t.pattern);return i||null}get externalFormat(){return{...super.externalFormat,"value type":"string",autocompletion_ws:this.autocompletionWs,default:this.default,values:super._valuesClone,"media height":this.mediaHeight}}}function R(t,e){switch(t){case"flag":return new M(t,e);case"numeric":return new A(t,e);case"selection":return new Q(t,e);case"string":return new D(t,e);default:throw new Error(`${t} of ${JSON.stringify(e)} is Uknown Attribute`)}}class I{#l;#c;#h=new Map;constructor(t,e){this.#l=t,this.#c=e}get config(){return this.attributes.map(t=>t.externalFormat)}set config(t){this.#h=new Map((t||[]).map(t=>[t.pred,R(t["value type"],t)]))}create(t,e,i=null){null!==i&&this.#h.size!==i?this.#h=new Map(Array.from(this.#h.entries()).reduce((n,[o,s],r)=>(r===i&&n.push([e.pred,R(t,e)]),n.push([o,s]),n),[])):this.#h.set(e.pred,R(t,e)),this.#l.emit("textae-event.type-definition.attribute.create",e.pred)}get(t){return this.#h.get(t)}update(t,e){return this.#h=new Map(Array.from(this.#h.entries()).map(([i,n])=>i===t?[e.pred,R(n.valueType,e)]:[i,n])),this.#l.emit("textae-event.type-definition.attribute.change",e.pred),this.get(e.pred)}updateValues(t,e){const i=this.get(t).externalFormat;return this.update(t,{...i,values:e})}move(t,e){var i,n,o;this.#h=new Map((i=this.attributes,n=t,o=e,function(t,e,i){const n=e<0?t.length+e:e;if(n>=0&&n<t.length){const n=i<0?t.length+i:i,[o]=t.splice(e,1);t.splice(n,0,o)}}(i=[...i],n,o),i).map(t=>[t.pred,t]));const{pred:s}=this.attributes[-1===e?this.attributes.length-1:e];this.#l.emit("textae-event.type-definition.attribute.move",s)}delete(t){this.#h.delete(t),this.#l.emit("textae-event.type-definition.attribute.delete")}get attributes(){return Array.from(this.#h.values())||[]}isSelectionAttributeValueIndelible(t,e){return!!this.get(t).hasOnlyOneValue||!!this.#c().some(i=>i.equalsTo(t,e))}getLabel(t,e){return console.assert(this.#h.has(t),`There is no attribute definition for ${t}.`),this.get(t).getLabel(e)}getDisplayName(t,e){return console.assert(this.#h.has(t),`There is no attribute definition for ${t}.`),this.get(t).getDisplayName(e)}getColor(t,e){if(this.#h.has(t))return this.get(t).getColor(e)}getIndexOf(t){return Array.from(this.#h.values()).findIndex(e=>e.pred===t)}getAttributeAt(t){return Array.from(this.#h.values())[t-1]}attributeCompareFunction(t,e){const i=this.getIndexOf(t.pred),n=this.getIndexOf(e.pred);return i!==n?i-n:t.id&&e.id?t.id.localeCompare(e.id):0}}function L(t,e,i){for(const n of i)t[n]=(...t)=>{const i=e();return console.assert(i[n],`No ${n} method to forward`,i),i[n].apply(i,t)};return t}function N(t){const{typesettings:e,denotations:i,blocks:n}=t;return(e||[]).concat(i||[]).concat(n||[])}function j(t){const{span:e}=t;return{...t,span:z(e)}}function z(t){return{...t,begin:parseInt(t.begin),end:parseInt(t.end)}}class B{constructor(t){this._trackNumber=t}addTrackNumberAsIDPrefix(t,e,i,n){const o=t.map(t=>({...t,id:this._prependToIDOf(t)})),s=e.map(t=>({...t,id:this._prependToIDOf(t)})),r=n.map(t=>({...t,id:this._prependToIDOf(t),subj:this._prependTrackNumberTo(t.subj),obj:t.obj})),a=i.map(t=>({...t,id:this._prependToIDOf(t),subj:this._prependTrackNumberTo(t.subj),obj:this._prependTrackNumberTo(t.obj)}));return{denotations:o,blocks:s,relations:a,attributes:r}}_prependToIDOf(t){return t.id?this._prependTrackNumberTo(t.id):null}_prependTrackNumberTo(t){return this._trackNumber+t}}function Z(t,e,i,n,o,s=""){const[r,a,l]=function(t,e,i){return[t.map(j),e.map(j),i.map(j)]}(o.typeSetting,o.denotation,o.block),{relation:c,attribute:h}=o,{denotations:u,blocks:d,relations:f,attributes:p}=new B(s).addTrackNumberAsIDPrefix(a,l,c,h);t.addSource(r,"typesetting"),t.addSource(u,"denotation"),t.addSource(d,"block"),e.addSource(u,"denotation"),e.addSource(d,"block"),n.addSource(f),i.addSource(p)}function W(t,e){for(const[i,n]of e.getInhibitors("isNotCrossing"))console.warn(`Crossing ${t}: [${i.span.begin}:${i.span.end}](${i.id}) crosses with ${n.map(({id:t,span:e})=>`[${e.begin}:${e.end}](${t})`).join(", ")}`)}class F{constructor(){this._map=new Map}set(t,e,i){this._map.set(t,[e,i])}getErrors(t){return this._map.has(t)?this._map.get(t)[0]:[]}getInhibitors(t){return this._map.has(t)?this._map.get(t)[1]:[]}get size(){return this._map.size}}function X(t,e){return e.reduce((e,i)=>e.concat(i.getErrors(t)),[])}class q{constructor(t,e,i="",n=()=>!0,o){this._candidates=t||[],this._name=i,this._predicate=n,this._prevValidation=o,this._sourcePropertyName=e}and(t,e){return new q(this._candidates,this._sourcePropertyName,t,e,this)}validateAll(){const t=new F;let e,i;for(e=this,i=this._candidates;e;e=e._prevValidation)i=e._validate(i,this._candidates,t);return[i,t]}_validate(t,e,i){return this._getRejects(e).length>0&&i.set(this._name,this._getRejects(e),this._getInhibitors(e)),this._getAccepts(t)}_getAccepts(t){return t.filter(t=>this._test(t))}_getRejects(t){return t.filter(t=>!this._test(t)).map(t=>function(t,e){return t.sourceProperty=e,t}(t,this._sourcePropertyName))}_getInhibitors(t){const e=new Map;for(const i of t){const t=this._predicate(i);Array.isArray(t)&&!t[0]&&e.set(i,t[1])}return e}_test(t){const e=this._predicate(t);return Array.isArray(e)?e[0]:e}}function H(t,e){return t.some(t=>t.id===e)}function V(t,e,i){const n=i.begin<t&&t<i.end&&i.end<e,o=t<i.begin&&i.begin<e&&e<i.end;return n||o}function Y(t,e,i){return t.filter(({span:t})=>V(e,i,t))}function U(t,e){return 0<=t&&t<=e.length}function G(t,e,i,n){return new q(t,n).and("hasLength",t=>t.span.end-t.span.begin>0).and("inText",t=>function(t,e){return U(e.begin,t)&&U(e.end,t)}(e,t.span)).and("isNotCrossing",t=>{const e=Y(i,t.span.begin,t.span.end);return[0===e.length,e]})}function K(t,e){return void 0===e.id||1===t.filter(t=>e.id&&e.id===t.id).length}function J(t,e,i){const[n,o]=function(t,e,i){return G(e,t,i,"typesettings").validateAll()}(t,i.typesettings,e),s=N(i),[r,a]=function(t,e,i,n){return G(e,t,i,"denotations").and("uniqueID",t=>K(n,t)).validateAll()}(t,i.denotations,e,s),[l,c]=function(t,e,i,n){return G(e,t,i,"blocks").and("uniqueID",t=>K(n,t)).and("uniqueRange",({span:t})=>1===e.filter(({span:e})=>t.begin===e.begin&t.end===e.end).length).validateAll()}(t,i.blocks,e,s),[h,u]=(d=r.concat(l),f=i.relations,new q(f).and("object",t=>H(d,t.obj)).and("subject",t=>H(d,t.subj)).validateAll());var d,f;const[p,m]=(g=r.concat(l).concat(h),v=i.attributes,new q(v).and("subject",t=>H(g,t.subj)).and("unique",t=>function(t,e){return 1===t.filter(t=>t.subj===e.subj&&t.pred===e.pred&&t.obj===e.obj).length}(v,t)).validateAll());var g,v,y,O,b;return W("TypeSettings",o),W("Denotations",a),W("Blocks",c),{accept:{denotation:r,attribute:p,relation:h,typeSetting:n,block:l},reject:{wrongRangeDenotations:a.getErrors("hasLength"),outOfTextDenotations:a.getErrors("inText"),wrongRangeBlocks:c.getErrors("hasLength"),outOfTextBlocks:c.getErrors("inText"),duplicatedRangeBlocks:c.getErrors("uniqueRange"),wrongRangeTypesettings:o.getErrors("hasLength"),outOfTextTypesettings:o.getErrors("inText"),duplicatedIDs:X("uniqueID",[a,c]),boundaryCrossingSpans:X("isNotCrossing",[o,a,c]),referencedEntitiesDoNotExist:(y=m.getErrors("subject"),O=u.getErrors("object"),b=u.getErrors("subject"),y.map(t=>(t.sourceProperty="attributes",t.alertSubj=!0,t)).concat(O.map(t=>(t.sourceProperty="relations",t.alertObj=!0,t))).concat(b.map(t=>(t.sourceProperty="relations",t.alertSubj=!0,t)))),duplicatedAttributes:m.getErrors("unique"),hasError:a.size||c.size||m.size||u.size||o.size}}}class tt{#u;#d;#f;#p;#m;#g;#v;#y;constructor(t,e){const{namespaceInstanceContainer:i,spanInstanceContainer:n,entityInstanceContainer:o,attributeInstanceContainer:s,relationInstanceContainer:r}=t;this.#u=i,this.#d=n,this.#f=o,this.#p=r,this.#m=s,this.#g=e}eval(){this.#g.namespaces?this.#u.addSource(this.#g.namespaces.map(t=>({id:t.prefix,...t}))):this.#u.addSource([]);const{accept:t,reject:e}=J(this.#O,this.#b,this.#g);Z(this.#d,this.#f,this.#m,this.#p,t),e.name="Root annotations.",this.#v=e,this.hasMultiTracks&&(this.#y=function(t,e,i,n,o,s,r){console.assert(r.tracks);const{tracks:a}=r;return a.map((r,a)=>{const l=a+1,c=`track${l}_`,{accept:h,reject:u}=J(o,s,r);return Z(t,e,i,n,h,c),u.name=`Track ${l} annotations.`,u})}(this.#d,this.#f,this.#m,this.#p,this.#O,this.#b,this.#g))}get hasMultiTracks(){return Boolean(this.#g.tracks)}get rejects(){return this.hasMultiTracks?[this.#v].concat(this.#y):[this.#v]}get#O(){return this.#g.text}get#b(){return function(t){let e=N(t);if(t.tracks)for(const i of t.tracks)e=e.concat(N(i));return e}(this.#g)}}class et{#x;#w;#_;constructor(t,e){this.#x=t,this.#w=e,this.#_=new Map}addSource(t,e){for(const i of t.map(t=>this._toInstance(t,e)))this._addToContainer(i)}add(t){const e=this._addToContainer(t);return this._emit(`textae-event.annotation-data.${this.#w}.add`,e),e}get(t){return this.#_.get(t)}get all(){return Array.from(this.#_.values())}get selectedItems(){return this.all.filter(({isSelected:t})=>t)}findByType(t){return this.all.filter(e=>e.typeName===t)}get some(){return!!this.#_.size}changeType(t,e){const i=this.#_.get(t);return i.typeName=e,this._emit(`textae-event.annotation-data.${this.#w}.change`,i),i}remove(t){const e=this.#_.get(t);return e&&(this.#_.delete(t),this._emit(`textae-event.annotation-data.${this.#w}.remove`,e)),e}clear(){this.#_.clear()}get _container(){return this.#_}_toInstance(t){return t}_addToContainer(t){return this.#_.set(t.id,t),t}_emit(t,e){this.#x.emit(t,e)}}class it extends et{#S;constructor(t,e,i){super(t,e),this.#S=i}addSource(t,e){const i=t.map(t=>this._toInstance(t,e));i.sort((t,e)=>t.id?e.id?t.id<e.id?-1:t.id>e.id?1:0:-1:1);for(const t of i)super._addToContainer(this.#k(t))}add(t){return super.add(this.#k(t))}#k(t){return t.id||(t.id=this.#$(t)),t}#$(t){const e=this.#S(t),i=new Set;for(const t of super._container.keys())new RegExp(`^${e}\\d+$`).test(t)&&i.add(t.slice(1));if(0===i.size)return`${e}1`;return`${e}${Math.max(...i.values())+1}`}}var nt=i(7901),ot=i.n(nt);function st(t){const[e,...i]=t;let n=e;for(const t of[...arguments].slice(1))n=`${n}${rt(t)}${i.shift()}`;return n}function rt(t){if(Array.isArray(t)&&"function"==typeof t.at(0))return t.map(t=>t()).join("");if("function"==typeof t){const e=t();return Array.isArray(e)?e.join(""):e}return ot()(t)}function at(t){return t.trim().startsWith("http")}function lt(t,e){const i=t.all.filter(t=>"_base"!==t.prefix).filter(t=>0===e.indexOf(`${t.prefix}:`));return 1===i.length?i[0]:null}function ct(t){return/\(?(?:(http|https|ftp):\/\/)?(?:((?:[^\W\s]|\.|-|[:]{1})+)@{1})?((?:www.)?(?:[^\W\s]|\.|-)+[.][^\W\s]{2,4}|localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::(\d*))?([/]?[^\s?]*[/]{1})*(?:\/?([^\s\n?[\]{}#]*(?:(?=\.)){1}|[^\s\n?[\]{}.#]*)?([.]{1}[^\s?#]*)?)?(?:\?{1}([^\s\n#[\]]*))?([#][^\s\n]*)?\)?/gi.exec(t)}function ht(t,e,i){if(i)return i;if(at(e))return function(t){if(at(t)){const e=ct(t);if(e)return e[9]?e[9].slice(1):e[6]?e[6]+(e[7]||""):e[5]&&e[5].length>1?e[5].split("/").filter(t=>""!==t).pop():e[3]}return t}(e);const n=lt(t,e);return n?e.replace(`${n.prefix}:`,""):e}function ut(t,e){const i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return console.assert(i,`${t} is not a hexadecimal color values!`),`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${e})`}function dt(){return ut("#FFFFFF",.6)}function ft(t,e,i){if(at(e))return e;if(i)return i;if(t.some){const i=lt(t,e);if(i)return`${i.uri}${e.replace(`${i.prefix}:`,"")}`;const n=t.all.find(t=>"_base"===t.prefix);if(n)return`${n.uri}${e}`}return null}function pt(t,e){return()=>e?st`<a target="_blank" href="${e}">${t}</a>`:st`${t}`}class mt{#T;#C;#P;#E;#f;#p;#u;#A;#M;constructor({id:t,subj:e,pred:i,obj:n},o,s,r,a,l){this.#T=t,this.#C=e,this.#P=i,this.#E=n,this.#f=o,this.#p=s,this.#u=r,this.#A=a,this.#M=l,"string"!==this.#Q||this.#D||this.#M.acquireContentTypeOf(this.#R).then(t=>{t&&this.updateElement()})}get id(){return this.#T}set id(t){this.#T=t}get subj(){return this.#C}set subj(t){this.#C=t}get pred(){return this.#P}set pred(t){this.#P=t}get obj(){return this.#E}set obj(t){"numeric"===this.#Q?this.#E=parseFloat(t):this.#E=t}get subjectInstance(){return this.#f.get(this.subj)||this.#p.get(this.subj)}get externalFormat(){return{id:this.id,subj:this.subj,pred:this.pred,obj:this.#E}}equalsTo(t,e){return this.pred===t&&String(this.#E)===e}updateElement(){this.subjectInstance.updateElement()}clarifyLabelIn(t){t.querySelector(st`[data-id="${this.id}"] .textae-editor__signboard__attribute-label`).style.backgroundColor=dt()}declarifyLabelIn(t){t.querySelector(st`[data-id="${this.id}"] .textae-editor__signboard__attribute-label`).style.backgroundColor=ut(this.#I,1)}get contentHTML(){return()=>st`
175
+ <div
176
+ class="textae-editor__signboard__attribute"
177
+ title="${this.#L}"
178
+ data-id="${this.id}"
179
+ style="background-color: ${ut(this.#I,.4)}; height: ${this.height}px;"
180
+ >
181
+ <span
182
+ class="textae-editor__signboard__attribute-label"
183
+ style="background-color: ${ut(this.#I,1)};"
184
+ >
185
+ ${this.#N}
186
+ </span>
187
+ </div>
188
+ `}get height(){return this.#A.get(this.pred).mediaHeight?this.#A.get(this.pred).mediaHeight:18}get#L(){return`[${this.id}] pred: ${this.pred}, value: ${this.#E}`}get#N(){return this.#j?()=>`<img src="${this.obj}" height="${this.height}" >`:pt(this.#z,this.#R)}get#j(){return"string"===this.#Q&&(this.#D||this.#M.hasImageContentTypeOf(this.#R))}get#D(){return/\.(jpg|png|gif)$/.test(this.#R)}get#z(){return ht(this.#u,"string"==typeof this.#E?this.#E:"",this.#A.getDisplayName(this.pred,this.#E))}get#R(){return ft(this.#u,"string"==typeof this.#E?this.#E:"")}get#I(){return this.#A.getColor(this.pred,this.#E)||this.subjectInstance.color}get#Q(){return this.#A.get(this.pred).valueType}}class gt{#B=new Map;async acquireContentTypeOf(t){if(!t)return Promise.resolve(!1);if(this.#B.has(t))return this.#B.get(t);const e=new Request(t,{method:"get",mode:"cors",cache:"force-cache"}),i=new Promise(n=>{fetch(e).then(t=>{const e=/image\/(jpg|png|gif)$/.test(t.headers.get("content-type"));i.value=e,n(e)}).catch(e=>{console.warn(e.message,t),n(!1)})});return this.#B.set(t,i),i}hasImageContentTypeOf(t){return!!t&&(!!this.#B.has(t)&&this.#B.get(t).value)}}class vt extends it{#f;#p;#u;#A;#M;constructor(t,e,i,n,o){super(t,"attribute",()=>"A"),this.#f=e,this.#p=i,this.#u=n,this.#A=o,this.#M=new gt}_toInstance(t){return new mt(t,this.#f,this.#p,this.#u,this.#A,this.#M)}add(t){return t=t instanceof mt?t:this._toInstance(t),super.add(t),t.updateElement(),t}change(t,e,i){const n=this.get(t);return e&&(n.pred=e),i&&(n.obj=i),n}remove(t){const e=super.remove(t);console.assert(e,`There are no attribute ${t} to delete!`),e.updateElement()}getSameDefinitionsAttributes(t){return this.all.filter(e=>e.pred===t)}getSameAttributes(t,e){return this.all.filter(i=>i.equalsTo(t,e))}getAttributesFor(t){return this.all.filter(e=>e.subj===t).sort((t,e)=>this.#A.attributeCompareFunction(t,e))}}function yt(t){const e=parseInt(t,10);return isNaN(e)?0:e}class Ot{#Z;#r;#W;#F;constructor(t,e,i){this.#Z=t,this.#r=t.querySelector(".textae-editor__text-box"),this.#W=e,this.#F=i}get boundingClientRect(){return this.#r.getBoundingClientRect()}get lineHeight(){return t=this.#r,yt(window.getComputedStyle(t).lineHeight);var t}set lineHeight(t){var e,i,n;e=this.#r,i=t,n=this.#F,e.style.lineHeight=`${i}px`,e.style.paddingTop=`${i/2+n}px`,this.forceUpdate(),this.#W.updatePosition()}render(t){this.#r.innerHTML=t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}updateLineHeight(){const t=this.#W.spanInstanceContainer.maxHeight;t?this.lineHeight=t:this.#X()}forceUpdate(){!function(t,e){const i=window.getComputedStyle(t);t.style.height="auto",t.style.height=`${t.offsetHeight-yt(i.paddingTop)+20+e}px`}(this.#r,this.#F),this.#q()}#X(){const{lineHeight:t}=window.getComputedStyle(this.#Z);this.lineHeight=yt(t)}#q(){const t=this.#Z.querySelector(".textae-editor__relation-box");t.style.height=this.#r.style.height;const e=parseFloat(window.getComputedStyle(this.#r).width);t.style.width=e-10+"px"}}function bt(t,e,i){const n='\n <div class="textae-editor__body">\n <div class="textae-editor__annotation-box"></div>\n <svg\n namespace="http://www.w3.org/2000/svg"\n class="textae-editor__relation-box">\n </svg>\n <div class="textae-editor__text-box"></div>\n </div>\n ';return t.innerHTML=n.replace(/[\n\r]+/g,""),function(t){new MutationObserver(e=>{e.forEach(e=>{e.removedNodes.length&&1===e.removedNodes[0].nodeType&&(e.removedNodes[0].classList.contains("textae-editor__span")||e.removedNodes[0].classList.contains("textae-editor__type"))&&"BODY"===document.activeElement.tagName&&t.focus()})}).observe(t.querySelector(".textae-editor__body"),{childList:!0,subtree:!0})}(t),new Ot(t,e,i)}function xt(t,e){const i=new URL(t,location);return i.searchParams.append("term",e),fetch(i.href).then(t=>t.ok?t.json():[])}class wt{#T;#I;#H;#V;constructor(t,e,i,n){this.#T=t,this.#I=e,this.#H=i,this.#V=n}get id(){return this.#T}get color(){return this.#I}get label(){return this.#H}get default(){return this.#V}toJSON(){return{id:this.#T,color:this.#I,label:this.#H,default:this.#V}}}function _t(t,e){for(const[e,i]of t.entries())t.set(e,{...i,usage:0});return e.reduce((t,{typeName:e})=>(t.get(e).usage+=1,t),t)}class St{#Y;constructor(t=[]){this.#Y=t.map(t=>new wt(t.id,t.color,t.label,t.default))}has(t){return this.map.has(t)}get default(){return this.#Y.find(t=>!0===t.default)}replace(t,e){e=new wt(e.id,e.color,e.label,e.default);const i=this.#Y.findIndex(e=>e.id===t);-1!==i?this.#Y.splice(i,1,e):this.#Y.push(e)}delete(t){this.#Y=this.#Y.filter(e=>e.id!==t)}ids(){return this.map.keys()}getColorOf(t){return this.#U(t)?.color}getLabelOf(t){return this.#U(t)?.label}labelsIncludes(t){return this.#Y.filter(t=>t.label).filter(e=>e.label.includes(t))}get map(){return new Map(this.#Y.map(t=>[t.id,t]))}#U(t){if(this.has(t))return this.map.get(t);const e=function(t,e){const i=function(t,e){const i=[];for(const n of t)-1!==n.indexOf("*")&&0===e.indexOf(n.slice(0,-1))&&i.push(n);return i}(t,e);return 0===i.length?null:function(t){let e="";for(const i of t)i.length>e.length&&(e=i);return e}(i)}(this.ids(),t);return this.map.get(e)}}function kt(t){const e=Array.from(t.keys());return e.sort((e,i)=>{const n=t.get(i).usage-t.get(e).usage;return 0!==n?n:e>i?1:e<i?-1:0}),e}class $t{#l;#G;#h=new St([]);#c;#K;#J;#tt="";#et;constructor(t,e,i,n){this.#l=t,this.#G=e,this.#c=i,this.#K=n}set autocompletionWs(t){this.#tt=t}set autocompletionFunction(t){this.#et=t}get autocompletionWs(){return this.#tt}get annotationType(){return this.#G}get config(){const t=this.#it;for(const[e,i]of t.entries()){const n=i.toJSON();i.id===this.defaultType?n.default=!0:delete n.default,t.set(e,n)}return[...t.values()]}set config(t){this.#h=new St(t);const e=this.#h.default;e?(delete e.default,this.#J=e.id):this.#J=null}has(t){return this.#h.has(t)}get(t){const e=this.#h.map.get(t).toJSON();return this.#J===t?(e.default=!0,e):(delete e.default,e)}replace(t,e){this.#h.replace(t,e),this.#l.emit(`textae-event.type-definition.${this.#G}.change`,e.id)}addDefinedType(t){if(void 0===t.color){const e=this.getColor(t.id);e!==this.#K&&(t.color=e)}if(void 0===t.label){const e=this.getLabel(t.id);e&&(t.label=e)}t.default&&(this.#J=t.id),this.replace(t.id,t)}get defaultType(){return this.#J?this.#J:this.#c().length>0?kt(_t(this.#it,this.#c()))[0]:"something"}set defaultType(t){this.#J=t,this.#l.emit(`textae-event.type-definition.${this.#G}.change-default`,t)}get defaultColor(){return this.#K}getColor(t){return this.#h.getColorOf(t)||this.#K}getLabel(t){return this.#h.getLabelOf(t)}getURI(t){return ct(t)?t:void 0}searchByLabel(t,e){if("function"==typeof this.#et){const i=this.#et(t),n=this.mergeWithLocalData(i,t);return void e(n)}this.#tt?xt(this.#tt,t).then(i=>{const n=this.mergeWithLocalData(i,t);e(n)}):e(this.findByLabel(t))}findByLabel(t){return this.#h.labelsIncludes(t)}mergeWithLocalData(t,e){const i=this.findByLabel(e),n=(t||[]).filter(t=>!i.some(e=>t.id===e.id));return i.concat(n)}get pallet(){const t=_t(this.#it,this.#c());return function(t,e,i,n,o){return t.map(t=>({id:t,label:i.getLabelOf(t)||void 0,defaultType:t===n,uri:ct(t)?t:void 0,color:i.getColorOf(t)||o,useNumber:e.get(t).usage}))}(kt(t),t,this.#h,this.defaultType,this.#K)}get#it(){const t=this.#h.map;for(const{typeName:e}of this.#c())t.has(e)||t.set(e,new wt(e));return t}delete(t,e){this.#h.delete(t),this.#J=e,this.#l.emit(`textae-event.type-definition.${this.#G}.delete`,t)}}class Tt{#nt;#ot;constructor(t,e=[]){this.#nt=t,this.#ot=e}get typeName(){return this.#nt}get attributes(){return this.#ot}get externalFormat(){return{obj:this.#nt,attributes:this.#ot.map(({externalFormat:t})=>t)}}isSameType(t,e=null){return e?this.typeName===t&&this._hasSameAttributes(e):this.typeName===t}hasSpecificPredicateAttribute(t){return this.attributes.some(e=>e.pred===t)}_hasSameAttributes(t){if(t.length!=this.attributes.length)return!1;const e=[...t];for(const t of this.attributes){const i=e.findIndex(e=>e.pred===t.pred&&e.obj===String(t.obj));if(-1===i)return!1;e.splice(i,1)}return 0===e.length||void 0}}function Ct(t){return Math.round(100*t)/100}const Pt="textae-editor__signboard--selected",Et="textae-editor__signboard--cutting";class At{#st;#rt;constructor(t,e,i){this.#st=t,this.#rt=u().create(this.#at(i,e))}get element(){return this.#rt}addEventListener(t,e){this.#rt.addEventListener(t,e)}hover(){this.#rt.classList.add("textae-editor__signboard--hovered")}select(){this.#rt.classList.add(Pt)}deselect(){this.#rt.classList.remove(Pt)}startCut(){this.#rt.classList.add(Et)}cancelCut(){this.#rt.classList.remove(Et)}clearCSSClass(){this.element.className="",this.element.classList.add("textae-editor__signboard")}updateLabel(){const t=this.element.querySelector(".textae-editor__signboard__type-values");t.style.backgroundColor=ut(this.#st.color,.4),t.querySelector(".textae-editor__signboard__type-label").innerHTML=st`${this.#st.anchorHTML}`;for(const e of t.querySelectorAll(".textae-editor__signboard__attribute"))e.remove();for(const e of this.#st.attributes)t.insertAdjacentHTML("beforeend",st`${e.contentHTML}`)}clarifyLabel(){this.element.querySelector(".textae-editor__signboard__type-label").style.backgroundColor=dt();for(const t of this.#st.attributes)t.clarifyLabelIn(this.element)}declarifyLabel(){this.element.querySelector(".textae-editor__signboard__type-label").style.backgroundColor=ut(this.#st.color,1);for(const t of this.#st.attributes)t.declarifyLabelIn(this.element)}focus(){this.#rt.querySelector(".textae-editor__signboard__type-label").focus()}replaceWith(t){return this.#rt.replaceWith(t.element),t}reflectTypeGapInTheHeight(t){this.#rt.setAttribute("style",`padding-top: ${t}px;`)}remove(){this.#rt.remove()}#at(t,e){return st`
189
+ <div
190
+ class="textae-editor__signboard"
191
+ ${t?`id="${t}"`:""}
192
+ title="${this.#st.title}"
193
+ data-entity-type="${e}"
194
+ data-id="${this.#st.id}"
195
+ >
196
+ <div
197
+ class="textae-editor__signboard__type-values"
198
+ style="background-color: ${ut(this.#st.color,.4)};"
199
+ >
200
+ <div
201
+ class="textae-editor__signboard__type-label"
202
+ tabindex="0"
203
+ style="background-color: ${dt()};"
204
+ >
205
+ ${this.#st.anchorHTML}
206
+ </div>
207
+ ${this.#st.attributes.map(t=>t.contentHTML)}
208
+ </div>
209
+ </div>
210
+ `}}class Mt{#lt;#T;#m;#p;#u;#ct;#ht;#ut;#dt=!1;#ft=!1;#pt=!1;#mt=null;#gt;#nt;constructor(t,e,i,n,o,s,r,a,l,c=null){this.#lt=t,this.#T=c,this.#m=e,this.#p=i,this.#ct=o,this.#ht=s,this.#u=n,this.#ut=l,this.span=r,this.typeName=a}get id(){return this.#T}set id(t){this.#T=t}get title(){return`[${this.id}] pred: type, value: ${this.#nt}`}get color(){return this.#A.getColor(this.typeName)}get anchorHTML(){return pt(this.#z,this.#R)}get span(){return this.#gt}set span(t){this.#gt=t,t.add(this)}get typeName(){return this.#nt}set typeName(t){this.#nt=String(t)}get typeValues(){return new Tt(this.#nt,this.#m.getAttributesFor(this.#T))}get relations(){return this.relationsWhereThisIsSource.concat(this.relationsWhereThisIsTarget)}get attributes(){return this.#m.getAttributesFor(this.#T)}get relationsWhereThisIsSource(){return this.#p.all.filter(t=>t.subj===this.id)}get relationsWhereThisIsTarget(){return this.#p.all.filter(t=>t.obj===this.id)}get hasMultipleEndpoints(){const t=new Map;t.set("whereThisIsSourceAndTargetIsOnTheLeft",new Set),t.set("whereThisIsSourceAndTargetIsOnTheRight",new Set),t.set("whereThisIsSourceAndTargetIsUpOrDown",new Set);for(const e of this.relationsWhereThisIsSource)e.targetEntity.offsetCenter<this.offsetCenter?t.get("whereThisIsSourceAndTargetIsOnTheLeft").add(e):this.offsetCenter<e.targetEntity.offsetCenter?t.get("whereThisIsSourceAndTargetIsOnTheRight").add(e):t.get("whereThisIsSourceAndTargetIsUpOrDown").add(e);t.set("whereThisIsTargetAndSourceIsOnTheLeft",new Set),t.set("whereThisIsTargetAndSourceIsOnTheRight",new Set),t.set("whereThisIsTargetAndSourceIsUpOrDown",new Set);for(const e of this.relationsWhereThisIsTarget)e.sourceEntity.offsetCenter<this.offsetCenter?t.get("whereThisIsTargetAndSourceIsOnTheLeft").add(e):this.offsetCenter<e.targetEntity.offsetCenter?t.get("whereThisIsTargetAndSourceIsOnTheRight").add(e):t.get("whereThisIsTargetAndSourceIsUpOrDown").add(e);return[...t.values()].filter(t=>t.size).length>1}get clientTop(){const{span:t}=this;if(t.isDenotation){let e=t.clientTopOfGrid+this.#ct.height;for(const i of t.entities){if(i===this)break;e+=this.#ct.height+i.height}return Ct(e)}if(t.isBlock){const e=15;return Ct(t.clientBottomOfGrid-this.height-e)}throw new Error("Unexpected type of span")}get offsetTop(){return this.clientTop-this.span.element.offsetParent.offsetParent.getBoundingClientRect().top}get clientBottom(){return this.clientTop+this.height}isInViewport(t){return this.#ut<=this.clientBottom&&this.clientTop<=t}get width(){return this.span.widthOfGrid}get height(){return 18+this.#vt}get heightWithTypeGap(){return this.height+this.#ct.height}get offsetCenter(){return Ct(this.span.offsetCenterOfGrid)}get isDenotation(){return this.#gt.isDenotation}get isBlock(){return this.#gt.isBlock}get isSelected(){return this.#dt}getSourceAnchorPosition(t){const e=this.width/2>=28||this.hasMultipleEndpoints&&t;return{left:e?this.offsetCenter-24:this.offsetCenter,right:e?this.offsetCenter+24:this.offsetCenter}}getTargetAnchorPosition(t){const e=this.width/2>=28||this.hasMultipleEndpoints&&t;return{left:e?this.offsetCenter-8:this.offsetCenter,right:e?this.offsetCenter+8:this.offsetCenter}}focus(){if(this.isDenotation)this.span.focus();else{if(!this.isBlock)throw new Error("Unexpected type of entity");this.span.forceRenderGrid(),this.#mt.focus()}}select(){this.#dt||(this.#dt=!0,this.#yt(),this.#Ot())}deselect(){this.#dt&&(this.#dt=!1,this.#mt&&this.#mt.deselect(),this.#Ot())}startCut(){this.#mt&&this.#mt.startCut()}cancelCut(){this.#mt&&this.#mt.cancelCut()}render(){if(!this.#mt&&this.span.isGridRendered){this.#mt=this.#bt(),this.span.addEntityElementToGridElement(this.#mt.element),this.reflectTypeGapInTheHeight();for(const t of this.span.entities.filter(t=>t!==this))for(const e of t.relations)e.redrawLineConsideringSelection();this.#dt&&this.#mt.select()}}updateElement(){if(this.#mt){this.#mt=this.#mt.replaceWith(this.#bt()),this.#dt&&this.#yt(),this.reflectTypeGapInTheHeight(),this.span.updateSelfAndAncestorsGridPosition();for(const t of this.span.entities)for(const e of t.relations)e.redrawLineConsideringSelection()}}reflectTypeGapInTheHeight(){this.isDenotation&&this.#mt&&this.#mt.reflectTypeGapInTheHeight(this.#ct.height)}clarifyLabel(){this.#mt&&this.#mt.clarifyLabel(),this.#pt=!0}declarifyLabel(){!this.#ft&&this.#mt&&this.#mt.declarifyLabel(),this.#pt=!1}erase(){this.#mt&&(this.#mt.remove(),this.#mt=null,this.span.updateSelfAndAncestorsGridPosition())}#bt(){const t=new At(this,this.isDenotation?"denotation":"block",`${this.#lt}__E${this.id.replace(/[:¥.]/g,"")}`);return t.addEventListener("mouseenter",()=>{t.clarifyLabel(),this.#xt(),this.#ft=!0}),t.addEventListener("mouseleave",()=>{this.#pt||t.declarifyLabel(),this.#Ot(),this.#ft=!1}),t}#yt(){this.span.forceRenderGrid(),this.#mt.select(),this.span.isGridBeforePositioned?this.span.entityToFocusOn=this:this.focus()}get#A(){if(this.isDenotation)return this.#ht.denotation;if(this.isBlock)return this.#ht.block;throw"unknown entity type"}get#z(){return ht(this.#u,this.typeName,this.#A.getLabel(this.typeName))}get#R(){return ft(this.#u,this.typeName,this.#A.getURI(this.typeName))}get#vt(){return this.attributes.map(({height:t})=>t).reduce((t,e)=>t+e,0)}#xt(){for(const t of this.relationsWhereThisIsSource)t.pointUpPathAndSourceBollards();for(const t of this.relationsWhereThisIsTarget)t.pointUpPathAndTargetBollards()}#Ot(){for(const t of this.relations)t.redrawLineConsideringSelection()}}class Qt extends it{#lt;#W;#ct;#u;#ut;constructor(t,e,i,n){super(e,"entity",t=>t.isDenotation?"T":"B"),this.#lt=t,this.#W=i,this.#ct=n,this.#u=i.namespaceInstanceContainer}get#d(){return this.#W.spanInstanceContainer}get#m(){return this.#W.attributeInstanceContainer}get#p(){return this.#W.relationInstanceContainer}set toolBarHeight(t){this.#ut=t}_toInstance(t,e){const i=this.#wt(e,t);return new Mt(this.#lt,this.#m,this.#p,this.#u,this.#ct,this.#W.typeDictionary,i,t.obj,this.#ut,t.id)}add(t){if(t instanceof Mt){if(!t.span)throw new Error(`entity has no span! ${JSON.stringify(t)}`);return super.add(t),t.span.add(t),t.render(),t}if(void 0===t.spanType||void 0===t.begin||void 0===t.end)throw new Error(`entity has no span information! ${JSON.stringify(t)}`);const e=this.#d.find(t.spanType,t.begin,t.end),i=new Mt(this.#lt,this.#m,this.#p,this.#u,this.#ct,this.#W.typeDictionary,e,t.typeName,this.#ut);return console.assert(i.span.isDenotation||i.span.entities.length>0,"A block span cannot have more than one entity."),super.add(i),i.render(),i}remove(t){const e=super.get(t);e.span.remove(e),super.remove(t),e.erase()}changeType(t,e){const i=super.changeType(t,e);return i.updateElement(),i}moveEntities(t,e){for(const i of e){i.erase();const e=i.span;e.remove(i),e.updateSelfAndAncestorsGridPosition(),i.span=t,i.render();for(const t of i.relations)t.redrawLineConsideringSelection()}super._emit("textae-event.annotation-data.entity.move")}get denotations(){return this.all.filter(t=>t.isDenotation)}get blocks(){return this.all.filter(t=>t.isBlock)}redrawEntitiesWithSpecifiedAttribute(t){const e=this.all.filter(e=>e.typeValues.hasSpecificPredicateAttribute(t));for(const t of e)t.updateElement();for(const t of new Set([...e.map(({span:t})=>t)]))t.updateGridPosition()}clarifyLabelOfAll(){for(const t of this.all)t.clarifyLabel()}declarifyLabelOfAll(){for(const t of this.all)t.declarifyLabel()}#wt(t,e){return this.#d.find(t,e.span.begin,e.span.end)}hasDenotation(t){return this.denotations.some(e=>e.id===t)}}function Dt(t){return t.querySelector(".textae-editor__annotation-box")}class Rt{constructor(t,e){this._textBox=e,this._enable=!1,t.on("textae-event.control.button.push",({name:t,isPushed:e})=>{"auto adjust lineheight"===t&&(this._enable=e)})}updateLineHeight(){this._enable&&this._textBox.updateLineHeight()}}const It="http://www.w3.org/2000/svg";class Lt{constructor(t,e,i,n,o){this._controlY=t.offsetTop-t.horizontalDistance/4-20+(e&&i?3:0),this._startAndEnd=t,this._toolBarHeight=n,this._clientTopOfContainer=o,this._virtualEntityWidth=100}get sourceX(){return this._startAndEnd.start.x}get targetX(){return this._startAndEnd.end.x}get sourceY(){return this._startAndEnd.start.y-6}get targetY(){return this._startAndEnd.end.y-6}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY}\n C ${this._sourceControlX} ${this._controlY}, ${this._targetControlX} ${this._controlY}, ${this.targetX} ${this.targetY}`}get transformDefinitionsForSourceTriangle(){return`translate(${this.sourceX}, ${this.sourceY})`}get transformDefinitionsForTargetTriangle(){return`translate(${this.targetX}, ${this.targetY})`}getTForY(t){return[...Array(20).keys()].map(t=>1*t/20).find(e=>{const i=Math.pow(1-e,3)*this.sourceY+3*Math.pow(1-e,2)*e*this._controlY+3*(1-e)*Math.pow(e,2)*this._controlY+Math.pow(e,3)*this.targetY;return Math.abs(i-t)<1})}getXOnT(t){const{sourceX:e,targetX:i,_sourceControlX:n,_targetControlX:o}=this;return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*n+3*(1-t)*Math.pow(t,2)*o+Math.pow(t,3)*i}get _sourceControlX(){return this._startAndEnd.start.x}get _targetControlX(){return this._startAndEnd.end.x}}class Nt extends Lt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!0}}class jt extends Lt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!0}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY}\n Q ${this.sourceX} ${this._additionalControlY}, ${this._junctionPointX} ${this._junctionPointY}\n C ${this._sourceControlX} ${this._controlY}, ${this._targetControlX} ${this._controlY}, ${this.targetX} ${this.targetY}`}getTForY(t){return[...Array(20).keys()].map(t=>1*t/20).find(e=>{const i=Math.pow(1-e,3)*this._junctionPointY+3*Math.pow(1-e,2)*e*this._controlY+3*(1-e)*Math.pow(e,2)*this._controlY+Math.pow(e,3)*this.targetY;return Math.abs(i-t)<1})}get _additionalControlY(){return.7*this.sourceY+.3*this.targetY}get _junctionPointX(){return.25*this._sourceControlX+.75*this.sourceX}get _junctionPointY(){return.25*this._controlY+.75*this._additionalControlY}get _sourceControlX(){return this._startAndEnd.start.x+(this._startAndEnd.isPointingToRight?150:-150)}}class zt extends Lt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!0}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY}\n C ${this._sourceControlX} ${this._controlY}, ${this._targetControlX} ${this._controlY}, ${this._junctionPointX} ${this._junctionPointY}\n Q ${this.targetX} ${this._additionalControlY}, ${this.targetX} ${this.targetY}`}getTForY(t){return[...Array(20).keys()].map(t=>1*t/20).find(e=>{const i=Math.pow(1-e,3)*this.sourceY+3*Math.pow(1-e,2)*e*this._controlY+3*(1-e)*Math.pow(e,2)*this._controlY+Math.pow(e,3)*this._junctionPointY;return Math.abs(i-t)<1})}get _additionalControlY(){return.3*this.sourceY+.7*this.targetY}get _junctionPointX(){return.25*this._targetControlX+.75*this.targetX}get _junctionPointY(){return.25*this._controlY+.75*this._additionalControlY}get _targetControlX(){return this._startAndEnd.end.x+(this._startAndEnd.isPointingToRight?150:-150)}}class Bt extends Nt{get isSourceJettyVisible(){return!1}get isTargetJettyVisible(){return!0}get sourceX(){return super.sourceX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.sourceXShiftRate}get sourceY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class Zt extends jt{get isSourceJettyVisible(){return!1}get isTargetJettyVisible(){return!0}get sourceX(){return super.sourceX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.sourceXShiftRate}get sourceY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class Wt extends zt{get isSourceJettyVisible(){return!1}get isTargetJettyVisible(){return!0}get sourceX(){return super.sourceX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.sourceXShiftRate}get sourceY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class Ft extends Nt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!1}get targetX(){return super.targetX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.targetXShiftRate}get targetY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class Xt extends jt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!1}get targetX(){return super.targetX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.targetXShiftRate}get targetY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class qt extends zt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!1}get targetX(){return super.targetX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.targetXShiftRate}get targetY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class Ht extends Lt{get isSourceJettyVisible(){return!1}get isTargetJettyVisible(){return!0}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY+6}\n C ${this._sourceControlX} ${this.sourceY+Math.abs(this.targetY-this.sourceY)/3}, ${this._targetControlX} ${this.targetY-Math.abs(this.targetY-this.sourceY)/3}, ${this.targetX} ${this.targetY}`}get transformDefinitionsForSourceTriangle(){return`rotate(180, ${this.sourceX}, ${this.sourceY+3}) translate(${this.sourceX}, ${this.sourceY})`}get sourceX(){return super.sourceX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.sourceXShiftRate}get sourceY(){return this._toolBarHeight-this._clientTopOfContainer}}class Vt extends Lt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!1}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY}\n C ${this._sourceControlX} ${this.sourceY-Math.abs(this.targetY-this.sourceY)/3}, ${this._targetControlX} ${this.targetY+Math.abs(this.targetY-this.sourceY)/3}, ${this.targetX} ${this.targetY+6}`}get transformDefinitionsForTargetTriangle(){return` rotate(180, ${this.targetX}, ${this.targetY+3}) translate(${this.targetX}, ${this.targetY})`}get targetX(){return super.targetX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.targetXShiftRate}get targetY(){return this._toolBarHeight-this._clientTopOfContainer}}class Yt{constructor(t,e,i){this._relation=t,this._sourceEntity=t.sourceEntity,this._targetEntity=t.targetEntity;const n=this._sourceEntity.offsetTop-(e?3:0),o=this._targetEntity.offsetTop-(i?3:0),s=this._sourceEntity.getSourceAnchorPosition(e),r=this._targetEntity.getTargetAnchorPosition(i);if(this._sourceEntity.offsetCenter===this._targetEntity.offsetCenter)return this._start={y:n,x:this._sourceEntity.offsetCenter},void(this._end={y:o,x:this._targetEntity.offsetCenter});if(n<o){const t=this.isPointingToRight?"right":"left",e=s[t]<this._targetEntity.offsetCenter?"left":"right";return this._start={y:n,x:s[t]},void(this._end={y:o,x:r[e]})}if(n>o){const t=this.isPointingToRight?"left":"right",e=r[t]<this._sourceEntity.offsetCenter?"left":"right";return this._start={y:n,x:s[e]},void(this._end={y:o,x:r[t]})}if(this.isPointingToRight){const t=s.right<r.left?"left":"right";return this._start={y:n,x:s.right},void(this._end={y:o,x:r[t]})}{const t=s.left<r.right?"left":"right";return this._start={y:n,x:s.left},void(this._end={y:o,x:r[t]})}}get start(){return this._start}get end(){return this._end}get isPointingToRight(){return this._sourceEntity.offsetCenter<this._targetEntity.offsetCenter}get isDownward(){return this._start.y<this._end.y}get offsetTop(){return Math.min(this._start.y,this._end.y)}get horizontalDistance(){return Math.abs(this._end.x-this._start.x)}get sourceXShiftRate(){const{relations:t}=this._sourceEntity.span,e=t.indexOf(this._relation);return 1===t.length?.5:e/(t.length-1)}get targetXShiftRate(){const{relations:t}=this._targetEntity.span,e=t.indexOf(this._relation);return 1===t.length?.5:e/(t.length-1)}}class Ut{static create(t,e,i,n,o){const s=new Yt(t,e,i),{sourceEntity:r,targetEntity:a}=t;if(a.clientBottom<o&&a.clientTop<r.clientTop)return new Vt(s,e,i,o,n);if(r.clientBottom<o&&r.clientTop<a.clientTop)return new Ht(s,e,i,o,n);const{clientHeight:l}=document.documentElement;return Math.abs(r.clientBottom-a.clientBottom)<12||42<s.horizontalDistance?l<r.clientTop?new Bt(s,e,i,o,n):l<a.clientTop?new Ft(s,e,i,o,n):new Nt(s,e,i,o,n):s.isDownward?l<r.clientTop?new Wt(s,e,i,o,n):l<a.clientTop?new qt(s,e,i,o,n):new zt(s,e,i,o,n):l<r.clientTop?new Zt(s,e,i,o,n):l<a.clientTop?new Xt(s,e,i,o,n):new jt(s,e,i,o,n)}}function Gt(t,e,i,n){t.setAttribute("points",`${e} ${i+6}, ${n.offsetCenter} ${i+6}, ${n.offsetCenter} ${n.offsetTop}`)}function Kt(t,e,i){const n=document.createElementNS(It,"polyline");return Gt(n,t,e,i),n}function Jt(){const t=document.createElementNS(It,"polygon");return t.setAttribute("points","-4 6, 4 6, 0 0"),t}function te(){const t=document.createElementNS(It,"polygon");return t.setAttribute("points","-4 0, 4 0, 0 6"),t}function ee(t,e,i,n){t.setAttribute("d",e.pathCommands),t.setAttribute("style",`stroke: ${i};`),n?t.classList.add("textae-editor__relation--isBold"):t.classList.remove("textae-editor__relation--isBold")}class ie{#_;#_t;#ut;#St;#kt;#$t;#Tt;#Ct;#Pt;#Et;#At;#Mt;constructor(t,e,i,n,o,s,r){this.#_=t.querySelector(".textae-editor__relation-box"),this.#_t=e,this.#ut=i;const a=Jt();this.#_.appendChild(a),this.#St=a;const l=te();this.#_.appendChild(l),this.#kt=l;const c=function(){const t=document.createElementNS(It,"path");return t.classList.add("textae-editor__relation"),t}();this.#_.appendChild(c),this.#$t=c;const h=document.createElementNS(It,"path");h.classList.add("textae-editor__relation-aura"),h.addEventListener("click",n),h.addEventListener("mouseenter",s),h.addEventListener("mouseleave",r);const u=document.createElementNS(It,"title");h.appendChild(u),this.#_.appendChild(h),this.#Tt=h;const d=Jt();d.classList.add("textae-editor__relation-bollard-aura"),d.addEventListener("click",t=>o(t,e.sourceEntity)),d.appendChild(document.createElementNS(It,"title")),this.#_.appendChild(d),this.#Ct=d;const f=te();f.classList.add("textae-editor__relation-bollard-aura"),f.addEventListener("click",t=>o(t,e.targetEntity)),f.appendChild(document.createElementNS(It,"title")),this.#_.appendChild(f),this.#Pt=f,this.#Et=null,this.#At=null,this.update(!1,!1,!1)}update(t,e,i){const n=Ut.create(this.#_t,e,i,this.#_.getBoundingClientRect().top,this.#ut);ee(this.#$t,n,this.#_t.color,t),ee(this.#Tt,n,this.#_t.color,!1),this.#Tt.children[0].textContent=this.#_t.title,this.#St.setAttribute("style",`fill:${this.#_t.sourceColor}`),this.#St.setAttribute("transform",n.transformDefinitionsForSourceTriangle),this.#kt.setAttribute("style",`fill:${this.#_t.targetColor}`),this.#kt.setAttribute("transform",n.transformDefinitionsForTargetTriangle),this.#Ct.children[0].textContent=this.#_t.sourceEntity.title,this.#Ct.setAttribute("transform",n.transformDefinitionsForSourceTriangle),this.#Pt.children[0].textContent=this.#_t.targetEntity.title,this.#Pt.setAttribute("transform",n.transformDefinitionsForTargetTriangle),e&&n.isSourceJettyVisible?this.#Qt(n):this.#Dt(),i&&n.isTargetJettyVisible?this.#Rt(n):this.#It(),this.#Mt=n}destructor(){this.#_.removeChild(this.#$t),this.#_.removeChild(this.#Ct),this.#_.removeChild(this.#Pt),this.#_.removeChild(this.#Tt),this.#_.removeChild(this.#St),this.#_.removeChild(this.#kt),this.#Dt(),this.#It()}get top(){return this.#$t.getBBox().y}get left(){return this.#$t.getBBox().x}get highestX(){const t=this.#Mt.getTForY(this.top);return this.#Mt.getXOnT(t)}get width(){return this.#$t.getBBox().width}#Qt(t){const{sourceEntity:e}=this.#_t;if(this.#Et)Gt(this.#Et,t.sourceX,t.sourceY,e);else{const i=Kt(t.sourceX,t.sourceY,e);this.#_.appendChild(i),this.#Et=i}}#Rt(t){const{targetEntity:e}=this.#_t;if(this.#At)Gt(this.#At,t.targetX,t.targetY,e);else{const i=Kt(t.targetX,t.targetY,e);this.#_.appendChild(i),this.#At=i}}#Dt(){this.#Et&&(this.#_.removeChild(this.#Et),this.#Et=null)}#It(){this.#At&&(this.#_.removeChild(this.#At),this.#At=null)}}class ne{#_;#_t;#Lt;#Nt;#mt;#jt;constructor(t,e,i,n,o,s){this.#_=Dt(t),this.#_t=e,this.#Lt=i,this.#Nt=u().create('<div class="textae-editor__relation__signboard-location"></div>'),this.#zt(),this.#mt=new At(e,"relation",null),this.#Nt.appendChild(this.#mt.element),this.#_.appendChild(this.#Nt),this.#Nt.addEventListener("click",n),this.#Nt.addEventListener("mouseenter",o),this.#Nt.addEventListener("mouseleave",s)}updateValue(){this.#zt(),this.#mt.updateLabel()}updateHighlighting(){this.#zt(),this.#mt.clearCSSClass(),this.#_t.isSelected?this.#mt.select():this.#_t.isHovered&&this.#mt.hover()}destructor(){this.#_.removeChild(this.#Nt)}get y(){return this.#jt.getBBox().y}get width(){return this.#Nt.getBBox().width}get height(){return this.#Nt.getBBox().height}#zt(){this.#Nt.style.width="0px",this.#Nt.style.left=`${this.#Lt.highestX}px`,this.#Nt.style.top=this.#Lt.top-18-18*this.#_t.attributes.length+"px"}}class oe{#Z;#l;#f;#m;#T;#nt;#C;#E;#u;#A;#ut;#dt;#ft;#Lt;#H;constructor(t,e,i,n,o,{id:s,pred:r,subj:a,obj:l},c,h){this.#Z=t,this.#l=e,this.#f=i,this.#m=n,this.#T=s,this.#C=a,this.#E=l,this.#u=o,this.#A=c,this.#ut=h,this.#dt=!1,this.#ft=!1,this.typeName=r}get id(){return this.#T}set id(t){this.#T=t}get typeName(){return this.#nt}set typeName(t){this.#nt=String(t)}get typeValues(){return new Tt(this.#nt,this.#m.getAttributesFor(this.#T))}get subj(){return this.#C}get obj(){return this.#E}get attributes(){return this.#m.getAttributesFor(this.#T)}get sourceEntity(){return this.#f.get(this.subj)}get targetEntity(){return this.#f.get(this.obj)}get sourceColor(){return this.sourceEntity.color}get targetColor(){return this.targetEntity.color}get isSelected(){return this.#dt}get isHovered(){return this.#ft}select(){this.#dt||(this.#dt=!0,this.#H&&this.#H.updateHighlighting())}deselect(){this.#dt&&(this.#dt=!1,(this.#Lt||this.#H)&&this.redrawLineConsideringSelection())}render(t,e){this.sourceEntity.isInViewport(t,e)||this.targetEntity.isInViewport(t,e)?(this.#Lt?this.#Bt():(this.#Lt=new ie(this.#Z,this,this.#ut,t=>{this.#l.emit("textae-event.editor.relation.click",t,this),t.stopPropagation()},(t,e)=>{this.#l.emit("textae-event.editor.relation-bollard.click",t,e),t.stopPropagation()},()=>this.#Zt(),()=>this.#Wt()),this.#H=new ne(this.#Z,this,this.#Lt,(t,e)=>{this.#l.emit("textae-event.editor.relation.click",t,this,e),t.stopPropagation()},()=>this.#Zt(),()=>this.#Wt())),this.sourceEntity.clientTop>this.targetEntity.clientTop&&this.targetEntity.isInViewport(t,e)||this.sourceEntity.clientTop<this.targetEntity.clientTop&&this.sourceEntity.isInViewport(t,e)||this.sourceEntity.clientTop===this.targetEntity.clientTop?this.#H?this.#Ft():(this.#H=new ne(this.#Z,this,this.#Lt,(t,e)=>{this.#l.emit("textae-event.editor.relation.click",t,this,e),t.stopPropagation()},()=>this.#Zt(),()=>this.#Wt()),this.#H.updateHighlighting()):this.#H&&(this.#H.destructor(),this.#H=void 0)):(this.#Lt||this.#H)&&this.erase()}updateElement(){this.#Lt&&this.#Lt.update(this.isSelected,this.isSelected,this.isSelected),this.#H&&this.#H.updateValue()}redrawLineConsideringSelection(){this.#Bt(),this.#Ft()}pointUpPathAndSourceBollards(){this.#Lt&&(this.targetEntity.isSelected?this.#Lt.update(!0,!0,!0):this.#Lt.update(!0,!0,this.isSelected)),this.#H&&this.#H.updateHighlighting()}pointUpPathAndTargetBollards(){this.#Lt&&(this.sourceEntity.isSelected?this.#Lt.update(!0,!0,!0):this.#Lt.update(!0,this.isSelected,!0)),this.#H&&this.#H.updateHighlighting()}pointUpSourceBollardsAndTargetBollards(){this.#Lt&&this.#Lt.update(this.isSelected,!0,!0),this.#H&&this.#H.updateHighlighting()}pointUpSourceBollards(){this.#Lt&&this.#Lt.update(this.isSelected,!0,this.isSelected),this.#H&&this.#H.updateHighlighting()}pointUpTargetBollards(){this.#Lt&&this.#Lt.update(this.isSelected,this.isSelected,!0),this.#H&&this.#H.updateHighlighting()}erase(){this.#Lt&&(this.#Lt.destructor(),this.#Lt=void 0),this.#H&&(this.#H.destructor(),this.#H=void 0)}get title(){return`[${this.id}] pred: type, value: ${this.typeName}`}get color(){return this.#A.getColor(this.typeName)}get anchorHTML(){return pt(this.#z,this.#R)}get#z(){return ht(this.#u,this.typeName,this.#A.getLabel(this.typeName))}get#R(){return ft(this.#u,this.typeName,this.#A.getURI(this.typeName))}#Zt(){this.#ft=!0,this.#Lt.update(!0,!0,!0),this.#H&&this.#H.updateHighlighting();const t=new Set,e=new Set,i=new Set;for(const i of this.sourceEntity.relationsWhereThisIsSource)i!==this&&(i.targetEntity==this.targetEntity?t.add(i):e.add(i));for(const e of this.sourceEntity.relationsWhereThisIsTarget)e!==this&&(e.sourceEntity==this.targetEntity?t.add(e):i.add(e));for(const i of this.targetEntity.relationsWhereThisIsSource)i!==this&&(i.targetEntity==this.sourceEntity?t.add(i):e.add(i));for(const e of this.targetEntity.relationsWhereThisIsTarget)e!==this&&(e.sourceEntity==this.sourceEntity?t.add(e):i.add(e));for(const e of t)e.pointUpSourceBollardsAndTargetBollards();for(const t of e)t.pointUpSourceBollards();for(const t of i)t.pointUpTargetBollards()}#Wt(){this.#ft=!1;const t=new Set;for(const e of this.sourceEntity.relations)t.add(e);for(const e of this.targetEntity.relations)t.add(e);for(const e of t)e.redrawLineConsideringSelection()}#Bt(){this.#Lt&&(this.sourceEntity.isSelected&&this.targetEntity.isSelected?this.#Lt.update(!0,!0,!0):this.sourceEntity.isSelected?this.#Lt.update(!0,!0,this.isSelected):this.targetEntity.isSelected?this.#Lt.update(!0,this.isSelected,!0):this.#Lt.update(this.isSelected,this.isSelected,this.isSelected))}#Ft(){this.#H&&this.#H.updateHighlighting()}}class se extends it{#Z;#l;#W;#u;#A;#ut;constructor(t,e,i,n){super(e,"relation",()=>"R"),this.#Z=t,this.#l=e,this.#W=i,this.#u=i.namespaceInstanceContainer,this.#A=n}set toolBarHeight(t){this.#ut=t}_toInstance(t){return new oe(this.#Z,this.#l,this.#W.entityInstanceContainer,this.#W.attributeInstanceContainer,this.#u,t,this.#A,this.#ut)}add(t){t=t instanceof oe?t:new oe(this.#Z,this.#l,this.#W.entityInstanceContainer,this.#W.attributeInstanceContainer,this.#u,t,this.#A,this.#ut);const e=super.add(t),{clientHeight:i,clientWidth:n}=document.documentElement;return e.render(i,n),e}changeType(t,e){const i=super.changeType(t,e);return i.updateElement(),i}remove(t){console.assert(t,"id is necessary!");super.remove(t).erase()}clear(){for(const t of this.all)t.erase();super.clear()}}const re="ui-selected",ae={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let le;const ce=new Uint8Array(16);const he=[];for(let t=0;t<256;++t)he.push((t+256).toString(16).slice(1));function ue(t,e=0){return(he[t[e+0]]+he[t[e+1]]+he[t[e+2]]+he[t[e+3]]+"-"+he[t[e+4]]+he[t[e+5]]+"-"+he[t[e+6]]+he[t[e+7]]+"-"+he[t[e+8]]+he[t[e+9]]+"-"+he[t[e+10]]+he[t[e+11]]+he[t[e+12]]+he[t[e+13]]+he[t[e+14]]+he[t[e+15]]).toLowerCase()}function de(t,e,i){const n=(t=t||{}).random??t.rng?.()??function(){if(!le){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");le=crypto.getRandomValues.bind(crypto)}return le(ce)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((i=i||0)<0||i+16>e.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[i+t]=n[t];return e}return ue(n)}const fe=function(t,e,i){return!ae.randomUUID||e||t?de(t,e,i):ae.randomUUID()};function pe(t,e,i){return{start:t-i,end:e-i}}function me(t){const{begin:e,end:i,parent:n,bigBrother:o}=t;let s;if(s=o?function(t,e,i){if(V(t,e,i))throw new Error(`span ${t}:${e} is crossing with ${i.begin}:${i.end}`);let{start:n,end:o}=pe(t,e,i.end),s=i.element.nextSibling;return s.length<n&&(n-=s.length,o-=s.length,s=s.nextSibling),{textNode:s,start:n,end:o}}(e,i,o):{textNode:n.element.firstChild,...pe(e,i,n.begin)},!s.textNode)throw new Error(`The textNode on to create a span ${e}:${i} is not found.`);if(s.start<0)throw new Error(`start must be positive, but ${s.start} for ${e}:${i}.`);return s}function ge(t,e){return function(t,e,i){console.assert(e,"element MUST exists.");const n=t.querySelectorAll(`.${i}`),o=Array.from(n).indexOf(e);return n.length-o>1?n[o+1]:null}(t,document.querySelector(`#${e}`),"textae-editor__span")}function ve(t,e,i){(function(t,e,i){return!(!t.style||parseFloat(t.style.top)!==e||parseFloat(t.style.left)!==i)})(t,e,i)||(t.style.top=`${e}px`,t.style.left=`${i}px`)}class ye{#Xt=!1;#dt=!1;#qt=new Set;#Ht=`span_${fe().replace(/-/g,"_")}`;constructor(t,e,i,n,o){this._editorID=t,this._editorHTMLElement=e,this._begin=i,this._end=n,this._spanInstanceContainer=o,this.severTies()}get id(){return this.#Ht}get begin(){return this._begin}get end(){return this._end}get title(){return`${this._begin}-${this._end}`}get types(){return[]}get entities(){return[...this.#qt]}get relations(){return this.entities.map(({relations:t})=>t).flat()}get bigBrother(){const t=this.parent.children,e=t.indexOf(this);return 0===e?null:t[e-1]}get root(){return this._spanInstanceContainer}get parent(){return this._parent}get children(){return this._children}add(t){this.#qt.add(t)}remove(t){this.#qt.delete(t)}offset(t,e){this._begin+=t,this._end+=e}severTies(){this._parent=null,this._children=[]}beChildOf(t){t.children.push(this),this._parent=t}traverse(t){t(this);for(const e of this._children)e.traverse(t)}get element(){return document.querySelector(`#${this.id}`)}render(){this.traverse(t=>{null!==t.element&&t.destroyElement()}),this.traverse(t=>t.renderElement())}erase(){if(this.hasStyle){const t=this.element;t.removeAttribute("tabindex"),t.classList.remove("textae-editor__span")}else this.destroyElement();this.#Vt()}renderElement(){const t=u().create(this._contentHTML),{textNode:e,start:i,end:n}=me(this),o=function(t,e,i){if(t.length<i)throw new Error(`oh my god! I cannot render span. "${t.textContent.slice(e,i)}" at ${e}~${i} of text(${t.textContent.length}) as "${t.textContent}".`);const n=document.createRange();return n.setStart(t,e),n.setEnd(t,i),n}(e,i,n);o.surroundContents(t)}destroyElement(){const t=this.element;if(!t)return;const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}get gridElement(){return document.querySelector(`#G${this.id}`)}get gridHeight(){return this.entities.map(({heightWithTypeGap:t})=>t).reduce((t,e)=>t+e,0)}get isGridRendered(){return this.#Xt}get isSelected(){return this.#dt}select(){this.#dt=!0}deselect(){this.#dt=!1}focus(){this.forceRenderGrid(),this.element.focus()}addEntityElementToGridElement(t){this.gridElement.insertAdjacentElement("beforeend",t)}updateSelfAndAncestorsGridPosition(){}drawGrid(t,e){this.isGridInDrawArea(t,e)?this.forceRenderGrid():this.#Vt()}forceRenderGrid(){if(!this.#Xt){this.#Yt();for(const t of this.entities)t.render()}}isGridInDrawArea(){throw new Error("SpanInstance.isGridInDrawArea should be implemented in a subclass.")}#Yt(){if(this.isGridRendered)return this.gridElement;const t=function(t,e){const i=ge(t,e);return i?document.querySelector(`#G${i.id}`):null}(this._editorHTMLElement,this.id);if(t)return t.insertAdjacentElement("beforebegin",this._createGridElement()),this.#Xt=!0,t.previousElementSibling;{const t=Dt(this._editorHTMLElement);return t.insertAdjacentElement("beforeend",this._createGridElement()),this.#Xt=!0,t.lastElementChild}}_createGridElement(){const{offsetTopOfGrid:t,offsetLeftOfGrid:e,widthOfGrid:i}=this,n=(o=this.id,s=Ct(t),r=Ct(e),`\n<div \n id=G${o} \n class="textae-editor__grid" \n style="top: ${s}px; left: ${r}px; width: ${i}px;">\n</div>\n`);var o,s,r;return u().create(n)}updateGridPosition(){if(this.isGridRendered){const{offsetTopOfGrid:t,offsetLeftOfGrid:e}=this;ve(this.gridElement,Ct(t),Ct(e))}}#Vt(){if(this.isGridRendered){this.#Xt=!1;for(const t of this.entities)t.erase();this.gridElement.remove()}}get _styleClasses(){return[...this.styles.values()].map(t=>`textae-editor__style textae-editor__style--${t}`)}getShortenInAnchorNodeToFocusNodeDirection(t,e,i){const{anchor:n,focus:o}=this._spanInstanceContainer.textSelection;return n<o?{begin:t.forwardFromBegin(e,o,i),end:this.end}:{begin:this.begin,end:t.backFromEnd(e,o-1,i)+1}}getShortenInFocusNodeToAnchorNodeDirection(t,e,i){const{anchor:n,focus:o}=this._spanInstanceContainer.textSelection;return o<n?{begin:t.forwardFromBegin(e,n,i),end:this.end}:{begin:this.begin,end:t.backFromEnd(e,n-1,i)+1}}getExpandedInAnchorNodeToFocusNodeDirection(t,e,i){const{anchor:n,focus:o}=this._spanInstanceContainer.textSelection;return n<o?{begin:this.begin,end:t.forwardFromEnd(e,o-1,i)+1}:{begin:t.backFromBegin(e,o,i),end:this.end}}getExpandedInFocusNodeToAnchorNodeDirection(t,e,i){const{anchor:n,focus:o}=this._spanInstanceContainer.textSelection;return o<n?{begin:this.begin,end:t.forwardFromEnd(e,n-1,i)+1}:{begin:t.backFromBegin(e,n,i),end:this.end}}}class Oe extends ye{#Ut;constructor(t,e,i,n,o,s){super(t,e,i,n,o),this.#Ut=s}get isBlock(){return!0}passesAllEntitiesTo(t){for(const e of this.entities)e.span=t}select(){super.select();const t=super.element;t.classList.add(re),this.#Gt.classList.add(re),t.focus()}deselect(){super.deselect();const t=super.element;t&&t.classList.remove(re),this.#Gt&&this.#Gt.classList.remove(re)}updateBackgroundPosition(){if(this.isGridRendered){const t=this.#Kt,e=this.element.getBoundingClientRect(),i=e.left-this.#Ut.boundingClientRect.left-8,n=e.width+8;!function(t,e,i,n,o){t.style.top=`${e}px`,t.style.left=`${i}px`,t.style.width=`${n}px`,t.style.height=`${o}px`}(this.#Gt,this.#Jt,i,n,t),this.gridElement.style.height=`${t}px`}}renderElement(){super.renderElement();!function(t,e){const i=u().create(`\n <div id="${e}" class="textae-editor__block-bg"></div>\n `);t.insertAdjacentElement("afterbegin",i)}(Dt(this._editorHTMLElement),this.#te)}destroyElement(){super.destroyElement(),this.#Gt.remove()}get heightIncludeDescendantGrids(){return super.gridHeight+35}get widthOfGrid(){return 100}get offsetCenterOfGrid(){return this.#Ut.boundingClientRect.width-58}get offsetTopOfGrid(){return this.#Jt}get clientBottomOfGrid(){return this.#ee+this.#Kt}get offsetBottomOfGrid(){return this.#Jt+this.#Kt}get offsetLeftOfGrid(){return this.#Ut.boundingClientRect.width-108}updateGridPosition(){super.updateGridPosition(),this._entityToFocusOn&&(this._entityToFocusOn.select(),this._entityToFocusOn=null)}get isGridBeforePositioned(){return!this.gridElement.style.top}set entityToFocusOn(t){this._entityToFocusOn=t}isGridInViewport(t){return this.#ie(t,0)}isGridInDrawArea(t){return this.#ie(t,t)}get#Kt(){return this.element.getBoundingClientRect().height}get#Jt(){return this.#ee-this.#Ut.boundingClientRect.top}get#te(){return`bg_of_${this.id}`}get#Gt(){return document.querySelector(`#${this.#te}`)}#ie(t,e){return 0-e<=this.#ne&&this.#ee<=t+e}get#ee(){return this.#oe(this.element.getBoundingClientRect().top)}get#ne(){return this.#oe(this.element.getBoundingClientRect().bottom)}#oe(t){return t-this.#Ut.lineHeight/2+20}get _contentHTML(){return`<div id="${this.id}" class="textae-editor__block"></div>`}_createGridElement(){const t=super._createGridElement();return t.classList.add("textae-editor__block-hit-area"),t.dataset.id=this.id,t.title=this.title,t}}function be(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function xe(t){const e=0===t.children.length?0:function(t){return Math.max.apply(null,t.children.map(t=>xe(t)))}(t);return t.gridHeight+e}class we extends ye{constructor(t,e,i,n,o){super(t,e,i,n,o)}passesAllEntitiesTo(t){for(const e of this.entities)e.span=t}get hasStyle(){return this.styles.size>0}get styles(){return this._spanInstanceContainer.getStyle(this.id)}get#se(){const t=this.element,e=t.getBoundingClientRect(),i=t.offsetParent.offsetParent.getBoundingClientRect();return e.left-i.left}get isDenotation(){return!0}addEntityElementToGridElement(t){super.addEntityElementToGridElement(t),this.updateSelfAndAncestorsGridPosition()}updateSelfAndAncestorsGridPosition(){this.updateGridPosition();let t=this.parent;for(;t instanceof we;)t.updateGridPosition(),t=t.parent}updateDenotationEntitiesWidth(){if(this.isGridRendered){const{widthOfGrid:t}=this;this.gridElement.style.width=`${t}px`}}select(){super.select();const t=super.element;t.classList.add(re),setTimeout(()=>t.focus(),0)}deselect(){super.deselect();const t=super.element;t&&t.classList.remove(re)}get heightIncludeDescendantGrids(){return this.#re+23+5}get widthOfGrid(){if(be){const t=this.element.getBoundingClientRect(),e=this.element.offsetParent.offsetParent.getBoundingClientRect(),i=t.left-e.left;return Ct(Math.min(t.width,e.width-i))}return Ct(this.element.getBoundingClientRect().width)}get offsetCenterOfGrid(){return this.#se+this.widthOfGrid/2}get clientTopOfGrid(){return this.element.getBoundingClientRect().top-this.#re}get offsetTopOfGrid(){return this.element.getBoundingClientRect().top-this.element.offsetParent.offsetParent.getBoundingClientRect().top-this.#re}get offsetLeftOfGrid(){return this.#se}isGridInViewport(t,e){return this.#ie(t,e,0)}isGridInDrawArea(t,e){return this.#ie(t,e,t)}#ie(t,e,i){const{top:n,left:o}=this.element.getBoundingClientRect(),s=this.#re;return 0-i<=n-s+this.gridHeight&&n-s<=t+i&&o<=e}get _contentHTML(){return`\n <span\n id="${this.id}"\n title="${this.title}"\n tabindex="0"\n class="${["textae-editor__span"].concat(this._styleClasses).join(" ")}"\n >\n </span>\n `}get#re(){return xe(this)}}function _e(t,e){return t.begin-e.begin||e.end-t.end}function Se(t,e,i){const n=t.get(e),o=t.get(i);let s=n,r=o;return _e(n,o)>0&&(s=o,r=n),[...t.values()].filter(t=>s.begin<=t.begin&&(t.end<=s.end||t.end<=r.end)).map(t=>t.id)}class ke{#ae=new Map;#le=new Map;set(t,e){this.#ae.set(t,e);const i=this.#ce(e.begin,e.end);this.#le.has(i)?this.#le.get(i).add(e):this.#le.set(i,new Set([e]))}get(t){return this.#ae.get(t)}getSameBeginEnd(t,e){const i=this.#ce(t,e);return this.#le.get(i)}getSingleOrThrowOn(t,e){const i=this.#ce(t,e),n=this.#le.get(i);if(1===n.size)return n.values().next().value;throw new Error("The span is not unique.")}has(t){return this.#ae.has(t)}delete(t){const e=this.#ae.get(t);if(e){const i=this.#ce(e.begin,e.end);return this.#le.get(i).delete(e),0===this.#le.get(i).size&&this.#le.delete(i),this.#ae.delete(t)}return!1}clear(){this.#ae.clear(),this.#le.clear()}values(){return this.#ae.values()}#ce(t,e){return 1e7*t+e}}class $e extends ye{constructor(t,e,i,n,o,s){super(t,e,i,n,o,s),this.styles=new Set([s])}get styleOnly(){return!0}appendStyles(t){this.styles=new Set([...this.styles,...t])}get _contentHTML(){return`\n <span\n id="${this.id}"\n title="${this.title}"\n class="${this._styleClasses.join(" ")}"\n >\n </span>\n `}}function Te(t){let e=0;for(const i of t.parentElement.childNodes){if(i==t)break;"#text"===i.nodeName?e+=i.nodeValue.length:e+=i.textContent.length}return e}function Ce(t){return t.classList.contains("textae-editor__block")}function Pe(t){return t.classList.contains("textae-editor__span")}function Ee(t){return t.classList.contains("textae-editor__style")}function Ae(t){return t.classList.contains("textae-editor__text-box")}function Me(t,e){const i=e.parentElement;if(Ae(i))return 0;if(Pe(i)||Ce(i)||Ee(i))return t.get(i.id).begin;throw new Error(`Can not get position of a node : ${e} ${e.data}`)}class Qe{#he;#d;constructor(t){this.#he=window.getSelection(),this.#d=t}get anchor(){return Me(this.#d,this.#he.anchorNode)+Te(this.#he.anchorNode)+this.#he.anchorOffset}get focus(){return Me(this.#d,this.#he.focusNode)+Te(this.#he.focusNode)+this.#he.focusOffset}get begin(){return this.anchor<this.focus?this.anchor:this.focus}get end(){return this.anchor<this.focus?this.focus:this.anchor}}function De(t,e){return function(t,e){return!!e&&e.begin<=t.begin&&t.end<=e.end}(t,e)?e:e.parent?De(t,e.parent):null}function Re(t,e){e.sort(_e).forEach((e,i,n)=>{e.severTies();const o=0!==i?n[i-1]:null;if(o){const i=De(e,o);i?e.beChildOf(i):e.beChildOf(t)}else e.beChildOf(t)})}class Ie{#lt;#Z;#x;#Ut;#ue=new ke;#de=new ke;#fe=new Map;constructor(t,e,i,n){this.#lt=t,this.#Z=e,this.#x=i,this.#Ut=n}add(t){if(console.assert(t,"span is necessary."),t instanceof Oe)return this.#pe(t);if(t instanceof we)return this.#me(t);if(t.isBlock){console.assert(!this.#ge(t.begin,t.end),`There are some parent spans of {begin: ${t.begin}, end: ${t.end}}.`);const e=new Oe(this.#lt,this.#Z,t.begin,t.end,this,this.#Ut);return this.#pe(e)}{console.assert(!this.find("denotation",t.begin,t.end),"There is already a span.");const e=new we(this.#lt,this.#Z,t.begin,t.end,this);return this.#me(e)}}addSource(t,e){for(const i of t)this.#ve(e,i);this.#ye()}validateNewDenotationSpan(t,e){return this.isBoundaryCrossingWithOtherSpans(t,e)?(n().warning("A span cannot be modified to make a boundary crossing."),!1):!this.find("denotation",t,e)&&!this.#Oe(t,e)}validateNewBlockSpan(t,e,i){return this.isBoundaryCrossingWithOtherSpans(t,e)?(n().warning("A span cannot be modified to make a boundary crossing."),!1):!this.#ge(t,e)&&!this.#Oe(t,e,{excluded:i})}validateEditableText(t,e){return!this.all.find(i=>t<i.begin&&i.begin<e||t<i.end&&i.end<e)||(n().warning("Text that contains any part of a span cannot be edited."),!1)}hasParentOf(t,e,i){for(const n of this.all)if(n.id!==i&&n.begin<=t&&e<=n.end)return!0;return!1}get(t){return this.#ue.has(t)?this.#ue.get(t):this.#de.has(t)?this.#de.get(t):this.#fe.get(t)}find(t,e,i){switch(t){case"denotation":return Array.from(this.#ue.values()).find(t=>t.begin===e&&t.end===i);case"block":return Array.from(this.#de.values()).find(t=>t.begin===e&&t.end===i);default:throw`${t} is unknown type span!`}}getStyle(t){return this.#fe.has(t)?this.#fe.get(t).styles:new Set}getDenotationSpan(t){if(this.#ue.has(t))return this.#ue.get(t)}rangeDenotationSpan(t,e){return Se(this.#ue,t,e)}rangeBlockSpan(t,e){return Se(this.#de,t,e)}get children(){return this.all.filter(t=>t.parent===this).sort(_e)}clear(){this.#ue.clear(),this.#de.clear(),this.#fe.clear()}remove(t){const e=this.#de.get(t);if(e)return this.#be(e),void this.#x.emit("textae-event.annotation-data.span.remove",e);const i=this.#ue.get(t);if(i)return this.#xe(i),void this.#x.emit("textae-event.annotation-data.span.remove",i);console.assert(!1,`There is no target for remove for ${t}!`)}moveDenotationSpan(t,e,i,n){const o=this.#ue.getSameBeginEnd(t,e);for(const s of o){console.assert(s,`There is no target for move for begin: ${t}, end: ${e}!`),console.assert(s.begin!==i||s.end!==n,`Do not need move span: ${s.id} ${i} ${n}`),this.#xe(s);const o=new we(this.#lt,this.#Z,i,n,this);this.#me(o,s)}this.#x.emit("textae-event.annotation-data.span.move")}moveBlockSpan(t,e,i,n){const o=this.#de.getSingleOrThrowOn(t,e);console.assert(o.begin!==i||o.end!==n,`Do not need move span: ${o.id} ${i} ${n}`),this.#be(o);const s=new Oe(this.#lt,this.#Z,i,n,this,this.#Ut);this.#pe(s,o),this.#x.emit("textae-event.annotation-data.span.move")}isBoundaryCrossingWithOtherSpans(t,e){return function(t,e,i){return console.assert(void 0!==i,"end is necessary."),Y(t.map(t=>({span:t})),e,i).length>0}(this.all,t,e)}get all(){const t=[...this.#fe.values()].filter(t=>!this.#ue.has(t.id));return[...this.#de.values()].concat([...this.#ue.values()]).concat(t)}get selectedItems(){return[...this.#de.values()].concat([...this.#ue.values()]).filter(({isSelected:t})=>t)}get allDenotationSpans(){return[...this.#ue.values()]}get allBlockSpans(){return[...this.#de.values()]}get begin(){return 0}get element(){return this.#Z.querySelector(".textae-editor__text-box")}get textSelection(){return new Qe(this)}arrangeDenotationEntityPosition(){for(const t of this.allDenotationSpans)t.updateGridPosition()}arrangeBlockEntityPosition(){for(const t of this.allBlockSpans)t.updateGridPosition()}arrangeBackgroundOfBlockSpanPosition(){for(const t of this.allBlockSpans)t.updateBackgroundPosition()}get maxHeight(){const t=[...this.#de.values()].concat([...this.#ue.values()]);return t.length?function(t){return Math.max(...t.map(t=>t.heightIncludeDescendantGrids))}(t):null}renderAll(){for(const t of this.children)t.render()}offsetSpans(t,e,i){const n=[];for(const o of this.all)o.end<=t||o.end<e||(e<=o.begin?(o.offset(i,i),n.push(o)):(o.offset(0,i),n.push(o)));return n.sort(_e)}#Oe(t,e,i={}){for(const n of this.#de.values())if(t<=n.begin&&n.end<=e&&i&&n.id!==i.excluded)return!0;return!1}#ge(t,e){const i=i=>i.begin<=t&&e<=i.end;return[...this.#ue.values()].some(i)||[...this.#de.values()].some(i)||[...this.#fe.values()].some(i)}#me(t,e=null){return this.#we(this.#ue,t,e),this.#x.emit("textae-event.annotation-data.span.add",t),t}#pe(t,e=null){return this.#we(this.#de,t,e),this.#x.emit("textae-event.annotation-data.span.add",t),t}#we(t,e,i=null){t.set(e.id,e),this.#ye(),i&&i.passesAllEntitiesTo(e),e.render();const{clientHeight:n,clientWidth:o}=document.documentElement;e.drawGrid(n,o)}#xe(t){this.#ue.delete(t.id),t.erase()}#be(t){this.#de.delete(t.id),t.erase()}#ye(){Re(this,this.all)}#ve(t,e){switch(t){case"denotation":if(!this.#ue.getSameBeginEnd(e.span.begin,e.span.end)){const t=new we(this.#lt,this.#Z,e.span.begin,e.span.end,this);this.#ue.set(t.id,t)}break;case"block":{const t=new Oe(this.#lt,this.#Z,e.span.begin,e.span.end,this,this.#Ut);this.#de.has(t.id)||this.#de.set(t.id,t);break}case"typesetting":{const t=new $e(this.#lt,this.#Z,e.span.begin,e.span.end,this,e.style);this.#fe.has(t.id)?this.#fe.get(t.id).appendStyles(t.styles):this.#fe.set(t.id,t);break}default:throw`${t} is unknown type span!`}}}var Le=i(504),Ne=i.n(Le);class je{#l;#_e;#Se;#ke;#$e;#Te=new(Ne())(!1);constructor(t,e,i,n,o,s=!0){this.#l=t,this.#_e=e,this.#Se=i,this.#ke=n,this.#$e=o,this.#Te(()=>this.#l.emit("textae-event.type-definition.lock")),this.#Te.set(s)}set autocompletionWs(t){this.#_e.autocompletionWs=t,this.#ke.autocompletionWs=t,this.#Se.autocompletionWs=t}set autocompletionFunction(t){this.#_e.autocompletionFunction=t,this.#ke.autocompletionFunction=t,this.#Se.autocompletionFunction=t}get denotation(){return this.#_e}get block(){return this.#Se}get relation(){return this.#ke}get attribute(){return this.#$e}get autocompletionWs(){return this.#_e.autocompletionWs}get config(){const t={};return this.#_e.config.length&&(t["entity types"]=this.#_e.config),this.#ke.config.length&&(t["relation types"]=this.#ke.config),this.#$e.config.length&&(t["attribute types"]=this.#$e.config),this.#Se.config.length&&(t["block types"]=this.#Se.config),t}get isLock(){return this.#Te()}lockEdit(){this.#Te.set(!0)}unlockEdit(){this.#Te.set(!1)}setTypeConfig(t){t?(this.#_e.config=t["entity types"],this.#ke.config=t["relation types"],this.#$e.config=t["attribute types"],this.#Se.config=t["block types"],this.autocompletionWs=t.autocompletion_ws):(this.#_e.config=null,this.#ke.config=null,this.#$e.config=null,this.#Se.config=null,this.autocompletionWs=""),this.#l.emit("textae-event.type-definition.reset")}}class ze{constructor(t){this._isGapShown=!0,this._numberOfGap=1,this._callback=t}set show(t){this._isGapShown!==t&&(this._isGapShown=t,this._callback(this.value))}get show(){return this._isGapShown}get value(){return this._isGapShown?this._numberOfGap:0}get height(){return 24*this.value}set value(t){this._numberOfGap!==t&&(this._numberOfGap=t,this._callback(t))}}function Be(t){return t.entityInstanceContainer.blocks.map(t=>({id:t.id,span:{begin:t.span.begin,end:t.span.end},obj:t.typeName}))}function Ze(t){return t.relationInstanceContainer.all.map(t=>({id:t.id,pred:t.typeName,subj:t.subj,obj:t.obj}))}class We{#Ce;#ct;#Ut;#Pe;#u;#d;#f;#p;#m;#ht;#Z;#l;constructor(t,e,i,n,o,s,r,a){this.#Ce="",this.#u=new et(i,"namespace");const l=new $t(i,"relation",()=>this.#p.all,"#00CC66");this.#p=new se(e,i,this,l),this.#ct=new ze(()=>{for(const t of this.entityInstanceContainer.denotations)t.reflectTypeGapInTheHeight();this.#Ut.updateLineHeight(),i.emit("textae-event.annotation-data.entity-gap.change")}),this.#f=new Qt(t,i,this,this.#ct),this.attributeDefinitionContainer=new I(i,()=>this.#m.all),this.#m=new vt(i,this.#f,this.#p,this.#u,this.attributeDefinitionContainer),this.updatePosition=()=>{try{n.startWait(),o(),this.#Ee()}catch(t){console.error(t)}finally{n.endWait(),s()}},this.#Ut=bt(e,this,a),this.#Pe=new Rt(i,this.#Ut),this.#d=new Ie(t,e,i,this.#Ut),L(this,()=>this.#d,["getDenotationSpan","isBoundaryCrossingWithOtherSpans","hasParentOf","validateNewDenotationSpan","validateNewBlockSpan","validateEditableText"]),this.denotationDefinitionContainer=new $t(i,"entity",()=>this.#f.denotations,"#77DDDD");const c=new $t(i,"entity",()=>this.#f.blocks,"#77DDDD");this.#ht=new je(i,this.denotationDefinitionContainer,c,l,this.attributeDefinitionContainer,r),i.on("textae-event.annotation-data.span.add",t=>{(t.isDenotation||t.isBlock)&&(this.#Ut.forceUpdate(),this.#Ee())}).on("textae-event.annotation-data.span.remove",t=>{(t.isDenotation||t.isBlock)&&(this.#Ut.forceUpdate(),this.#Ee())}).on("textae-event.annotation-data.entity.add",t=>{t.span.isDenotation&&this.#Pe.updateLineHeight()}).on("textae-event.annotation-data.entity.remove",t=>{t.span.isDenotation&&this.#Pe.updateLineHeight()}),i.on("textae-event.type-definition.entity.change",t=>{for(const e of this.#f.all)(e.typeName===t||t.lastIndexOf("*")===t.length-1&&e.typeName.indexOf(0===t.slice(0,-1)))&&e.updateElement()}).on("textae-event.type-definition.attribute.change",t=>this.#f.redrawEntitiesWithSpecifiedAttribute(t)).on("textae-event.type-definition.attribute.move",t=>this.#f.redrawEntitiesWithSpecifiedAttribute(t)).on("textae-event.type-definition.relation.change",t=>{for(const e of this.#p.all)(e.typeName===t||t.lastIndexOf("*")===t.length-1&&e.typeName.indexOf(0===t.slice(0,-1)))&&e.updateElement()}),this.#Z=e,this.#l=i}reset(t,e){console.assert(t.text,"This is not a json file of annotations."),this.#ht.setTypeConfig(e),this.#Ce=t.text,this.#Ut.render(this.sourceDoc),this.#Ae();const i=new tt(this,t);i.eval(),this.#Me(),this.#l.emit("textae-event.annotation-data.all.change",i.hasMultiTracks,i.rejects),this.reLayout()}set autocompletionFunction(t){this.#ht.autocompletionFunction=t}get externalFormat(){return{text:this.#Ce,denotations:(t=this,t.entityInstanceContainer.denotations.map(t=>({id:t.id,span:{begin:t.span.begin,end:t.span.end},obj:t.typeName}))),attributes:this.#m.all.map(({externalFormat:t})=>t),relations:Ze(this),blocks:Be(this)};var t}getReplicationRanges(t,e){return function(t,e,i,n,o){return function(t,e,i){const n=t.substring(e,i),o=i-e,s=[];let r=0;for(let e=t.indexOf(n);-1!==e;e=t.indexOf(n,r))r=e+o,s.push({begin:e,end:r});return s}(t,e,i).filter(({begin:t})=>t!==e).filter(({begin:e,end:i})=>function(t,e,i,n){const o=t.charAt(e-1),s=t.charAt(i);return n(o)&&n(s)}(t,e,i,o)).filter(({begin:t,end:e})=>!n.find("denotation",t,e)).filter(({begin:t,end:e})=>!n.isBoundaryCrossingWithOtherSpans(t,e))}(this.sourceDoc,t.begin,t.end,this.#d,e)}get typeGap(){return this.#ct}get textBox(){return this.#Ut}get sourceDoc(){return this.#Ce.replaceAll(/\r\n/g," \n")}get typeDictionary(){return this.#ht}get spanInstanceContainer(){return this.#d}getSpan(t){return this.#d.get(t)}get entityInstanceContainer(){return this.#f}get relationInstanceContainer(){return this.#p}get attributeInstanceContainer(){return this.#m}get namespaceInstanceContainer(){return this.#u}get textSelection(){return this.#d.textSelection}findDenotation(t,e){return this.#d.find("denotation",t,e)}findBlock(t,e){return this.#d.find("block",t,e)}getTextBetween(t,e){return this.sourceDoc.substring(t,e)}changeTextBetween(t,e,i){this.#Ce=`${this.#Ce.slice(0,t)}${i}${this.#Ce.slice(e)}`;const n=i.length-(e-t),o=this.#d.offsetSpans(t,e,n);return this.#Ut.render(this.sourceDoc),this.#Me(),this.#l.emit("textae-event.annotation-data.text.change"),o}hasCharacters(t){const{begin:e,end:i}=this.textSelection,n=this.getTextBetween(e,i);return t.removeBlankCharacters(n).length>0}getTextSelection(t,e){const{begin:i,end:n}=this.textSelection;return{begin:e.backFromBegin(this.sourceDoc,i,t),end:e.forwardFromEnd(this.sourceDoc,n-1,t)+1}}getInstanceContainerFor(t){switch(t){case"span":return this.#d;case"relation":return this.#p;case"entity":return this.#f;case"attribute":return this.#m}}drawGridsInSight(){if(this.#Qe){const{clientHeight:t,clientWidth:e}=document.documentElement;for(const i of this.#d.allDenotationSpans)i.drawGrid(t,e);for(const i of this.#d.allBlockSpans)i.drawGrid(t,e),i.updateBackgroundPosition();for(const i of this.#p.all)i.render(t,e)}}reLayout(){this.#Ut.forceUpdate(),this.#Qe&&this.updatePosition()}set toolBarHeight(t){this.#f.toolBarHeight=t,this.#p.toolBarHeight=t}get#Qe(){const{clientHeight:t}=document.documentElement,{top:e,bottom:i}=this.#Z.getBoundingClientRect();return 0<=i&&e<=t}focusDenotation(t){console.assert(this.#f.hasDenotation(t),"The denotation does not exist.");const{span:e}=this.#f.get(t);e.focus()}#Me(){this.#d.renderAll(),this.#Ut.updateLineHeight(),this.drawGridsInSight()}#Ee(){this.#d.arrangeDenotationEntityPosition(),this.#d.arrangeBackgroundOfBlockSpanPosition(),this.#d.arrangeBlockEntityPosition();for(const t of this.#p.all)t.sourceEntity.span.isGridRendered&&t.targetEntity.span.isGridRendered&&t.redrawLineConsideringSelection()}#Ae(){this.#d.clear(),this.#f.clear(),this.#m.clear(),this.#p.clear(),this.#u.clear(),Dt(this.#Z).innerHTML=""}}class Fe{#De;#Re;#Ie;constructor(t,e,i){this.#De=t,this.#Re=e,this.#Ie=i,this.#Le()}dispose(){this.#De.removeEventListener(this.#Re,this.#Ie)}#Le(){this.#De.addEventListener(this.#Re,this.#Ie)}}class Xe{constructor(t){this._editorHTMLElement=t}startWait(){this._editorHTMLElement.classList.add("textae-editor--wait")}endWait(){this._editorHTMLElement.classList.remove("textae-editor--wait")}}class qe{#l;#Ne;#Ie;constructor(t,e,i){this.#l=t,this.#Ne=e,this.#Ie=i;for(const i of e)t.on(i,this.#Ie)}dispose(){for(const t of this.#Ne)this.#l.off(t,this.#Ie)}}function He(t){if("object"!=typeof t)return t;if(null===t)return null;if(Array.isArray(t))return t.map(He);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return function(t){var e;const i=/^\/(.*)\/([gimyu]*)$/.exec(t.toString());if(!i)throw new Error("Invalid RegExp");return new RegExp(null!==(e=i[1])&&void 0!==e?e:"",i[2])}(t);const e={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=He(t[i]));return e}function Ve(t,e){if(t.length<2)throw new Error(e||"Expected an array with at least 2 items")}class Ye{setResult(t){return this.result=t,this.hasResult=!0,this}exit(){return this.exiting=!0,this}push(t,e){var i;return t.parent=this,void 0!==e&&(t.childName=e),t.root=this.root||this,t.options=t.options||this.options,this.children?(!function(t,e){if(0===t.length)throw new Error(e||"Expected a non-empty array")}(this.children),(i=this.children,i[i.length-1]).next=t,this.children.push(t)):(this.children=[t],this.nextAfterChildren=this.next||null,this.next=t),t.next=this,this}}const Ue=class extends Ye{constructor(t,e){super(),this.left=t,this.right=e,this.pipe="diff"}prepareDeltaResult(t){var e,i,n,o;if("object"==typeof t&&((null===(e=this.options)||void 0===e?void 0:e.omitRemovedValues)&&Array.isArray(t)&&t.length>1&&(2===t.length||0===t[2]||3===t[2])&&(t[0]=0),null===(i=this.options)||void 0===i?void 0:i.cloneDiffValues)){const e="function"==typeof(null===(n=this.options)||void 0===n?void 0:n.cloneDiffValues)?null===(o=this.options)||void 0===o?void 0:o.cloneDiffValues:He;"object"==typeof t[0]&&(t[0]=e(t[0])),"object"==typeof t[1]&&(t[1]=e(t[1]))}return t}setResult(t){return this.prepareDeltaResult(t),super.setResult(t)}};const Ge=class extends Ye{constructor(t,e){super(),this.left=t,this.delta=e,this.pipe="patch"}};const Ke=class extends Ye{constructor(t){super(),this.delta=t,this.pipe="reverse"}};const Je=class{constructor(t){this.name=t,this.filters=[]}process(t){if(!this.processor)throw new Error("add this pipe to a processor before using it");const e=this.debug,i=this.filters.length,n=t;for(let t=0;t<i;t++){const i=this.filters[t];if(i&&(e&&this.log(`filter: ${i.filterName}`),i(n),"object"==typeof n&&n.exiting)){n.exiting=!1;break}}!n.next&&this.resultCheck&&this.resultCheck(n)}log(t){console.log(`[jsondiffpatch] ${this.name} pipe, ${t}`)}append(...t){return this.filters.push(...t),this}prepend(...t){return this.filters.unshift(...t),this}indexOf(t){if(!t)throw new Error("a filter name is required");for(let e=0;e<this.filters.length;e++){const i=this.filters[e];if((null==i?void 0:i.filterName)===t)return e}throw new Error(`filter not found: ${t}`)}list(){return this.filters.map(t=>t.filterName)}after(t,...e){const i=this.indexOf(t);return this.filters.splice(i+1,0,...e),this}before(t,...e){const i=this.indexOf(t);return this.filters.splice(i,0,...e),this}replace(t,...e){const i=this.indexOf(t);return this.filters.splice(i,1,...e),this}remove(t){const e=this.indexOf(t);return this.filters.splice(e,1),this}clear(){return this.filters.length=0,this}shouldHaveResult(t){return!1===t?(this.resultCheck=null,this):(this.resultCheck||(this.resultCheck=t=>{if(!t.hasResult){console.log(t);const e=new Error(`${this.name} failed`);throw e.noResult=!0,e}}),this)}};const ti=class{constructor(t){this.selfOptions=t||{},this.pipes={}}options(t){return t&&(this.selfOptions=t),this.selfOptions}pipe(t,e){let i=e;if("string"==typeof t){if(void 0===i)return this.pipes[t];this.pipes[t]=i}if(t&&t.name){if(i=t,i.processor===this)return i;this.pipes[i.name]=i}if(!i)throw new Error(`pipe is not defined: ${t}`);return i.processor=this,i}process(t,e){let i=t;i.options=this.options();let n,o=e||t.pipe||"default";for(;o;)void 0!==i.nextAfterChildren&&(i.next=i.nextAfterChildren,i.nextAfterChildren=null),"string"==typeof o&&(o=this.pipe(o)),o.process(i),n=o,o=null,i&&i.next&&(i=i.next,o=i.pipe||n);return i.hasResult?i.result:void 0}},ei=(t,e,i,n)=>t[i]===e[n],ii=(t,e,i,n)=>{const o=n||{},s=((t,e,i,n)=>{var o,s,r;const a=t.length,l=e.length;let c,h;const u=new Array(a+1);for(c=0;c<a+1;c++){const t=new Array(l+1);for(h=0;h<l+1;h++)t[h]=0;u[c]=t}for(u.match=i,c=1;c<a+1;c++){const a=u[c];if(void 0===a)throw new Error("LCS matrix row is undefined");const d=u[c-1];if(void 0===d)throw new Error("LCS matrix row is undefined");for(h=1;h<l+1;h++)i(t,e,c-1,h-1,n)?a[h]=(null!==(o=d[h-1])&&void 0!==o?o:0)+1:a[h]=Math.max(null!==(s=d[h])&&void 0!==s?s:0,null!==(r=a[h-1])&&void 0!==r?r:0)}return u})(t,e,i||ei,o);return((t,e,i,n)=>{let o=e.length,s=i.length;const r={sequence:[],indices1:[],indices2:[]};for(;0!==o&&0!==s;){if(void 0===t.match)throw new Error("LCS matrix match function is undefined");if(t.match(e,i,o-1,s-1,n))r.sequence.unshift(e[o-1]),r.indices1.unshift(o-1),r.indices2.unshift(s-1),--o,--s;else{const e=t[o];if(void 0===e)throw new Error("LCS matrix row is undefined");const i=e[s-1];if(void 0===i)throw new Error("LCS matrix value is undefined");const n=t[o-1];if(void 0===n)throw new Error("LCS matrix row is undefined");const r=n[s];if(void 0===r)throw new Error("LCS matrix value is undefined");i>r?--s:--o}}return r})(s,t,e,o)};function ni(t,e,i,n,o){const s=t[i],r=e[n];if(s===r)return!0;if("object"!=typeof s||"object"!=typeof r)return!1;const a=o.objectHash;if(!a)return o.matchByPosition&&i===n;o.hashCache1=o.hashCache1||[];let l=o.hashCache1[i];if(void 0===l&&(o.hashCache1[i]=l=a(s,i)),void 0===l)return!1;o.hashCache2=o.hashCache2||[];let c=o.hashCache2[n];return void 0===c&&(o.hashCache2[n]=c=a(r,n)),void 0!==c&&l===c}const oi=function(t){var e,i,n,o,s;if(!t.leftIsArray)return;const r={objectHash:null===(e=t.options)||void 0===e?void 0:e.objectHash,matchByPosition:null===(i=t.options)||void 0===i?void 0:i.matchByPosition};let a,l,c,h=0,u=0;const d=t.left,f=t.right,p=d.length,m=f.length;let g,v;for(p>0&&m>0&&!r.objectHash&&"boolean"!=typeof r.matchByPosition&&(r.matchByPosition=!function(t,e,i,n){for(let o=0;o<i;o++){const i=t[o];for(let t=0;t<n;t++){const n=e[t];if(o!==t&&i===n)return!0}}return!1}(d,f,p,m));h<p&&h<m&&ni(d,f,h,h,r);)a=h,g=new Ue(d[a],f[a]),t.push(g,a),h++;for(;u+h<p&&u+h<m&&ni(d,f,p-1-u,m-1-u,r);)l=p-1-u,c=m-1-u,g=new Ue(d[l],f[c]),t.push(g,c),u++;if(h+u===p){if(p===m)return void t.setResult(void 0).exit();for(v=v||{_t:"a"},a=h;a<m-u;a++)v[a]=[f[a]],t.prepareDeltaResult(v[a]);return void t.setResult(v).exit()}if(h+u===m){for(v=v||{_t:"a"},a=h;a<p-u;a++){const e=`_${a}`;v[e]=[d[a],0,0],t.prepareDeltaResult(v[e])}return void t.setResult(v).exit()}r.hashCache1=void 0,r.hashCache2=void 0;const y=d.slice(h,p-u),O=f.slice(h,m-u),b=ii(y,O,ni,r),x=[];for(v=v||{_t:"a"},a=h;a<p-u;a++)if(b.indices1.indexOf(a-h)<0){const e=`_${a}`;v[e]=[d[a],0,0],t.prepareDeltaResult(v[e]),x.push(a)}let w=!0;(null===(n=t.options)||void 0===n?void 0:n.arrays)&&!1===t.options.arrays.detectMove&&(w=!1);let _=!1;(null===(s=null===(o=t.options)||void 0===o?void 0:o.arrays)||void 0===s?void 0:s.includeValueOnMove)&&(_=!0);const S=x.length;for(a=h;a<m-u;a++){const e=b.indices2.indexOf(a-h);if(e<0){let e=!1;if(w&&S>0)for(let i=0;i<S;i++){l=x[i];const n=void 0===l?void 0:v[`_${l}`];if(void 0!==l&&n&&ni(y,O,l-h,a-h,r)){n.splice(1,2,a,3),n.splice(1,2,a,3),_||(n[0]=""),c=a,g=new Ue(d[l],f[c]),t.push(g,c),x.splice(i,1),e=!0;break}}e||(v[a]=[f[a]],t.prepareDeltaResult(v[a]))}else{if(void 0===b.indices1[e])throw new Error(`Invalid indexOnArray2: ${e}, seq.indices1: ${b.indices1}`);if(l=b.indices1[e]+h,void 0===b.indices2[e])throw new Error(`Invalid indexOnArray2: ${e}, seq.indices2: ${b.indices2}`);c=b.indices2[e]+h,g=new Ue(d[l],f[c]),t.push(g,c)}}t.setResult(v).exit()};oi.filterName="arrays";const si={numerically:(t,e)=>t-e,numericallyBy:t=>(e,i)=>e[t]-i[t]},ri=function(t){var e;if(!t.nested)return;const i=t.delta;if("a"!==i._t)return;let n,o;const s=i,r=t.left;let a=[],l=[];const c=[];for(n in s)if("_t"!==n)if("_"===n[0]){const t=n;if(void 0===s[t]||0!==s[t][2]&&3!==s[t][2])throw new Error(`only removal or move can be applied at original array indices, invalid diff type: ${null===(e=s[t])||void 0===e?void 0:e[2]}`);a.push(Number.parseInt(n.slice(1),10))}else{const t=n;1===s[t].length?l.push({index:Number.parseInt(t,10),value:s[t][0]}):c.push({index:Number.parseInt(t,10),delta:s[t]})}for(a=a.sort(si.numerically),n=a.length-1;n>=0;n--){if(o=a[n],void 0===o)continue;const t=s[`_${o}`],e=r.splice(o,1)[0];3===(null==t?void 0:t[2])&&l.push({index:t[1],value:e})}l=l.sort(si.numericallyBy("index"));const h=l.length;for(n=0;n<h;n++){const t=l[n];void 0!==t&&r.splice(t.index,0,t.value)}const u=c.length;if(u>0)for(n=0;n<u;n++){const e=c[n];if(void 0===e)continue;const i=new Ge(r[e.index],e.delta);t.push(i,e.index)}t.children?t.exit():t.setResult(r).exit()};ri.filterName="arrays";const ai=function(t){if(!t||!t.children)return;if("a"!==t.delta._t)return;const e=t.left,i=t.children.length;for(let n=0;n<i;n++){const i=t.children[n];if(void 0===i)continue;e[i.childName]=i.result}t.setResult(e).exit()};ai.filterName="arraysCollectChildren";const li=function(t){if(!t.nested){const e=t.delta;if(3===e[2]){const i=e;t.newName=`_${i[1]}`,t.setResult([i[0],Number.parseInt(t.childName.substring(1),10),3]).exit()}return}const e=t.delta;if("a"!==e._t)return;const i=e;for(const e in i){if("_t"===e)continue;const n=new Ke(i[e]);t.push(n,e)}t.exit()};li.filterName="arrays";const ci=(t,e,i)=>{if("string"==typeof e&&"_"===e[0])return Number.parseInt(e.substring(1),10);if(Array.isArray(i)&&0===i[2])return`_${e}`;let n=+e;for(const i in t){const o=t[i];if(Array.isArray(o))if(3===o[2]){const t=Number.parseInt(i.substring(1),10),s=o[1];if(s===+e)return t;t<=n&&s>n?n++:t>=n&&s<n&&n--}else if(0===o[2]){Number.parseInt(i.substring(1),10)<=n&&n++}else 1===o.length&&Number.parseInt(i,10)<=n&&n--}return n},hi=t=>{if(!t||!t.children)return;const e=t.delta;if("a"!==e._t)return;const i=e,n=t.children.length,o={_t:"a"};for(let e=0;e<n;e++){const n=t.children[e];if(void 0===n)continue;let s=n.newName;if(void 0===s){if(void 0===n.childName)throw new Error("child.childName is undefined");s=ci(i,n.childName,n.result)}o[s]!==n.result&&(o[s]=n.result)}t.setResult(o).exit()};hi.filterName="arraysCollectChildren";const ui=function(t){t.left instanceof Date?(t.right instanceof Date?t.left.getTime()!==t.right.getTime()?t.setResult([t.left,t.right]):t.setResult(void 0):t.setResult([t.left,t.right]),t.exit()):t.right instanceof Date&&t.setResult([t.left,t.right]).exit()};ui.filterName="dates";const di=t=>{if(!t||!t.children)return;const e=t.children.length;let i=t.result;for(let n=0;n<e;n++){const e=t.children[n];if(void 0!==e&&void 0!==e.result){if(i=i||{},void 0===e.childName)throw new Error("diff child.childName is undefined");i[e.childName]=e.result}}i&&t.leftIsArray&&(i._t="a"),t.setResult(i).exit()};di.filterName="collectChildren";const fi=t=>{var e;if(t.leftIsArray||"object"!==t.leftType)return;const i=t.left,n=t.right,o=null===(e=t.options)||void 0===e?void 0:e.propertyFilter;for(const e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;if(o&&!o(e,t))continue;const s=new Ue(i[e],n[e]);t.push(s,e)}for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&(!o||o(e,t))&&void 0===i[e]){const i=new Ue(void 0,n[e]);t.push(i,e)}t.children&&0!==t.children.length?t.exit():t.setResult(void 0).exit()};fi.filterName="objects";const pi=function(t){if(!t.nested)return;const e=t.delta;if(e._t)return;const i=e;for(const e in i){const n=new Ge(t.left[e],i[e]);t.push(n,e)}t.exit()};pi.filterName="objects";const mi=function(t){if(!t||!t.children)return;if(t.delta._t)return;const e=t.left,i=t.children.length;for(let n=0;n<i;n++){const i=t.children[n];if(void 0===i)continue;const o=i.childName;Object.prototype.hasOwnProperty.call(t.left,o)&&void 0===i.result?delete e[o]:e[o]!==i.result&&(e[o]=i.result)}t.setResult(e).exit()};mi.filterName="collectChildren";const gi=function(t){if(!t.nested)return;if(t.delta._t)return;const e=t.delta;for(const i in e){const n=new Ke(e[i]);t.push(n,i)}t.exit()};gi.filterName="objects";const vi=t=>{if(!t||!t.children)return;if(t.delta._t)return;const e=t.children.length,i={};for(let n=0;n<e;n++){const e=t.children[n];if(void 0===e)continue;const o=e.childName;i[o]!==e.result&&(i[o]=e.result)}t.setResult(i).exit()};vi.filterName="collectChildren";let yi=null;function Oi(t,e){var i;if(!yi){let n;if(!(null===(i=null==t?void 0:t.textDiff)||void 0===i?void 0:i.diffMatchPatch)){if(!e)return null;const t=new Error("The diff-match-patch library was not provided. Pass the library in through the options or use the `jsondiffpatch/with-text-diffs` entry-point.");throw t.diff_match_patch_not_found=!0,t}n=new t.textDiff.diffMatchPatch,yi={diff:(t,e)=>n.patch_toText(n.patch_make(t,e)),patch:(t,e)=>{const i=n.patch_apply(n.patch_fromText(e),t);for(const t of i[1])if(!t){const t=new Error("text patch failed");throw t.textPatchFailed=!0,t}return i[0]}}}return yi}const bi=function(t){var e,i;if("string"!==t.leftType)return;const n=t.left,o=t.right,s=(null===(i=null===(e=t.options)||void 0===e?void 0:e.textDiff)||void 0===i?void 0:i.minLength)||60;if(n.length<s||o.length<s)return void t.setResult([n,o]).exit();const r=Oi(t.options);if(!r)return void t.setResult([n,o]).exit();const a=r.diff;t.setResult([a(n,o),0,2]).exit()};bi.filterName="texts";const xi=function(t){if(t.nested)return;const e=t.delta;if(2!==e[2])return;const i=e,n=Oi(t.options,!0).patch;t.setResult(n(t.left,i[0])).exit()};xi.filterName="texts";const wi=t=>{var e,i,n;const o=/^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/,s=t.split("\n");for(let t=0;t<s.length;t++){const r=s[t];if(void 0===r)continue;const a=r.slice(0,1);if("@"===a){const e=o.exec(r);if(null!==e){s[t]=`@@ -${e[3]},${e[4]} +${e[1]},${e[2]} @@`}}else if("+"===a){if(s[t]=`-${null===(e=s[t])||void 0===e?void 0:e.slice(1)}`,"+"===(null===(i=s[t-1])||void 0===i?void 0:i.slice(0,1))){const e=s[t];s[t]=s[t-1],s[t-1]=e}}else"-"===a&&(s[t]=`+${null===(n=s[t])||void 0===n?void 0:n.slice(1)}`)}return s.join("\n")},_i=function(t){if(t.nested)return;const e=t.delta;if(2!==e[2])return;const i=e;t.setResult([wi(i[0]),0,2]).exit()};_i.filterName="texts";const Si=function(t){if(t.left!==t.right)if(void 0!==t.left)if(void 0!==t.right){if("function"==typeof t.left||"function"==typeof t.right)throw new Error("functions are not supported");t.leftType=null===t.left?"null":typeof t.left,t.rightType=null===t.right?"null":typeof t.right,t.leftType===t.rightType&&"boolean"!==t.leftType&&"number"!==t.leftType?("object"===t.leftType&&(t.leftIsArray=Array.isArray(t.left)),"object"===t.rightType&&(t.rightIsArray=Array.isArray(t.right)),t.leftIsArray===t.rightIsArray?t.left instanceof RegExp&&(t.right instanceof RegExp?t.setResult([t.left.toString(),t.right.toString()]).exit():t.setResult([t.left,t.right]).exit()):t.setResult([t.left,t.right]).exit()):t.setResult([t.left,t.right]).exit()}else t.setResult([t.left,0,0]).exit();else{if("function"==typeof t.right)throw new Error("functions are not supported");t.setResult([t.right]).exit()}else t.setResult(void 0).exit()};Si.filterName="trivial";const ki=function(t){if(void 0===t.delta)return void t.setResult(t.left).exit();if(t.nested=!Array.isArray(t.delta),t.nested)return;const e=t.delta;if(1!==e.length)if(2!==e.length)3===e.length&&0===e[2]&&t.setResult(void 0).exit();else{if(t.left instanceof RegExp){const i=/^\/(.*)\/([gimyu]+)$/.exec(e[1]);if(null==i?void 0:i[1])return void t.setResult(new RegExp(i[1],i[2])).exit()}t.setResult(e[1]).exit()}else t.setResult(e[0]).exit()};ki.filterName="trivial";const $i=function(t){if(void 0===t.delta)return void t.setResult(t.delta).exit();if(t.nested=!Array.isArray(t.delta),t.nested)return;const e=t.delta;1!==e.length?2!==e.length?3===e.length&&0===e[2]&&t.setResult([e[0]]).exit():t.setResult([e[1],e[0]]).exit():t.setResult([e[0],0,0]).exit()};$i.filterName="trivial";const Ti=class{constructor(t){this.processor=new ti(t),this.processor.pipe(new Je("diff").append(di,Si,ui,bi,fi,oi).shouldHaveResult()),this.processor.pipe(new Je("patch").append(mi,ai,ki,xi,pi,ri).shouldHaveResult()),this.processor.pipe(new Je("reverse").append(vi,hi,$i,_i,gi,li).shouldHaveResult())}options(t){return this.processor.options(t)}diff(t,e){return this.processor.process(new Ue(t,e))}patch(t,e){return this.processor.process(new Ge(t,e))}reverse(t){return this.processor.process(new Ke(t))}unpatch(t,e){return this.patch(t,this.reverse(e))}clone(t){return He(t)}};let Ci;function Pi(t,e){return Ci||(Ci=new Ti),Ci.diff(t,e)}function Ei(t,e){return t.id<e.id?-1:t.id>e.id?1:0}function Ai({text:t,denotations:e=[],attributes:i=[],relations:n=[],blocks:o=[],selectedText:s}){return{text:t,denotations:e.sort(Ei),attributes:i.sort(Ei),relations:n.sort(Ei),blocks:o.sort(Ei),selectedText:s}}function Mi(t,e){return Pi(Ai(t),Ai(e))}function Qi(){return/Android/.test(navigator.userAgent)}const Di=Object.freeze({QUERY_PARAMETER:"parameter",INLINE:"inline",REMOTE_URL:"remote",INSTANT:"instant",LOCAL_FILE:"local file",UNKNOWN:"unknown"});class Ri{#je;#T;#ze;static createURLSource(t,e){return console.assert("string"==typeof t,"id must be a string when type is url."),new Ri(Di.REMOTE_URL,t,e)}static createFileSource(t,e){return console.assert("string"==typeof t,"id must be a string when type is local file."),new Ri(Di.LOCAL_FILE,t,e)}static createInstantSource(t){return new Ri(Di.INSTANT,null,t)}static createInlineSource(t){return new Ri(Di.INLINE,null,t)}static createParameterSource(t){return new Ri(Di.QUERY_PARAMETER,null,t)}constructor(t,e,i){console.assert(Object.values(Di).includes(t),`type must be a member of RESOURCE_TYPE. type: ${t}`),t===Di.REMOTE_URL||t===Di.LOCAL_FILE?console.assert("string"==typeof e,"id must be a string when type is url or local file."):console.assert(null===e,"id must be null when type is not url."),this.#je=t,this.#T=e,this.#ze=i}get resourceType(){return this.#je}get id(){return this.#T}get data(){return this.#ze}get displayName(){switch(this.#je){case Di.REMOTE_URL:return new URL(this.#T,location.href).href;case Di.LOCAL_FILE:return`${this.#T}(local file)`;default:return`${this.#je}`}}}function Ii(t,e){return!!e.text&&(t.emit("textae-event.resource.annotation.load.success",Ri.createInstantSource(e)),!0)}function Li(t){return t.length?st`
211
+ <table>
212
+ <caption>Denotations or Blocks or Typesettings with boundary-cross.</caption>
213
+ <thead>
214
+ <tr>
215
+ <th class="id">id</th>
216
+ <th class="sourceProperty">source property</th>
217
+ <th class="range">begin</th>
218
+ <th class="range">end</th>
219
+ <th>style/obj</th>
220
+ </tr>
221
+ </thead>
222
+ <tbody>
223
+ ${t.map(({id:t,sourceProperty:e,span:i,style:n,obj:o})=>function(t,e,i,n,o){return()=>st`
224
+ <tr>
225
+ <td>${t||""}</td>
226
+ <td>${e}</td>
227
+ <td class="alert">${i.begin}</td>
228
+ <td class="alert">${i.end}</td>
229
+ <td>${n||o}</td>
230
+ </tr>
231
+ `}(t,e,i,n,o))}
232
+ </tbody>
233
+ </table>
234
+ `:""}function Ni(t){return t.length?st`
235
+ <table>
236
+ <caption>Duplicated attributes.</caption>
237
+ <thead>
238
+ <tr>
239
+ <th class="id">id</th>
240
+ <th class="referencedItem">subj</th>
241
+ <th>pred</th>
242
+ <th class="referencedItem">obj</th>
243
+ </tr>
244
+ </thead>
245
+ <tbody>
246
+ ${t.map(({id:t,subj:e,pred:i,obj:n})=>function(t,e,i,n){return()=>st`
247
+ <tr>
248
+ <td>${t||""}</td>
249
+ <td class="alert">${e}</td>
250
+ <td>${i}</td>
251
+ <td class="alert">${n}</td>
252
+ </tr>
253
+ `}(t,e,i,n))}
254
+ </tbody>
255
+ </table>
256
+ `:""}function ji(t){return t.length?st`
257
+ <table>
258
+ <caption>Duplicated IDs in Denotations and Blocks.</caption>
259
+ <thead>
260
+ <tr>
261
+ <th class="id">id</th>
262
+ <th class="sourceProperty">source property</th>
263
+ <th class="range">begin</th>
264
+ <th class="range">end</th>
265
+ <th>obj</th>
266
+ </tr>
267
+ </thead>
268
+ <tbody>
269
+ ${t.map(({id:t,sourceProperty:e,span:i,obj:n})=>function(t,e,i,n){return()=>st`
270
+ <tr>
271
+ <td>${t||""}</td>
272
+ <td>${e}</td>
273
+ <td class="alert">${i.begin}</td>
274
+ <td class="alert">${i.end}</td>
275
+ <td>${n}</td>
276
+ </tr>
277
+ `}(t,e,i,n))}
278
+ </tbody>
279
+ </table>
280
+ `:""}function zi(t){return t.length?st`
281
+ <table>
282
+ <caption>Duplicated range blocks.</caption>
283
+ <thead>
284
+ <tr>
285
+ <th class="id">id</th>
286
+ <th class="range">begin</th>
287
+ <th class="range">end</th>
288
+ <th>obj</th>
289
+ </tr>
290
+ </thead>
291
+ <tbody>
292
+ ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>st`
293
+ <tr>
294
+ <td>${t||""}</td>
295
+ <td class="alert">${e.begin}</td>
296
+ <td class="alert">${e.end}</td>
297
+ <td>${i}</td>
298
+ </tr>
299
+ `}(t,e,i))}
300
+ </tbody>
301
+ </table>
302
+ `:""}function Bi(t){return t.length?st`
303
+ <table>
304
+ <caption>Out of text blocks.</caption>
305
+ <thead>
306
+ <tr>
307
+ <th class="id">id</th>
308
+ <th class="range">begin</th>
309
+ <th class="range">end</th>
310
+ <th>obj</th>
311
+ </tr>
312
+ </thead>
313
+ <tbody>
314
+ ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>st`
315
+ <tr>
316
+ <td>${t||""}</td>
317
+ <td class="alert">${e.begin}</td>
318
+ <td class="alert">${e.end}</td>
319
+ <td>${i}</td>
320
+ </tr>
321
+ `}(t,e,i))}
322
+ </tbody>
323
+ </table>
324
+ `:""}function Zi(t){return t.length?st`
325
+ <table>
326
+ <caption>Out of text denotations.</caption>
327
+ <thead>
328
+ <tr>
329
+ <th class="id">id</th>
330
+ <th class="range">begin</th>
331
+ <th class="range">end</th>
332
+ <th>obj</th>
333
+ </tr>
334
+ </thead>
335
+ <tbody>
336
+ ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>st`
337
+ <tr>
338
+ <td>${t||""}</td>
339
+ <td class="alert">${e.begin}</td>
340
+ <td class="alert">${e.end}</td>
341
+ <td>${i}</td>
342
+ </tr>
343
+ `}(t,e,i))}
344
+ </tbody>
345
+ </table>`:""}function Wi(t){return t.length?st`
346
+ <table>
347
+ <caption>Out of text typesettings.</caption>
348
+ <thead>
349
+ <tr>
350
+ <th class="id">id</th>
351
+ <th class="range">begin</th>
352
+ <th class="range">end</th>
353
+ <th>style</th>
354
+ </tr>
355
+ </thead>
356
+ <tbody>
357
+ ${t.map(({id:t,span:e,style:i})=>function(t,e,i){return()=>st`
358
+ <tr>
359
+ <td>${t||""}</td>
360
+ <td class="alert">${e.begin}</td>
361
+ <td class="alert">${e.end}</td>
362
+ <td>${i}</td>
363
+ </tr>
364
+ `}(t,e,i))}
365
+ </tbody>
366
+ </table>
367
+ `:""}function Fi(t){return t.length?st`
368
+ <table>
369
+ <caption>Referenced entities do not exist.</caption>
370
+ <thead>
371
+ <tr>
372
+ <th class="id">id</th>
373
+ <th class="sourceProperty">source property</th>
374
+ <th class="referencedItem">subj</th>
375
+ <th>pred</th>
376
+ <th class="referencedItem">obj</th>
377
+ </tr>
378
+ </thead>
379
+ <tbody>
380
+ ${t.map(({id:t,sourceProperty:e,alertSubj:i,subj:n,pred:o,alertObj:s,obj:r})=>function(t,e,i,n,o,s,r){return()=>st`
381
+ <tr>
382
+ <td>${t||""}</td>
383
+ <td>${e}</td>
384
+ <td${i?' class="alert"':""}>${n}</td>
385
+ <td>${o}</td>
386
+ <td${s?' class="alert"':""}>${r}</td>
387
+ </tr>
388
+ `}(t,e,i,n,o,s,r))}
389
+ </tbody>
390
+ </table>
391
+ `:""}function Xi(t){return t.length?st`
392
+ <table>
393
+ <caption>Wrong range blocks.</caption>
394
+ <thead>
395
+ <tr>
396
+ <th class="id">id</th>
397
+ <th class="range">begin</th>
398
+ <th class="range">end</th>
399
+ <th>obj</th>
400
+ </tr>
401
+ </thead>
402
+ <tbody>
403
+ ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>st`
404
+ <tr>
405
+ <td>${t||""}</td>
406
+ <td class="alert">${e.begin}</td>
407
+ <td class="alert">${e.end}</td>
408
+ <td>${i}</td>
409
+ </tr>
410
+ `}(t,e,i))}
411
+ </tbody>
412
+ </table>
413
+ `:""}function qi(t){return t.length?st`
414
+ <table>
415
+ <caption>Wrong range denotations.</caption>
416
+ <thead>
417
+ <tr>
418
+ <th class="id">id</th>
419
+ <th class="range">begin</th>
420
+ <th class="range">end</th>
421
+ <th>obj</th>
422
+ </tr>
423
+ </thead>
424
+ <tbody>
425
+ ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>st`
426
+ <tr>
427
+ <td>${t||""}</td>
428
+ <td class="alert">${e.begin}</td>
429
+ <td class="alert">${e.end}</td>
430
+ <td>${i}</td>
431
+ </tr>
432
+ `}(t,e,i))}
433
+ </tbody>
434
+ </table>`:""}class Hi extends p{constructor(t){const e=t.map(({name:t,wrongRangeDenotations:e,outOfTextDenotations:i,wrongRangeBlocks:n,outOfTextBlocks:o,duplicatedRangeBlocks:s,wrongRangeTypesettings:r,outOfTextTypesettings:a,duplicatedIDs:l,boundaryCrossingSpans:c,referencedEntitiesDoNotExist:h,duplicatedAttributes:u},d)=>`\n ${1===d?'\n <div class="textae-editor__validate-dialog__content">\n <h1>Track annotations will be merged to the root annotations.</h1>\n </div>':""}\n <div class="textae-editor__validate-dialog__content">\n <h2>${t}</h2>\n ${qi(e)}\n ${Zi(i)}\n ${Xi(n)}\n ${Bi(o)}\n ${zi(s)}\n ${function(t){return t.length?`\n <table>\n <caption>Wrong range typesettings.</caption>\n <thead>\n <tr>\n <th class="id">id</th>\n <th class="range">begin</th>\n <th class="range">end</th>\n <th>style</th>\n </tr>\n </thead>\n <tbody>\n ${t.map(({id:t,span:e,style:i})=>`\n <tr>\n <td>${t||""}</td>\n <td class="alert">${e.begin}</td>\n <td class="alert">${e.end}</td>\n <td>${i}</td>\n </tr>\n `).join("\n")}\n </tbody>\n </table>\n `:""}(r)}\n ${Wi(a)}\n ${ji(l)}\n ${Li(c)}\n ${Fi(h)}\n ${Ni(u)}\n </div>\n `).join("\n");super("The following erroneous annotations ignored",e,{maxWidth:900})}}class Vi{#x;#G;#Be;constructor(t,e,i){this.#x=t,this.#G=e,this.#Be=i.getInstanceContainerFor(e)}add(t){const e=this.#Be.get(t);console.assert(e,`${t} is not a instance of ${this.#G}.`),e.isSelected||(e.select(),this.triggerChange())}has(t){const e=this.#Be.get(t);return!!e&&e.isSelected}contains(t){for(const e of this.#Be.selectedItems)if(t(e))return!0;return!1}get all(){return this.#Be.selectedItems}get size(){return this.#Be.selectedItems.length}get some(){return this.size>0}get singleId(){const t=this.single;return t?t.id:null}get single(){return 1===this.size?this.#Be.selectedItems[0]:null}toggle(t){this.has(t)?this.remove(t):this.add(t)}remove(t){this.has(t)&&(this.#Be.get(t).deselect(),this.triggerChange())}removeInstance(t){this.remove(t.id)}removeAll(){if(0!==this.size){for(const t of this.all)t.deselect();this.triggerChange()}}triggerChange(){this.#x.emit(`textae-event.selection.${this.#G}.change`)}}class Yi extends Vi{selectedWithAttributeOf(t){return this.all.some(e=>e.attributes.some(e=>e.pred===t))}onlySelectedWithJustOneAttributeOf(t){return this.all.every(e=>1===e.attributes.filter(e=>e.pred===t).length)}selectedWithoutAttributeOf(t){return this.all.some(e=>!e.attributes.some(e=>e.pred===t))}isDuplicatedPredAttributeSelected(t){return this.all.some(e=>e.attributes.filter(e=>e.pred===t).length>1)}findSelectedWithSamePredicateAttribute(t){return this.all.find(e=>e.attributes.find(e=>e.pred===t))}findSelectedAttributeWithSamePredicate(t){const e=this.findSelectedWithSamePredicateAttribute(t);if(e)return e.attributes.find(e=>e.pred===t)}}class Ui{#W;#l;constructor(t,e){this.#l=t,this.#W=e,this.span=new Vi(t,"span",e),this.entity=new Yi(t,"entity",e),this.relation=new Yi(t,"relation",e),t.on("textae-event.annotation-data.span.remove",t=>this.span.removeInstance(t)).on("textae-event.annotation-data.entity.remove",t=>this.entity.removeInstance(t)).on("textae-event.annotation-data.relation.remove",t=>this.relation.removeInstance(t)).on("textae-event.annotation-data.all.change",()=>{this.span.triggerChange(),this.entity.triggerChange(),this.relation.triggerChange()})}get copyingTargets(){return[...this.#Ze].map(({typeValues:t})=>t)}get cuttingTargets(){return this.#Ze}add(t,e){console.assert(this[t]);for(const i of e)this[t].add(i);"entity"===t&&this.#We(e[e.length-1])&&this.#l.emit("textae-event.selection-model.last-selected-denotation-id.change",e[e.length-1])}remove(t,e){console.assert(this[t]),this[t].remove(e)}removeAll(){this.span.removeAll(),this.entity.removeAll(),this.relation.removeAll()}selectSpan(t){this.removeAll(),this.span.add(t)}selectSpanRange(t){this.removeAll();for(const e of t)this.span.add(e)}selectEntity(t){this.removeAll(),this.entity.add(t),this.#We(t)&&this.#l.emit("textae-event.selection-model.last-selected-denotation-id.change",t)}selectDenotation(t){if(!this.#We(t))throw new Error(`Denotation ${t} not found`);this.selectEntity(t)}selectRelation(t){this.removeAll(),this.relation.add(t)}get#Ze(){return new Set(this.span.all.map(t=>t.entities).flat().concat(this.entity.all))}#We(t){return this.#W.entityInstanceContainer.hasDenotation(t)}}const Gi=class{#Fe;#Xe;#E;#T;constructor(t,e,i,n=null){this.#Fe=t,this.#Xe=e,this.#E=i,this.#T=n}get beginPos(){return this.#Fe}get endPos(){return this.#Xe}get obj(){return this.#E}get id(){return this.#T}get span(){return{begin:this.#Fe,end:this.#Xe}}toObject(){const t={span:this.span,obj:this.#E};return this.#T&&(t.id=this.#T),t}isNestedWithin(t){return t.beginPos<=this.#Fe&&this.#Xe<=t.endPos}get isPositionNotInteger(){return!(Number.isInteger(this.#Fe)&&Number.isInteger(this.endPos))}get isPositionNegative(){return this.#Fe<0||this.#Xe<0}get isPositionInvalid(){return this.#Fe>this.#Xe}isOutOfBounds(t){return this.#Fe>=t||this.#Xe>t}isBoundaryCrossing(t){const e=this.#Fe>t.beginPos&&this.#Fe<t.endPos,i=this.#Xe>t.beginPos&&this.#Xe<t.endPos;return e||i}};const Ki=class{validateDenotations(t,e){let i=this.#qe(t);return i=this.#He(i),i=this.#Ve(i),i=this.#Ye(i),i=this.#Ue(i,e),i=this.#Ge(i),this.#Ke(i)}#qe(t){const e=new Set;return t.filter(t=>{const i=JSON.stringify(t.span);return!e.has(i)&&(e.add(i),!0)})}#He(t){return t.filter(t=>!t.isPositionNotInteger)}#Ve(t){return t.filter(t=>!t.isPositionNegative)}#Ye(t){return t.filter(t=>!t.isPositionInvalid)}#Ue(t,e){return t.filter(t=>!t.isOutOfBounds(e))}#Ge(t){const e=t.sort((t,e)=>t.beginPos===e.beginPos?e.endPos-t.endPos:t.beginPos-e.beginPos),i=[];return e.forEach(t=>{i.some(e=>t.isNestedWithin(e))||i.push(t)}),i}#Ke(t){return t.filter(e=>!t.some(t=>e!==t&&e.isBoundaryCrossing(t)))}};class Ji extends Error{constructor(t){super(t),this.name=this.constructor.name}}const tn=Ji;const en=class{validateRelations(t){return this.#Je(t)}#Je(t){return t.filter(t=>t.subj&&t.pred&&t.obj)}};const nn=class{constructor(t){this.source=Object.freeze({...t}),this.denotations=this.#ti(t.denotations||[]),this.config=this.source.config}generate(){const t=this.source.text;if(!t)throw new tn('The "text" key is missing.');const e=(new Ki).validateDenotations(this.denotations,t.length),i=(new en).validateRelations(this.source.relations||[]);return[this.#ei(t,e,i),this.#ii()].filter(Boolean).join("\n\n")}#ti(t){return t.map(t=>new Gi(t.span.begin,t.span.end,t.obj,t.id||null))}#ei(t,e,i){return e.sort((t,e)=>e.beginPos-t.beginPos).forEach(e=>{const n=e.beginPos,o=e.endPos,s=e.id?this.#ni(e,i):this.#oi(e.obj),r=`[${t.slice(n,o)}][${s}]`;t=t.slice(0,n)+r+t.slice(o)}),t}#ii(){const t=this.#si();return t&&0!==t.length?t.map(t=>`[${t.label}]: ${t.id}`).join("\n"):null}#si(){return this.config&&this.config["entity types"]?.filter(t=>t.hasOwnProperty("label"))||null}#ni(t,e){const i=e.find(e=>e.subj===t.id)||null,n=[t.id,t.obj,i?.pred,i?.obj];if(!this.#si())return n.filter(t=>null!=t).join(", ");n[1]=this.#oi(t.obj);this.#si().find(e=>e.id===t.obj);return n.filter(t=>null!=t).join(", ")}#oi(t){if(!this.#si())return t;const e=this.#si().find(e=>e.id===t);return e?e.label:t}},on=/^\s*\[([^\]]+)\]:\s+(\S+)(?:\s+(?:"[^"]*"|'[^']*'))?\s*$/,sn=new RegExp(`(?:\\A|\\n\\s*\\n)((?:${on.source}(?:\\n|$))+)`,"gm");const rn=class{#ri;#ai=null;constructor(t){this.#ri=t}get(t){return this.#li[t]}get config(){return Object.entries(this.#li).map(([t,e])=>({id:e,label:t}))}get#li(){return this.#ai||(this.#ai=this.#ci()),this.#ai}#ci(){const t={},e=Array.from(this.#ri.matchAll(sn));for(const i of e)this.#hi(i,t);return t}#hi(t,e){const i=t[0].split("\n");for(const t of i)this.#ui(t,e)}#ui(t,e){const i=t.trim().match(on);if(!i)return;const[n,o,s]=i;o!==s&&(e[o]||(e[o]=s))}},an=new RegExp(`(?:\\A|\\n\\s*\\n)((?:${/^\s*\[([^\]]+)\]:\s+(\S+)(?:\s+(?:"[^"]*"|'[^']*'))?\s*$/.source}(?:\\n|$))+)`,"gm"),ln=/(?<!\\)\[([^\[]+?)\]\[([^\]]+?)\]/;const cn=class{#ri;#ue;#di;#fi;constructor(t){this.#ri=t,this.#di=new rn(t)}parse(){this.#ue=[],this.#fi=[];let t=this.#pi();return t=this.#mi(t),new un(t,this.#ue,this.#fi,this.#di)}#pi(){return this.#ri.replace(an,t=>t.startsWith("\n\n")?"\n\n":"").trim()}#gi(t){return this.#di.get(t)||t}#mi(t){const e=new RegExp(ln,"g");let i;for(;null!==(i=e.exec(t));){const n=i[1],o=i.index,s=o+n.length,r=i[2].split(", ");switch(r.length){case 1:this.#vi(o,s,r[0]);break;case 2:this.#yi(o,s,r);break;case 4:this.#Oi(o,s,r);break;default:e.lastIndex=i.index+i[0].length;continue}t=t.slice(0,i.index)+n+t.slice(i.index+i[0].length),e.lastIndex=s}return t}#vi(t,e,i){const n=this.#gi(i);this.#ue.push(new Gi(t,e,n))}#yi(t,e,i){const[n,o]=i,s=this.#gi(o);this.#ue.push(new Gi(t,e,s,n))}#Oi(t,e,i){const[n,o,s,r]=i,a=this.#gi(o);this.#ue.push(new Gi(t,e,a,n)),this.#fi.push({pred:s,subj:n,obj:r})}},hn=/\\(?=\[[^\]]+\]\[[^\]]+\])/;const un=class{#O;#ue;#fi;#di;constructor(t,e,i,n){this.#O=t,this.#ue=e,this.#fi=i,this.#di=n}static parse(t){return new cn(t).parse().toObject()}static generate(t){return new nn(t).generate()}toObject(){const t={text:this.#bi(this.#O),denotations:this.#ue.map(t=>t.toObject())};this.#fi&&this.#fi.length>0&&(t.relations=this.#fi);const e=this.#xi();return e&&Object.keys(e).length>0&&!Object.values(e).every(t=>null==t||Array.isArray(t)&&0===t.length)&&(t.config=e),t}#bi(t){let e=this.#wi(t);return this.#_i(e)}#wi(t){return t.replace(hn,"")}#_i(t){return t.replace(/\n{2,}/g,"\n\n")}#xi(){return this.#di&&0!==this.#di.length?{"entity types":this.#di.config}:null}};function dn(t){if("string"!=typeof t)return!1;try{JSON.parse(t)}catch(t){return!1}return!0}class fn{#Si;#ki;constructor(t,e,i){if(i)this.#Si=i;else if(e)this.#ki=e;else{const e=this.#$i(t);e&&(this.#Si=e)}}get isLoaded(){return Boolean(this.#Si)}get isRemote(){return Boolean(this.#ki)}get URL(){return this.#ki}annotation(){try{return dn(this.#Si)?JSON.parse(this.#Si):un.parse(this.#Si)}catch{return null}}#$i(t){const e=t.textContent;return t.innerHTML="",e}}class pn{#rt;#Ti;constructor(t){this.#rt=t,this.#Ti=new fn(this.#rt,this.#ki,this.#Ci)}get resourceType(){return this.#Ci?Di.QUERY_PARAMETER:this.#Ti.isLoaded?Di.INLINE:this.annotationURL?Di.REMOTE_URL:Di.UNKNOWN}get annotationURL(){return this.#Ti.isRemote?this.#Ti.URL:null}get config(){return this.#Pi("config")}get configLock(){if(this.#ki){const t=new URLSearchParams(this.#ki.split("?")[1]);if(t.has("config_lock"))return t.get("config_lock")}return this.#Ei("config_lock")}get control(){return this.#Ei("control")}get inspect(){return this.#Ei("inspect")}get isEditMode(){switch(this.#Ei("mode")){case"edit":case"term-edit":case"block-edit":case"relation-edit":case"text-edit":return!0;default:return!1}}get isEditTermMode(){return"edit"===this.#Ei("mode")||"term-edit"===this.#Ei("mode")}get isEditBlockMode(){return"block-edit"===this.#Ei("mode")}get isEditRelationMode(){return"relation-edit"===this.#Ei("mode")}get isTextEditMode(){return"text-edit"===this.#Ei("mode")}get statusBar(){return this.#Ei("status_bar")}get saveTo(){return this.#Pi("save_to")}get isFocusFirstDenotation(){const t="true"===this.#Ei("focus_first_denotation");if(t&&this.isEditMode)throw new Error("focus_first_denotation is only available in view mode.");return t}get additionalPaddingTop(){return this.#Ei("padding_top")?parseInt(this.#Ei("padding_top"),10):0}get#ki(){return this.#Pi("source")||this.#Pi("target")}annotation(){return this.#Ti.isLoaded?this.#Ti.annotation():null}#Ei(t){return this.#rt.hasAttribute(t)?this.#rt.getAttribute(t):null}#Pi(t){return this.#rt.hasAttribute(t)?decodeURIComponent(this.#rt.getAttribute(t)):null}get#Ci(){if(this.#Ai)return null;const t=new URLSearchParams(window.location.search);return t.has("annotation")?decodeURIComponent(t.get("annotation")):null}get#Ai(){return Boolean(this.#rt.getAttribute("ignore_annotation_parameter"))}}const mn="Init",gn="View",vn="Term",yn="Block",On="Relation",bn="Text";class xn{#l;#Mi;#W;#Qi=new(Ne())(!1);constructor(t,e,i){this.#l=t,this.#Mi=e,this.#W=i,t.on("textae-event.resource.annotation.save",()=>{this.#Qi.set(!1),this.#Di()}).on("textae-event.annotation-data.all.change",()=>{this.#Qi.set(!1),this.#Di()}).on("textae-event.annotation-data.span.add",()=>this.#Ri()).on("textae-event.annotation-data.span.change",()=>this.#Ri()).on("textae-event.annotation-data.span.remove",()=>this.#Ri()).on("textae-event.annotation-data.entity.add",()=>this.#Ri()).on("textae-event.annotation-data.entity.change",()=>this.#Ri()).on("textae-event.annotation-data.entity.remove",()=>this.#Ri()).on("textae-event.annotation-data.entity.move",()=>this.#Ri()).on("textae-event.annotation-data.relation.add",()=>this.#Ri()).on("textae-event.annotation-data.relation.change",()=>this.#Ri()).on("textae-event.annotation-data.relation.remove",()=>this.#Ri()).on("textae-event.annotation-data.attribute.add",()=>this.#Ri()).on("textae-event.annotation-data.attribute.remove",()=>this.#Ri()).on("textae-event.annotation-data.text.change",()=>this.#Ri()),this.#Qi(()=>t.emit("textae-event.annotation-data.events-observer.unsaved-change",this.#Qi()))}get hasChange(){return this.#Qi()}#Ri(){this.#Qi.set(Mi(this.#Mi.annotation,this.#W.externalFormat)),this.#Di()}#Di(){this.#l.emit("textae-event.annotation-data.events-observer.change",this.#W)}}function wn(t){return t.map(t=>{const e=[];for(const{type:i,title:n,pushed:o,disabled:s,transit:r}of t){const t=["textae-control-icon",`textae-control-${i.replaceAll(" ","-")}-button`];o&&t.push("textae-control-icon--pushed"),s&&t.push("textae-control-icon--disabled"),r&&t.push("textae-control-icon--transit"),e.push({type:i,title:n,classList:t})}return e})}const _n=new m;class Sn{#r;constructor(t,e){const i=u().create(t);this.#r=i,function(t,e){c()(t,".textae-control-icon","touchstart",({target:t})=>{if(t.classList.contains("textae-control-icon--disabled"))return;const{buttonType:i}=t.dataset;switch(i){case"create span by touch":case"expand span by touch":case"shrink span by touch":case"edit text by touch":e.handle(i)}},{passive:!0}),c()(t,".textae-control-icon","click",({target:t})=>{if(t.classList.contains("textae-control-icon--disabled"))return;const{buttonType:i}=t.dataset;switch(i){case"help":_n.open();break;case"create span by touch":case"expand span by touch":case"shrink span by touch":case"edit text by touch":break;default:e.handle(i)}});const i=t.querySelector(".textae-control-hamburger-menu-button");i&&i.addEventListener("click",t=>t.target.closest(".textae-control").querySelector(".textae-control-details").classList.toggle("textae-control-details--force-show"))}(this.#r,e)}get el(){return this.#r}_querySelector(t){return this.#r.querySelector(t)}}function kn({type:t,title:e,classList:i}){return`<p \n class="${i.join(" ")}" \n data-button-type="${t}">${e}\n </p>`}class $n extends Sn{#Z;#Ii;constructor(t,e,i){super(`<div class="textae-control ${be()?"textae-android-context-menu":"textae-context-menu"}"></div>`,i),this.#Z=t,this.#Ii=e}show(t){const e=window.getSelection(),i=this.#Z.getBoundingClientRect();if(be()&&1===e.rangeCount){const t=e.getRangeAt(0).getBoundingClientRect(),n=this.#Z.querySelector(".textae-editor__text-box").getBoundingClientRect();this.#Li(t.y-i.y,t.x-n.x)}else this.#Ni(t.pageY-i.y,t.pageX-i.x)}hide(){this.#ji&&(super.el.classList.remove("textae-context-menu--show"),super.el.classList.add("textae-context-menu--hide"))}get#ji(){return super.el.classList.contains("textae-context-menu--show")}#Li(t,e){this.#zi();const{height:i}=this.el.getBoundingClientRect();super.el.setAttribute("style",`top: ${t-i}px; left: ${e}px`)}#Ni(t,e){this.#zi(),super.el.setAttribute("style",`top: ${t}px; left: ${e}px`)}#zi(){const t=wn(this.#Ii.contextMenuButton);if(0===t.length)return;const e=`\n <div">\n ${t.map(t=>t.map(kn).join("")).join('<p class="textae-control-separator"></p>\n')}\n </div>\n `;super.el.replaceChildren(...u().create(e).children),super.el.classList.remove("textae-context-menu--hide"),super.el.classList.add("textae-context-menu--show")}}var Tn=i(6438),Cn=i.n(Tn);function Pn(t){switch(t){case vn:return"Term Configuration";case yn:return"Block Configuration";case On:return"Relation Configuration";default:return""}}function En({type:t,title:e,classList:i}){return`\n<span \nclass="${i.join(" ")}" \ntitle="${e}" \ndata-button-type="${t}">\n</span>\n`}function An(t){return`\n<div class="textae-control ${be()?"textae-touch-bar":"textae-control-bar"}">\n <div class="textae-control-summary">\n <span class="textae-control-title">\n <a href="http://textae.pubannotation.org/" target="_blank">TextAE</a>\n </span>\n <button type="button" class="textae-control-hamburger-menu-button" >\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="bi" fill="currentColor" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M2.5 11.5A.5.5 0 0 1 3 11h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 3h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"></path>\n </svg>\n </button>\n </div>\n <div class="textae-control-details ${t.detailModifierClassName}">\n <span class="textae-control-title">\n <a href="http://textae.pubannotation.org/" target="_blank">TextAE</a>\n </span>\n ${wn(t.controlBarButton).map(t=>`\n <span class="textae-control-separator"></span>\n ${t.map(En).join("\n")}\n `).join("\n")}\n </div>\n</div>\n`}class Mn extends Sn{#Ii;constructor(t,e,i){super(An(e),i),this.#Ii=e,be()&&Math.max(document.documentElement.clientWidth,window.innerWidth)<768&&new(Cn())(".textae-touch-bar",{stickyContainer:".textae-editor"}),t.on("textae-event.control.button.push",({name:t})=>{this.#Bi(t,"pushed")}).on("textae-event.control.buttons.change",t=>{for(const e of t)this.#Bi(e,"disabled")}).on("textae-event.annotation-data.events-observer.unsaved-change",()=>{this.#Bi("upload","transit")}).on("textae-event.edit-mode.transition",t=>{const e=Pn(t);super._querySelector(".textae-control-pallet-button").title=e}).on("textae-event.configuration.reset",()=>this.#Zi()).on("textae-event.type-definition.entity.change",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.entity.delete",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.entity.change-default",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.relation.change",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.relation.delete",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.relation.change-default",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.attribute.create",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.attribute.change",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.attribute.delete",()=>this.#Bi("pallet","transit")).on("textae-event.type-definition.attribute.move",()=>this.#Bi("pallet","transit"))}#Bi(t,e){const i=super._querySelector(`.textae-control-${t.replaceAll(" ","-")}-button`);i&&(this.#Ii.getState(t,e)?i.classList.add(`textae-control-icon--${e}`):i.classList.remove(`textae-control-icon--${e}`))}#Zi(){super.el.innerHTML="",super.el.insertAdjacentHTML("beforeend",An(this.#Ii))}}class Qn extends Error{constructor(t){super(t),this.name="FormatConversionError"}}var Dn=i(7975),Rn=i.n(Dn);async function In(t,e){if(function(t,e){const i=Rn().extname(e),n=t.headers.get("Content-Type");return".json"===i||n&&n.includes("application/json")}(t,e))return await t.json();if(function(t,e){const i=Rn().extname(e),n=t.headers.get("Content-Type");return".txt"===i||n&&n.includes("text/plain")}(t,e)){const e=await t.text();return un.parse(e)}throw new Error("The content type of the loaded content is not supported.")}class Ln{#l;constructor(t){this.#l=t}async loadFrom(t){console.assert(t,"url is necessary!"),this.#l.emit("textae-event.resource.startLoad");try{const e=await fetch(t,{method:"GET",cache:"no-cache",credentials:"omit",headers:{Accept:"application/json, text/plain"},signal:AbortSignal.timeout(3e4)});if(e.ok){const i=await In(e,t);this.#Wi(t,i)}else 401===e.status?await this.#Fi(t):this.#Xi(t)}catch(e){e instanceof Qn||console.error(e),this.#Xi(t)}finally{this.#l.emit("textae-event.resource.endLoad")}}#Wi(t,e){const i=Ri.createURLSource(t,e);e&&e.text?(this.#l.emit("textae-event.resource.annotation.load.success",i),this.#l.emit("textae-event.resource.annotation.url.set",i)):this.#l.emit("textae-event.resource.annotation.format.error",i)}async#Fi(t){try{const e=await fetch(t,{method:"GET",cache:"no-cache",credentials:"include",headers:{Accept:"application/json, text/plain"},signal:AbortSignal.timeout(3e4)});if(e.ok){const i=await In(e,t);this.#Wi(t,i)}else 401===e.status?await this.#Fi(t):this.#Xi(t)}catch{this.#Xi(t)}}#Xi(t){n().error(`Could not load the file from the location you specified.: ${t}`),this.#l.emit("textae-event.resource.annotation.load.error",t)}}function Nn(t,e,i){return 401===t&&e&&"ServerPage"===e&&i?i:null}function jn(t){return window.open(t,"_blank","width=600, height=500")}function zn(t){return new Promise(e=>{const i=setInterval(()=>{t.closed&&(clearInterval(i),e())},1e3)})}function Bn(t,e){return"json"===e?JSON.stringify(t):"inline"===e?un.generate(t):void 0}class Zn{#qi;#l;constructor(t,e){this.#qi=t,this.#l=e}async saveTo(t,e){if(t){this.#l.emit("textae-event.resource.startSave");try{const i=Bn(e,this.#qi),n=await this.#Hi(t,i);await this.#Vi(n,t,e)}catch(t){t instanceof Qn||console.error(t),this.#Xi()}finally{this.#l.emit("textae-event.resource.endSave")}}}async#Hi(t,e){const i="json"===this.#qi?"application/json":"text/plain";return fetch(t,{method:"POST",headers:{"Content-Type":i,"App-Name":"TextAE"},body:e,credentials:"include"})}async#Vi(t,e,i){if(t.ok)this.#Yi(i);else if(401===t.status){const n=Nn(t.status,t.headers.get("WWW-Authenticate"),t.headers.get("Location"));n&&await this.#Ui(n,e,i)}else this.#Xi()}#Yi(t){n().success("annotation saved"),this.#l.emit("textae-event.resource.annotation.save",t)}async#Ui(t,e,i){const n=jn(t);if(!n)return this.#Xi();await zn(n),await this.#Gi(i,e)}async#Gi(t,e){const i=Bn(t,this.#qi);(await this.#Hi(e,i)).ok?this.#Yi(t):this.#Xi()}#Xi(){n().error("could not save"),this.#l.emit("textae-event.resource.save.error")}}class Wn{#l;constructor(t){this.#l=t}loadFrom(t,e){console.assert(t,"url is necessary!"),this.#l.emit("textae-event.resource.startLoad"),fetch(t,{method:"GET",cache:"no-cache",credentials:"omit",headers:{Accept:"application/json","Content-Type":"application/json"},signal:AbortSignal.timeout(3e4)}).then(i=>{if(i.ok)return i.json().then(i=>this.#Wi(t,i,e));this.#Xi(t)}).catch(()=>this.#Xi(t)).finally(()=>this.#l.emit("textae-event.resource.endLoad"))}#Wi(t,e,i){this.#l.emit("textae-event.resource.configuration.load.success",Ri.createURLSource(t,e),i)}#Xi(t){n().error(`Could not load the file from the location you specified.: ${t}`),this.#l.emit("textae-event.resource.configuration.load.error",t)}}class Fn{#l;constructor(t){this.#l=t}async saveTo(t,e){console.assert(void 0!==t,"url is required"),this.#l.emit("textae-event.resource.startSave");const i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:"include"};try{const n=await fetch(t,i);if(n.ok)this.#Yi(e);else if(401===n.status){const i=Nn(n.status,n.headers.get("WWW-Authenticate"),n.headers.get("Location"));i&&this.#Ui(i,t,e)}else this.#Xi()}catch{this.#Xi()}finally{this.#l.emit("textae-event.resource.endSave")}}#Yi(t){n().success("configuration saved"),this.#l.emit("textae-event.resource.configuration.save",t)}#Ui(t,e,i){const n=jn(t);return n?zn(n).then(()=>this.#Gi(i,e)):Promise.reject(new Error("failed to open pop-up window"))}#Gi(t,e){const i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"include"};return fetch(e,i).then(e=>{e.ok?this.#Yi(t):this.#Xi()})}#Xi(){n().error("could not save"),this.#l.emit("textae-event.resource.save.error")}}class Xn{#l;constructor(t){this.#l=t}loadAnnotation(t){new Ln(this.#l).loadFrom(t)}loadConfiguration(t,e=null){new Wn(this.#l).loadFrom(t,e)}saveAnnotation(t,e,i){new Zn(i,this.#l).saveTo(t,e)}saveConfiguration(t,e){new Fn(this.#l).saveTo(t,e)}}class qn{#Ii;constructor(t,e,i,n,o){this.#Ii=e;const s=a(()=>i.saveAnnotation(),5e3);t.on("textae-event.resource.annotation.load.success",()=>this.#Ki()).on("textae-event.resource.save.error",()=>this.#Ki()).on("textae-event.resource.annotation.url.set",e=>t.emit("textae-event.annotation-auto-saver.enable",Boolean(n||e.id))).on("textae-event.control.button.push",({name:t,isPushed:e})=>{"upload automatically"===t&&!0===e&&o.hasChange&&i.saveAnnotation()}).on("textae-event.annotation-data.events-observer.unsaved-change",t=>{t&&e.isPushed("upload automatically")&&s()})}#Ki(){this.#Ii.isPushed("upload automatically")&&this.#Ii.toggleButton("upload automatically")}}function Hn(t,e,i,n,o,s,r){i.setPushButtons(e),n.set(e),o.reset(s,e),r.availability=e["function availability"],t.emit("textae-event.configuration.reset")}function Vn(t){return t?JSON.parse(JSON.stringify(t)):{}}function Yn(t){const e=t.reduce((t,e)=>t.has(e)?t.set(e,t.get(e)+1):t.set(e,1),new Map),i=Math.max(...e.values());for(const[t,n]of e.entries())if(n===i)return t}function Un(t){const e=Math.max(...t.map(t=>{const[e,i]=String(t).split(".");return i?i.length:0}));return Number(Array.from(Array(e)).reduce((t,e)=>.1*t,1).toFixed(e))}function Gn(t){if(!0===t)return"flag";if("number"==typeof t)return"numeric";if("string"==typeof t)return"string";throw`${JSON.stringify(t)} is an unexpected value for an Attribute.`}class Kn{constructor({pred:t,obj:e}){this._pred=t,this._objects=[e]}push(t){this._objects.push(t)}get definition(){switch(Gn(this._objects[0])){case"flag":return this._prototype;case"numeric":return this._numericAttribute;case"string":return this._stringAttribute;default:throw new Error(`prototype: ${JSON.stringify(this._prototype)}`)}}get mostFrequentObject(){return Yn(this._objects)}get _prototype(){return{pred:this._pred,"value type":Gn(this._objects[0])}}get _numericAttribute(){return{min:Math.min(...this._objects),max:Math.max(...this._objects),step:Un(this._objects),default:Yn(this._objects),...this._prototype}}get _stringAttribute(){return{default:Yn(this._objects),...this._prototype}}}function Jn(t){return t.reduce((t,e)=>(t.has(e.pred)?t.get(e.pred).push(e.obj):t.set(e.pred,new Kn(e)),t),new Map)}function to(t,e){const i=function(t){return[...Jn(t).values()].map(t=>t.definition)}(e);return function(t,e){for(const i of e){const e=t.findIndex(t=>t.pred===i.pred);-1!==e?t[e]={...i,...t[e]}:t.push(i)}return t}(t,i)}class eo{constructor(t=[],e=[]){this._annotations=e,this._config=t}get configuration(){let t=to(this._config,this._annotations);return t=function(t){t=Vn(t);for(const e of t.filter(t=>"numeric"===t["value type"]))Object.prototype.hasOwnProperty.call(e,"default")||(e.default=0),Object.prototype.hasOwnProperty.call(e,"step")||(e.step=2);return t}(t),t=function(t,e){t=Vn(t);const i=Jn(e);for(const e of function(t){return t.filter(t=>"selection"===t["value type"])}(t))if(e.values&&0!==e.values.length)if(e.values.find(t=>!0===t.default));else if(i.has(e.pred)){const t=i.get(e.pred);e.values.find(e=>e.id===t.mostFrequentObject).default=!0}else e.values[0].default=!0;else e.values=[{id:"default",default:!0}];return t}(t,this._annotations),t}}function io(t,e){if(console.assert(t),(e=Vn(e))["attribute types"]=new eo(e["attribute types"],t.attributes).configuration,t.tracks)for(const i of t.tracks)e["attribute types"]=new eo(e["attribute types"],i.attributes).configuration;return e}function no(t,e){const i=function(t,e){if(console.assert(e,"If you don't have a configuration, generate a configuration from the annotation."),t.attributes){const i=e["attribute types"],n=t.attributes.filter(t=>i.some(e=>e.pred===t.pred&&"selection"===e["value type"])).filter(t=>!i.some(e=>e.pred===t.pred&&e.values.some(e=>e.id===t.obj)));if(n.length)return console.warn("selection attribute values without definition",n),`selection attribute value definition for "${n.map(t=>t.obj).join(", ")}" in configuration is missing. `}}(t,e);if(!i)return e;n().error(i)}var oo=i(3282),so=i.n(oo),ro=i(8182),ao=i.n(ro);const lo=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"JSON schema for texta configuration files","definitions":{"characters":{"type":"array","items":{"type":"string","minLength":1,"maxLength":1}},"color":{"pattern":"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$","type":"string"},"default":{"type":"boolean"},"denote":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"color":{"$ref":"#/definitions/color"},"default":{"$ref":"#/definitions/default"}}},"types":{"type":"array","items":{"$ref":"#/definitions/denote"}},"autocompletion_ws":{"type":"string","format":"uri-reference"}},"type":"object","properties":{"delimiter characters":{"$ref":"#/definitions/characters"},"non-edge characters":{"$ref":"#/definitions/characters"},"autocompletion_ws":{"$ref":"#/definitions/autocompletion_ws"},"autosave":{"type":"boolean"},"autolineheight":{"type":"boolean"},"boundarydetection":{"type":"boolean"},"entity types":{"$ref":"#/definitions/types"},"relation types":{"$ref":"#/definitions/types"},"attribute types":{"type":"array","items":{"type":"object","required":["pred","value type"],"properties":{"pred":{"type":"string"},"value type":{"enum":["flag","selection","string","numeric"]}},"allOf":[{"if":{"properties":{"value type":{"const":"flag"}}},"then":{"properties":{"color":{"$ref":"#/definitions/color"},"label":{"type":"string"}}}},{"if":{"properties":{"value type":{"const":"selection"}}},"then":{"required":["values"],"properties":{"values":{"type":"array","items":{"$ref":"#/definitions/denote"}}}}},{"if":{"properties":{"value type":{"const":"string"}}},"then":{"properties":{"autocompletion_ws":{"$ref":"#/definitions/autocompletion_ws"},"default":{"type":"string"},"values":{"type":"array","items":{"type":"object","required":["pattern"],"properties":{"pattern":{"type":"string","format":"regex"},"label":{"type":"string"},"color":{"$ref":"#/definitions/color"}}}}}}},{"if":{"properties":{"value type":{"const":"numeric"}}},"then":{"required":["default","step"],"properties":{"default":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"},"step":{"type":"number"},"values":{"type":"array","items":{"type":"object","required":["range"],"properties":{"range":{"type":"string"},"label":{"type":"string"},"color":{"$ref":"#/definitions/color"}}}}}}}]}},"function availability":{"type":"object","properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"write-auto":{"type":"boolean"},"view":{"type":"boolean"},"term":{"type":"boolean"},"block":{"type":"boolean"},"relation":{"type":"boolean"},"simple":{"type":"boolean"},"line-height":{"type":"boolean"},"line-height-auto":{"type":"boolean"},"undo":{"type":"boolean"},"redo":{"type":"boolean"},"replicate":{"type":"boolean"},"replicate-auto":{"type":"boolean"},"boundary-detection":{"type":"boolean"},"create-span-by-touch":{"type":"boolean"},"expand-span-by-touch":{"type":"boolean"},"shrink-span-by-touch":{"type":"boolean"},"entity":{"type":"boolean"},"pallet":{"type":"boolean"},"edit-properties":{"type":"boolean"},"delete":{"type":"boolean"},"copy":{"type":"boolean"},"cut":{"type":"boolean"},"paste":{"type":"boolean"},"setting":{"type":"boolean"},"help":{"type":"boolean"}}}}}');const co=new(so())({verbose:!0});ao()(co,["uri-reference","regex"]);const ho=co.compile(lo);function uo(t){return console.assert(t,"config is required."),ho(t)?null:(console.warn(ho.errors),function(t){for(const e of t){if("required"===e.keyword)return`Invalid configuration: The attribute type whose predicate is '${e.data.pred}' misses a mandatory property, '${e.params.missingProperty}'.`;if(e.instancePath.includes("color"))return st`Invalid configuration: '${e.data}' is invalid color format.`}}(ho.errors))}function fo(t,e){const i=io(t,e),o=uo(i);if(!o)return no(t,i);n().error(o)}function po(t){(function(t){if(t.denotations)for(const e of t.denotations){if(e.span.begin!==parseInt(e.span.begin))return!0;if(e.span.end!==parseInt(e.span.end))return!0}})(t)&&n().warning("In the annotation file, some of the begin and end offsets of denotations were not integer values.\n TextAE converted them to integer values.\n However, to avoid a chance of unexpected rendering, please fix them.",15)}class mo{#l;#Ji;#tn;#en;#in;#ht;#nn;#on;constructor(t,e,i,n,o,s){this.#l=t,this.#Ji=e,this.#tn=i,this.#en=n,this.#in=o,this.#ht=s,this.#nn=[],this.#on=fe(),t.on("textae-event.annotation-data.entity.remove",t=>{this.hasCuttingItem&&this.#sn(this.#nn.filter(e=>e!=t))}).on("textae-event.edit-mode.transition",()=>this.#sn())}get hasCopyingItem(){return this.#nn[0]instanceof Tt}get hasCuttingItem(){return this.#nn[0]instanceof Mt}copyEntitiesToLocalClipboard(){this.#sn(this.#tn.copyingTargets)}copyEntitiesToSystemClipboard(t){if(this.#tn.span.contains(t=>t.isBlock))return;const{copyingTargets:e}=this.#tn;if(e.length>0){const i=this.#en.config.filter(({id:t})=>e.some(({typeName:e})=>e===t)),n=this.#in.config.filter(({pred:t})=>e.some(({attributes:e})=>e.some(e=>e.pred===t))),o=JSON.stringify({typeValues:e.map(({externalFormat:t})=>t),config:{"entity types":i,"attribute types":n}});t.clipboardData.setData("text/plain",o),t.clipboardData.setData("application/x-textae-type-values",o),t.preventDefault()}}cutEntitiesToLocalClipboard(){const{cuttingTargets:t}=this.#tn;this.#rn.length&&this.#rn.every(e=>t.has(e))&&[...t].every(t=>this.#rn.includes(t))?this.#sn():this.#sn([...t])}cutEntitiesToSystemClipboard(t){this.#tn.span.contains(t=>t.isBlock)||(this.cutEntitiesToLocalClipboard(),t.clipboardData.setData("application/x-textae-editor-uuid",this.#on),this.copyEntitiesToSystemClipboard(t))}pasteEntitiesFromLocalClipboard(){if(this.#an.length&&this.#tn.span.single)this.#ln();else if(this.hasCopyingItem){const t=this.#Ji.factory.pasteTypesToSelectedSpansCommand(this.#nn);this.#Ji.invoke(t)}}pasteEntitiesFromSystemClipboard(t){if(this.#tn.span.contains(t=>t.isBlock))return;if(t.clipboardData.getData("application/x-textae-editor-uuid")===this.#on&&this.#an.length&&this.#tn.span.single)return void this.#ln();const e=t.clipboardData.getData("application/x-textae-type-values");if(e){const t=JSON.parse(e),i=new I;if(i.definedTypes=t.config["attribute types"],this.#ht.isLock){const e=t.typeValues.map(({obj:t,attributes:e})=>new Tt(t,e.filter(({pred:t})=>this.#in.get(t)&&this.#in.get(t).valueType===i.get(t).valueType))),n=this.#Ji.factory.pasteTypesToSelectedSpansCommand(e);this.#Ji.invoke(n)}else{const e=t.typeValues.map(({obj:t,attributes:e})=>new Tt(t,e.filter(({pred:t})=>!this.#in.get(t)||this.#in.get(t).valueType===i.get(t).valueType))),n=t.config["entity types"].filter(({id:t})=>!this.#en.config.some(e=>e.id===t)),o=t.config["attribute types"].filter(({pred:t})=>!this.#in.get(t)),s=this.#Ji.factory.pasteTypesToSelectedSpansCommand(e,n,o,this.#cn(e,i));this.#Ji.invoke(s)}return void(this.hasCuttingItem&&this.#sn())}}#cn(t,e){const i=[],n=t.reduce((t,i)=>t.concat(i.attributes.filter(({pred:t})=>"selection"===e.get(t).valueType)),[]);for(const{pred:t,obj:o}of n)if(this.#in.get(t)&&!this.#in.get(t).values.some(({id:t})=>t===o)){const n=e.get(t).values.find(({id:t})=>t===o);i.push({pred:t,value:n})}return i}#ln(){const t=this.#Ji.factory.moveEntitiesToSelectedSpanCommand(this.#an);this.#Ji.invoke(t),this.#sn()}#sn(t=[]){const e=this.#rn.filter(e=>!t.includes(e));this.#nn=t,this.#l.emit("textae-event.clip-board.change",this.#rn,e)}get#an(){return this.#rn.filter(t=>t.span.id!==(this.#tn.span.single&&this.#tn.span.single.id))}get#rn(){return this.hasCuttingItem?this.#nn:[]}}class go{get isEmpty(){return!1}isExactly(t){return this.kind.has(t)&&1===this.kind.size}}class vo extends go{get kind(){return new Set(["configuration_command"])}}function yo(t,e,i){i?console.log(`[${t.constructor.name}]`,e,i):console.log(`[${t.constructor.name}]`,e)}class Oo extends vo{constructor(t,e,i,n=null){super(),this._definitionContainer=t,this._attrDef=e,this._index=i,this._indexThatAddDefaultTo=n}execute(){const t=[...this._attrDef.values];if("selection"===this._attrDef.valueType&&t[this._index].default&&null===this._indexThatAddDefaultTo){let e=null;t.forEach((t,i)=>{null===e&&i!=this._index&&(e=i)}),t[e]={...t[e],default:!0}}this._deletedValue=t.splice(this._index,1)[0],"selection"===this._attrDef.valueType&&null!==this._indexThatAddDefaultTo&&(t[this._indexThatAddDefaultTo]={...t[this._indexThatAddDefaultTo],default:!0}),this._updatedAttrDef=this._definitionContainer.updateValues(this._attrDef.pred,t),yo(this,`remove a value from an attrribute:${this._attrDef.pred}, index:${this._index}, updated values: \n ${t.map(t=>JSON.stringify(t)).join("\n ")}`)}revert(){return new bo(this._definitionContainer,this._updatedAttrDef,this._deletedValue,this._index)}}class bo extends vo{constructor(t,e,i,n=null){super(),this._definitionContainer=t,this._pred=e.pred,this._index=n,this._value=i;const o=[...e.values];if("selection"===e.valueType&&i.default){this._indexThatRemoveDefaultFrom||(this._indexThatRemoveDefaultFrom=o.findIndex(t=>t.default));const t={...o[this._indexThatRemoveDefaultFrom]};delete t.default,o[this._indexThatRemoveDefaultFrom]=t}o.splice(n||o.length,0,i),this._modifiedValues=o}execute(){this._updatedAttrDef=this._definitionContainer.updateValues(this._pred,this._modifiedValues),yo(this,`add a new value to attrribute:${this._pred}, value: ${JSON.stringify(this._value)}, index: ${this._index}, updated values: \n ${this._modifiedValues.map(t=>JSON.stringify(t)).join("\n ")}`)}revert(){return new Oo(this._definitionContainer,this._updatedAttrDef,this._updatedAttrDef.values.length-1,this._indexThatRemoveDefaultFrom)}}class xo extends go{get kind(){return new Set(["annotation_command"])}}class wo extends xo{#W;#hn;#un;#dn;#fn;#pn;#mn;constructor(t,e,i,n){super(),this.#W=t,this.#hn=e,this.#un=e.pred,this.#dn=e.obj,this.#fn=i,this.#pn=n}execute(){this.#mn=this.#W.attributeInstanceContainer.change(this.#hn.id,this.#fn,this.#pn),yo(this,`attribute: ${this.#hn.id} changed from ${this.#un}:${this.#dn} to ${this.#mn.pred}:${this.#mn.obj}.`)}revert(){return new wo(this.#W,this.#mn,this.#un,this.#dn)}}class _o extends go{constructor(){super(),this._isExecuteSubCommandsInReverseOrderWhenRevert=!0}execute(){if(console.assert(this._subCommands,"_subCommands is necessary!"),this.isEmpty)return void(this.revert=()=>({execute(){}}));for(const t of this._subCommands)t.execute();this._afterInvoke&&this._afterInvoke();const t=this;this.revert=()=>({_subCommands:this._subCommands,_logMessage:this._logMessage,_afterInvoke:this._afterInvoke,_isExecuteSubCommandsInReverseOrderWhenRevert:this._isExecuteSubCommandsInReverseOrderWhenRevert,execute(){let e=this._subCommands.map(t=>t.revert());this._isExecuteSubCommandsInReverseOrderWhenRevert&&(e=e.reverse());for(const t of e)t.execute();this._afterInvoke&&this._afterInvoke(),yo(t,`revert: ${this._logMessage}`)}}),yo(this,this._logMessage)}get kind(){return this._subCommands.reduce((t,e)=>new Set([...t,...e.kind]),new Set)}get isEmpty(){return!this._subCommands||0===this._subCommands.length}}class So extends vo{constructor(t,e,i){super(),this._definitionContainer=t,this._attrDef=e,this._changedProperties=i}execute(){const t=this._attrDef.pred,[e,i]=function(t,e){const i=t.externalFormat,n=new Map;for(const[o,s]of e.entries())null===s&&void 0!==t[o]?(delete i[o],n.set(o,t[o])):null!==s&&(i[o]=s,n.set(o,void 0===t[o]?null:t[o]));return[i,n]}(this._attrDef,this._changedProperties);this._revertAttrDef=this._definitionContainer.update(t,e),this._revertChangedProperties=i,yo(this,`change old pred:${t} to new attridute definition:${JSON.stringify(e)}`)}revert(){return new So(this._definitionContainer,this._revertAttrDef,this._revertChangedProperties)}}class ko extends _o{constructor(t,e,i,n,o){super(),this._isExecuteSubCommandsInReverseOrderWhenRevert=!1;const s=[new So(i,n,o)];let r=[];if(o.has("pred")){const i=e.attributeInstanceContainer.getSameDefinitionsAttributes(n.pred);r=i.map(t=>new wo(e,t,o.get("pred"),t.obj)),this._afterInvoke=()=>{t.emit("textae-event.commander.attributes.change",i)}}this._subCommands=s.concat(r),this._logMessage=`set ${[...o.entries()].map(([t,e])=>`${t}:${e}`)} to attribute definition ${n.pred}`}}class $o extends _o{constructor(t,e,i,n,o){super();const s=[];for(const t of i){const e=t.attributes.find(t=>t.pred==n.pred&&t.obj!==o);e&&s.push(e)}this._subCommands=s.map(t=>new wo(e,t,null,o)),s.length&&(this._afterInvoke=()=>t.emit("textae-event.commander.attributes.change",s)),this._logMessage=`update obj ${o} to attributes: ${s.map(t=>t.id).join(",")}`}}function To(t,e,i,n){if("string"===e.valueType&&n&&!e.values.some(t=>t.pattern===i)&&n!==e.getLabel(i))return new bo(t,e,{pattern:i,label:n})}class Co extends _o{constructor(t,e,i,n,o,s,r=null){super();const a=[];for(const t of n){const e=t.attributes.find(t=>t.pred==o.pred&&t.obj!==s);e&&a.push(e)}this._subCommands=a.map(t=>new wo(e,t,null,s)),a.length&&(this._afterInvoke=()=>t.emit("textae-event.commander.attributes.change",a));const l=To(i,o,s,r);l&&this._subCommands.push(l),this._logMessage=`update obj ${s} to attributes: ${a.map(t=>t.id).join(",")}`}}class Po extends xo{#W;#gn;#vn;#yn;#On;#bn;constructor(t,e,i){super(),this.#W=t,this.#gn=e.begin,this.#vn=e.end,this.#yn=i}execute(){this.#On=this.#gn+this.#yn.length,this.#bn=this.#W.getTextBetween(this.#gn,this.#vn);const t=this.#W.changeTextBetween(this.#gn,this.#vn,this.#yn);yo(this,`change text at ${this.#gn}:${this.#vn} to ${this.#yn} and spans [${t.map(({begin:t,end:e})=>`${t}:${e}`).join(", ")}] are effected.`)}revert(){return new Po(this.#W,{begin:this.#gn,end:this.#On},this.#bn)}}class Eo extends _o{constructor(t,e,i,n){super(),this._isExecuteSubCommandsInReverseOrderWhenRevert=!1,this._subCommands=[new Po(t,{begin:e,end:i},n)],this._logMessage=`change text from ${e} to ${i} to ${n}`}}class Ao extends vo{constructor(t,e,i,n,o){super(),this._annotationModel=t,this._definitionContainer=e,this._id=i,this._changedProperties=n,this._newDefaultTypeId=o}execute(){const t=this._definitionContainer.get(this._id),[e,i]=function(t,e){const i={...e},n=new Map;for(const[o,s]of t.entries())null===s&&void 0!==e[o]?(delete i[o],n.set(o,e[o])):null!==s&&(i[o]=s,n.set(o,void 0===e[o]?null:e[o]));return[i,n]}(this._changedProperties,t);this._definitionContainer.replace(this._id,e),e.default?(this.revertDefaultTypeId=this._definitionContainer.defaultType,this._definitionContainer.defaultType=e.id):this._newDefaultTypeId&&(this._definitionContainer.defaultType=this._newDefaultTypeId),this.revertId=e.id,this.revertChangedProperties=i,yo(this,`change old type:${JSON.stringify(t)} to new type:${JSON.stringify(e)}, default is ${this._definitionContainer.defaultType}`)}revert(){return new Ao(this._annotationModel,this._definitionContainer,this.revertId,this.revertChangedProperties,this.revertDefaultTypeId)}}class Mo extends vo{constructor(t,e,i){super(),this._definitionContainer=t,this._removeType=e,this._revertDefaultTypeId=i}execute(){const{id:t}=this._removeType,e=this._definitionContainer.get(t);this._definitionContainer.delete(t,this._revertDefaultTypeId),e&&(this._removeType=e),yo(this,`remove a type:${JSON.stringify(this._removeType)}, default is ${this._definitionContainer.defaultType}`)}revert(){return new Qo(this._definitionContainer,this._removeType)}}class Qo extends vo{constructor(t,e){super(),this._definitionContainer=t,this._newType=e}execute(){this._revertDefaultTypeId=this._definitionContainer._defaultType,this._definitionContainer.addDefinedType(this._newType),yo(this,`create a new type:${JSON.stringify(this._newType)}, default is ${this._definitionContainer.defaultType}`)}revert(){return new Mo(this._definitionContainer,this._newType,this._revertDefaultTypeId)}}function Do(t,e,i,n){return t.has(e)?new Ao(i,t,e,n,null):new Qo(t,{id:e,...Object.fromEntries(n)})}class Ro extends xo{#xn;#G;#T;#wn;constructor(t,e,i,n){super(),this.#xn=t,this.#G=e,this.#T=i,this.#wn=n}execute(){this.oldType=this.#xn.getInstanceContainerFor(this.#G).get(this.#T).typeName;const t=this.#xn.getInstanceContainerFor(this.#G).changeType(this.#T,this.#wn);yo(this,`change type of a ${this.#G}. old type:${this.oldType} ${this.#G}:`,t)}revert(){return new Ro(this.#xn,this.#G,this.#T,this.oldType)}}class Io extends _o{constructor(t,e,i,n,o){super();const s=[Do(e,n,t,o)];let r=[];o.has("id")&&(r=function(t,e,i,n){return t.getInstanceContainerFor(e).all.filter(t=>t.typeName===i).map(i=>new Ro(t,e,i.id,n))}(t,i,n,o.get("id"))),this._subCommands=s.concat(r),this._logMessage=`set ${[...o.entries()].map(([t,e])=>`${t}:${e}`)} to type definition ${n}`}}class Lo extends _o{constructor(t,e,i,n){super();const o=e[i].all.filter(t=>!t.typeValues.isSameType(n));this._subCommands=o.map(e=>new Ro(t,i,e.id,n)),this._logMessage=`set type ${n} to ${i} items ${o}`}}class No extends xo{#W;#G;#st;#tn;constructor(t,e,i,n=null){super(),this.#W=t,this.#G=e,this.#st=i,this.#tn=n}execute(){this.#st=this.#W.getInstanceContainerFor(this.#G).add(this.#st),this.#tn&&this.#tn.add(this.#G,[this.#st.id]),yo(this,`${this.#G}: ${this.#st.id}`)}revert(){return new jo(this.#W,this.#G,this.#st)}}class jo extends xo{#W;#G;#st;constructor(t,e,i){super(),this.#W=t,this.#G=e,this.#st=i}execute(){this.#W.getInstanceContainerFor(this.#G).remove(this.#st.id),yo(this,`${this.#G}: ${this.#st.id}`)}revert(){return new No(this.#W,this.#G,this.#st)}}class zo extends _o{constructor(t,e,i,n,o){super();const s=e[i].all.filter(t=>!t.typeValues.isSameType(n,o));this._subCommands=s.map(e=>new Ro(t,i,e.id,n)),this._subCommands=this._subCommands.concat(function(t,e,i){const n=[];for(const o of t){if(o.typeValues)for(const t of o.attributes){const o=e.find(e=>t.equalsTo(e.pred,e.obj));o?String(t.obj)!==o.obj&&n.push(new wo(i,t,o.pred,o.obj)):n.push(new jo(i,"attribute",t))}for(const t of e)o.attributes.some(e=>e.equalsTo(t.pred,t.obj))||n.push(new No(i,"attribute",{subj:o.id,pred:t.pred,obj:t.obj}))}return n}(s,o,t));for(const{pred:e,obj:i,label:n}of o){const o=t.typeDictionary.attribute,s=o.get(e),r=To(o,s,i,n);r&&this._subCommands.push(r)}this._logMessage=`set type ${n}${o.length>0?` and attributes ${JSON.stringify(o)}`:""} to ${i} items ${s.map(t=>t.id)}`}}class Bo extends _o{constructor(t,e,i,n,o,s){super();const r=[];i&&r.push(Do(o,n,t,new Map([["label",i]])));const a=new zo(t,e,o.annotationType,n,s);a.isEmpty||r.push(a),this._subCommands=r,this._logMessage=`change ${o.annotationType} value:"${n}"${i?`, label:"${i}"`:""}${s.length>0?`, attributes:${JSON.stringify(s)}`:""}`}}class Zo extends vo{constructor(t,e,i,n,o){super(),this._definitionContainer=t,this._attrDef=e,this._targetIndex=i,this._newValue=n,this._indexThatRemoveDefaultFrom=o}execute(){if("selection"===this._attrDef["value type"]&&(!this._attrDef.values[this._targetIndex].default&&this._newValue.default&&(this._indexThatRemoveDefaultFrom||(this._indexThatRemoveDefaultFrom=this._attrDef.values.findIndex(t=>t.default)),delete this._attrDef.values[this._indexThatRemoveDefaultFrom].default),this._attrDef.values[this._targetIndex].default&&!this._newValue.default))if(1===this._attrDef.values.length)this._newValue.default=!0;else if(this._indexThatRemoveDefaultFrom)this._attrDef.values[this._indexThatRemoveDefaultFrom].default=!0;else{let t=null;this._attrDef.values.forEach((e,i)=>{null===t&&i!=this._targetIndex&&(t=i)}),this._attrDef.values[t].default=!0,this._indexThatRemoveDefaultFrom=t}this._valueBeforeChange=this._attrDef.values.splice(this._targetIndex,1,this._newValue)[0],this._definitionContainer.update(this._attrDef.pred,this._attrDef),yo(this,`change value of attrribute:${this._attrDef.pred}, oldValue: ${JSON.stringify(this._valueBeforeChange)}, newValue: ${JSON.stringify(this._newValue)}`)}revert(){return new Zo(this._definitionContainer,this._attrDef,this._targetIndex,this._valueBeforeChange,this._indexThatRemoveDefaultFrom)}}class Wo extends _o{constructor(t,e,i,n,o,s,r){if(super(),this._subCommands=[new Zo(i,n,o,s,r)],"selection"===n["value type"]&&n.values[o].id!==s.id){const i=e.attributeInstanceContainer.getSameAttributes(n.pred,n.values[o].id),r=i.map(t=>new wo(e,t,null,s.id));this._subCommands=this._subCommands.concat(r),this._afterInvoke=()=>t.emit("textae-event.commander.attributes.change",i)}this._logMessage=`attribute: ${n.pred}`}}class Fo extends vo{constructor(t,e){super(),this._definitionContainer=t,this._removeAttrdef=e,this._index=t.getIndexOf(e.pred)}execute(){this._definitionContainer.delete(this._removeAttrdef.pred),yo(this,`remove an attrribute definition:${JSON.stringify(this._removeAttrdef)}, index:${this._index}`)}revert(){return new Xo(this._definitionContainer,this._removeAttrdef,this._index)}}class Xo extends vo{constructor(t,e,i){super(),this._definitionContainer=t,this._newAttrDef=e,this._index=i}execute(){"selection"!==this._newAttrDef.valueType||this._newAttrDef.values||(this._newAttrDef.values=[{id:"default",default:!0}]),this._definitionContainer.create(this._newAttrDef.valueType,this._newAttrDef,this._index),yo(this,`create a new attrribute definition:${JSON.stringify(this._newAttrDef)}, index: ${this._index}`)}revert(){return new Fo(this._definitionContainer,this._newAttrDef)}}function qo(t,e,i,n){return e.filter(t=>!t.typeValues.hasSpecificPredicateAttribute(i)).map(({id:e})=>new No(t,"attribute",{id:null,subj:e,pred:i,obj:n}))}class Ho extends _o{constructor(t,e,i,n){super(),this._subCommands=qo(t,e,i.pred,n||i.default),this._logMessage=`create attirbute ${i.pred}:${i.default} to item ${e.map(({id:t})=>t).join(", ")}`}}class Vo extends No{constructor(t,e,i){super(t,"attribute",{obj:e,pred:i})}execute(){const t=this._annotationModel.entityInstanceContainer.all.pop().id;return this._instance.subj=t,super.execute()}}class Yo extends _o{constructor(t,e,i,n,o,s,r){super(),this._subCommands=[new No(t,"entity",{spanType:i,begin:n,end:o,typeName:s},e)].concat(r.map(({obj:e,pred:i})=>new Vo(t,e,i))),this._logMessage=`span: ${n}:${o}, type: ${s}${r.length?`, attributes: ${r.map(({pred:t})=>t).join(", ")}`:""}`}}class Uo extends _o{constructor(t,e,i,n,o,s){super();const r=new No(e,"span",{begin:n,end:o,isBlock:!0},i),a=new Yo(e,i,"block",n,o,s,[]);this._subCommands=[r,a],this._logMessage=`create a span ${n}:${o} with type ${s}`}}class Go extends _o{constructor(t,e,i){super();const n=e.span.all.filter(t=>t.isDenotation);this._subCommands=n.map(n=>new No(t,"entity",{spanType:"denotation",begin:n.begin,end:n.end,typeName:i},e)),this._logMessage=`create a ${i} type entity to ${n}`}}class Ko extends _o{constructor(t,e,i,n,o,s){super(),this._subCommands=[new No(t,"span",{begin:n,end:o},e)].concat(s.map(i=>new Yo(t,e,"denotation",n,o,i.typeName,i.attributes))),this._logMessage=`span: ${n}:${o}, types: ${s.map(({typeName:t})=>t).join(", ")}`}}class Jo extends _o{constructor(t,e,i,n,o,s){super(),console.log(n),this._subCommands=e.getReplicationRanges(n,s).map(({begin:n,end:s})=>new Ko(e,i,t,n,s,o)),this._logMessage=`from span: ${n.id}`}}class ts extends _o{constructor(t,e,i,n,o,s,r){super();const a=[new Tt(o)];this._subCommands=[new Ko(e,i,t,n.begin,n.end,a)],this._logMessage=`create a span ${n.begin}:${n.end} with type ${a[0].typeName}`,s&&n.end-n.begin<=100&&(this._subCommands.push(new Jo(t,e,i,{begin:n.begin,end:n.end},a,r)),this._logMessage=`${this._logMessage} and replicate auto`)}}class es extends vo{constructor(t,e,i){super(),this._definitionContainer=t,this._oldIndex=e,this._newIndex=i}execute(){this._definitionContainer.move(this._oldIndex,this._newIndex),yo(this,`move the attrribute definition: from ${this._oldIndex} to ${this._newIndex}`)}revert(){return new es(this._definitionContainer,this._newIndex,this._oldIndex)}}class is extends xo{#d;#_n;#Sn;#kn;#$n;constructor(t,e,i,n,o){super(),this.#d=t,this.#_n=e,this.#Sn=i,this.#kn=n,this.#$n=o}execute(){this.#d.moveBlockSpan(this.#_n,this.#Sn,this.#kn,this.#$n),yo(this,`move span: from {begin: ${this.#_n}, end: ${this.#Sn} } to {begin: ${this.#kn}, end: ${this.#$n}}`)}revert(){return new is(this.#d,this.#kn,this.#$n,this.#_n,this.#Sn)}}class ns extends xo{#d;#_n;#Sn;#kn;#$n;constructor(t,e,i,n,o){super(),this.#d=t,this.#_n=e,this.#Sn=i,this.#kn=n,this.#$n=o}execute(){this.#d.moveDenotationSpan(this.#_n,this.#Sn,this.#kn,this.#$n),yo(this,`move span: from {begin: ${this.#_n}, end: ${this.#Sn} } to {begin: ${this.#kn}, end: ${this.#$n}}`)}revert(){return new ns(this.#d,this.#kn,this.#$n,this.#_n,this.#Sn)}}function os(t,e){return t.entities.every(t=>e.includes(t))}class ss extends _o{constructor(t,e){super(),this._subCommands=[];for(const[i,n]of e.entries())this._subCommands.push(new rs(t,i,n));this._logMessage=`revert: move entities ${Array.from(e.values()).flat().map(t=>t.id).join(", ")}`}}class rs extends xo{constructor(t,e,i){super(),this._annotationModel=t,this._span=e,this._entities=i}execute(){this._moveMap=this._entities.reduce((t,e)=>(t.has(e.span)?t.get(e.span).push(e):t.set(e.span,[e]),t),new Map);const t=`${Array.from(this._moveMap.entries()).map(([t,e])=>`${e.map(t=>t.id).join(", ")} from ${e[0].span.id} to ${this._span.id}`).join(", ")}`;this._annotationModel.entityInstanceContainer.moveEntities(this._span,this._entities),yo(this,t)}revert(){return new ss(this._annotationModel,this._moveMap)}}class as extends _o{constructor(t,e,i){console.assert(e.span.single,"There must be one span to be pasted."),super();const n=[new rs(t,e.span.single,i)];for(const e of i.map(t=>t.span).reduce((t,e)=>(t.add(e),t),new Set).values())os(e,i)&&n.push(new jo(t,"span",e));this._subCommands=n,this._logMessage="paste cut entities"}}class ls extends _o{constructor(t,e,i,n,o,s){super();const r=e.span.all;this._subCommands=[];for(const e of n)this._subCommands.push(new Qo(t.denotationDefinitionContainer,e));for(const e of o)this._subCommands.push(new Xo(t.attributeInstanceContainerDefinitionContainer,{valueType:e["value type"],...e}));for(const{pred:e,value:i}of s)this._subCommands.push(new bo(t.attributeInstanceContainerDefinitionContainer,t.attributeInstanceContainerDefinitionContainer.get(e),i));this._subCommands=this._subCommands.concat(r.map(n=>i.map(i=>new Yo(t,e,"denotation",n.begin,n.end,i.typeName,i.attributes))).flat()),this._logMessage=`paste types [${i.map(({typeName:t,attributes:e})=>[`{type:${t}}`].concat(e.map(({pred:t,obj:e})=>`{${t}:${e}}`)))}] to ${r}`}}function cs(t,e,i){return e.reduce((t,{attributes:e})=>t.concat(e),[]).filter(t=>t.pred===i).map(e=>new jo(t,"attribute",e))}class hs extends _o{constructor(t,e,i){super();const n=cs(t,e,i.pred);this._subCommands=n,this._logMessage=`remove ${i.pred} attribute from items ${e.map(t=>t.id).join(", ")}`}}function us(t,e,i){t.add(i);for(const t of i.attributes)e.add(t)}function ds(t,e,i,n){t.add(n);for(const t of n.attributes)i.add(t);for(const t of n.relations)us(e,i,t)}class fs extends _o{constructor(t,e){super();const i=new Set,n=new Set,o=new Set,s=new Set;for(const t of e.span.all){i.add(t);for(const e of t.entities)ds(n,o,s,e)}for(const t of e.entity.all)ds(n,o,s,t);for(const t of e.relation.all)us(o,s,t);for(const n of t.spanInstanceContainer.all)n.entities.every(t=>e.entity.all.includes(t))&&(n.styleOnly||i.add(n));this._subCommands=[];for(const e of s)this._subCommands.push(new jo(t,"attribute",e));for(const e of o)this._subCommands.push(new jo(t,"relation",e));for(const e of n)this._subCommands.push(new jo(t,"entity",e));for(const e of i)this._subCommands.push(new jo(t,"span",e));this._logMessage=`remove selected ${[...i,...n,...o,...s].map(({id:t})=>t).join(", ")}`}}class ps extends _o{constructor(t,e){super();const i=new jo(t,"relation",e),n=e.attributes.map(e=>new jo(t,"attribute",e));this._subCommands=n.concat(i),this._logMessage=`remove a relation ${e.id}`}}class ms extends _o{constructor(t,e){super();const i=new jo(t,"entity",e),n=e.relations.map(e=>new ps(t,e)),o=e.attributes.map(e=>new jo(t,"attribute",e));this._subCommands=n.concat(o).concat(i),this._logMessage=`remove an entity ${e.id}`}}class gs extends _o{constructor(t,e){super();const i=t.getSpan(e),n=i.entities.map(e=>new ms(t,e)),o=new jo(t,"span",i);this._subCommands=n.concat(o),this._logMessage=`remove a span ${e}`}}class vs extends _o{constructor(t,e,i){super(),this._subCommands=qo(t,e,i.pred,i.default);const n=cs(t,e,i.pred);this._subCommands=this._subCommands.concat(n),this._logMessage=`toggle flag attirbute ${i.pred} to item ${e.map(({id:t})=>t).join(", ")}`}}class ys{#lt;#l;#W;#tn;constructor(t,e,i,n){this.#lt=t,this.#l=e,this.#W=i,this.#tn=n}addValueToAttributeDefinitionCommand(t,e){return new bo(this.#W.typeDictionary.attribute,t,e)}changeAttributeDefinitionCommand(t,e){return new ko(this.#l,this.#W,this.#W.typeDictionary.attribute,t,e)}changeAttributeObjOfItemsCommand(t,e,i){return new $o(this.#l,this.#W,t,e,i)}changeStringAttributeObjOfItemsCommand(t,e,i,n){return new Co(this.#l,this.#W,this.#W.typeDictionary.attribute,t,e,i,n)}changeTypeValuesCommand(t,e,i,n){return new Bo(this.#W,this.#tn,t,e,i,n)}changeTypeDefinitionCommand(t,e,i,n){return new Io(this.#W,t,e,i,n)}changeTypeOfSelectedItemsCommand(t,e){return new Lo(this.#W,this.#tn,t,e)}changeValueOfAttributeDefinitionAndObjectOfSelectionAttributeCommand(t,e,i){return new Wo(this.#l,this.#W,this.#W.typeDictionary.attribute,t,e,i)}createAttributeDefinitionCommand(t){return new Xo(this.#W.typeDictionary.attribute,t)}createAttributeToItemsCommand(t,e,i=null){return new Ho(this.#W,t,e,i)}createBlockSpanCommand(t){return new Uo(this.#lt,this.#W,this.#tn,t.begin,t.end,this.#W.typeDictionary.block.defaultType)}createDefaultTypeEntityToSelectedSpansCommand(t){return new Go(this.#W,this.#tn,t)}createRelationCommand(t){return new No(this.#W,"relation",t,this.#tn)}createSpanAndAutoReplicateCommand(t,e,i){return new ts(this.#lt,this.#W,this.#tn,t,this.#W.typeDictionary.denotation.defaultType,e,i)}createTypeDefinitionCommand(t,e){return new Qo(t,e)}deleteAttributeDefinitionCommand(t){return new Fo(this.#W.typeDictionary.attribute,t)}moveAttributeDefinitionCommand(t,e){return new es(this.#W.typeDictionary.attribute,t,e)}moveBlockSpanCommand(t,e,i){const{begin:n,end:o}=this.#W.getSpan(t);return new is(this.#W.spanInstanceContainer,n,o,e,i)}moveDenotationSpanCommand(t,e,i){const{begin:n,end:o}=this.#W.getSpan(t);return new ns(this.#W.spanInstanceContainer,n,o,e,i)}moveEntitiesToSelectedSpanCommand(t){return new as(this.#W,this.#tn,t)}pasteTypesToSelectedSpansCommand(t,e=[],i=[],n=[]){return new ls(this.#W,this.#tn,t,e,i,n)}replicateSpanCommand(t,e,i){return new Jo(this.#lt,this.#W,this.#tn,t,e,i)}removeAttributesFromItemsByPredCommand(t,e){return new hs(this.#W,t,e)}removeSpanCommand(t){return new gs(this.#W,t)}removeSelectedCommand(){return new fs(this.#W,this.#tn)}removeTypeDefinitionCommand(t,e){return new Mo(t,e)}removeValueFromAttributeDefinitionCommand(t,e){return new Oo(this.#W.typeDictionary.attribute,t,e)}toggleFlagAttributeToItemsCommand(t,e){return new vs(this.#W,t,e)}changeTextAndMoveSpanCommand(t,e,i){return new Eo(this.#W,t,e,i)}}class Os{constructor(t){this._resetHistory(),this._eventEmitter=t,t.on("textae-event.type-definition.reset",()=>{this._removeConfigurationOperationsFromHistory(),this._trigger()}).on("textae-event.annotation-data.all.change",()=>{this._resetHistory(),this._trigger()}).on("textae-event.resource.annotation.save",()=>{this._trigger()}).on("textae-event.resource.configuration.save",()=>{this._trigger()})}push(t){this._histories.splice(this._pointer+1,this._histories.length-this._pointer,t),this._pointer++,this._trigger()}next(){this._pointer++;const t=this._histories[this._pointer];return this._trigger(),t}prev(){const t=this._histories[this._pointer];return this._pointer--,this._trigger(),t}get hasAnythingToUndo(){return this._pointer>-1}get hasAnythingToRedo(){return this._pointer<this._histories.length-1}_trigger(){this._eventEmitter.emit("textae-event.history.change",this)}_removeConfigurationOperationsFromHistory(){for(let t=0;t<this._histories.length;t++)this._histories[t].isExactly("configuration_command")&&(this._pointer--,this._histories.splice(t,1))}_resetHistory(){this._pointer=-1,this._histories=[]}}class bs{#Z;#lt;#l;#W;#tn;#Tn;constructor(t,e,i,n,o){this.#Z=t,this.#lt=e,this.#l=i,this.#W=n,this.#tn=o,this.#Tn=new Os(i)}invoke(t){t.isEmpty||(t.execute(),this.#Tn.push(t))}undo(){if(this.#Tn.hasAnythingToUndo){this.#tn.removeAll(),this.#Z.focus();const t=this.#Tn.prev();t.kind.has("configuration_command")&&n().success("configuration has been undone"),t.revert().execute()}}redo(){if(this.#Tn.hasAnythingToRedo){this.#tn.removeAll();const t=this.#Tn.next();t.kind.has("configuration_command")&&n().success("configuration has been redo"),t.execute()}}get factory(){return new ys(this.#lt,this.#l,this.#W,this.#tn,this.#W.typeDictionary)}}function xs(t){return a(t,300)}class ws{#Cn;#Pn;#En;#An;#Mn;#Qn;constructor(t,e,i,n,o,s,r){this.#Cn=t,this.#Pn=e,this.#En=i,this.#An=n,this.#Mn=o,this.#Qn=s;const a=xs(()=>this.#Dn.updateSelectedTextOffsets());document.addEventListener("selectionchange",a),r.on("textae-event.editor.relation.click",(t,e)=>this.#Dn.relationClicked(t,e)).on("textae-event.editor.relation-bollard.click",(t,e)=>this.#Dn.relationBollardClicked(e)),L(this,()=>this.#Dn,["showPallet","hidePallet","selectLeftAttributeTab","selectRightAttributeTab","createSpanWithTouchDevice","expandSpanWithTouchDevice","shrinkSpanWithTouchDevice","editTextWithTouchDevice","applyTextSelectionWithTouchDevice","editProperties","manipulateAttribute"])}get isEditDenotation(){return this.#Cn.currentState===vn}get isTypeValuesPalletShown(){return this.#Dn.isPalletShown}get#Dn(){switch(this.#Cn.currentState){case vn:return this.#Pn;case yn:return this.#En;case On:return this.#An;case bn:return this.#Mn;default:return this.#Qn}}}i(1758);class _s{constructor(t,e,i){this._editorHTMLElement=t,this._title=e,this._el=this.createElement(),this._mousePoint=i,function(t,e){f()(t).draggable({containment:e})}(this._el,t),c()(this._el,'[type="button"]',"click",()=>t.focus()),c()(this._el,".textae-editor__pallet__close-button","click",()=>this.hide())}updateDisplay(){this.visibly&&this._updateDisplay()}get el(){return this._el}show(){this._el.style.display="block",this._updateDisplay(),this._moveInto()}hide(){this._el.style.display="none"}get visibly(){return"none"!==this._el.style.display}createElement(){return u().create('\n <div\n class="textae-editor__pallet ui-dialog"\n style="display: none;"\n >\n </div>')}_updateDisplay(){var t,e;this._el.innerHTML=`\n <div class="textae-editor__pallet__container">\n <div class="textae-editor__pallet__title-bar ui-widget-header ui-corner-all">\n <span class="textae-editor__pallet__title-string">${this._title}</span>\n <button\n type="button"\n class="textae-editor__pallet__close-button ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close"\n title="Close">\n <span class="ui-button-icon ui-icon ui-icon-closethick"></span>\n <span class="ui-button-icon-space"> </span>Close\n </button>\n </div>\n <div class="textae-editor__pallet__content">${this._content}</div>\n </div>\n `,t=this._el,e=this._maxWidth,t.style.width="auto",e-2<=t.offsetWidth&&(t.style.width=e-4+"px"),function(t,e){e-14<=t.offsetHeight?t.style.height=e-14+"px":t.style.height=null}(this._el.querySelector(".textae-editor__pallet__container"),this._maxHeight)}_moveInto(){this._el.style.left=`${this._left}px`,this._el.style.top=`${this._top}px`}get _left(){const{clientX:t}=this._mousePoint,e=t-this._editorHTMLElement.getBoundingClientRect().x;return this._maxWidth<e+this._el.offsetWidth?this._maxWidth-this._el.offsetWidth-2:e}get _top(){const{clientY:t}=this._mousePoint,e=this._editorHTMLElement.getBoundingClientRect().y;return this._maxHeight<t+this._el.offsetHeight?this._maxHeight-this._el.offsetHeight-e-2:t-e}get _maxWidth(){return this._editorHTMLElement.offsetWidth}get _maxHeight(){return document.documentElement.clientHeight}}function Ss(t){const{values:e}=t.attrDef;return st`
435
+ <div>
436
+ <table>
437
+ <thead>
438
+ <tr>
439
+ <th>id</th>
440
+ <th>label</th>
441
+ <th>color</th>
442
+ </tr>
443
+ </thead>
444
+ <tbody>
445
+ ${e.map(({color:t="",id:e,default:i,label:n=""})=>function(t,e,i,n){return()=>st`
446
+ <tr class="textae-editor__pallet__row" style="background-color: ${t};">
447
+ <td class="textae-editor__pallet__selection-attribute-label" data-id="${e}">
448
+ ${e}
449
+ ${()=>i?'<span class="textae-editor__pallet__default-icon" title="This type is set as a default type."></span>':""}
450
+ </td>
451
+ <td class="textae-editor__pallet__short-label">
452
+ ${n}
453
+ </td>
454
+ <td class="textae-editor__pallet__short-label">
455
+ ${t}
456
+ </td>
457
+ </tr>
458
+ `}(t,e,i,n))}
459
+ </tbody>
460
+ </table>
461
+ </div>
462
+ `}class ks extends _s{constructor(t,e){super(t,"Selection attribute",e),this._veil=u().create('<div style="position: fixed; right: 0; top: 0; bottom:0; left: 0; background-color: rgba(0, 0, 10, 0.3);"></div>'),this._el.addEventListener("keydown",t=>{"Escape"===t.code&&(t.preventDefault(),this.hide())})}show(t,e=90,i=null){return this._editorHTMLElement.appendChild(this._veil),this._editorHTMLElement.appendChild(this.el),this._veil.style["z-index"]=e+1,this._el.style["z-index"]=e+1,this._attributeDefinition=t,super.show(),this._el.querySelector(".textae-editor__pallet__close-button").focus(),this._opener=i,this._show=!0,new Promise(t=>{c()(this._el,".textae-editor__pallet__selection-attribute-label","click",e=>{this.hide(),t(e.target.dataset.id)})})}hide(){this._show&&(this._editorHTMLElement.removeChild(this._veil),this._editorHTMLElement.removeChild(this.el),this._show=!1),this._opner&&this._opener.focus()}get _content(){return Ss({attrDef:this._attributeDefinition.externalFormat})}}class $s extends p{constructor(t,e,i,n){const o=()=>{const t=n();t&&this.resolveFunc(t),super.close()},s={text:"OK",click:o};i.buttons=i.buttons?i.buttons.concat([s]):[s],super(t,e,i),c()(super.el,".textae-editor__promise-dialog__observable-element","keyup",t=>{13===t.keyCode&&o()})}open(){return super.open(),new Promise(t=>this.resolveFunc=t)}}class Ts extends $s{constructor(t,e,i,n,o,s){const r=[];n&&r.unshift({class:"textae-editor__edit-numeric-attribute-dialog__remove-attribute",click:()=>{this.close(),this.resolveFunc({newObj:null})}}),s&&r.unshift({text:"...",title:"configuration",click:()=>{this.close(),s.show(),s.showAttribute(e.pred)}}),super(`Attribute [${i.map(({id:t})=>t||"-").join(",")}]`,function(t){const{subjects:e,pred:i,min:n,max:o,step:s,value:r}=t;return st`
463
+ <div class="textae-editor__edit-numeric-attribute-dialog__container">
464
+ <div class="textae-editor__edit-numeric-attribute-dialog__row">
465
+ <label>Subject</label>
466
+ <div class="textae-editor__edit-numeric-attribute-dialog__subject-row">
467
+ <input
468
+ class="textae-editor__edit-numeric-attribute-dialog__subject-input"
469
+ value="${e}"
470
+ disabled="disabled">
471
+ <button
472
+ class="textae-editor__edit-numeric-attribute-dialog__subject-edit-button"
473
+ title="properties">...</button>
474
+ </div>
475
+ </div>
476
+ <div class="textae-editor__edit-numeric-attribute-dialog__row">
477
+ <label>Predicate</label>
478
+ <input
479
+ value="${i}"
480
+ disabled="disabled">
481
+ </div>
482
+ <div class="textae-editor__edit-numeric-attribute-dialog__row ui-front">
483
+ <label>Object</label>
484
+ <input
485
+ class="textae-editor__edit-numeric-attribute-dialog__value textae-editor__promise-dialog__observable-element"
486
+ type="number"
487
+ ${"number"==typeof n?`min="${n}"`:""}
488
+ ${"number"==typeof o?`max="${o}"`:""}
489
+ step="${s}"
490
+ value="${r}"
491
+ autofocus>
492
+ </div>
493
+ </div>`}({subjects:`${i.map(({subj:t})=>t||"-").join(", ")}`,pred:e.pred,value:e.obj,min:t.min,max:t.max,step:t.step}),{buttons:r},()=>({newObj:super.el.querySelector(".textae-editor__edit-numeric-attribute-dialog__value").value})),o&&c()(super.el,".textae-editor__edit-numeric-attribute-dialog__subject-edit-button","click",()=>{this.close(),o()})}}function Cs(t,e,i,n,o,s){new Ts(e,i,t.all.reduce((t,e)=>(t.push(e.attributes.find(t=>t.pred==i.pred)),t),[]),!0,o,s).open().then(({newObj:i})=>{const o=i?n.factory.changeAttributeObjOfItemsCommand(t.all,e,i):n.factory.removeAttributesFromItemsByPredCommand(t.all,e);n.invoke(o)})}class Ps{#Rn;#In;#_;constructor(t,e){this.#Rn=t,this.#In=e,this.#_=document.createElement("ul"),this.#_.setAttribute("popover","manual"),this.#_.classList.add("popover-autocomplete-container"),this.#_.style.margin=0,t.parentElement.appendChild(this.#_)}get element(){return this.#_}set items(t){if(t.length>0){this.#_.innerHTML="";const e=t.map((t,e)=>function(t,e,i){const n=document.createElement("li");if(n.classList.add("popover-autocomplete-item"),"object"==typeof t&&null!==t)for(const[e,i]of Object.entries(t))n.dataset[e]=i;else n.dataset.value=t;return n.dataset.index=e,n.textContent=i(t),n}(t,e,this.#In));this.#_.append(...e),this.#Ln(),this.#_.showPopover()}else this.#_.hidePopover()}highlight(t){this.#Nn();const e=this.#_.querySelector(`li:nth-child(${t+1})`);e&&e.classList.add("popover-autocomplete-item-highlighted")}#Ln(){const t=this.#Rn.getBoundingClientRect();Object.assign(this.#_.style,{position:"absolute",top:`${t.bottom+window.scrollY}px`,left:`${t.left+window.scrollX}px`})}#Nn(){const t=this.#_.querySelector(".popover-autocomplete-item-highlighted");t&&t.classList.remove("popover-autocomplete-item-highlighted")}}class Es{#jn;#zn;#Bn;#Zn;#Wn="";#nn=[];#Fn=-1;constructor(t,e,i,n){this.#jn=t,this.#zn=e,this.#Bn=i,this.#Zn=n}get term(){return this.#Wn}set term(t){this.#Wn=t,this.#Wn.length>=this.#Zn?this.#jn(this.#Wn):this.clearItems()}get itemsCount(){return this.#nn.length}get hasItems(){return this.#nn.length>0}get hasNoItems(){return 0===this.#nn.length}set items(t){this.#nn=t,this.clearHighlight(),this.#zn(this.#nn)}get highlightedIndex(){return this.#Fn}set highlightedIndex(t){this.#Fn=t,this.#Bn(this.#Fn)}clearItems(){this.items=[]}clearHighlight(){this.highlightedIndex=-1}moveHighlightIndexPrevious(){this.highlightedIndex>=0?this.highlightedIndex--:this.highlightedIndex=this.itemsCount-1}moveHighlightIndexNext(){this.highlightedIndex<this.itemsCount-1?this.highlightedIndex++:this.clearHighlight()}}var As=i(6998);class Ms{#Xn;#qn;#Hn;constructor({inputElement:t,onSearch:e,onSelect:i,onRender:n=t=>t,minLength:o=3}){this.#Xn=i,this.#qn=new Ps(t,n),this.#Hn=new Es(t=>e(t,t=>this.#Hn.items=t),t=>this.#qn.items=t,t=>this.#qn.highlight(t),o),this.#Vn(t),this.#Yn(this.#qn.element),this.#Un()}#Vn(t){const e=As(t=>{this.#Hn.term=t},300);t.addEventListener("input",({target:t})=>e(t.value)),t.addEventListener("keydown",t=>this.#Gn(t)),t.addEventListener("keyup",t=>this.#Kn(t))}#Yn(t){this.#Jn(t,"mousedown","li",({delegateTarget:e})=>{this.#Xn(e.dataset),t.hidePopover()}),this.#Jn(t,"mouseover","li",({delegateTarget:t})=>{this.#Hn.highlightedIndex=Number(t.dataset.index)}),this.#Jn(t,"mouseout","li",()=>{this.#Hn.clearHighlight()})}#Un(){document.addEventListener("mousedown",({target:t})=>{this.#qn.element.contains(t)||this.#Hn.clearItems()}),window.addEventListener("resize",()=>this.#Hn.clearItems())}#Jn(t,e,i,n){t.addEventListener(e,({target:t})=>{const e=t.closest(i);e&&n({delegateTarget:e})})}#Gn(t){if(!this.#Hn.hasNoItems)switch(t.key){case"ArrowDown":t.preventDefault(),this.#Hn.moveHighlightIndexNext();break;case"ArrowUp":t.preventDefault(),this.#Hn.moveHighlightIndexPrevious();break;case"Tab":t.preventDefault(),t.shiftKey?this.#Hn.moveHighlightIndexPrevious():this.#Hn.moveHighlightIndexNext();break;case"Escape":t.preventDefault(),this.#Hn.clearItems()}}#Kn(t){if("Enter"===t.key&&this.#Hn.hasItems){t.stopPropagation();const e=document.querySelector(".popover-autocomplete-item-highlighted");e&&this.#Xn(e.dataset),this.#Hn.clearItems()}}}class Qs extends $s{constructor(t,e,i,n,o,s){const r=[];n&&r.unshift({class:"textae-editor__edit-string-attribute-dialog__remove-attribute",click:()=>{this.close(),this.resolveFunc({newObj:null})}}),s&&r.unshift({text:"...",title:"configuration",click:()=>{this.close(),s.show(),s.showAttribute(e.pred)}}),super(`Attribute [${i.map(({id:t})=>t||"-").join(",")}]`,function(t){const{subjects:e,pred:i,value:n,label:o}=t;return st`
494
+ <div class="textae-editor__edit-string-attribute-dialog__container">
495
+ <div class="textae-editor__edit-numeric-attribute-dialog__row">
496
+ <label>Subject</label>
497
+ <div class="textae-editor__edit-numeric-attribute-dialog__subject-row">
498
+ <input
499
+ class="textae-editor__edit-numeric-attribute-dialog__subject-input"
500
+ value="${e}"
501
+ disabled="disabled">
502
+ <button
503
+ class="textae-editor__edit-numeric-attribute-dialog__subject-edit-button"
504
+ title="properties">...</button>
505
+ </div>
506
+ </div>
507
+ <div class="textae-editor__edit-string-attribute-dialog__row">
508
+ <label>Predicate</label>
509
+ <input
510
+ value="${i}" disabled="disabled">
511
+ </div>
512
+ <div class="textae-editor__edit-string-attribute-dialog__row ui-front">
513
+ <label>Object</label>
514
+ <input
515
+ class="textae-editor__edit-string-attribute-dialog__value textae-editor__promise-dialog__observable-element"
516
+ value="${n}"
517
+ autofocus>
518
+ </div>
519
+ <div class="textae-editor__edit-string-attribute-dialog__row">
520
+ <label>Label</label>
521
+ <input
522
+ class="textae-editor__edit-string-attribute-dialog__label"
523
+ value="${o}" disabled="disabled">
524
+ </div>
525
+ </div>`}({subjects:`${i.map(({subj:t})=>t||"-").join(", ")}`,pred:e.pred,value:e.obj,label:t.getDisplayName(e.obj)}),{buttons:r},()=>({newObj:super.el.querySelector(".textae-editor__edit-string-attribute-dialog__value").value,newLabel:super.el.querySelector(".textae-editor__edit-string-attribute-dialog__label").value})),o&&c()(super.el,".textae-editor__edit-numeric-attribute-dialog__subject-edit-button","click",()=>{this.close(),o()});const a=super.el.querySelector(".textae-editor__edit-string-attribute-dialog__value"),l=super.el.querySelector(".textae-editor__edit-string-attribute-dialog__label");new Ms({inputElement:a,onSearch:(e,i)=>{t.autocompletionWs?xt(t.autocompletionWs,e).then(i):i([])},onSelect:t=>{a.value=t.id,l.value=t.label},onRender:t=>`${t.id} ${t.label}`})}}function Ds(t,e,i,n,o,s){new Qs(n,e,t.all.reduce((t,i)=>(t.push(i.attributes.find(t=>t.pred==e.pred)),t),[]),!0,o,s).open().then(({newObj:e,newLabel:o})=>{e?i.invoke(i.factory.changeStringAttributeObjOfItemsCommand(t.all,n,e,o)):i.invoke(i.factory.removeAttributesFromItemsByPredCommand(t.all,n))})}class Rs{#Ji;#to;#eo;#ht;#io;#no;constructor(t,e,i,n,o,s){this.#Ji=t,this.#to=i,this.#eo=n,this.#ht=e,this.#io=o,this.#no=s}manipulateAttribute(t,e){e?this.#oo(t):this.#so(t)}#oo(t){const e=this.#ht.attribute.getAttributeAt(t);if(e)if(this.#to.selectedWithAttributeOf(e.pred)){const t=this.#Ji.factory.removeAttributesFromItemsByPredCommand(this.#to.all,e);this.#Ji.invoke(t)}else n().warning("None of the selected items has this attribute.");else n().warning(`Attribute No.${t} is not defined`)}#so(t){this.#eo.hide();const e=this.#ht.attribute.getAttributeAt(t);if(e)switch(e.valueType){case"flag":this.#Ji.invoke(this.#Ji.factory.toggleFlagAttributeToItemsCommand(this.#to.all,e));break;case"numeric":!function(t,e,i,o,s){const r=t.findSelectedAttributeWithSamePredicate(e.pred);if(r)t.onlySelectedWithJustOneAttributeOf(e.pred)?Cs(t,e,r,i,o,s):n().warning("Some selected items has zero or multi this attribute.");else{const n=i.factory.createAttributeToItemsCommand(t.all,e);i.invoke(n)}}(this.#to,e,this.#Ji,this.#io,this.#no);break;case"selection":if(this.#to.selectedWithAttributeOf(e.pred))this.#eo.show(e).then(t=>{if(this.#to.isDuplicatedPredAttributeSelected(e.pred))n().warning("An item among the selected has this attribute multiple times.");else{const i=this.#Ji.factory.changeAttributeObjOfItemsCommand(this.#to.all,e,t);this.#Ji.invoke(i)}});else{const t=this.#Ji.factory.createAttributeToItemsCommand(this.#to.all,e);this.#Ji.invoke(t)}break;case"string":!function(t,e,i,o,s){const r=t.findSelectedAttributeWithSamePredicate(e.pred);if(r)t.onlySelectedWithJustOneAttributeOf(e.pred)?Ds(t,r,i,e,o,s):n().warning("Some selected items has zero or multi this attribute.");else{const n=i.factory.createAttributeToItemsCommand(t.all,e);i.invoke(n)}}(this.#to,e,this.#Ji,this.#io,this.#no);break;default:throw`${e.valueType} is unknown attribute`}else n().warning(`Attribute No.${t} is not defined`)}}class Is{createSpanWithTouchDevice(){}expandSpanWithTouchDevice(){}shrinkSpanWithTouchDevice(){}editTextWithTouchDevice(){}editProperties(){}relationClicked(){}relationBollardClicked(t){t.focus()}applyTextSelectionWithTouchDevice(){}manipulateAttribute(){}showPallet(){}hidePallet(){}get isPalletShown(){return!1}updateSelectedTextOffsets(){}}function Ls(t){const e=window.getSelection();return"Range"===e.type&&t.contains(e.anchorNode)&&t.contains(e.focusNode)}function Ns(t,e){return t.querySelector(`input${e}`)&&t.querySelector(`input${e}`).value}function js(){return`#${zs()}${zs()}${zs()}`}function zs(){return Math.floor(155*Math.random()+100).toString(16)}function Bs(t,e){const{pred:i,autocompletionWs:n,default:o,mediaHeight:s,label:r,color:a,min:l,max:c,step:h,valueType:u}=e,d="numeric"===u||"string"===u,f="string"===u,p="flag"===u,m="numeric"===u;return st`
526
+ <div class="${t}__row">
527
+ <label>Predicate</label>
528
+ <input
529
+ value="${i||""}"
530
+ class="${t}__pred textae-editor__promise-dialog__observable-element"
531
+ >
532
+ </div>
533
+ ${"string"===u?function(t,e){return()=>st`
534
+ <div class="${t}__row">
535
+ <label>Autocompletion_ws</label>
536
+ <input
537
+ value="${e||""}"
538
+ class="${t}__autocompletion-ws"
539
+ >
540
+ </div>
541
+ `}(t,n):""}
542
+ ${d?function(t,e){return()=>st`
543
+ <div class="${t}__row">
544
+ <label>Default</label>
545
+ <input
546
+ value="${e||""}"
547
+ class="${t}__default-value"
548
+ >
549
+ </div>
550
+ `}(t,o):""}
551
+ ${f?function(t,e){return()=>st`
552
+ <div class="${t}__row">
553
+ <label>Media Height</label>
554
+ <input
555
+ type="text"
556
+ value="${e||""}"
557
+ class="${t}__media-height"
558
+ >
559
+ </div>
560
+ `}(t,s):""}
561
+ ${p?function(t,e,i){return()=>st`
562
+ <div class="${t}__row">
563
+ <label>Label</label>
564
+ <input
565
+ type="text"
566
+ value="${e||""}"
567
+ class="${t}__label"
568
+ >
569
+ </div>
570
+ <div class="${t}__row">
571
+ <label>Color</label>
572
+ <input
573
+ type="color"
574
+ value="${i||js()}"
575
+ class="${t}__color"
576
+ >
577
+ </div>
578
+ `}(t,r,a):""}
579
+ ${m?function(t,e,i,n){return()=>st`
580
+ <div class="${t}__row">
581
+ <label>Min</label>
582
+ <input
583
+ type="text"
584
+ value="${e||""}"
585
+ class="${t}__min"
586
+ >
587
+ </div>
588
+ <div class="${t}__row">
589
+ <label>Max</label>
590
+ <input
591
+ type="text"
592
+ value="${i||""}"
593
+ class="${t}__max"
594
+ >
595
+ </div>
596
+ <div class="${t}__row">
597
+ <label>Step</label>
598
+ <input
599
+ type="text"
600
+ value="${n||2}"
601
+ class="${t}__step"
602
+ >
603
+ </div>
604
+ `}(t,l,c,h):""}
605
+ `}function Zs(t,e){const{valueType:i}=e;return st`
606
+ <div class="${t}__container">
607
+ <div class="${t}__row">
608
+ <label>Attribute type</label>
609
+ <div class="${t}__value-type-row">
610
+ <label>
611
+ <input
612
+ type="radio"
613
+ name="${t}__value-type"
614
+ value="flag"
615
+ ${"flag"===i?"checked":""}
616
+ >
617
+ <span class="${t}__value-type--flag">
618
+ flag
619
+ </label>
620
+ <label>
621
+ <input
622
+ type="radio"
623
+ name="${t}__value-type"
624
+ value="selection"
625
+ ${"selection"===i?"checked":""}
626
+ >
627
+ <span class="${t}__value-type--selection">
628
+ selection
629
+ </label>
630
+ <label>
631
+ <input
632
+ type="radio"
633
+ name="${t}__value-type"
634
+ value="string"
635
+ ${"string"===i?"checked":""}
636
+ >
637
+ <span class="${t}__value-type--string">
638
+ string
639
+ </label>
640
+ <label>
641
+ <input
642
+ type="radio"
643
+ name="${t}__value-type"
644
+ value="numeric"
645
+ ${"numeric"===i?"checked":""}
646
+ >
647
+ <span class="${t}__value-type--numeric">
648
+ numeric
649
+ </label>
650
+ </div>
651
+ </div>
652
+ ${()=>Bs(t,e)}
653
+ </div>`}const Ws="textae-editor__create-attribute-definition-dialog";class Fs extends $s{constructor(){super("New attribute",Zs(Ws,{valueType:"flag"}),{},()=>this._state),c()(super.el,`[name="${Ws}__value-type"]`,"change",()=>{const t=Zs(Ws,this._state);super.el.closest(".ui-dialog-content").innerHTML=t})}get _state(){const t=super.el.querySelector(`[name="${Ws}__value-type"]:checked`).value;return{pred:Ns(super.el,`.${Ws}__pred`),label:Ns(super.el,`.${Ws}__label`),color:Ns(super.el,`.${Ws}__color`),default:Ns(super.el,`.${Ws}__default-value`),"media height":Ns(super.el,`.${Ws}__media-height`),min:Ns(super.el,`.${Ws}__min`),max:Ns(super.el,`.${Ws}__max`),step:Ns(super.el,`.${Ws}__step`),valueType:t}}}function Xs(t,e){e?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")}function qs(t){const{labelForRangeOrIdOrPattern:e,rangeOrIdOrPattern:i,showDefault:n,default:o,label:s,color:r}=t;return st`
654
+ <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__container">
655
+ <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__row">
656
+ <label>${e}</label>
657
+ <input
658
+ value="${i||""}"
659
+ class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__range_or_id_or_pattern textae-editor__promise-dialog__observable-element"
660
+ >
661
+ </div>
662
+ ${function(t,e){return()=>t?st`
663
+ <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__row">
664
+ <label>
665
+ <input
666
+ type="checkbox"
667
+ ${e?'checked="checked"':""}
668
+ class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__default"
669
+ >
670
+ default
671
+ </label>
672
+ </div>
673
+ `:""}(n,o)}
674
+ <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__row">
675
+ <label>label</label>
676
+ <input
677
+ value="${s||""}"
678
+ class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__label textae-editor__promise-dialog__observable-element"
679
+ >
680
+ </div>
681
+ <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__row">
682
+ <label>
683
+ <input
684
+ type="color"
685
+ value="${r||js()}"
686
+ class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__color"
687
+ >
688
+ color
689
+ </label>
690
+ </div>
691
+ </div>`}class Hs extends $s{constructor(t,e={}){const i={label:e.label,color:e.color};switch(t){case"numeric":i.labelForRangeOrIdOrPattern="range",i.rangeOrIdOrPattern=e.range;break;case"selection":i.labelForRangeOrIdOrPattern="id",i.rangeOrIdOrPattern=e.id,i.showDefault=!0,i.default=e.default;break;case"string":i.labelForRangeOrIdOrPattern="pattern",i.rangeOrIdOrPattern=e.pattern;break;default:throw new Error(`${t} is Unknown Attribute`)}super(Object.keys(e).length?"Edit attribute values":"New attribute value",qs(i),{},()=>{const e=Ns(super.el,".textae-editor__create-or-edit-value-of-attribute-definition-dialog__range_or_id_or_pattern"),i=Ns(super.el,".textae-editor__create-or-edit-value-of-attribute-definition-dialog__label"),n=Ns(super.el,".textae-editor__create-or-edit-value-of-attribute-definition-dialog__color"),o={};switch(i&&(o.label=i),n&&(o.color=n),t){case"numeric":o.range=e;break;case"selection":o.id=e,super.el.querySelector("input.textae-editor__create-or-edit-value-of-attribute-definition-dialog__default").checked&&(o.default=!0);break;case"string":o.pattern=e}return o}),"numeric"===t&&super.el.querySelector(".textae-editor__create-or-edit-value-of-attribute-definition-dialog__range_or_id_or_pattern").addEventListener("input",t=>{const{value:e}=t.target;try{new P(e),Xs(super.button,!0)}catch(t){Xs(super.button,!1)}}),"string"===t&&super.el.querySelector(".textae-editor__create-or-edit-value-of-attribute-definition-dialog__range_or_id_or_pattern").addEventListener("input",t=>{const{value:e}=t.target;try{new RegExp(e),Xs(super.button,!0)}catch(t){Xs(super.button,!1)}}),super.el.querySelector(".textae-editor__create-or-edit-value-of-attribute-definition-dialog__color").addEventListener("input",t=>{const{value:e}=t.target;Xs(super.button,!e||/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e))})}}function Vs(t,e){return!Number.isNaN(parseFloat(e))&&t!==parseFloat(e)}const Ys="textae-editor__edit-attribute-definition-dialog";class Us extends $s{constructor(t){super("Edit attribute",function(t,e){return`\n<div class="${t}__container">\n ${Bs(t,e)}\n</div>`}(Ys,t),{},()=>{const e=Ns(super.el,`.${Ys}__pred`),i=Ns(super.el,`.${Ys}__default-value`),n=new Map;if(t.pred!==e&&n.set("pred",e),"flag"===t.valueType){const e=Ns(super.el,`.${Ys}__label`),i=Ns(super.el,`.${Ys}__color`);t.label!==e&&n.set("label",e),t.color!==i&&n.set("color",i)}if("string"===t.valueType){t.default!==i&&n.set("default",i);const e=Ns(super.el,`.${Ys}__autocompletion-ws`),o=Ns(super.el,`.${Ys}__media-height`);t.autocompletionWs!==e&&n.set("autocompletion_ws",e),t.mediaHeight!==o&&n.set("media height",o)}if("numeric"===t.valueType){Vs(t.default,i)&&n.set("default",i);const e=Ns(super.el,`.${Ys}__min`),o=Ns(super.el,`.${Ys}__max`),s=Ns(super.el,`.${Ys}__step`);Vs(t.min,e)&&n.set("min",e),Vs(t.max,o)&&n.set("max",o),Vs(t.step,s)&&n.set("step",s)}return n})}}function Gs(t,e,i,o){!function(t){c()(t,".textae-editor__pallet__attribute","dragstart",t=>{t.dataTransfer.setData("application/x-textae-attribute-tab-old-index",t.target.dataset.index),function(t){t.target.closest(".textae-editor__pallet__content").classList.add("textae-editor__pallet__content--dragging")}(t)}),c()(t,".textae-editor__pallet__attribute","dragend",t=>{!function(t){t.target.closest(".textae-editor__pallet__content").classList.remove("textae-editor__pallet__content--dragging")}(t)})}(e),function(t,e){c()(t,".textae-editor__pallet__drop-target","dragover",t=>{const e=t.target.closest(".textae-editor__pallet__content").querySelector(".textae-editor__pallet__attribute").offsetWidth;t.target.innerHTML=`<div style="width: ${e}px;"></div>`,t.preventDefault()}),c()(t,".textae-editor__pallet__drop-target","dragleave",t=>{t.target.innerHTML=""}),c()(t,".textae-editor__pallet__drop-target","drop",t=>{const i=parseInt(t.dataTransfer.getData("application/x-textae-attribute-tab-old-index")),n=parseInt(t.target.dataset.index);e.invoke(e.factory.moveAttributeDefinitionCommand(i,i<n?n-1:n))})}(e,i),c()(e,".textae-editor__pallet__attribute","click",e=>{t.showAttribute(e.target.dataset.attribute)}),c()(e,".textae-editor__pallet__create-predicate","click",()=>(new Fs).open().then(t=>{t.pred&&i.invoke(i.factory.createAttributeDefinitionCommand(t))})),c()(e,".textae-editor__pallet__edit-predicate","click",()=>new Us(t.attrDef).open().then(e=>{e.size&&""!==e.get("pred")&&i.invoke(i.factory.changeAttributeDefinitionCommand(t.attrDef,e))})),c()(e,".textae-editor__pallet__delete-predicate","click",()=>i.invoke(i.factory.deleteAttributeDefinitionCommand(t.attrDef))),c()(e,".textae-editor__pallet__selection-attribute-label","click",e=>{if(o.selectedWithAttributeOf(t.attrDef.pred))if(o.isDuplicatedPredAttributeSelected(t.attrDef.pred))n().warning("An item among the selected has this attribute multiple times.");else{const n=i.factory.changeAttributeObjOfItemsCommand(o.all,t.attrDef,e.target.dataset.id);i.invoke(n)}else{const n=i.factory.createAttributeToItemsCommand(o.all,t.attrDef,e.target.dataset.id);i.invoke(n)}}),c()(e,".textae-editor__pallet__add-attribute-value-button","click",()=>new Hs(t.attrDef.valueType).open().then(e=>{(e.range||e.id||e.pattern)&&i.invoke(i.factory.addValueToAttributeDefinitionCommand(t.attrDef,e))})),c()(e,".textae-editor__pallet__edit-value","click",e=>{const n=t.attrDef.values[e.target.dataset.index];new Hs(t.attrDef.valueType,n).open().then(o=>{if(o.range||o.id||o.pattern){const s=Object.keys(o).reduce((t,e)=>t||o[e]!==n[e],!1)||Object.keys(n).reduce((t,e)=>t||o[e]!==n[e],!1);if(!s)return;i.invoke(i.factory.changeValueOfAttributeDefinitionAndObjectOfSelectionAttributeCommand(t.attrDef.externalFormat,e.target.dataset.index,o))}})}),c()(e,".textae-editor__pallet__remove-value","click",e=>i.invoke(i.factory.removeValueFromAttributeDefinitionCommand(t.attrDef,e.target.dataset.index))),c()(e,".textae-editor__pallet__add-attribute","click",()=>i.invoke(i.factory.createAttributeToItemsCommand(o.all,t.attrDef))),c()(e,".textae-editor__pallet__edit-object","click",()=>{const e=o.findSelectedAttributeWithSamePredicate(t.attrDef.pred);switch(t.attrDef.valueType){case"numeric":Cs(o,t.attrDef,e,i);break;case"string":Ds(o,e,i,t.attrDef);break;default:throw new Error(`Invalid attribute valueType: ${t.attrDef.valueType}`)}}),c()(e,".textae-editor__pallet__remove-attribute","click",()=>i.invoke(i.factory.removeAttributesFromItemsByPredCommand(o.all,t.attrDef)))}function Ks(t){const{isLock:e,selectionModelItems:i,selectedPred:n,attributes:o,hasDiff:s}=t,r=1===(a=i.size)?"1 item selected":a>1?`${a} items selected`:"";var a;const l=o.length<30,c=n===(o[o.length-1]&&o[o.length-1].pred);return()=>st`
692
+ <div class="textae-editor__pallet__header-first-row">
693
+ <div class="textae-editor__pallet__information">
694
+ <span class="textae-editor__pallet__lock-icon" style="display: ${e?"inline-block":"none"};">locked</span>
695
+ ${n&&i.size>0?()=>st`
696
+ ${function(t){const{selectionModelItems:e,selectedPred:i}=t,n=e.selectedWithoutAttributeOf(i);return()=>n?'\n <button\n type="button"\n class="textae-editor__pallet__add-attribute"\n >add to</button>\n ':'\n <button\n type="button"\n class="textae-editor__pallet__add-attribute"\n disabled="disabled"\n title="All the selected items already have this attribute."\n >add to</button>\n '}(t)}
697
+ ${function(t){const{attrDef:e,selectionModelItems:i,selectedPred:n}=t,{valueType:o}=e,s=i.onlySelectedWithJustOneAttributeOf(n);return()=>"string"===o||"numeric"===o?s?'\n <button\n type="button"\n class="textae-editor__pallet__edit-object"\n >edit object of\n </button>\n ':'\n <button\n type="button"\n class="textae-editor__pallet__edit-object"\n disabled="disabled"\n title="Some selected items has zero or multi this attribute."\n >edit object of\n </button>\n ':""}(t)}
698
+ ${function(t){const{selectionModelItems:e,selectedPred:i}=t,n=e.selectedWithAttributeOf(i);return()=>n?'\n <button\n type="button"\n class="textae-editor__pallet__remove-attribute"\n >remove from</button>\n ':'\n <button\n type="button"\n class="textae-editor__pallet__remove-attribute"\n disabled="disabled"\n title="None of the selected items has this attribute."\n >remove from</button>\n '}(t)}
699
+ the
700
+ `:""}
701
+ <span class="textae-editor__pallet__selected-entity-label">${r}</span>
702
+ </div>
703
+ <div class="textae-editor__pallet__buttons">
704
+ <span class="textae-editor__pallet__button textae-editor__pallet__import-button" title="Import"></span>
705
+ <span class="textae-editor__pallet__button textae-editor__pallet__upload-button ${s?"textae-editor__pallet__upload-button--transit":""}" title="Upload"></span>
706
+ </div>
707
+ </div>
708
+ <div class="textae-editor__pallet__header-second-row">
709
+ <p class="textae-editor__pallet__attribute ${n?"":"textae-editor__pallet__attribute--selected"}" data-attribute="">
710
+ Type
711
+ </p>
712
+ ${o.map((t,e,i)=>function({pred:t},e,i,n){const o=i[e-1],s=t!==n&&(!o||o.pred!==n);return()=>st`
713
+ ${s?()=>`<span class="textae-editor__pallet__drop-target" data-index="${e}"></span>`:""}
714
+ <p
715
+ class="textae-editor__pallet__attribute${t===n?" textae-editor__pallet__attribute--selected":""}"
716
+ data-attribute="${t}"
717
+ data-index="${e}"
718
+ ${t===n?"draggable=true":""}>
719
+ ${e<9?`${e+1}:`:""}${t}
720
+ </p>
721
+ `}(t,e,i,n))}
722
+ ${function(t,e,i){return()=>t?"":`\n ${e?"":'<span class="textae-editor__pallet__drop-target" data-index="-1"></span>'}\n ${i?'\n <p class="textae-editor__pallet__attribute textae-editor__pallet__create-predicate">\n <span class="textae-editor__pallet__create-predicate__button" title="Add a new attribute"></span>\n </p>\n ':""}`}(e,c,l)}
723
+ </div>
724
+ `}function Js(t){const{attrDef:e}=t,{pred:i}=e,{valueType:n}=e;return()=>st`
725
+ <div>
726
+ Attribute
727
+ <span
728
+ class="textae-editor__pallet__predicate__value-type textae-editor__pallet__predicate__value-type--${n}"
729
+ title="${n} type">
730
+ </span>
731
+ "${i}"
732
+ ${function(t){const{isLock:e,numberOfItemsUsingSelectedPred:i}=t;return e?()=>'\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__table-button--disabled textae-editor__pallet__edit-predicate"\n disabled="disabled">\n </button>\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__table-button--disabled textae-editor__pallet__delete-predicate"\n disabled="disabled">\n </button>\n ':()=>`\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__edit-predicate"\n title="Edit this predicate.">\n </button>\n ${function(t){return t.size>0?`\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__table-button--disabled textae-editor__pallet__delete-predicate"\n disabled="disabled"\n title="It cannot be deleted, as this attribute is used for ${t.size} items.">\n </button>\n `:'\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__delete-predicate"\n title="Delete this predicate.">\n </button>\n '}(i)}\n `}(t)}
733
+ </div>
734
+ `}function tr(t){return t?"":()=>'\n <th>\n <span class="textae-editor__pallet__add-attribute-value-button" title="Add new value"></span>\n </th>'}function er(t,e,i){return t?"":()=>`\n <td class="textae-editor__pallet__table-attribute-buttons">\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__edit-value"\n title="Edit this value." data-index="${e}">\n </button>\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__remove-value${i?" textae-editor__pallet__table-button--disabled":""}"\n title="${i?"To activate this button, remove all the annotations of this type.":"Remove this value."}"\n ${i?' disabled="disabled"':""}\n data-index="${e}">\n </button>\n </td>\n `}function ir(t){const{min:e,max:i,step:n,default:o,values:s}=t.attrDef,{isLock:r}=t;return st`
735
+ ${Ks(t)}
736
+ <div>
737
+ <div class="textae-editor__pallet__predicate">
738
+ ${Js(t)}
739
+ min: ${e||'""'}
740
+ max: ${i||'""'}
741
+ step: ${n}
742
+ default: ${o}
743
+ </div>
744
+
745
+ <table>
746
+ <thead>
747
+ <tr>
748
+ <th>range</th>
749
+ <th>label</th>
750
+ <th>color</th>
751
+ ${tr(r)}
752
+ </tr>
753
+ </thead>
754
+ <tbody>
755
+ ${s.map(({color:t="",range:e,label:i="",indelible:n},o)=>function(t,e,i,n,o,s){return()=>st`
756
+ <tr class="textae-editor__pallet__row" style="background-color: ${t};">
757
+ <td class="textae-editor__pallet__attribute-label">
758
+ ${e}
759
+ </td>
760
+ <td class="textae-editor__pallet__short-label">
761
+ ${i}
762
+ </td>
763
+ <td class="textae-editor__pallet__short-label">
764
+ ${t}
765
+ </td>
766
+ ${er(n,o,s)}
767
+ </tr>
768
+ `}(t,e,i,r,o,n))}
769
+ </tbody>
770
+ </table>
771
+ </div>
772
+ `}function nr(t,e){const{values:i}=t.attrDef,{isLock:n,selectedPred:o}=t;return st`
773
+ ${Ks(t)}
774
+ <div>
775
+ <div class="textae-editor__pallet__predicate">
776
+ ${Js(t)}
777
+ </div>
778
+
779
+ <table>
780
+ <thead>
781
+ <tr>
782
+ <th>id</th>
783
+ <th>label</th>
784
+ <th>color</th>
785
+ ${tr(n)}
786
+ </tr>
787
+ </thead>
788
+ <tbody>
789
+ ${i.map(({color:t="",id:i,default:s,label:r=""},a)=>function(t,e,i,n,o,s,r,a){return()=>st`
790
+ <tr class="textae-editor__pallet__row" style="background-color: ${t};">
791
+ <td class="textae-editor__pallet__selection-attribute-label" data-id="${e}">
792
+ ${e}
793
+ ${()=>i?'<span class="textae-editor__pallet__default-icon" title="This type is set as a default type."></span>':""}
794
+ </td>
795
+ <td class="textae-editor__pallet__short-label">
796
+ ${n}
797
+ </td>
798
+ <td class="textae-editor__pallet__short-label">
799
+ ${t}
800
+ </td>
801
+ ${er(o,s,r.isSelectionAttributeValueIndelible(a,e))}
802
+ </tr>
803
+ `}(t,i,s,r,n,a,e,o))}
804
+ </tbody>
805
+ </table>
806
+ </div>
807
+ `}function or(t){const{default:e,mediaHeight:i,values:n}=t.attrDef,{isLock:o}=t;return st`
808
+ ${Ks(t)}
809
+ <div>
810
+ <div class="textae-editor__pallet__predicate">
811
+ ${Js(t)}
812
+ media height: ${i||'""'}
813
+ default: ${e}
814
+ </div>
815
+
816
+ <table>
817
+ <thead>
818
+ <tr>
819
+ <th>pattern</th>
820
+ <th>label</th>
821
+ <th>color</th>
822
+ ${tr(o)}
823
+ </tr>
824
+ </thead>
825
+ <tbody>
826
+ ${n.map(({color:t=" ",pattern:e="",label:i="",indelible:n},s)=>function(t,e,i,n,o,s){return()=>st`
827
+ <tr class="textae-editor__pallet__row" style="background-color: ${t};">
828
+ <td class="textae-editor__pallet__attribute-label">
829
+ ${e}
830
+ </td>
831
+ <td class="textae-editor__pallet__short-label">
832
+ ${i}
833
+ </td>
834
+ <td class="textae-editor__pallet__short-label">
835
+ ${t}
836
+ </td>
837
+ ${er(n,o,s)}
838
+ </tr>`}(t,e,i,o,s,n))}
839
+ </tbody>
840
+ </table>
841
+ </div>
842
+ `}function sr(t,e,i,n,o,s,r){return()=>st`
843
+ <tr class="textae-editor__pallet__row" style="background-color: ${t};">
844
+ <td class="textae-editor__pallet__label" data-id="${e}">
845
+ <span title="${e}">
846
+ ${e}
847
+ </span>
848
+ ${i?()=>st`<a href="${i}" target="_blank"><span class="textae-editor__pallet__link"></span></a>`:""}
849
+ ${n?()=>'<span class="textae-editor__pallet__default-icon" title="This type is set as a default type."></span>':""}
850
+ </td>
851
+ <td class="textae-editor__pallet__short-label">
852
+ ${o}
853
+ </td>
854
+ <td class="textae-editor__pallet__use-number">
855
+ ${s}
856
+ </td>
857
+ <td class="textae-editor__pallet__table-buttons">
858
+ <button
859
+ type="button"
860
+ class="textae-editor__pallet__table-button textae-editor__pallet__select-all${s?"":" textae-editor__pallet__table-button--disabled"}"
861
+ title="Select all the cases of this type."
862
+ data-id="${e}"
863
+ data-use-number="${s}">
864
+ </button>
865
+ ${r?"":function(t,e,i,n,o){return()=>st`
866
+ <button
867
+ type="button"
868
+ class="textae-editor__pallet__table-button textae-editor__pallet__edit-type"
869
+ title="Edit this type." data-id="${t}"
870
+ data-color="${e}"
871
+ data-is-default="${i}">
872
+ </button>
873
+ <button
874
+ type="button"
875
+ class="textae-editor__pallet__table-button textae-editor__pallet__remove${o?" textae-editor__pallet__table-button--disabled":""}"
876
+ title="${o?"To activate this button, remove all the annotations of this type.":"Remove this type."}"
877
+ data-id="${t}"
878
+ data-label="${n}">
879
+ </button>
880
+ `}(e,t,n,o,s)}
881
+ </td>
882
+ </tr>`}function rr(t){const{types:e,isLock:i}=t;return st`
883
+ ${Ks(t)}
884
+ <table>
885
+ <tbody>
886
+ <tr>
887
+ <th>id</th>
888
+ <th>label</th>
889
+ <th title="Number of annotations.">#</th>
890
+ <th>
891
+ ${i?"":()=>'<span class="textae-editor__pallet__add-button" title="Add new type"></span>'}
892
+ </th>
893
+ </tr>
894
+ ${e.length?e.map(({color:t="",id:e,uri:n,defaultType:o,label:s="",useNumber:r})=>sr(t,e,n,o,s,r,i)):()=>'\n <tr class="textae-editor__pallet__row">\n <td class="textae-editor__pallet__no-config" colspan="4">There is no Entity definition.</td>\n </tr>\n '}
895
+ </tbody>
896
+ </table>
897
+ `}function ar(t,e,i,n,o,s,r){const{attributes:a}=o;if(!i)return rr({isLock:r,attributes:a,hasDiff:e,types:t,selectionModelItems:n});const l=a.find(t=>t.pred===i);if(!l)return rr({isLock:r,attributes:a,hasDiff:e,types:t,selectionModelItems:n});const c={isLock:r,attributes:a,hasDiff:e,attrDef:l,selectedPred:i,selectionModelItems:n,numberOfItemsUsingSelectedPred:new Set(s.filter(t=>t.pred===i).map(t=>t.subj))};switch(l.valueType){case"flag":return function(t){const{label:e,color:i}=t.attrDef;return st`
898
+ ${Ks(t)}
899
+ <div>
900
+ <div class="textae-editor__pallet__predicate">
901
+ ${Js(t)}
902
+ label: "${e||""}"
903
+ color: "${i||""}"
904
+ </div>
905
+ </div>
906
+ `}(c);case"numeric":return ir(c);case"selection":return nr(c,o);case"string":return or(c);default:throw"attrDef.valueType is unknown attribute"}}function lr(t){for(const e of t.querySelectorAll(".textae-editor__pallet__attribute"))e.addEventListener("mousedown",t=>{t.stopPropagation()})}class cr extends _s{#ht;#m;#A;#to;#Ii;#ro;constructor(t,e,i,n,o,s,r,a,l,h){super(t,a,h),this.#ht=i,this.#m=n,this.#A=o,this.#to=s,this.#Ii=l,c()(this._el,".textae-editor__pallet__import-button","click",()=>e.emit("textae-event.pallet.import-button.click")),c()(this._el,".textae-editor__pallet__upload-button","click",()=>e.emit("textae-event.pallet.upload-button.click")),Gs(this,this._el,r,s),e.on("textae-event.type-definition.attribute.create",t=>{this.showAttribute(t)}).on("textae-event.type-definition.attribute.change",t=>{this.showAttribute(t)}).on("textae-event.type-definition.attribute.delete",()=>{this.showAttribute(null)}).on("textae-event.type-definition.attribute.move",()=>{this.updateDisplay()}),e.on("textae-event.annotation-data.events-observer.unsaved-change",()=>this.updateDisplay()),e.on("textae-event.selection.entity.change",()=>this.updateDisplay()),e.on("textae-event.editor.unselect",()=>this.hide()).on("textae-event.resource.configuration.save",()=>this.updateDisplay()).on("textae-event.type-definition.lock",()=>this.updateDisplay()),e.on("textae-event.type-definition.entity.change",()=>this.updateDisplay()).on("textae-event.type-definition.entity.delete",()=>this.updateDisplay()).on("textae-event.type-definition.entity.change-default",()=>this.updateDisplay()).on("textae-event.type-definition.relation.change",()=>this.updateDisplay()).on("textae-event.type-definition.relation.delete",()=>this.updateDisplay()).on("textae-event.type-definition.relation.change-default",()=>this.updateDisplay())}updateDisplay(){super.updateDisplay(),lr(this._el)}showPallet(){this.show()}hidePallet(){this.hide()}show(){this.#ro=null,super.show(),lr(this._el)}showAttribute(t){this.#ro=t,this.updateDisplay()}selectLeftAttributeTab(){this.#ro&&(0===this.#ao?this.showAttribute():this.showAttribute(this.#lo[this.#ao-1].pred))}selectRightAttributeTab(){if(this.#ro){if(this.#ao===this.#lo.length-1)return;this.showAttribute(this.#lo[this.#ao+1].pred)}else this.#lo.length&&this.showAttribute(this.#lo[0].pred)}get#ao(){return this.#lo.findIndex(t=>t.pred===this.#ro)}get _content(){return ar(this.#A.pallet,this.#Ii.diffOfConfiguration,this.#ro,this.#to,this.#ht.attribute,this.#m.all,this.#ht.isLock)}get attrDef(){return this.#ht.attribute.get(this.#ro)}get#lo(){return this.#ht.attribute.attributes}}class hr extends $s{constructor(t,e,i,n){super(t,function(t){const{id:e,label:i,color:n,isDefault:o}=t;return st`
907
+ <div class="textae-editor__type-definition-dialog__container">
908
+ <div class="textae-editor__type-definition-dialog__row ui-front">
909
+ <label>Id</label>
910
+ <input
911
+ class="textae-editor__type-definition-dialog--id textae-editor__promise-dialog__observable-element"
912
+ value="${e||""}">
913
+ </div>
914
+ <div class="textae-editor__type-definition-dialog__row ui-front">
915
+ <label>Label<span></span></label>
916
+ <input
917
+ class ="textae-editor__promise-dialog__observable-element"
918
+ value="${i}">
919
+ </div>
920
+ <div class="textae-editor__type-definition-dialog__color-picker">
921
+ <label><input
922
+ class="textae-editor__type-definition-dialog__color-picker__input"
923
+ type="color"
924
+ value="${n}">
925
+ Color</label>
926
+ </div>
927
+ <div class="textae-editor__type-definition-dialog__set-default">
928
+ <label><input
929
+ class="textae-editor__type-definition-dialog__set-default__input"
930
+ type="checkbox" ${o?'checked="checked" disabled="disabled"':""}>
931
+ Default type</label>
932
+ </div>
933
+ </div>`}(e),{},()=>{const t=super.el.querySelectorAll("input");return n(t[0].value,t[1].value,t[2].value,t[3].checked)});const[o,s]=super.el.querySelectorAll("input"),r=(t,e)=>i.searchByLabel(t,e),a=t=>{o.value=t.id,s.value=t.label},l=t=>`${t.id} ${t.label}`;new Ms({inputElement:o,onSearch:r,onSelect:a,onRender:l}),new Ms({inputElement:s,onSearch:r,onSelect:a,onRender:l})}}class ur extends hr{constructor(t){super("New type",{id:null,label:"",color:t.defaultColor,isDefault:!1},t,(t,e,i,n)=>{if(""===t)return;const o={id:t,color:i};return""!==e&&(o.label=e),n&&(o.default=n),{newType:o}})}}class dr extends hr{constructor(t,e,i,n){const o=t.getLabel(e)||"",s={id:e,label:o,color:i,isDefault:n};super("Edit type",s,t,(t,i,n,o)=>{const r=function(t,e){const i=new Map;return t.id!==e.id&&i.set("id",e.id),t.label!==e.label&&i.set("label",""===e.label?null:e.label),t.color!==e.color&&i.set("color",""===e.color?null:e.color),t.isDefault!==e.isDefault&&i.set("default",!!e.isDefault||null),i}(s,{id:t,label:i,color:n,isDefault:o});return{id:e,changedProperties:r}})}}function fr(t){return!t.classList.contains("textae-editor__pallet__table-button--disabled")}class pr{static create(t,e,i,n,o,s,r,a,l,h,u,d,f,p){const m=new cr(t,e,i,n,o,s,r,a,l,h);return function(t,e,i,n,o,s){c()(t.el,".textae-editor__pallet__add-button","click",()=>{new ur(i).open().then(({newType:t})=>e.invoke(e.factory.createTypeDefinitionCommand(i,t)))}),c()(t.el,".textae-editor__pallet__label","click",t=>e.invoke(e.factory.changeTypeOfSelectedItemsCommand(n,t.delegateTarget.dataset.id))),c()(t.el,".textae-editor__pallet__select-all","click",t=>{if(!fr(t.target))return;o.removeAll();const e=s.getInstanceContainerFor(n).findByType(t.delegateTarget.dataset.id).map(({id:t})=>t);o.add(n,e)}),c()(t.el,".textae-editor__pallet__edit-type","click",t=>{new dr(i,t.target.dataset.id,t.target.dataset.color.toLowerCase(),"true"===t.target.dataset.isDefault).open().then(({id:t,changedProperties:o})=>{o.size&&e.invoke(e.factory.changeTypeDefinitionCommand(i,n,t,o))})}),c()(t.el,".textae-editor__pallet__remove","click",t=>{if(!fr(t.target))return;const{id:n}=t.delegateTarget.dataset,{label:o}=t.delegateTarget.dataset,s={id:n,label:o||""};if(void 0===n)throw new Error("You must set the type id to remove.");e.invoke(e.factory.removeTypeDefinitionCommand(i,s))})}(m,r,o,u,d,f),L(p,()=>m,["showPallet","hidePallet","selectLeftAttributeTab","selectRightAttributeTab"]),this.#co(t,m),m}static#co(t,e){t.appendChild(e.el)}}function mr(t,e,i){const n=()=>i?'disabled="disabled" title="This predicate is already used with its default value."':st`title="${t} type"`;return()=>st`
934
+ <button
935
+ type="button"
936
+ class="textae-editor__edit-type-values-dialog__add-attribute textae-editor__edit-type-values-dialog__add-attribute--${t}"
937
+ data-pred="${e}"
938
+ ${n}> ${e}</button>`}function gr(t,e){const{pred:i,obj:n}=t,{valueType:o}=e.get(i);switch(o){case"string":return t.label||e.getLabel(i,n)||"";case"selection":case"numeric":case"flag":return e.getLabel(i,n)||"";default:throw`unknown attribute type: ${o}`}}function vr(t,e,i,n){const{id:o,subj:s,pred:r,obj:a}=t,l=i[e-1],c=l&&l.pred,h=n.getIndexOf(r),{valueType:u}=n.get(r),d=()=>r===c?'<td class="shortcut-key" rowspan="2"></td>':`<td class="shortcut-key" rowspan="2">\n ${h<9?`<span class="textae-editor__edit-type-values-dialog__shortcut-key" title="Shortcut key for this predicate">${h+1}</span>`:""}\n </td>\n `;return()=>st`
939
+ <tr class="textae-editor__edit-type-values-dialog__attribute">
940
+ ${d}
941
+ <td rowspan="2">
942
+ <span
943
+ class="textae-editor__edit-type-values-dialog__attribute-predicate ${r===c?"":`textae-editor__edit-type-values-dialog__attribute-predicate--${u}`}"
944
+ data-pred="${r}"
945
+ title="${u} type"
946
+ >
947
+ ${r===c?"":r}
948
+ </span>
949
+ </td>
950
+ <td>
951
+ <span
952
+ class="textae-editor__edit-type-values-dialog__attribute-value"
953
+ data-id="${o}"
954
+ data-subj="${s||""}""
955
+ data-obj="${a}"
956
+ data-label="${gr(t,n)}"
957
+ >
958
+ ${gr(t,n)||a}
959
+ </span>
960
+ </td>
961
+ </tr>
962
+ <tr>
963
+ <td>
964
+ <button
965
+ type="button"
966
+ class="textae-editor__edit-type-values-dialog__edit-attribute"
967
+ data-pred="${r}"
968
+ data-index="${e}"
969
+ ${"flag"===u?'disabled="disabled"':""}>
970
+ </button>
971
+ <button
972
+ type="button"
973
+ class="textae-editor__edit-type-values-dialog__remove-attribute"
974
+ data-index="${e}">
975
+ </button>
976
+ </td>
977
+ </tr>
978
+ `}function yr(t,e,i,n,o){return st`
979
+ <div style="overflow-y: auto; max-height: 36em; overflow-x: hidden;">
980
+ <table class="textae-editor__edit-type-values-dialog__table">
981
+ <thead>
982
+ <tr>
983
+ <th></th>
984
+ <th>Predicate</th>
985
+ <th>Value/Label</th>
986
+ </tr>
987
+ </thead>
988
+ <tbody>
989
+ ${s=t,r=e,()=>st`
990
+ <tr>
991
+ <td rowspan="2"></td>
992
+ <td>
993
+ <span class="textae-editor__edit-type-values-dialog__type-predicate">type</span>
994
+ </td>
995
+ <td class="ui-front">
996
+ <input class="textae-editor__edit-type-values-dialog__type-name textae-editor__promise-dialog__observable-element" value="${s}">
997
+ </td>
998
+ </tr>
999
+ <tr>
1000
+ <td></td>
1001
+ <td>
1002
+ <span class="textae-editor__edit-type-values-dialog__type-label">${r}</span>
1003
+ </td>
1004
+ </tr>
1005
+ `}
1006
+ ${i.map((t,e,i)=>vr(t,e,i,n))}
1007
+ </tbody>
1008
+ </table>
1009
+ </div>
1010
+ <fieldset>
1011
+ <legend>
1012
+ <span class="textae-editor__edit-type-values-dialog__open-pallet" title="${o} Configuration"></span>
1013
+ Available Predicates:
1014
+ </legend>
1015
+ <div class="textae-editor__edit-type-values-dialog__add-attribute-buttons">
1016
+ ${n.attributes.map(({pred:t,valueType:e})=>mr(e,t,function(t,e,i){return t.some(t=>t.pred===e&&String(t.obj)===String(i.get(e).default))}(i,t,n)))}
1017
+ </div>
1018
+ </fieldset>
1019
+ `;var s,r}function Or(t){const e=t.querySelector(".textae-editor__edit-type-values-dialog__type-name").value,i=t.querySelector(".textae-editor__edit-type-values-dialog__type-label").innerText,n=[];for(const e of t.querySelectorAll(".textae-editor__edit-type-values-dialog__attribute"))n.push({id:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-value").dataset.id,subj:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-value").dataset.subj,pred:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-predicate").dataset.pred,obj:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-value").dataset.obj,label:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-value").dataset.label});return{typeName:e,label:i,attributes:n}}class br{#ho;#$e;#uo;#rt;#do;constructor(t,e,i,n,o){this.#ho=t,this.#$e=e,this.#uo=i,this.#rt=n,this.#do=o}onClick(t){const{pred:e}=t.target.dataset,i=this.#$e.get(e),n=parseInt(this.#rt.closest(".textae-editor__dialog").style["z-index"]),{typeName:o,label:s,attributes:r}=Or(this.#rt);switch(i.valueType){case"numeric":new Ts(i,r[t.target.dataset.index],[r[t.target.dataset.index]]).open().then(({newObj:e})=>{r[t.target.dataset.index].obj=e,this.#do(o,s,r)});break;case"selection":new ks(this.#ho,this.#uo).show(i,n,t.target).then(e=>{r[t.target.dataset.index].obj=e,this.#do(o,s,r)});break;case"string":new Qs(i,r[t.target.dataset.index],[r[t.target.dataset.index]]).open().then(({newObj:e,newLabel:i})=>{r[t.target.dataset.index].obj=e,r[t.target.dataset.index].label=i,this.#do(o,s,r)});break;default:throw`${i.valueType} is unknown attribute.`}}}class xr extends $s{#$e;#A;#nt;#fo;#ot;constructor(t,e,i,n,o,s,r,a){const{typeName:l,attributes:h}=function(t){const{typeName:e}=t[t.length-1],i=[];for(const{attributes:e}of t)for(const t of e)i.some(e=>e.equalsTo(t.pred,t.obj))||i.push(t);return new Tt(e,i)}(s),u=yr(l,n.getLabel(l),h,o,i);super(`${e} [${s.map(({id:t})=>t).join(",")}] Properties`,u,{maxWidth:800},()=>Or(super.el)),this.#$e=o,this.#A=n;const d=super.el,f=new br(t,o,a,d,(t,e,i)=>{this.#nt=t,this.#fo=e,this.#ot=i,this.#do()});c()(d,".textae-editor__edit-type-values-dialog__edit-attribute","click",t=>f.onClick(t)),c()(d,".textae-editor__edit-type-values-dialog__remove-attribute","click",t=>{const{index:e}=t.target.dataset,i=parseInt(e),{typeName:n,label:o,attributes:s}=Or(d);this.#nt=n,this.#fo=o,this.#ot=s.filter((t,e)=>e!==i),this.#do()}),c()(d,".textae-editor__edit-type-values-dialog__open-pallet","click",()=>{super.close(),r.show()}),c()(d,".textae-editor__edit-type-values-dialog__add-attribute","click",t=>{const{pred:e}=t.target.dataset,i=o.get(e).default,{typeName:n,label:s,attributes:r}=Or(d);this.#nt=n,this.#fo=s,this.#ot=r.concat({pred:e,obj:i,id:""}).sort((t,e)=>o.attributeCompareFunction(t,e)),this.#do()}),this.#po(n)}#do(){super.el.closest(".ui-dialog-content").innerHTML=this.#mo,this.#po(this.#A)}get#mo(){return yr(this.#nt,this.#fo,this.#ot,this.#$e)}#po(t){const e=super.el.querySelector(".textae-editor__edit-type-values-dialog__type-name"),i=super.el.querySelector(".textae-editor__edit-type-values-dialog__type-label");new Ms({inputElement:e,onSearch:(e,i)=>t.searchByLabel(e,i),onSelect:t=>{e.value=t.id,i.innerText=t.label},onRender:t=>`${t.id} ${t.label}`})}}class wr{#Z;#Ji;#go;#vo;#uo;#A;#W;#G;constructor(t,e,i,n,o,s,r,a){this.#Z=t,this.#Ji=e,this.#go=i,this.#vo=n,this.#uo=o,this.#A=s,this.#W=r,this.#G=a}startEditing(t){t.some&&this.#yo(t.all).open().then(t=>this.#Oo(t))}#Oo({typeName:t,label:e,attributes:i=[]}){const n=this.#Ji.factory.changeTypeValuesCommand(e,t,this.#A,i);t&&this.#Ji.invoke(n)}#yo(t){return new xr(this.#Z,this.#G,this.#vo,this.#A,this.#W.typeDictionary.attribute,t,this.#go,this.#uo)}}class _r{constructor(){this.selection=window.getSelection(),console.assert(this.parentOfAnchorNode.closest(".textae-editor__text-box")===this.parentOfFocusNode.closest(".textae-editor__text-box"),"Text selection across editors is disabled")}get isParentOfAnchorNodeTextBox(){return Ae(this.parentOfAnchorNode)}get isParentOfAnchorNodeDenotationSpan(){return Pe(this.parentOfAnchorNode)}get isParentOfAnchorNodeBlockSpan(){return Ce(this.parentOfAnchorNode)}get isParentOfAnchorNodeStyleSpan(){return Ee(this.parentOfAnchorNode)}get isParentOfFocusNodeTextBox(){return Ae(this.parentOfFocusNode)}get isParentOfFocusNodeDenotationSpan(){return Pe(this.parentOfFocusNode)}get isParentOfFocusNodeBlockSpan(){return Ce(this.parentOfFocusNode)}get isParentOfFocusNodeStyleSpan(){return Ee(this.parentOfFocusNode)}get isParentOfBothNodesSame(){return this.parentOfAnchorNode===this.parentOfFocusNode}get isParentOfBothNodesTextBox(){return this.isParentOfAnchorNodeTextBox&&this.isParentOfFocusNodeTextBox}get isParentsParentOfAnchorNodeAndFocusedNodeSame(){return this.parentOfAnchorNode.parentElement===this.parentOfFocusNode.parentElement}get isAnchorNodeParentIsDescendantOfFocusNodeParent(){return this.parentOfAnchorNode.closest(`#${this.parentOfFocusNode.id}`)}get ancestorDenotationSpanOfAnchorNode(){return this.parentOfAnchorNode.closest(".textae-editor__span")}get ancestorDenotationSpanOfFocusNode(){return this.parentOfFocusNode.closest(".textae-editor__span")}get ancestorBlockSpanOfAnchorNode(){return this.parentOfAnchorNode.closest(".textae-editor__block")}get ancestorBlockSpanOfFocusNode(){return this.parentOfFocusNode.closest(".textae-editor__block")}get doesFitInOneBlockSpan(){return this.ancestorBlockSpanOfAnchorNode===this.ancestorBlockSpanOfFocusNode}get parentOfAnchorNode(){return this.selection.anchorNode.parentElement}get parentOfFocusNode(){return this.selection.focusNode.parentElement}}function Sr(t){return t.closest(".textae-editor__signboard")}function kr(){window.getSelection().removeAllRanges()}function $r(t,e,i,n){e.length?t.selectSpanRange(e):i.ctrlKey||i.metaKey?t.span.toggle(n):t.selectSpan(n)}class Tr{#Z;#W;#tn;#bo;#go;constructor(t,e,i,n,o){this.#Z=t,this.#W=e,this.#tn=i,this.#bo=n,this.#go=o}bind(){const t=[];return t.push(c()(this.#Z,".textae-editor__text-box","click",t=>{t.target.classList.contains("textae-editor__text-box")&&this.#xo()})),t.push(c()(this.#Z,".textae-editor","click",t=>{t.target.classList.contains("textae-editor")&&this.#wo()})),t.push(c()(this.#Z,".textae-editor__signboard","mousedown",()=>this.#_o())),t.push(c()(this.#Z,".textae-editor__signboard__type-values","click",t=>{const e=Sr(t.target).dataset.id;this.#So(t,e)})),t.push(c()(this.#Z,".textae-editor__block","mouseup",t=>{t.target.classList.contains("textae-editor__block")&&this.#ko()})),t.push(c()(this.#Z,".textae-editor__block-hit-area","mouseup",t=>{t.target.classList.contains("textae-editor__block-hit-area")&&this.#$o(t)})),t.push(c()(this.#Z,".textae-editor__style","mouseup",t=>{t.target.classList.contains("textae-editor__style")&&this.#To(t)})),t.push(c()(this.#Z,".textae-editor__span","mouseup",t=>{t.target.classList.contains("textae-editor__span")&&this.#Co(t)})),t}#wo(){this.#go.hide(),this.#tn.removeAll()}#xo(){"Caret"===window.getSelection().type&&(this.#go.hide(),this.#tn.removeAll()),Ls(this.#Z.querySelector(".textae-editor__text-box"))&&this.#bo.editFor()}#ko(){"Caret"===window.getSelection().type&&(this.#go.hide(),kr(),this.#tn.removeAll()),Ls(this.#Z.querySelector(".textae-editor__text-box"))&&this.#bo.editFor()}#$o(t){2===t.button&&kr();const e=window.getSelection();if("Caret"===e.type||"None"===e.type){const e=t.target.dataset.id;this.#Po(t,e)}}#To(t){"Caret"===window.getSelection().type&&this.#tn.removeAll(),Ls(this.#Z.querySelector(".textae-editor__text-box"))&&(this.#bo.editFor(),t.stopPropagation())}#Co(t){"Caret"===window.getSelection().type&&this.#tn.removeAll(),Ls(this.#Z.querySelector(".textae-editor__text-box"))&&(this.#bo.editFor(),t.stopPropagation())}#_o(){this.#Z.focus()}#So(t,e){if(this.#W.entityInstanceContainer.get(e).isBlock){t.ctrlKey||t.metaKey?this.#tn.entity.toggle(e):this.#tn.selectEntity(e);const i=this.#tn.entity.all.map(t=>t.span).map(t=>t.id);this.#tn.add("span",i)}}#Po(t,e){const i=this.#tn.span.singleId,n=t.shiftKey&&i?this.#W.spanInstanceContainer.rangeBlockSpan(i,e):[];$r(this.#tn,n,t,e);const o=this.#tn.span.all.map(t=>t.entities.at(0)).map(t=>t.id);this.#tn.add("entity",o)}}function Cr(t,e,i,o,s,r,a,l,c){if(a){o.removeAll();const h=ge(t,a),u=function(t,e,i,o,s,r,a){const{begin:l,end:c}=t.getSpan(s).getShortenInAnchorNodeToFocusNodeDirection(o,e,r);if(t.isBoundaryCrossingWithOtherSpans(l,c))return n().warning("A span cannot be shrunken to make a boundary crossing."),!1;const h=t.findDenotation(l,c);return l<c&&!h?(a(l,c),!1):(i.invoke(i.factory.removeSpanCommand(s)),!0)}(e,i,s,r,a,l,c);u&&h&&o.selectSpan(h.id)}}class Pr{#Z;#W;#Eo;#Ji;#Ii;#tn;constructor(t,e,i,n,o,s){this.#Z=t,this.#W=e,this.#Eo=i,this.#Ji=n,this.#Ii=o,this.#tn=s}editFor(){const t=new _r;if(t.isParentOfAnchorNodeTextBox){if(t.isParentOfFocusNodeTextBox)return void this.#Ao();if(t.isParentOfFocusNodeDenotationSpan||t.isParentOfFocusNodeStyleSpan)return void(t.ancestorBlockSpanOfFocusNode?this.#Mo(t):this.#Ao());if(t.isParentOfFocusNodeBlockSpan)return void this.#Mo(t)}if(t.isParentOfAnchorNodeDenotationSpan||t.isParentOfAnchorNodeStyleSpan){if(t.isParentOfFocusNodeTextBox||t.isParentOfFocusNodeDenotationSpan||t.isParentOfFocusNodeStyleSpan){if(t.ancestorBlockSpanOfAnchorNode)if(t.doesFitInOneBlockSpan){const{anchor:e,focus:i}=this.#W.textSelection,n=this.#W.getSpan(t.parentOfAnchorNode.id),o=this.#W.getSpan(t.ancestorBlockSpanOfAnchorNode.id);e<i&&n.begin===o.begin||i<e&&n.end===o.end?this.#Mo(t):kr()}else this.#Qo(t);else t.ancestorBlockSpanOfFocusNode?this.#Mo(t):this.#Ao();return}if(t.isParentOfFocusNodeBlockSpan)return void this.#Mo(t)}if(t.isParentOfAnchorNodeBlockSpan){if(t.isParentOfFocusNodeTextBox||t.isParentOfFocusNodeDenotationSpan||t.isParentOfFocusNodeStyleSpan)return void(t.ancestorBlockSpanOfFocusNode?this.#Mo(t):this.#Qo(t));if(t.isParentOfFocusNodeBlockSpan){const{anchor:e}=this.#W.textSelection,i=this.#W.getSpan(t.parentOfFocusNode.id);if(e===i.begin||e===i.end)return void this.#Mo(t)}}kr()}cerateSpanForTouchDevice(){(new _r).isParentOfBothNodesTextBox&&this.#Ao()}expandForTouchDevice(){const t=this.#Do();if(t){const{spanID:e,begin:i,end:n}=t;this.#W.validateNewBlockSpan(i,n,e)&&this.#Ji.invoke(this.#Ji.factory.moveBlockSpanCommand(e,i,n))}}shrinkForTouchDevice(){const t=this.#Ro();if(t){const{spanID:e,begin:i,end:o}=t,s=ge(this.#Z,e);if(this.#W.isBoundaryCrossingWithOtherSpans(i,o))return void n().warning("A span cannot be modified to make a boundary crossing.");if(this.#W.hasParentOf(i,o,e))return;const r=this.#W.findBlock(i,o);i<o&&!r?this.#Ji.invoke(this.#Ji.factory.moveBlockSpanCommand(e,i,o)):(this.#Ji.invoke(this.#Ji.factory.removeSpanCommand(e)),s&&this.#tn.selectSpan(s.id))}}#Ao(){this.#W.hasCharacters(this.#Eo)&&(this.#tn.removeAll(),function(t,e,i,n){const{begin:o,end:s}=t.getTextSelection(n,i);if(t.validateNewBlockSpan(o,s)){const t=e.factory.createBlockSpanCommand({begin:o,end:s});e.invoke(t)}}(this.#W,this.#Ji,this.#Ii.textSelectionAdjuster,this.#Eo)),kr()}#Qo(t){const e=t.ancestorBlockSpanOfAnchorNode.id;this.#tn.removeAll();const{begin:i,end:n}=this.#W.getSpan(e).getExpandedInAnchorNodeToFocusNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo);this.#W.validateNewBlockSpan(i,n,e)&&this.#Ji.invoke(this.#Ji.factory.moveBlockSpanCommand(e,i,n)),kr()}#Mo(t){const e=t.ancestorBlockSpanOfFocusNode.id;Cr(this.#Z,this.#W,this.#W.sourceDoc,this.#tn,this.#Ji,this.#Ii.textSelectionAdjuster,e,this.#Eo,(t,i)=>{this.#Ji.invoke(this.#Ji.factory.moveBlockSpanCommand(e,t,i))}),kr()}#Do(){const t=new _r;if(null==t.ancestorBlockSpanOfAnchorNode&&null==t.ancestorBlockSpanOfFocusNode)return null;if(t.parentOfFocusNode.contains(t.parentOfAnchorNode)){const e=t.parentOfAnchorNode.id;return{spanID:e,...this.#W.getSpan(e).getExpandedInAnchorNodeToFocusNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo)}}if(t.parentOfAnchorNode.contains(t.parentOfFocusNode)){const e=t.parentOfFocusNode.id;return{spanID:e,...this.#W.getSpan(e).getExpandedInFocusNodeToAnchorNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo)}}}#Ro(){const t=new _r;if(null==t.ancestorBlockSpanOfAnchorNode&&null==t.ancestorBlockSpanOfFocusNode)return null;if(t.parentOfAnchorNode===t.parentOfFocusNode)return null;if(t.parentOfFocusNode.contains(t.parentOfAnchorNode)){const e=t.parentOfAnchorNode.id;return{spanID:e,...this.#W.getSpan(e).getShortenInFocusNodeToAnchorNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo)}}if(t.parentOfAnchorNode.contains(t.parentOfFocusNode)){const e=t.parentOfFocusNode.id;return{spanID:e,...this.#W.getSpan(e).getShortenInAnchorNodeToFocusNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo)}}}}class Er extends Is{#Io;#bo;#Ut;#Lo;#W;#tn;#Ii;#go;constructor(t,e,i,n,o,s,r,a){super(),this.#go=pr.create(t,e,i.typeDictionary,i.attributeInstanceContainer,i.typeDictionary.block,n.entity,s,"Block configuration",r,a,"entity",n,i,this);const l=new Pr(t,i,o,s,r,n);this.#Io=new Tr(t,i,n,l,this.#go),this.#Lo=new wr(t,s,this.#go,"Block",a,i.typeDictionary.block,i,"Entity"),this.#tn=n,this.#bo=l,this.#Ut=t.querySelector(".textae-editor__text-box"),this.#W=i,this.#Ii=r;const c=new Rs(s,i.typeDictionary,n.entity,new ks(t,a),()=>this.editProperties(),this.#go);L(this,()=>c,["manipulateAttribute"])}bindMouseEvents(){return this.#Io.bind()}editProperties(){this.#Lo.startEditing(this.#tn.entity)}get isPalletShown(){return this.#go.visibly}createSpanWithTouchDevice(){console.log("createSpanWithTouchDevice"),this.#bo.cerateSpanForTouchDevice()}expandSpanWithTouchDevice(){this.#bo.expandForTouchDevice()}shrinkSpanWithTouchDevice(){this.#bo.shrinkForTouchDevice()}applyTextSelectionWithTouchDevice(){if(Ls(this.#Ut)){const{begin:t,end:e}=this.#W.textSelection,i=this.#W.isBoundaryCrossingWithOtherSpans(t,e),{isParentOfBothNodesTextBox:n}=new _r;this.#Ii.updateButtonsToOperateSpanWithTouchDevice(n,i,i,!1)}else this.#Ii.updateButtonsToOperateSpanWithTouchDevice(!1,!1,!1,!1)}}class Ar{#Z;#tn;#Ji;#ht;#go;constructor(t,e,i,n,o){this.#Z=t,this.#tn=e,this.#Ji=i,this.#ht=n,this.#go=o}bind(){const t=[];return t.push(c()(this.#Z,".textae-editor__text-box","click",()=>this.#wo())),t.push(c()(this.#Z,".textae-editor","click",t=>{t.target.classList.contains("textae-editor")&&this.#wo()})),t.push(c()(this.#Z,".textae-editor__signboard","mousedown",()=>this.#_o())),t.push(c()(this.#Z,".textae-editor__signboard__type-values","click",t=>{const e=Sr(t.target).dataset.id;this.#So(t,e)})),t}#wo(){this.#go.hide(),this.#tn.removeAll()}#_o(){this.#Z.focus()}#So(t,e){!function(t,e,i,n,o){if(t.entity.some){const s=t.entity.singleId,r=o;s===r?t.entity.toggle(s):(e.invoke(e.factory.createRelationCommand({subj:s,obj:r,pred:i.defaultType})),function(t,e,i,n){t.ctrlKey||t.metaKey?e.remove("entity",n):t.shiftKey?(e.remove("entity",i),e.add("entity",[n])):(e.remove("entity",i),e.remove("entity",n))}(n,t,s,r))}else t.selectEntity(o)}(this.#tn,this.#Ji,this.#ht.relation,t,e)}}class Mr extends Is{#Io;#Lo;#tn;#go;constructor(t,e,i,n,o,s,r){super(),this.#go=pr.create(t,e,i.typeDictionary,i.attributeInstanceContainer,i.typeDictionary.relation,n.relation,o,"Relation configuration",s,r,"relation",n,i,this),this.#Io=new Ar(t,n,o,i.typeDictionary,this.#go),this.#Lo=new wr(t,o,this.#go,"Relation",r,i.typeDictionary.relation,i,"Relation"),this.#tn=n;const a=new Rs(o,i.typeDictionary,n.relation,new ks(t,r),()=>this.editProperties(),this.#go);L(this,()=>a,["manipulateAttribute"])}bindMouseEvents(){return this.#Io.bind()}editProperties(){this.#Lo.startEditing(this.#tn.relation)}get isPalletShown(){return this.#go.visibly}relationClicked(t,e){t.ctrlKey||t.metaKey?this.#tn.relation.toggle(e.id):this.#tn.selectRelation(e.id)}relationBollardClicked(t){t.span.forceRenderGrid(),this.#tn.selectEntity(t.id)}}class Qr{#Z;#W;#tn;#bo;#go;constructor(t,e,i,n,o){this.#Z=t,this.#W=e,this.#tn=i,this.#bo=o,this.#go=n}bind(){const t=[];let e=!1;return t.push(c()(this.#Z,".textae-editor__text-box","click",t=>{t.target.classList.contains("textae-editor__text-box")&&!e&&this.#xo()})),t.push(c()(this.#Z,".textae-editor","click",t=>{t.target.classList.contains("textae-editor")&&this.#wo()})),t.push(c()(this.#Z,".textae-editor__signboard","mousedown",()=>this.#_o())),t.push(c()(this.#Z,".textae-editor__signboard__type-values","click",t=>{const e=Sr(t.target).dataset.id;this.#So(t,e)})),t.push(c()(this.#Z,".textae-editor__span","mouseup",t=>{t.target.classList.contains("textae-editor__span")&&(this.#Co(t),e=!0,setTimeout(()=>e=!1,0))})),t.push(c()(this.#Z,".textae-editor__block","mouseup",t=>{t.target.classList.contains("textae-editor__block")&&this.#ko(t)})),t.push(c()(this.#Z,".textae-editor__style","mouseup",t=>{t.target.classList.contains("textae-editor__style")&&this.#To(t)})),t}#wo(){this.#go.hide(),this.#tn.removeAll()}#xo(){this.#go.hide(),Ls(this.#Z.querySelector(".textae-editor__text-box"))?this.#bo.editFor():this.#tn.removeAll()}#Co(t){2===t.button&&kr();const e=window.getSelection();"Caret"!==e.type&&"None"!==e.type||this.#No(t,t.target.id),Ls(this.#Z.querySelector(".textae-editor__text-box"))&&this.#bo.editFor()}#ko(t){2===t.button&&kr();"Caret"===window.getSelection().type&&this.#tn.removeAll(),Ls(this.#Z.querySelector(".textae-editor__text-box"))&&this.#bo.editFor()}#To(t){2===t.button&&kr();if("Caret"===window.getSelection().type){const e=t.target.closest(".textae-editor__span");e?this.#No(t,e.id):this.#tn.removeAll()}Ls(this.#Z.querySelector(".textae-editor__text-box"))&&this.#bo.editFor()}#_o(){this.#Z.focus()}#So(t,e){this.#W.entityInstanceContainer.get(e).isDenotation&&(t.ctrlKey||t.metaKey?this.#tn.entity.toggle(e):this.#tn.selectEntity(e))}#No(t,e){const i=this.#tn.span.singleId,n=t.shiftKey&&i?this.#W.spanInstanceContainer.rangeDenotationSpan(i,e):[];$r(this.#tn,n,t,e)}}function Dr(t,e){return t.isPushed("boundary detection")?t=>e.isDelimiter(t):()=>!0}class Rr{#Z;#W;#tn;#Ji;#Ii;#Eo;constructor(t,e,i,n,o,s){this.#Z=t,this.#W=e,this.#tn=i,this.#Ji=n,this.#Ii=o,this.#Eo=s}editFor(){const t=new _r;if(t.isParentOfAnchorNodeTextBox){if(t.isParentOfFocusNodeTextBox)return void this.#jo();if(t.isParentOfFocusNodeDenotationSpan)return void this.#zo(t);if(t.isParentOfFocusNodeBlockSpan)return void this.#Bo(t);if(t.isParentOfFocusNodeStyleSpan)return void this.#Zo(t)}if(t.isParentOfAnchorNodeDenotationSpan){if(t.isParentOfFocusNodeTextBox)return void this.#Wo(t);if(t.isParentOfFocusNodeDenotationSpan)return void this.#Fo(t);if(t.isParentOfFocusNodeBlockSpan)return void this.#Xo(t);if(t.isParentOfFocusNodeStyleSpan)return void this.#qo(t)}if(t.isParentOfAnchorNodeBlockSpan){if(t.isParentOfFocusNodeTextBox)return void this.#Ho(t);if(t.isParentOfFocusNodeDenotationSpan)return void this.#Vo(t);if(t.isParentOfFocusNodeBlockSpan)return void this.#Yo(t);if(t.isParentOfFocusNodeStyleSpan)return void this.#Uo(t)}if(t.isParentOfAnchorNodeStyleSpan){if(t.isParentOfFocusNodeTextBox)return void this.#Go(t);if(t.isParentOfFocusNodeDenotationSpan)return void this.#Ko(t);if(t.isParentOfFocusNodeBlockSpan)return void this.#Jo(t);if(t.isParentOfFocusNodeStyleSpan)return void this.#ts(t)}}cerateSpanForTouchDevice(){(new _r).isParentOfBothNodesSame&&this.#Ao()}expandForTouchDevice(){const t=this.#Do();if(t){const{spanID:e,begin:i,end:n}=t;if(this.#W.isBoundaryCrossingWithOtherSpans(i,n))return;if(this.#W.findDenotation(i,n))return;this.#Ji.invoke(this.#Ji.factory.moveDenotationSpanCommand(e,i,n))}}shrinkForTouchDevice(){const t=this.#Ro();if(t){const{spanID:e,begin:i,end:o}=t,s=ge(this.#Z,e);if(this.#W.isBoundaryCrossingWithOtherSpans(i,o))return void n().warning("A span cannot be shrunken to make a boundary crossing.");const r=this.#W.findDenotation(i,o);i<o&&!r?this.#Ji.invoke(this.#Ji.factory.moveDenotationSpanCommand(e,i,o)):(this.#Ji.invoke(this.#Ji.factory.removeSpanCommand(e)),s&&this.#tn.selectSpan(s.id))}}#Do(){const t=new _r;if(null==t.ancestorDenotationSpanOfAnchorNode&&null==t.ancestorDenotationSpanOfFocusNode)return null;if(t.parentOfFocusNode.contains(t.parentOfAnchorNode)){const e=t.ancestorDenotationSpanOfAnchorNode.id;return{spanID:e,...this.#W.getSpan(e).getExpandedInAnchorNodeToFocusNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo)}}if(t.parentOfAnchorNode.contains(t.parentOfFocusNode)){const e=t.ancestorDenotationSpanOfFocusNode.id;return{spanID:e,...this.#W.getSpan(e).getExpandedInFocusNodeToAnchorNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo)}}}#Ro(){const t=new _r;if(null==t.ancestorDenotationSpanOfAnchorNode&&null==t.ancestorDenotationSpanOfFocusNode)return null;if(t.parentOfAnchorNode===t.parentOfFocusNode)return null;if(t.parentOfFocusNode.contains(t.parentOfAnchorNode)){const e=t.ancestorDenotationSpanOfAnchorNode.id;return{spanID:e,...this.#W.getSpan(e).getShortenInFocusNodeToAnchorNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo)}}if(t.parentOfAnchorNode.contains(t.parentOfFocusNode)){const e=t.ancestorDenotationSpanOfFocusNode.id;return{spanID:e,...this.#W.getSpan(e).getShortenInAnchorNodeToFocusNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo)}}}#jo(){this.#Ao()}#zo(t){const e=this.#es(t);e?this.#Mo(e):kr()}#Bo(){kr()}#Zo(t){const e=this.#es(t);e?this.#Mo(e):this.#Ao()}#Wo(t){this.#Qo(t.parentOfAnchorNode.id)}#Fo(t){const e=this.#is(t);if(e)return void this.#Mo(e);if(t.isParentOfBothNodesSame)return void this.#Ao();const i=this.#es(t);i?this.#Mo(i):this.#Qo(t.parentOfAnchorNode.id)}#Xo(t){t.parentOfFocusNode.contains(t.parentOfAnchorNode)?this.#Qo(t.parentOfAnchorNode.id):kr()}#qo(t){const e=this.#is(t);if(e)return void this.#Mo(e);if(t.parentOfAnchorNode===t.ancestorDenotationSpanOfFocusNode)return void this.#Ao();const i=this.#ns(t);if(i)return void this.#Qo(i);const n=this.#es(t);n&&this.#Mo(n)}#Ho(){kr()}#Vo(t){const e=this.#es(t);e?this.#Mo(e):kr()}#Yo(t){this.#Ao()}#Uo(t){const e=this.#es(t);e?this.#Mo(e):kr()}#Go(t){if(t.ancestorDenotationSpanOfAnchorNode){const e=t.ancestorDenotationSpanOfAnchorNode.id;return void(e&&this.#Qo(e))}this.#Ao()}#Ko(t){const e=this.#is(t);if(e)return void this.#Mo(e);if(t.ancestorDenotationSpanOfAnchorNode===t.parentOfFocusNode)return void this.#Ao();const i=this.#es(t);if(i)return void this.#Mo(i);const n=this.#ns(t);n?this.#Qo(n):kr()}#Jo(t){const e=this.#ns(t);e?this.#Qo(e):this.#Ao()}#ts(t){const e=this.#is(t);if(e)return void this.#Mo(e);if(t.isParentOfBothNodesSame||t.isParentsParentOfAnchorNodeAndFocusedNodeSame)return void this.#Ao();const i=this.#ns(t);i?this.#Qo(i):kr()}#is(t){if(t.ancestorDenotationSpanOfAnchorNode){const{anchor:e}=this.#W.textSelection,{begin:i,end:n}=this.#W.getDenotationSpan(t.ancestorDenotationSpanOfAnchorNode.id);if(e===i||e===n){if(t.ancestorDenotationSpanOfAnchorNode===t.ancestorDenotationSpanOfFocusNode)return t.ancestorDenotationSpanOfAnchorNode.id;if(t.ancestorDenotationSpanOfAnchorNode!==t.ancestorDenotationSpanOfFocusNode&&t.ancestorDenotationSpanOfFocusNode.contains(t.ancestorDenotationSpanOfAnchorNode))return t.ancestorDenotationSpanOfFocusNode.id}}}#es(t){const e=t.ancestorDenotationSpanOfFocusNode;return!e||t.ancestorDenotationSpanOfAnchorNode===e||t.ancestorDenotationSpanOfAnchorNode&&!t.ancestorDenotationSpanOfAnchorNode.contains(e)?t.isAnchorNodeParentIsDescendantOfFocusNodeParent&&(i=this.#tn.span.single,n=this.#W.textSelection.focus,i&&i.begin<n&&n<i.end)?this.#tn.span.single.element.id:void 0:e.id;var i,n}#ns(t){const e=t.ancestorDenotationSpanOfAnchorNode;if(e){const{ancestorDenotationSpanOfFocusNode:i}=t;if(!i)return e.id;if(e!==i&&(e.parentElement===i.parentElement||i.contains(e)))return e.id}}#Ao(){this.#W.hasCharacters(this.#Eo)&&(this.#tn.removeAll(),function(t,e,i,n,o,s){const{begin:r,end:a}=t.getTextSelection(o,i);if(t.validateNewDenotationSpan(r,a)){const t=e.factory.createSpanAndAutoReplicateCommand({begin:r,end:a},n,s);e.invoke(t)}}(this.#W,this.#Ji,this.#Ii.textSelectionAdjuster,this.#os,this.#Eo,Dr(this.#Ii,this.#Eo))),kr()}#Qo(t){this.#tn.removeAll();const{begin:e,end:i}=this.#W.getSpan(t).getExpandedInAnchorNodeToFocusNodeDirection(this.#Ii.textSelectionAdjuster,this.#W.sourceDoc,this.#Eo);this.#W.validateNewDenotationSpan(e,i)&&this.#Ji.invoke(this.#Ji.factory.moveDenotationSpanCommand(t,e,i)),kr()}#Mo(t){Cr(this.#Z,this.#W,this.#W.sourceDoc,this.#tn,this.#Ji,this.#Ii.textSelectionAdjuster,t,this.#Eo,(e,i)=>{this.#Ji.invoke(this.#Ji.factory.moveDenotationSpanCommand(t,e,i))}),kr()}get#os(){return this.#Ii.isPushed("auto replicate")}}class Ir extends Is{#Io;#bo;#Ut;#W;#Lo;#tn;#Ii;#go;constructor(t,e,i,n,o,s,r,a){super(),this.#go=pr.create(t,e,i.typeDictionary,i.attributeInstanceContainer,i.typeDictionary.denotation,n.entity,s,"Term configuration",r,a,"entity",n,i,this);const l=new Rr(t,i,n,s,r,o);this.#Io=new Qr(t,i,n,this.#go,l),this.#Lo=new wr(t,s,this.#go,"Entity",a,i.typeDictionary.denotation,i,"Denotation"),this.#tn=n,this.#bo=l,this.#Ut=t.querySelector(".textae-editor__text-box"),this.#W=i,this.#Ii=r;const c=new Rs(s,i.typeDictionary,n.entity,new ks(t,a),()=>this.editProperties(),this.#go);L(this,()=>c,["manipulateAttribute"])}bindMouseEvents(){return this.#Io.bind()}editProperties(){this.#Lo.startEditing(this.#tn.entity)}get isPalletShown(){return this.#go.visibly}createSpanWithTouchDevice(){this.#bo.cerateSpanForTouchDevice()}expandSpanWithTouchDevice(){this.#bo.expandForTouchDevice()}shrinkSpanWithTouchDevice(){this.#bo.shrinkForTouchDevice()}applyTextSelectionWithTouchDevice(){if(Ls(this.#Ut)){const{begin:t,end:e}=this.#W.textSelection,i=this.#W.isBoundaryCrossingWithOtherSpans(t,e),{isParentOfBothNodesSame:n}=new _r;this.#Ii.updateButtonsToOperateSpanWithTouchDevice(n,i,i,!1)}else this.#Ii.updateButtonsToOperateSpanWithTouchDevice(!1,!1,!1,!1)}}class Lr{#ss;constructor(t,e){const i=document.createElement("dialog");i.classList.add("textae-editor__text-edit-dialog"),t.appendChild(i),i.addEventListener("close",t=>{const i=t.target,{returnValue:n}=i;if("OK"===n){const t=i.querySelector("form"),n=parseInt(t.begin.value),o=parseInt(t.end.value),s=t.originalText.value,r=t.editedText.value;e(n,o,s,r)}}),c()(i,".textae-editor__text-edit-dialog__close-button","click",t=>{i.close()}),c()(i,".textae-editor__text-edit-dialog__text-box","keyup",t=>{t.stopPropagation()}),this.#ss=i}open(t,e,i){this.#ss.innerHTML=this.#rs({begin:t,end:e,text:i}),this.#ss.showModal()}#rs(t){const{text:e,begin:i,end:n}=t;return st`
1020
+ <div class="textae-editor__text-edit-dialog__title-bar">
1021
+ <h1>Edit text dialog</h1>
1022
+ <button class="textae-editor__text-edit-dialog__close-button">X</button>
1023
+ </div>
1024
+ <h3>Original Text</h3>
1025
+ <div>${e}</div>
1026
+ <h3>Edit text</h3>
1027
+ <form method="dialog">
1028
+ <input type="hidden" name="begin" value="${i}">
1029
+ <input type="hidden" name="end" value="${n}">
1030
+ <input type="hidden" name="originalText" value="${e}">
1031
+ <textarea class="textae-editor__text-edit-dialog__text-box" name="editedText" autofocus>${e}</textarea>
1032
+ <br>
1033
+ <div class="textae-editor__text-edit-dialog__button-bar">
1034
+ <button value="OK">OK</button>
1035
+ </div>
1036
+ </form>
1037
+ `}}class Nr extends Is{#Z;#W;#Eo;#Ii;#Ji;#ss;constructor(t,e,i,n,o){super(),this.#Z=t,this.#W=e,this.#Eo=i,this.#Ii=n,this.#Ji=o,this.#ss=new Lr(t,(t,e,i,n)=>{if(i===n)return;const o=this.#Ji.factory.changeTextAndMoveSpanCommand(t,e,n);this.#Ji.invoke(o)})}bindMouseEvents(){const t=[];return t.push(c()(this.#Z,".textae-editor__text-box","click",()=>this.#as())),t}applyTextSelectionWithTouchDevice(){this.#Ii.updateButtonsToOperateSpanWithTouchDevice(!1,!1,!1,this.#ls)}editTextWithTouchDevice(){this.#as()}#as(){if(!this.#ls)return;const{begin:t,end:e}=this.#W.getTextSelection(this.#Eo,this.#Ii.textSelectionAdjuster);if(!this.#W.validateEditableText(t,e))return!1;const i=this.#W.getTextBetween(t,e);this.#ss.open(t,e,i)}get#ls(){return!!Ls(this.#Ut)&&!!this.#W.hasCharacters(this.#Eo)}get#Ut(){return this.#Z.querySelector(".textae-editor__text-box")}}function jr(t){for(const e of t.querySelectorAll("mark")){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e),t.normalize()}}function zr(t,e){let i=0;return function t(n){for(const o of n.childNodes)if(o.nodeType===Node.TEXT_NODE){const t=o.textContent.length;if(i+t>=e)return{node:o,offset:e-i};i+=t}else if(o.nodeType===Node.ELEMENT_NODE){const e=t(o);if(e)return e}return null}(t)}class Br extends Is{#Z;#l;#W;#cs;#hs;#Eo;#Ii;#us=!1;constructor(t,e,i,n,o){super(),this.#Z=t,this.#l=e,this.#W=i,this.#Eo=n,this.#Ii=o}get selectedText(){return void 0===this.#cs||void 0===this.#hs?{status:"unselected"}:this.#W.isBoundaryCrossingWithOtherSpans(this.#cs,this.#hs)?{status:"cross boundary detected"}:{begin:this.#cs,end:this.#hs,status:"selected"}}updateSelectedTextOffsets(){if(this.#us)return;const t=document.getSelection();if(this.hasEmptySelection(t))return;const e=t.getRangeAt(0),i=this.#Z.querySelector(".textae-editor__text-box");if(!this.isSelectionInTextBox(e,i))return;this.#us=!0,jr(i);const{begin:n,end:o}=this.#W.getTextSelection(this.#Eo,this.#Ii.textSelectionAdjuster);!function(t,e,i){const n=zr(t,e),o=zr(t,i),s=document.createRange();s.setStart(n.node,n.offset),s.setEnd(o.node,o.offset);const r=s.extractContents(),a=u().create("<mark></mark>");a.appendChild(r),s.insertNode(a)}(i,n,o),this.#cs=n,this.#hs=o,this.#l.emit("textae-event.editor.selected-text.change"),setTimeout(()=>this.#us=!1,600)}isSelectionInTextBox(t,e){return t.startContaine!==e&&t.endContainer!==e&&e.contains(t.startContainer)&&e.contains(t.endContainer)}hasEmptySelection(t){return!t||0===t.rangeCount||0===t.toString().replace(/\s+/g,"").length}}class Zr{static createTermEditMode(t,e,i,n,o,s,r,a){return new Ir(t,e,i,n,o,s,r,a)}static createBlockEditMode(t,e,i,n,o,s,r,a){return new Er(t,e,i,n,o,s,r,a)}static createRelationEditMode(t,e,i,n,o,s,r){return new Mr(t,e,i,n,o,s,r)}static createTextEditMode(t,e,i,n,o){return new Nr(t,e,i,n,o)}static createViewMode(t,e,i,n,o){return new Br(t,e,i,n,o)}}class Wr{#ds;#fs;#ke;#l;#ps;constructor(t,e,i){this.#ds=!1,this.#fs=mn,this.#ke=t,this.#l=e,this.#ps=i}get currentState(){return this.#fs}toViewMode(t){this.#ds=t,this.#fs=gn,this.#ms()}toTermEditMode(t){this.#ds=t,this.#fs=vn,this.#ms()}toBlockEditMode(t){this.#ds=t,this.#fs=yn,this.#ms()}toRelationEditMode(){this.#ds=!0,this.#fs=On,this.#ms()}toTextEditMode(t){this.#ds=t,this.#fs=bn,this.#ms()}toggleSimpleMode(){switch(this.currentState){case vn:this.toTermEditMode(!this.#ds);break;case yn:this.toBlockEditMode(!this.#ds);break;case bn:this.toTextEditMode(!this.#ds);break;case gn:this.toViewMode(!this.#ds);break;default:throw new Error(`Invalid state: ${this.currentState}`)}}changeModeByShortcut(){const t=this.#gs;if(t.length<=1)return;const e=t.findIndex(t=>t.name===this.currentState);e<t.length-1?this[t[e+1].funcName](this.nextShowRelation):this[t[0].funcName](this.nextShowRelation)}get nextShowRelation(){return this.#fs===On?this.#ke.some:this.#ds}#ms(){this.#l.emit("textae-event.edit-mode.transition",this.#fs,this.#ds)}get#gs(){return[{name:gn,availabilityName:"view mode",funcName:"toViewMode"},{name:vn,availabilityName:"term edit mode",funcName:"toTermEditMode"},{name:yn,availabilityName:"block edit mode",funcName:"toBlockEditMode"},{name:On,availabilityName:"relation edit mode",funcName:"toRelationEditMode"}].filter(t=>this.#ps.isAvailable(t.availabilityName))}}class Fr{#Cn;#vs;#p;#ys;constructor(t,e,i,n){this.#vs=t,this.#Cn=e,this.#p=i,this.#ys=n}toViewMode(){this.#ys(),this.#Cn.toViewMode(this.#Cn.nextShowRelation)}toTermEditMode(){this.#ys(),this.#Cn.toTermEditMode(this.#Cn.nextShowRelation)}toBlockEditMode(){this.#ys(),this.#Cn.toBlockEditMode(this.#Cn.nextShowRelation)}toRelationEditMode(){this.#ys(),this.#Cn.toRelationEditMode()}toTextEditMode(){this.#ys(),this.#Cn.toTextEditMode(this.#Cn.nextShowRelation)}toggleSimpleMode(){this.#ys(),this.#Cn.toggleSimpleMode()}changeModeByShortcut(){this.#ys(),this.#Cn.changeModeByShortcut()}reset(){this.#vs.isEditTermMode?this.#Cn.toTermEditMode(this.#p.some):this.#vs.isEditBlockMode?this.#Cn.toBlockEditMode(this.#p.some):this.#vs.isEditRelationMode?this.#Cn.toRelationEditMode():this.#vs.isTextEditMode?this.#Cn.toTextEditMode(this.#p.some):this.#Cn.toViewMode(this.#p.some)}}class Xr{constructor(t){this._editorHTMLElement=t}clear(){for(const t of this._editorHTMLElement.classList)t.startsWith("textae-editor__mode")&&this._editorHTMLElement.classList.remove(t)}setFor(t){this._editorHTMLElement.classList.add(`textae-editor__mode--${t}`)}}class qr{#Os;constructor(t,e,i,n,o,s,r){this.#Os=[];const a=new Xr(t);e.on("textae-event.edit-mode.transition",(t,e)=>{switch(this.#bs(),a.clear(),t){case gn:i.typeGap.show=e,e?a.setFor("view-with-relation"):a.setFor("view-without-relation");break;case vn:i.typeGap.show=e,this.#Os=n.bindMouseEvents(),e?a.setFor("denotation-with-relation"):a.setFor("denotation-without-relation");break;case yn:i.typeGap.show=e,this.#Os=o.bindMouseEvents(),e?a.setFor("block-with-relation"):a.setFor("block-without-relation");break;case On:i.typeGap.show=!0,this.#Os=s.bindMouseEvents(),a.setFor("relation");break;case bn:i.typeGap.show=e,this.#Os=r.bindMouseEvents(),e?a.setFor("text-with-relation"):a.setFor("text-without-relation");break;default:throw new Error(`Unknown mode: ${t}`)}})}#bs(){for(const t of this.#Os)t.destroy();this.#Os=[]}}class Hr{#xs;constructor(){this.#xs=new Map([["logo",{name:"show logo",enabled:!0}],["read",{name:"import",enabled:!0}],["write",{name:"upload",enabled:!0}],["write-auto",{name:"upload automatically",enabled:!0}],["view",{name:"view mode",enabled:!0}],["term",{name:"term edit mode",enabled:!0}],["term-edit",{alias:"term"}],["block",{name:"block edit mode",enabled:!0}],["block-edit",{alias:"block"}],["relation",{name:"relation edit mode",enabled:!0}],["relation-edit",{alias:"relation"}],["text-edit",{name:"text edit mode",enabled:!0}],["simple",{name:"simple view",enabled:!0}],["line-height",{name:"adjust lineheight",enabled:!0}],["line-height-auto",{name:"auto adjust lineheight",enabled:!0}],["undo",{name:"undo",enabled:!0}],["redo",{name:"redo",enabled:!0}],["replicate",{name:"replicate span annotation",enabled:!0}],["replicate-auto",{name:"auto replicate",enabled:!0}],["boundary-detection",{name:"boundary detection",enabled:!0}],["create-span-by-touch",{name:"create span by touch",enabled:!0}],["expand-span-by-touch",{name:"expand span by touch",enabled:!0}],["shrink-span-by-touch",{name:"shrink span by touch",enabled:!0}],["edit-text-by-touch",{name:"edit text by touch",enabled:!0}],["entity",{name:"new entity",enabled:!0}],["pallet",{name:"pallet",enabled:!0}],["edit-properties",{name:"edit properties",enabled:!0}],["delete",{name:"delete",enabled:!0}],["copy",{name:"copy",enabled:!0}],["cut",{name:"cut",enabled:!0}],["paste",{name:"paste",enabled:!0}],["setting",{name:"setting",enabled:!0}],["help",{name:"help",enabled:!0}]])}get defaultAvailabilities(){return Array.from(this.#xs.values()).filter(({name:t,enabled:e})=>void 0!==t&&void 0!==e).reduce((t,{name:e,enabled:i})=>t.set(e,i),new Map)}translateToInnerNameFrom(t){if(this.#xs.has(t)){const e=this.#xs.get(t);return e.alias?this.#xs.get(e.alias).name:e.name}return n().warning(`'${t}' is an unknown function name for function availabilities.`),t}}class Vr{#ws;#_s;constructor(){this.#ws=new Hr,this.#_s=this.#ws.defaultAvailabilities}isAvailable(t){return this.#_s.get(t)}enable(t){this.#_s.set(t,!0)}disable(t){this.#_s.set(t,!1)}get names(){return Array.from(this.#_s.keys())}set availability(t){const e=this.#ws.defaultAvailabilities;if(t)for(const[i,n]of Object.entries(t))e.set(this.#ws.translateToInnerNameFrom(i),n);this.#_s=e}}class Yr{constructor(t,e,i,n,o,s,r){this._map=new Map([["view mode",()=>r.toViewMode()],["term edit mode",()=>r.toTermEditMode()],["block edit mode",()=>r.toBlockEditMode()],["relation edit mode",()=>r.toRelationEditMode()],["text edit mode",()=>r.toTextEditMode()],["simple view",()=>r.toggleSimpleMode()],["import",()=>i.importAnnotation()],["upload",()=>i.uploadAnnotation()],["undo",()=>t.undo()],["redo",()=>t.redo()],["replicate span annotation",()=>e.replicate()],["create span by touch",()=>s.createSpanWithTouchDevice()],["expand span by touch",()=>s.expandSpanWithTouchDevice()],["shrink span by touch",()=>s.shrinkSpanWithTouchDevice()],["edit text by touch",()=>s.editTextWithTouchDevice()],["new entity",()=>e.createEntity()],["edit properties",()=>s.editProperties()],["pallet",()=>s.showPallet()],["delete",()=>e.removeSelectedElements()],["copy",()=>e.copyEntitiesToLocalClipboard()],["cut",()=>e.cutEntitiesToLocalClipboard()],["paste",()=>e.pasteEntitiesFromLocalClipboard()],["setting",()=>e.showSettingDialog()],["adjust lineheight",()=>o.textBox.updateLineHeight()]]);for(const t of n.pushButtonNames)this._map.has(t)||this._map.set(t,()=>e.toggleButton(t))}handle(t){this._map.has(t)&&this._map.get(t)()}}function Ur(t,e,i,o,s,r,a,l,c){if(!e.data.config&&i)o.loadConfiguration(i,e);else{if(po(e.data),e.data.config&&"object"!=typeof e.data.config)return void n().error("configuration in annotation file is invalid.");const i=fo(e.data,e.data.config);i&&(Hn(t,i,s,r,a,e.data,l),c.annotation=e)}}class Gr{constructor(t,e,i,n,o,s){this._map=new Map([["1",t=>o.manipulateAttribute(1,t)],["2",t=>o.manipulateAttribute(2,t)],["3",t=>o.manipulateAttribute(3,t)],["4",t=>o.manipulateAttribute(4,t)],["5",t=>o.manipulateAttribute(5,t)],["6",t=>o.manipulateAttribute(6,t)],["7",t=>o.manipulateAttribute(7,t)],["8",t=>o.manipulateAttribute(8,t)],["9",t=>o.manipulateAttribute(9,t)],["a",()=>n.isAvailable("redo")&&t.redo()],["b",()=>n.isAvailable("boundary detection")&&e.toggleButton("boundary detection")],["d",()=>n.isAvailable("delete")&&e.removeSelectedElements()],["e",()=>n.isAvailable("new entity")&&e.createEntity()],["f",()=>s.changeModeByShortcut()],["i",()=>n.isAvailable("import")&&i.importAnnotation()],["m",()=>s.changeModeByShortcut()],["q",()=>n.isAvailable("pallet")&&o.showPallet()],["r",()=>n.isAvailable("replicate span annotation")&&e.replicate()],["u",()=>n.isAvailable("upload")&&i.uploadAnnotation()],["w",()=>n.isAvailable("edit properties")&&o.editProperties()],["y",()=>n.isAvailable("redo")&&t.redo()],["z",()=>n.isAvailable("undo")&&t.undo()],["ArrowDown",()=>e.selectDown()],["ArrowLeft",t=>e.selectLeft(t)],["ArrowRight",t=>e.selectRight(t)],["ArrowUp",()=>e.selectUp()],["Backspace",()=>e.removeSelectedElements()],["Delete",()=>e.removeSelectedElements()],["Escape",()=>e.cancelSelect()]])}handle(t){const e=t.shiftKey&&48<=t.keyCode&&t.keyCode<=57?String.fromCharCode(t.keyCode):t.key;this._map.has(e)&&this._map.get(e)(t.shiftKey)}}function Kr(t,e,i,n,o){for(;o(t(i,n));)n+=e;return n}const Jr=function(t,e){return t.charAt(e)},ta=function(t,e,i){return Kr(Jr,1,t,e,i)},ea=function(t,e,i){return Kr(Jr,-1,t,e,i)};class ia{backFromBegin(t,e,i){}forwardFromEnd(t,e,i){}forwardFromBegin(t,e,i){}backFromEnd(t,e,i){}}class na extends ia{backFromBegin(t,e,i){return ta(t,e,t=>i.isBlankCharacter(t))}forwardFromEnd(t,e,i){return ea(t,e,t=>i.isBlankCharacter(t))}forwardFromBegin(t,e,i){return ta(t,e,t=>i.isBlankCharacter(t))}backFromEnd(t,e,i){return ea(t,e,t=>i.isBlankCharacter(t))}}class oa{#je;#L;#Ss=!1;#ks=null;#$s=[gn,vn,yn,On,bn];constructor(t,e,i=!1,n=null,o=null){this.#je=t,this.#L=e,this.#Ss=i,n&&(this.#ks=n),o&&(this.#$s=o)}get displayProperties(){return{type:this.#je,title:this.#L}}get type(){return this.#je}get push(){return this.#Ss}get enableWhenSelecting(){return this.#ks}get availableModes(){return this.#$s}}const sa=[{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"import",title:"Import [I]"},{type:"upload",title:"Upload [U]"},{type:"upload automatically",title:"Upload Automatically",push:!0}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"view mode",title:"View Mode",push:!0},{type:"term edit mode",title:"Term Edit Mode",push:!0},{type:"block edit mode",title:"Block Edit Mode",push:!0},{type:"relation edit mode",title:"Relation Edit Mode",push:!0},{type:"text edit mode",title:"Text Edit Mode",push:!0}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"simple view",title:"Simple View",push:!0},{type:"adjust lineheight",title:"Adjust LineHeight"},{type:"auto adjust lineheight",title:"Auto Adjust LineHeight",push:!0}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"undo",title:"Undo [Z]"},{type:"redo",title:"Redo [A]"}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"replicate span annotation",title:"Replicate span annotation [R]",enableWhenSelecting:t=>t.span.single&&t.span.single.isDenotation},{type:"auto replicate",title:"Auto replicate",push:!0},{type:"boundary detection",title:"Boundary Detection [B]",push:!0}]},{usage:{"keyboard device":[],"touch device":["control bar","context menu"]},list:[{type:"create span by touch",title:"Create span",availableModes:[vn,yn]},{type:"expand span by touch",title:"Expand span",availableModes:[vn,yn]},{type:"shrink span by touch",title:"Shrink span",availableModes:[vn,yn]},{type:"edit text by touch",title:"Edit text",availableModes:[bn]}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"new entity",title:"New entity [E]",enableWhenSelecting:t=>t.span.contains(t=>t.isDenotation)},{type:"pallet"},{type:"edit properties",title:"Edit Properties [W]",enableWhenSelecting:t=>t.entity.some||t.relation.some},{type:"delete",title:"Delete [D]",enableWhenSelecting:t=>t.span.some||t.entity.some||t.relation.some}]},{usage:{"keyboard device":[],"touch device":["control bar"]},list:[{type:"copy",title:"Copy [C]",enableWhenSelecting:t=>t.span.contains(t=>t.isDenotation)||t.entity.contains(t=>t.isDenotation)},{type:"cut",title:"Cut [X]",enableWhenSelecting:t=>t.span.contains(t=>t.isDenotation)||t.entity.contains(t=>t.isDenotation)},{type:"paste",title:"Paste [V]",enableWhenSelecting:(t,e)=>e.hasCopyingItem&&t.span.some||e.hasCuttingItem&&Boolean(t.span.single)}]},{usage:{"keyboard device":["control bar"],"touch device":["control bar"]},list:[{type:"setting",title:"Setting"}]},{usage:{"keyboard device":["control bar"],"touch device":[]},list:[{type:"help",title:"Help [H]"}]}];class ra{#Ts;#Cs;constructor(t,e){this.#Ts=t,this.#Cs=e}isShowOnControlBar(){return Qi()||/iPad/.test(navigator.userAgent)||/iPhone/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&be()?this.#Ts["touch device"].includes("control bar"):this.#Ts["keyboard device"].includes("control bar")}isShowOnContextMenu(){return be()?this.#Ts["touch device"].includes("context menu"):this.#Ts["keyboard device"].includes("context menu")}getButtonsFor(t){const e=this.#Cs.filter(({availableModes:e})=>e.includes(t));return new ra(this.#Ts,e)}get buttonList(){return this.#Cs}get displayProperties(){return{list:this.#Cs.map(t=>t.displayProperties)}}}class aa{#Ps;constructor(){this.#Ps=sa.map(({usage:t,list:e})=>new ra(t,e.map(({type:t,title:e,push:i,enableWhenSelecting:n,availableModes:o})=>new oa(t,e,i,n,o))))}get controlBar(){return this.#Ps.filter(t=>t.isShowOnControlBar()).map(t=>t.displayProperties)}getContextMenuFor(t){return this.#Ps.filter(t=>t.isShowOnContextMenu()).map(e=>e.getButtonsFor(t)).map(t=>t.displayProperties)}get pasteButton(){return this.#Cs.find(({type:t})=>"paste"===t)}get enableButtonsWhenSelecting(){return this.#Cs.filter(t=>t.enableWhenSelecting)}get pushButtons(){return this.#Cs.filter(t=>t.push).map(t=>t.type)}get#Cs(){return this.#Ps.flatMap(t=>t.buttonList)}}function la(t,e){return[t.charAt(e),t.charAt(e-1)]}function ca(t,e){return[t.charAt(e),t.charAt(e+1)]}function ha(t,e,i){return""!==i[0]&&!t(i[1])&&!e(i[1])||e(i[0])}class ua extends ia{backFromBegin(t,e,i){const n=function(t,e,i){return Kr(la,-1,t,e,t=>t[1]&&!i(t[0])&&!i(t[1]))}(t,ta(t,e,t=>i.isBlankCharacter(t)),t=>i.isDelimiter(t));return n}forwardFromEnd(t,e,i){const n=function(t,e,i){return Kr(ca,1,t,e,t=>t[1]&&!i(t[0])&&!i(t[1]))}(t,ea(t,e,t=>i.isBlankCharacter(t)),t=>i.isDelimiter(t));return n}forwardFromBegin(t,e,i){return function(t,e,i){return Kr(la,1,t,e,i)}(t,e,t=>ha(t=>i.isBlankCharacter(t),t=>i.isDelimiter(t),t))}backFromEnd(t,e,i){return function(t,e,i){return Kr(ca,-1,t,e,i)}(t,e,t=>ha(t=>i.isBlankCharacter(t),t=>i.isDelimiter(t),t))}}class da{#Es;#l;#tn;#As;constructor(t,e,i){this.#Es=new Map([["import",!0],["upload",!0],["view mode",!0],["term edit mode",!0],["block edit mode",!0],["relation edit mode",!0],["text edit mode",!0],["simple view",!0],["setting",!0],["help",!0]]),this.#l=t,this.#tn=e,this.#As=i,t.on("textae-event.history.change",t=>{this.enable("undo",t.hasAnythingToUndo),this.enable("redo",t.hasAnythingToRedo)}).on("textae-event.selection.span.change",()=>this.#Ms()).on("textae-event.selection.relation.change",()=>this.#Ms()).on("textae-event.selection.entity.change",()=>this.#Ms()).on("textae-event.edit-mode.transition",t=>this.#Qs(t)).on("textae-event.clip-board.change",()=>this.#Ds()).on("textae-event.annotation-auto-saver.enable",t=>this.enable("upload automatically",t))}get(t){return this.#Es.get(t)}enable(t,e){this.#Es.set(t,e),this.#Rs()}updateButtonsToOperateSpanWithTouchDevice(t,e,i,n){this.#Es.set("create span by touch",t),this.#Es.set("expand span by touch",e),this.#Es.set("shrink span by touch",i),this.#Es.set("edit text by touch",n),this.#Rs()}#Ms(){for(const{type:t,enableWhenSelecting:e}of(new aa).enableButtonsWhenSelecting)this.enable(t,e(this.#tn,this.#As));this.#Rs()}#Ds(){this.enable("paste",(new aa).pasteButton.enableWhenSelecting(this.#tn,this.#As))}#Rs(){this.#l.emit("textae-event.control.buttons.change",this.#Es.keys())}#Qs(t){switch(t){case gn:this.#Is(!0,!1,!1,!1,!1,!1,!1);break;case vn:this.#Is(!0,!0,!0,!0,!0,!0,!0);break;case yn:this.#Is(!0,!1,!0,!0,!0,!0,!0);break;case On:this.#Is(!1,!1,!1,!0,!0,!1,!0);break;case bn:this.#Is(!0,!1,!0,!0,!0,!1,!1);break;default:throw`unknown edit mode!${t}`}this.#Rs()}#Is(t,e,i,n,o,s,r){this.#Es.set("simple view",t),this.#Es.set("auto replicate",e),this.#Es.set("boundary detection",i),this.#Es.set("adjust lineheight",n),this.#Es.set("auto adjust lineheight",o),this.#Es.set("create span by touch",s),this.#Es.set("expand span by touch",s),this.#Es.set("shrink span by touch",s),this.#Es.set("pallet",r)}}class fa{#w;#l;#Ls;constructor(t,e=null){this.#w=t,this.#l=e,this.#Ls=!1}get name(){return this.#w}get isPushed(){return this.#Ls}set isPushed(t){this.#Ls=t,this.#Rs()}toggle(){this.#Ls=!this.#Ls,this.#Rs()}#Rs(){this.#l&&this.#l.emit("textae-event.control.button.push",this)}}class pa{#Ns;constructor(t){this.#Ns=(new aa).pushButtons.reduce((e,i)=>(e.set(i,new fa(i,t)),e),new Map),t.on("textae-event.edit-mode.transition",(t,e)=>this.#js(t,!e))}get(t){return this.#Ns.has(t)?this.#Ns.get(t):new fa(t)}get names(){return this.#Ns.keys()}#js(t,e){switch(t){case gn:this.#zs(!0,!1,!1,!1,!1,e);break;case vn:this.#zs(!1,!0,!1,!1,!1,e);break;case yn:this.#zs(!1,!1,!0,!1,!1,e);break;case On:this.#zs(!1,!1,!1,!0,!1,!1);break;case bn:this.#zs(!1,!1,!1,!1,!0,e);break;default:throw`unknown edit mode!${t}`}}#zs(t,e,i,n,o,s){this.#Ns.get("view mode").isPushed=t,this.#Ns.get("term edit mode").isPushed=e,this.#Ns.get("block edit mode").isPushed=i,this.#Ns.get("relation edit mode").isPushed=n,this.#Ns.get("text edit mode").isPushed=o,this.#Ns.get("simple view").isPushed=s}}class ma{#Bs;#Zs;#Ws;#Mi;#ht;#ps;#Cn;constructor(t,e,i,n,o,s,r,a){this.#Bs=new da(t,e,i),this.#Zs=new pa(t),this.#Ws=n,this.#Mi=o,this.#ht=s,this.#ps=r,this.#Cn=a}get pushButtonNames(){return this.#Zs.names}isPushed(t){return this.#Zs.get(t).isPushed}push(t){this.#Zs.get(t).isPushed=!0}release(t){this.#Zs.get(t).isPushed=!1}toggleButton(t){return this.#Zs.get(t).toggle()}get textSelectionAdjuster(){return this.isPushed("boundary detection")?new ua:new na}get controlBarButton(){return(new aa).controlBar.map(({list:t})=>t.filter(({type:t})=>this.#ps.isAvailable(t)).map(({type:t,title:e})=>this.#Fs(t,e)).map(({type:t,title:e})=>({type:t,title:e,pushed:this.getState(t,"pushed"),disabled:this.getState(t,"disabled")}))).filter(t=>t.length)}get contextMenuButton(){return(new aa).getContextMenuFor(this.#Cn.currentState).map(({list:t})=>t.filter(({type:t})=>this.#ps.isAvailable(t)).map(({type:t,title:e})=>this.#Fs(t,e)).reduce((t,{type:e,title:i})=>(!be()&&this.getState(e,"disabled")||t.push(this.#Xs(e,i)),t),[])).filter(t=>t.length)}getState(t,e){switch(e){case"pushed":return this.#Zs.get(t).isPushed;case"disabled":return!this.#Bs.get(t);case"transit":switch(t){case"upload":return this.#Ws.hasChange;case"pallet":return this.diffOfConfiguration;default:new Error("Unknown name")}break;default:new Error("Unknown state")}}updateButtonsToOperateSpanWithTouchDevice(t,e,i,n){this.#Bs.updateButtonsToOperateSpanWithTouchDevice(t,e,i,n)}get diffOfConfiguration(){return Pi(this.#Mi.configuration,{...this.#Mi.configuration,...this.#ht.config})}setPushButtons(t){!0===t.autosave?this.push("upload automatically"):this.release("upload automatically"),!1===t.autolineheight?this.release("auto adjust lineheight"):this.push("auto adjust lineheight"),!1===t.boundarydetection?this.release("boundary detection"):this.push("boundary detection")}get detailModifierClassName(){return this.#ps.isAvailable("show logo")?"textae-control-details--show-logo":"textae-control-details--hide-logo"}#Fs(t,e){return"pallet"==t?{type:t,title:Pn(this.#Cn.currentState)}:{type:t,title:e}}#Xs(t,e){return{type:t,title:e,pushed:this.getState(t,"pushed"),disabled:this.getState(t,"disabled"),transit:this.getState(t,"transit")}}}const ga='\n<div class="textae-editor__footer">\n <div class="textae-editor__footer__message"></div>\n</div>\n';class va{#Z;#qs;constructor(t,e){this.#Z=t,this.#qs=e}set status(t){var e;this.#qs&&(""!==t&&((e=this.#Z,e.querySelector(".textae-editor__footer__message")||(e.insertAdjacentHTML("beforeend",ga.replace(/[\n\r]+/g,"")),e.querySelector(".textae-editor__footer__message"))).innerHTML=at(t)?`Source: <a class="textae-editor__footer__message__link" href="${t}">${decodeURI(t)}</a>`:`Source: ${t}`))}}class ya{#l;#Hs;#Si;#Vs;constructor(t,e,i){this.#l=t,this.#Hs=new va(e,i),t.on("textae-event.resource.annotation.save",t=>{this.#Ys=t}).on("textae-event.resource.configuration.save",t=>{this.#Vs=t})}get defaultAnnotation(){return{text:"Currently, the document is empty. Use the `import` button or press the key `i` to open a document with annotation."}}get defaultConfiguration(){return io(this.defaultAnnotation)}get annotation(){return this.#Si?this.#Si:this.defaultAnnotation}set annotation(t){this.#Ys=t.data,this.#Hs.status=t.displayName,this.#l.emit("textae-event.original-data.annotation.reset",t)}get configuration(){return this.#Vs?this.#Vs:{}}set configuration(t){this.#Vs=t.data,this.#l.emit("textae-event.original-data.configuration.reset",t)}set#Ys(t){this.#Si=t,t.config&&(this.#Vs=t.config)}}const Oa=1024;let ba=0;class xa{constructor(t,e){this.from=t,this.to=e}}class wa{constructor(t={}){this.id=ba++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=ka.match(t)),e=>{let i=t(e);return void 0===i?null:[this,i]}}}wa.closedBy=new wa({deserialize:t=>t.split(" ")}),wa.openedBy=new wa({deserialize:t=>t.split(" ")}),wa.group=new wa({deserialize:t=>t.split(" ")}),wa.isolate=new wa({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),wa.contextHash=new wa({perNode:!0}),wa.lookAhead=new wa({perNode:!0}),wa.mounted=new wa({perNode:!0});class _a{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[wa.mounted.id]}}const Sa=Object.create(null);class ka{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):Sa,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new ka(t.name||"",e,t.id,i);if(t.props)for(let i of t.props)if(Array.isArray(i)||(i=i(n)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[i[0].id]=i[1]}return n}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(wa.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return t=>{for(let i=t.prop(wa.group),n=-1;n<(i?i.length:0);n++){let o=e[n<0?t.name:i[n]];if(o)return o}}}}ka.none=new ka("",Object.create(null),0,8);class $a{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let i of this.types){let n=null;for(let e of t){let t=e(i);if(t){n||(n=Object.assign({},i.props));let e=t[1],o=t[0];o.combine&&o.id in n&&(e=o.combine(n[o.id],e)),n[o.id]=e}}e.push(n?new ka(i.name,n,i.id,i.flags):i)}return new $a(e)}}const Ta=new WeakMap,Ca=new WeakMap;var Pa;!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"}(Pa||(Pa={}));class Ea{constructor(t,e,i,n,o){if(this.type=t,this.children=e,this.positions=i,this.length=n,this.props=null,o&&o.length){this.props=Object.create(null);for(let[t,e]of o)this.props["number"==typeof t?t:t.id]=e}}toString(){let t=_a.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let t of this.children){let i=t.toString();i&&(e&&(e+=","),e+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Wa(this.topNode,t)}cursorAt(t,e=0,i=0){let n=Ta.get(this)||this.topNode,o=new Wa(n);return o.moveTo(t,e),Ta.set(this,o._tree),o}get topNode(){return new Ia(this,0,0,null)}resolve(t,e=0){let i=Da(Ta.get(this)||this.topNode,t,e,!1);return Ta.set(this,i),i}resolveInner(t,e=0){let i=Da(Ca.get(this)||this.topNode,t,e,!0);return Ca.set(this,i),i}resolveStack(t,e=0){return function(t,e,i){let n=t.resolveInner(e,i),o=null;for(let t=n instanceof Ia?n:n.context.parent;t;t=t.parent)if(t.index<0){let s=t.parent;(o||(o=[n])).push(s.resolve(e,i)),t=s}else{let s=_a.get(t.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let r=new Ia(s.tree,s.overlay[0].from+t.from,-1,t);(o||(o=[n])).push(Da(r,e,i,!1))}}return o?Ba(o):n}(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:o=this.length}=t,s=t.mode||0,r=(s&Pa.IncludeAnonymous)>0;for(let t=this.cursor(s|Pa.IncludeAnonymous);;){let s=!1;if(t.from<=o&&t.to>=n&&(!r&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;s=!0}for(;s&&i&&(r||!t.type.isAnonymous)&&i(t),!t.nextSibling();){if(!t.parent())return;s=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Ha(ka.none,this.children,this.positions,0,this.children.length,0,this.length,(t,e,i)=>new Ea(this.type,t,e,i,this.propValues),t.makeTree||((t,e,i)=>new Ea(ka.none,t,e,i)))}static build(t){return function(t){var e;let{buffer:i,nodeSet:n,maxBufferLength:o=Oa,reused:s=[],minRepeatType:r=n.types.length}=t,a=Array.isArray(i)?new Aa(i,i.length):i,l=n.types,c=0,h=0;function u(t,e,i,y,O,b){let{id:x,start:w,end:_,size:S}=a,k=h,$=c;if(S<0){if(a.next(),-1==S){let e=s[x];return i.push(e),void y.push(w-t)}if(-3==S)return void(c=x);if(-4==S)return void(h=x);throw new RangeError(`Unrecognized record size: ${S}`)}let T,C,P=l[x],E=w-t;if(_-w<=o&&(C=g(a.pos-e,O))){let e=new Uint16Array(C.size-C.skip),i=a.pos-C.size,o=e.length;for(;a.pos>i;)o=v(C.start,e,o);T=new Ma(e,_-C.start,n),E=C.start-t}else{let t=a.pos-S;a.next();let e=[],i=[],n=x>=r?x:-1,s=0,l=_;for(;a.pos>t;)n>=0&&a.id==n&&a.size>=0?(a.end<=l-o&&(p(e,i,w,s,a.end,l,n,k,$),s=e.length,l=a.end),a.next()):b>2500?d(w,t,e,i):u(w,t,e,i,n,b+1);if(n>=0&&s>0&&s<e.length&&p(e,i,w,s,w,l,n,k,$),e.reverse(),i.reverse(),n>-1&&s>0){let t=f(P,$);T=Ha(P,e,i,0,e.length,0,_-w,t,t)}else T=m(P,e,i,_-w,k-_,$)}i.push(T),y.push(E)}function d(t,e,i,s){let r=[],l=0,c=-1;for(;a.pos>e;){let{id:t,start:e,end:i,size:n}=a;if(n>4)a.next();else{if(c>-1&&e<c)break;c<0&&(c=i-o),r.push(t,e,i),l++,a.next()}}if(l){let e=new Uint16Array(4*l),o=r[r.length-2];for(let t=r.length-3,i=0;t>=0;t-=3)e[i++]=r[t],e[i++]=r[t+1]-o,e[i++]=r[t+2]-o,e[i++]=i;i.push(new Ma(e,r[2]-o,n)),s.push(o-t)}}function f(t,e){return(i,n,o)=>{let s,r,a=0,l=i.length-1;if(l>=0&&(s=i[l])instanceof Ea){if(!l&&s.type==t&&s.length==o)return s;(r=s.prop(wa.lookAhead))&&(a=n[l]+s.length+r)}return m(t,i,n,o,a,e)}}function p(t,e,i,o,s,r,a,l,c){let h=[],u=[];for(;t.length>o;)h.push(t.pop()),u.push(e.pop()+i-s);t.push(m(n.types[a],h,u,r-s,l-r,c)),e.push(s-i)}function m(t,e,i,n,o,s,r){if(s){let t=[wa.contextHash,s];r=r?[t].concat(r):[t]}if(o>25){let t=[wa.lookAhead,o];r=r?[t].concat(r):[t]}return new Ea(t,e,i,n,r)}function g(t,e){let i=a.fork(),n=0,s=0,l=0,c=i.end-o,h={size:0,start:0,skip:0};t:for(let o=i.pos-t;i.pos>o;){let t=i.size;if(i.id==e&&t>=0){h.size=n,h.start=s,h.skip=l,l+=4,n+=4,i.next();continue}let a=i.pos-t;if(t<0||a<o||i.start<c)break;let u=i.id>=r?4:0,d=i.start;for(i.next();i.pos>a;){if(i.size<0){if(-3!=i.size)break t;u+=4}else i.id>=r&&(u+=4);i.next()}s=d,n+=t,l+=u}return(e<0||n==t)&&(h.size=n,h.start=s,h.skip=l),h.size>4?h:void 0}function v(t,e,i){let{id:n,start:o,end:s,size:l}=a;if(a.next(),l>=0&&n<r){let r=i;if(l>4){let n=a.pos-(l-4);for(;a.pos>n;)i=v(t,e,i)}e[--i]=r,e[--i]=s-t,e[--i]=o-t,e[--i]=n}else-3==l?c=n:-4==l&&(h=n);return i}let y=[],O=[];for(;a.pos>0;)u(t.start||0,t.bufferStart||0,y,O,-1,0);let b=null!==(e=t.length)&&void 0!==e?e:y.length?O[0]+y[0].length:0;return new Ea(l[t.topID],y.reverse(),O.reverse(),b)}(t)}}Ea.empty=new Ea(ka.none,[],[],0);class Aa{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Aa(this.buffer,this.index)}}class Ma{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return ka.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],i=this.buffer[t+3],n=this.set.types[e],o=n.name;if(/\W/.test(o)&&!n.isError&&(o=JSON.stringify(o)),i==(t+=4))return o;let s=[];for(;t<i;)s.push(this.childString(t)),t=this.buffer[t+3];return o+"("+s.join(",")+")"}findChild(t,e,i,n,o){let{buffer:s}=this,r=-1;for(let a=t;a!=e&&!(Qa(o,n,s[a+1],s[a+2])&&(r=a,i>0));a=s[a+3]);return r}slice(t,e,i){let n=this.buffer,o=new Uint16Array(e-t),s=0;for(let r=t,a=0;r<e;){o[a++]=n[r++],o[a++]=n[r++]-i;let e=o[a++]=n[r++]-i;o[a++]=n[r++]-t,s=Math.max(s,e)}return new Ma(o,s,this.set)}}function Qa(t,e,i,n){switch(t){case-2:return i<e;case-1:return n>=e&&i<e;case 0:return i<e&&n>e;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function Da(t,e,i,n){for(var o;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){let e=!n&&t instanceof Ia&&t.index<0?null:t.parent;if(!e)return t;t=e}let s=n?0:Pa.IgnoreOverlays;if(n)for(let n=t,r=n.parent;r;n=r,r=n.parent)n instanceof Ia&&n.index<0&&(null===(o=r.enter(e,i,s))||void 0===o?void 0:o.from)!=n.from&&(t=r);for(;;){let n=t.enter(e,i,s);if(!n)return t;t=n}}class Ra{cursor(t=0){return new Wa(this,t)}getChild(t,e=null,i=null){let n=La(this,t,e,i);return n.length?n[0]:null}getChildren(t,e=null,i=null){return La(this,t,e,i)}resolve(t,e=0){return Da(this,t,e,!1)}resolveInner(t,e=0){return Da(this,t,e,!0)}matchContext(t){return Na(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let t=e.lastChild;if(!t||t.to!=e.to)break;t.type.isError&&t.from==t.to?(i=e,e=t.prevSibling):e=t}return i}get node(){return this}get next(){return this.parent}}class Ia extends Ra{constructor(t,e,i,n){super(),this._tree=t,this.from=e,this.index=i,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,i,n,o=0){for(let s=this;;){for(let{children:r,positions:a}=s._tree,l=e>0?r.length:-1;t!=l;t+=e){let l=r[t],c=a[t]+s.from;if(Qa(n,i,c,c+l.length))if(l instanceof Ma){if(o&Pa.ExcludeBuffers)continue;let r=l.findChild(0,l.buffer.length,e,i-c,n);if(r>-1)return new za(new ja(s,l,t,c),null,r)}else if(o&Pa.IncludeAnonymous||!l.type.isAnonymous||Fa(l)){let r;if(!(o&Pa.IgnoreMounts)&&(r=_a.get(l))&&!r.overlay)return new Ia(r.tree,c,t,s);let a=new Ia(l,c,t,s);return o&Pa.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(e<0?l.children.length-1:0,e,i,n)}}if(o&Pa.IncludeAnonymous||!s.type.isAnonymous)return null;if(t=s.index>=0?s.index+e:e<0?-1:s._parent._tree.children.length,s=s._parent,!s)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&Pa.IgnoreOverlays)&&(n=_a.get(this._tree))&&n.overlay){let i=t-this.from;for(let{from:t,to:o}of n.overlay)if((e>0?t<=i:t<i)&&(e<0?o>=i:o>i))return new Ia(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function La(t,e,i,n){let o=t.cursor(),s=[];if(!o.firstChild())return s;if(null!=i)for(let t=!1;!t;)if(t=o.type.is(i),!o.nextSibling())return s;for(;;){if(null!=n&&o.type.is(n))return s;if(o.type.is(e)&&s.push(o.node),!o.nextSibling())return null==n?s:[]}}function Na(t,e,i=e.length-1){for(let n=t;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class ja{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class za extends Ra{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,o=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return o<0?null:new za(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Pa.ExcludeBuffers)return null;let{buffer:n}=this.context,o=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return o<0?null:new za(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new za(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new za(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,o=i.buffer[this.index+3];if(o>n){let s=i.buffer[this.index+1];t.push(i.slice(n,o,s)),e.push(0)}return new Ea(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ba(t){if(!t.length)return null;let e=0,i=t[0];for(let n=1;n<t.length;n++){let o=t[n];(o.from>i.from||o.to<i.to)&&(i=o,e=n)}let n=i instanceof Ia&&i.index<0?null:i.parent,o=t.slice();return n?o[e]=n:o.splice(e,1),new Za(o,i)}class Za{constructor(t,e){this.heads=t,this.node=e}get next(){return Ba(this.heads)}}class Wa{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof Ia)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let e=t._parent;e;e=e._parent)this.stack.unshift(e.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return!!t&&(t instanceof Ia?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,o=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);return!(o<0)&&(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?!(i&Pa.ExcludeBuffers)&&this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Pa.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Pa.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let t=i<0?0:this.stack[i]+4;if(this.index!=t)return this.yieldBuf(e.findChild(t,this.index,-1,0,4))}else{let t=e.buffer[this.index+3];if(t<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(t)}return i<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index<n.buffer.buffer.length)return!1}else for(let t=0;t<this.index;t++)if(n.buffer.buffer[t+3]<this.index)return!1;({index:e,parent:i}=n)}else({index:e,_parent:i}=this._tree);for(;i;({index:e,_parent:i}=i))if(e>-1)for(let n=e+t,o=t<0?-1:i._tree.children.length;n!=o;n+=t){let t=i._tree.children[n];if(this.mode&Pa.IncludeAnonymous||t instanceof Ma||!t.type.isAnonymous||Fa(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let n=this.index,o=this.stack.length;o>=0;){for(let s=t;s;s=s._parent)if(s.index==n){if(n==this.index)return s;e=s,i=o+1;break t}n=this.stack[--o]}for(let t=i;t<this.stack.length;t++)e=new za(this.buffer,e,this.stack[t]);return this.bufferNode=new za(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let n=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){i++;continue}this.type.isAnonymous||(n=!0)}for(;;){if(n&&e&&e(this),n=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,n=!0}}}matchContext(t){if(!this.buffer)return Na(this.node.parent,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let n=t.length-1,o=this.stack.length-1;n>=0;o--){if(o<0)return Na(this._tree,t,n);let s=i[e.buffer[this.stack[o]]];if(!s.isAnonymous){if(t[n]&&t[n]!=s.name)return!1;n--}}return!0}}function Fa(t){return t.children.some(t=>t instanceof Ma||!t.type.isAnonymous||Fa(t))}const Xa=new WeakMap;function qa(t,e){if(!t.isAnonymous||e instanceof Ma||e.type!=t)return 1;let i=Xa.get(e);if(null==i){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof Ea)){i=1;break}i+=qa(t,n)}Xa.set(e,i)}return i}function Ha(t,e,i,n,o,s,r,a,l){let c=0;for(let i=n;i<o;i++)c+=qa(t,e[i]);let h=Math.ceil(1.5*c/8),u=[],d=[];return function e(i,n,o,r,a){for(let c=o;c<r;){let o=c,f=n[c],p=qa(t,i[c]);for(c++;c<r;c++){let e=qa(t,i[c]);if(p+e>=h)break;p+=e}if(c==o+1){if(p>h){let t=i[o];e(t.children,t.positions,0,t.children.length,n[o]+a);continue}u.push(i[o])}else{let e=n[c-1]+i[c-1].length-f;u.push(Ha(t,i,n,o,c,f,e,null,l))}d.push(f+a-s)}}(e,i,n,o,0),(a||l)(u,d,r)}class Va{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof za?this.setBuffer(t.context.buffer,t.index,e):t instanceof Ia&&this.map.set(t.tree,e)}get(t){return t instanceof za?this.getBuffer(t.context.buffer,t.index):t instanceof Ia?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Ya{constructor(t,e,i,n,o=!1,s=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(o?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],i=!1){let n=[new Ya(0,t.length,t,0,!1,i)];for(let i of e)i.to>t.length&&n.push(i);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],o=1,s=t.length?t[0]:null;for(let r=0,a=0,l=0;;r++){let c=r<e.length?e[r]:null,h=c?c.fromA:1e9;if(h-a>=i)for(;s&&s.from<h;){let e=s;if(a>=e.from||h<=e.to||l){let t=Math.max(e.from,a)-l,i=Math.min(e.to,h)-l;e=t>=i?null:new Ya(t,i,e.tree,e.offset+l,r>0,!!c)}if(e&&n.push(e),s.to>h)break;s=o<t.length?t[o++]:null}if(!c)break;a=c.toA,l=c.toA-c.toB}return n}}class Ua{startParse(t,e,i){return"string"==typeof t&&(t=new Ga(t)),i=i?i.length?i.map(t=>new xa(t.from,t.to)):[new xa(0,0)]:[new xa(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let t=n.advance();if(t)return t}}}class Ga{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new wa({perNode:!0});class Ka{constructor(t,e,i,n,o,s,r,a,l,c=0,h){this.p=t,this.stack=e,this.state=i,this.reducePos=n,this.pos=o,this.score=s,this.buffer=r,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=h}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){let n=t.parser.context;return new Ka(t,[],e,i,i,0,[],0,n?new Ja(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let i=t>>19,n=65535&t,{parser:o}=this.p,s=this.reducePos<this.pos-25;s&&this.setLookAhead(this.pos);let r=o.dynamicPrecedence(n);if(r&&(this.score+=r),0==i)return this.pushState(o.getGoto(this.state,n,!0),this.reducePos),n<o.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,s?8:4,!0),void this.reduceContext(n,this.reducePos);let a=this.stack.length-3*(i-1)-(262144&t?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(null===(e=this.p.parser.nodeSet.types[n])||void 0===e?void 0:e.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let h=a?this.stack[a-1]:0,u=this.bufferBase+this.buffer.length-h;if(n<o.minRepeatTerm||131072&t){let t=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,l,t,u+4,!0)}if(262144&t)this.state=this.stack[a];else{let t=this.stack[a-3];this.state=o.getGoto(t,n,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(n,l)}storeNode(t,e,i,n=4,o=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let t=this,n=this.buffer.length;if(0==n&&t.parent&&(n=t.bufferBase-t.parent.bufferBase,t=t.parent),n>0&&0==t.buffer[n-4]&&t.buffer[n-1]>-1){if(e==i)return;if(t.buffer[n-2]>=e)return void(t.buffer[n-2]=i)}}if(o&&this.pos!=i){let o=this.buffer.length;if(o>0&&(0!=this.buffer[o-4]||this.buffer[o-1]<0)){let t=!1;for(let e=o;e>0&&this.buffer[e-2]>i;e-=4)if(this.buffer[e-1]>=0){t=!0;break}if(t)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,n>4&&(n-=4)}this.buffer[o]=t,this.buffer[o+1]=e,this.buffer[o+2]=i,this.buffer[o+3]=n}else this.buffer.push(t,e,i,n)}shift(t,e,i,n){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=n,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,n,4);else{let o=t,{parser:s}=this.p;(n>this.pos||e<=s.maxNode)&&(this.pos=n,s.stateFlag(o,1)||(this.reducePos=n)),this.pushState(o,i),this.shiftContext(e,i),e<=s.maxNode&&this.buffer.push(e,i,n,4)}}apply(t,e,i,n){65536&t?this.reduce(t):this.shift(t,e,i,n)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let n=this.pos;this.reducePos=this.pos=n+t.length,this.pushState(e,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let i=t.buffer.slice(e),n=t.bufferBase+e;for(;t&&n==t.bufferBase;)t=t.parent;return new Ka(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new tl(this);;){let i=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==i)return!1;if(!(65536&i))return!0;e.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let n,o=0;o<e.length;o+=2)(n=e[o+1])!=this.state&&this.p.parser.hasAction(n,t)&&i.push(e[o],n);if(this.stack.length<120)for(let t=0;i.length<8&&t<e.length;t+=2){let n=e[t+1];i.some((t,e)=>1&e&&t==n)||i.push(e[t],n)}e=i}let i=[];for(let t=0;t<e.length&&i.length<4;t+=2){let n=e[t+1];if(n==this.state)continue;let o=this.split();o.pushState(n,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(e[t],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:t}=this.p,e=t.stateSlot(this.state,5);if(!(65536&e))return!1;if(!t.validAction(this.state,e)){let i=e>>19,n=65535&e,o=this.stack.length-3*i;if(o<0||t.getGoto(this.stack[o],n,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],i=(n,o)=>{if(!e.includes(n))return e.push(n),t.allActions(n,e=>{if(393216&e);else if(65536&e){let i=(e>>19)-o;if(i>1){let n=65535&e,o=this.stack.length-3*i;if(o>=0&&t.getGoto(this.stack[o],n,!1)>=0)return i<<19|65536|n}}else{let t=i(e,o+1);if(null!=t)return t}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||-3!=this.buffer[t])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||-4!=this.buffer[t])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new Ja(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){t>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Ja{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class tl{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,i=t>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=n}}class el{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new el(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new el(this.stack,this.pos,this.index)}}function il(t,e=Uint16Array){if("string"!=typeof t)return t;let i=null;for(let n=0,o=0;n<t.length;){let s=0;for(;;){let e=t.charCodeAt(n++),i=!1;if(126==e){s=65535;break}e>=92&&e--,e>=34&&e--;let o=e-32;if(o>=46&&(o-=46,i=!0),s+=o,i)break;s*=46}i?i[o++]=s:i=new e(s)}return i}class nl{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const ol=new nl;class sl{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=ol,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let i=this.range,n=this.rangeIndex,o=this.pos+t;for(;o<i.from;){if(!n)return null;let t=this.ranges[--n];o-=i.from-t.to,i=t}for(;e<0?o>i.to:o>=i.to;){if(n==this.ranges.length-1)return null;let t=this.ranges[++n];o+=t.from-i.to,i=t}return o}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e,i,n=this.chunkOff+t;if(n>=0&&n<this.chunk.length)e=this.pos+t,i=this.chunk.charCodeAt(n);else{let n=this.resolveOffset(t,1);if(null==n)return-1;if(e=n,e>=this.chunk2Pos&&e<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(e-this.chunk2Pos);else{let t=this.rangeIndex,n=this.range;for(;n.to<=e;)n=this.ranges[++t];this.chunk2=this.input.chunk(this.chunk2Pos=e),e+this.chunk2.length>n.to&&(this.chunk2=this.chunk2.slice(0,n.to-e)),i=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),i}acceptToken(t,e=0){let i=e?this.resolveOffset(e,-1):this.pos;if(null==i||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=i}acceptTokenTo(t,e){this.token.value=t,this.token.end=e}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),e=this.pos+t.length;this.chunk=e>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=ol,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let i="";for(let n of this.ranges){if(n.from>=e)break;n.to>t&&(i+=this.input.read(Math.max(n.from,t),Math.min(n.to,e)))}return i}}class rl{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:i}=e.p;cl(this.data,t,e,this.id,i.data,i.tokenPrecTable)}}rl.prototype.contextual=rl.prototype.fallback=rl.prototype.extend=!1;class al{constructor(t,e,i){this.precTable=e,this.elseToken=i,this.data="string"==typeof t?il(t):t}token(t,e){let i=t.pos,n=0;for(;;){let i=t.next<0,o=t.resolveOffset(1,1);if(cl(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(null==this.elseToken)return;if(i||n++,null==o)break;t.reset(o,t.token)}n&&(t.reset(i,t.token),t.acceptToken(this.elseToken,n))}}al.prototype.contextual=rl.prototype.fallback=rl.prototype.extend=!1;class ll{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function cl(t,e,i,n,o,s){let r=0,a=1<<n,{dialect:l}=i.p.parser;t:for(;0!=(a&t[r]);){let i=t[r+1];for(let n=r+3;n<i;n+=2)if((t[n+1]&a)>0){let i=t[n];if(l.allows(i)&&(-1==e.token.value||e.token.value==i||ul(i,e.token.value,o,s))){e.acceptToken(i);break}}let n=e.next,c=0,h=t[r+2];if(!(e.next<0&&h>c&&65535==t[i+3*h-3])){for(;c<h;){let o=c+h>>1,s=i+o+(o<<1),a=t[s],l=t[s+1]||65536;if(n<a)h=o;else{if(!(n>=l)){r=t[s+2],e.advance();continue t}c=o+1}}break}r=t[i+3*h-1]}}function hl(t,e,i){for(let n,o=e;65535!=(n=t[o]);o++)if(n==i)return o-e;return-1}function ul(t,e,i,n){let o=hl(i,n,e);return o<0||hl(i,n,t)<o}const dl="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let fl=null;function pl(t,e,i){let n=t.cursor(Pa.IncludeAnonymous);for(n.moveTo(e);;)if(!(i<0?n.childBefore(e):n.childAfter(e)))for(;;){if((i<0?n.to<e:n.from>e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class ml{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?pl(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?pl(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let i=this.trees[e],n=this.index[e];if(n==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=i.children[n],s=this.start[e]+i.positions[n];if(s>t)return this.nextStart=s,null;if(o instanceof Ea){if(s==t){if(s<this.safeFrom)return null;let t=s+o.length;if(t<=this.safeTo){let e=o.prop(wa.lookAhead);if(!e||t+e<this.fragment.to)return o}}this.index[e]++,s+o.length>=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[e]++,this.nextStart=s+o.length}}}class gl{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(t=>new nl)}getActions(t){let e=0,i=null,{parser:n}=t.p,{tokenizers:o}=n,s=n.stateSlot(t.state,3),r=t.curContext?t.curContext.hash:0,a=0;for(let n=0;n<o.length;n++){if(!(1<<n&s))continue;let l=o[n],c=this.tokens[n];if((!i||l.fallback)&&((l.contextual||c.start!=t.pos||c.mask!=s||c.context!=r)&&(this.updateCachedToken(c,l,t),c.mask=s,c.context=r),c.lookAhead>c.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=e;if(c.extended>-1&&(e=this.addActions(t,c.extended,c.end,e)),e=this.addActions(t,c.value,c.end,e),!l.extend&&(i=c,e>n))break}}for(;this.actions.length>e;)this.actions.pop();return a&&t.setLookAhead(a),i||t.pos!=this.stream.end||(i=new nl,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,e=this.addActions(t,i.value,i.end,e)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new nl,{pos:i,p:n}=t;return e.start=i,e.end=Math.min(i+1,n.stream.end),e.value=i==n.stream.end?n.parser.eofTerm:0,e}updateCachedToken(t,e,i){let n=this.stream.clipPos(i.pos);if(e.token(this.stream.reset(n,t),i),t.value>-1){let{parser:e}=i.p;for(let n=0;n<e.specialized.length;n++)if(e.specialized[n]==t.value){let o=e.specializers[n](this.stream.read(t.start,t.end),i);if(o>=0&&i.p.parser.dialect.allows(o>>1)){1&o?t.extended=o>>1:t.value=o>>1;break}}}else t.value=0,t.end=this.stream.clipPos(n+1)}putAction(t,e,i,n){for(let e=0;e<n;e+=3)if(this.actions[e]==t)return n;return this.actions[n++]=t,this.actions[n++]=e,this.actions[n++]=i,n}addActions(t,e,i,n){let{state:o}=t,{parser:s}=t.p,{data:r}=s;for(let t=0;t<2;t++)for(let a=s.stateSlot(o,t?2:1);;a+=3){if(65535==r[a]){if(1!=r[a+1]){0==n&&2==r[a+1]&&(n=this.putAction(wl(r,a+2),e,i,n));break}a=wl(r,a+2)}r[a]==e&&(n=this.putAction(wl(r,a+1),e,i,n))}return n}}class vl{constructor(t,e,i,n){this.parser=t,this.input=e,this.ranges=n,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new sl(e,n),this.tokens=new gl(t,this.stream),this.topTerm=t.top[1];let{from:o}=n[0];this.stacks=[Ka.start(this,t.top[0],o)],this.fragments=i.length&&this.stream.end-o>4*t.bufferLength?new ml(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,i=this.stacks,n=this.minStackPos,o=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[t]=i;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<i.length;s++){let r=i[s];for(;;){if(this.tokens.mainToken=null,r.pos>n)o.push(r);else{if(this.advanceStack(r,o,i))continue;{t||(t=[],e=[]),t.push(r);let i=this.tokens.getMainToken(r);e.push(i.value,i.end)}}break}}if(!o.length){let e=t&&function(t){let e=null;for(let i of t){let t=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=t&&i.pos>t)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.score<i.score)&&(e=i)}return e}(t);if(e)return dl&&console.log("Finish with "+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw dl&&t&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&t){let i=null!=this.stoppedAt&&t[0].pos>this.stoppedAt?t[0]:this.runRecovery(t,e,o);if(i)return dl&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(o.length>t)for(o.sort((t,e)=>e.score-t.score);o.length>t;)o.pop();o.some(t=>t.reducePos>n)&&this.recovering--}else if(o.length>1){t:for(let t=0;t<o.length-1;t++){let e=o[t];for(let i=t+1;i<o.length;i++){let n=o[i];if(e.sameState(n)||e.buffer.length>500&&n.buffer.length>500){if(!((e.score-n.score||e.buffer.length-n.buffer.length)>0)){o.splice(t--,1);continue t}o.splice(i--,1)}}}o.length>12&&o.splice(12,o.length-12)}this.minStackPos=o[0].pos;for(let t=1;t<o.length;t++)o[t].pos<this.minStackPos&&(this.minStackPos=o[t].pos);return null}stopAt(t){if(null!=this.stoppedAt&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,i){let n=t.pos,{parser:o}=this,s=dl?this.stackID(t)+" -> ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,i=e?t.curContext.hash:0;for(let r=this.fragments.nodeAt(n);r;){let n=this.parser.nodeSet.types[r.type.id]==r.type?o.getGoto(t.state,r.type.id):-1;if(n>-1&&r.length&&(!e||(r.prop(wa.contextHash)||0)==i))return t.useNode(r,n),dl&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(r.type.id)})`),!0;if(!(r instanceof Ea)||0==r.children.length||r.positions[0]>0)break;let a=r.children[0];if(!(a instanceof Ea&&0==r.positions[0]))break;r=a}}let r=o.stateSlot(t.state,4);if(r>0)return t.reduce(r),dl&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(65535&r)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let a=this.tokens.getActions(t);for(let r=0;r<a.length;){let l=a[r++],c=a[r++],h=a[r++],u=r==a.length||!i,d=u?t:t.split(),f=this.tokens.mainToken;if(d.apply(l,c,f?f.start:d.pos,h),dl&&console.log(s+this.stackID(d)+` (via ${65536&l?`reduce of ${o.getName(65535&l)}`:"shift"} for ${o.getName(c)} @ ${n}${d==t?"":", split"})`),u)return!0;d.pos>n?e.push(d):i.push(d)}return!1}advanceFully(t,e){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return yl(t,e),!0}}runRecovery(t,e,i){let n=null,o=!1;for(let s=0;s<t.length;s++){let r=t[s],a=e[s<<1],l=e[1+(s<<1)],c=dl?this.stackID(r)+" -> ":"";if(r.deadEnd){if(o)continue;if(o=!0,r.restart(),dl&&console.log(c+this.stackID(r)+" (restarted)"),this.advanceFully(r,i))continue}let h=r.split(),u=c;for(let t=0;t<10&&h.forceReduce();t++){if(dl&&console.log(u+this.stackID(h)+" (via force-reduce)"),this.advanceFully(h,i))break;dl&&(u=this.stackID(h)+" -> ")}for(let t of r.recoverByInsert(a))dl&&console.log(c+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,i);this.stream.end>r.pos?(l==r.pos&&(l++,a=0),r.recoverByDelete(a,l),dl&&console.log(c+this.stackID(r)+` (via recover-delete ${this.parser.getName(a)})`),yl(r,i)):(!n||n.score<r.score)&&(n=r)}return n}stackToTree(t){return t.close(),Ea.build({buffer:el.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(fl||(fl=new WeakMap)).get(t);return e||fl.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function yl(t,e){for(let i=0;i<e.length;i++){let n=e[i];if(n.pos==t.pos&&n.sameState(t))return void(e[i].score<t.score&&(e[i]=t))}e.push(t)}class Ol{constructor(t,e,i){this.source=t,this.flags=e,this.disabled=i}allows(t){return!this.disabled||0==this.disabled[t]}}const bl=t=>t;class xl extends Ua{constructor(t){if(super(),this.wrappers=[],14!=t.version)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let i=0;i<t.repeatNodeCount;i++)e.push("");let i=Object.keys(t.topRules).map(e=>t.topRules[e][1]),n=[];for(let t=0;t<e.length;t++)n.push([]);function o(t,e,i){n[t].push([e,e.deserialize(String(i))])}if(t.nodeProps)for(let e of t.nodeProps){let t=e[0];"string"==typeof t&&(t=wa[t]);for(let i=1;i<e.length;){let n=e[i++];if(n>=0)o(n,t,e[i++]);else{let s=e[i+-n];for(let r=-n;r>0;r--)o(e[i++],t,s);i++}}}this.nodeSet=new $a(e.map((e,o)=>ka.define({name:o>=this.minRepeatTerm?void 0:e,id:o,props:n[o],top:i.indexOf(o)>-1,error:0==o,skipped:t.skippedNodes&&t.skippedNodes.indexOf(o)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=Oa;let s=il(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t<this.specializerSpecs.length;t++)this.specialized[t]=this.specializerSpecs[t].term;this.specializers=this.specializerSpecs.map(_l),this.states=il(t.states,Uint32Array),this.data=il(t.stateData),this.goto=il(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(t=>"number"==typeof t?new rl(s,t):t),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,i){let n=new vl(this,t,e,i);for(let o of this.wrappers)n=o(n,t,e,i);return n}getGoto(t,e,i=!1){let n=this.goto;if(e>=n[0])return-1;for(let o=n[e+1];;){let e=n[o++],s=1&e,r=n[o++];if(s&&i)return r;for(let i=o+(e>>1);o<i;o++)if(n[o]==t)return r;if(s)return-1}}hasAction(t,e){let i=this.data;for(let n=0;n<2;n++)for(let o,s=this.stateSlot(t,n?2:1);;s+=3){if(65535==(o=i[s])){if(1!=i[s+1]){if(2==i[s+1])return wl(i,s+2);break}o=i[s=wl(i,s+2)]}if(o==e||0==o)return wl(i,s+1)}return 0}stateSlot(t,e){return this.states[6*t+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){return!!this.allActions(t,t=>t==e||null)}allActions(t,e){let i=this.stateSlot(t,4),n=i?e(i):void 0;for(let i=this.stateSlot(t,1);null==n;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=wl(this.data,i+2)}n=e(wl(this.data,i+1))}return n}nextStates(t){let e=[];for(let i=this.stateSlot(t,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=wl(this.data,i+2)}if(!(1&this.data[i+2])){let t=this.data[i+1];e.some((e,i)=>1&i&&e==t)||e.push(this.data[i],t)}}return e}configure(t){let e=Object.assign(Object.create(xl.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=i}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(e=>{let i=t.tokenizers.find(t=>t.from==e);return i?i.to:e})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((i,n)=>{let o=t.specializers.find(t=>t.from==i.external);if(!o)return i;let s=Object.assign(Object.assign({},i),{external:o.to});return e.specializers[n]=_l(s),s})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),i=e.map(()=>!1);if(t)for(let n of t.split(" ")){let t=e.indexOf(n);t>=0&&(i[t]=!0)}let n=null;for(let t=0;t<e.length;t++)if(!i[t])for(let i,o=this.dialects[e[t]];65535!=(i=this.data[o++]);)(n||(n=new Uint8Array(this.maxTerm+1)))[i]=1;return new Ol(t,i,n)}static deserialize(t){return new xl(t)}}function wl(t,e){return t[e]|t[e+1]<<16}function _l(t){if(t.external){let e=t.extend?1:0;return(i,n)=>t.external(i,n)<<1|e}return t.get}let Sl=0;class kl{constructor(t,e,i,n){this.name=t,this.set=e,this.base=i,this.modified=n,this.id=Sl++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i="string"==typeof t?t:"?";if(t instanceof kl&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let n=new kl(i,[],null,[]);if(n.set.push(n),e)for(let t of e.set)n.set.push(t);return n}static defineModifier(t){let e=new Tl(t);return t=>t.modified.indexOf(e)>-1?t:Tl.get(t.base||t,t.modified.concat(e).sort((t,e)=>t.id-e.id))}}let $l=0;class Tl{constructor(t){this.name=t,this.instances=[],this.id=$l++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(i=>{return i.base==t&&(n=e,o=i.modified,n.length==o.length&&n.every((t,e)=>t==o[e]));var n,o});if(i)return i;let n=[],o=new kl(t.name,n,t,e);for(let t of e)t.instances.push(o);let s=function(t){let e=[[]];for(let i=0;i<t.length;i++)for(let n=0,o=e.length;n<o;n++)e.push(e[n].concat(t[i]));return e.sort((t,e)=>e.length-t.length)}(e);for(let e of t.set)if(!e.modified.length)for(let t of s)n.push(Tl.get(e,t));return o}}function Cl(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let t of i.split(" "))if(t){let i=[],o=2,s=t;for(let e=0;;){if("..."==s&&e>0&&e+3==t.length){o=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!n)throw new RangeError("Invalid path: "+t);if(i.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),e+=n[0].length,e==t.length)break;let r=t[e++];if(e==t.length&&"!"==r){o=0;break}if("/"!=r)throw new RangeError("Invalid path: "+t);s=t.slice(e)}let r=i.length-1,a=i[r];if(!a)throw new RangeError("Invalid path: "+t);let l=new El(n,o,r>0?i.slice(0,r):null);e[a]=l.sort(e[a])}}return Pl.add(e)}const Pl=new wa({combine(t,e){let i,n,o;for(;t||e;){if(!t||e&&t.depth>=e.depth?(o=e,e=e.next):(o=t,t=t.next),i&&i.mode==o.mode&&!o.context&&!i.context)continue;let s=new El(o.tags,o.mode,o.context);i?i.next=s:n=s,i=s}return n}});class El{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}function Al(t,e){let i=Object.create(null);for(let e of t)if(Array.isArray(e.tag))for(let t of e.tag)i[t.id]=e.class;else i[e.tag.id]=e.class;let{scope:n,all:o=null}=e||{};return{style:t=>{let e=o;for(let n of t)for(let t of n.set){let n=i[t.id];if(n){e=e?e+" "+n:n;break}}return e},scope:n}}function Ml(t,e,i,n=0,o=t.length){let s=new Ql(n,Array.isArray(e)?e:[e],i);s.highlightRange(t.cursor(),n,o,"",s.highlighters),s.flush(o)}El.empty=new El([],2,null);class Ql{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,o){let{type:s,from:r,to:a}=t;if(r>=i||a<=e)return;s.isTop&&(o=this.highlighters.filter(t=>!t.scope||t.scope(s)));let l=n,c=function(t){let e=t.type.prop(Pl);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||El.empty,h=function(t,e){let i=null;for(let n of t){let t=n.style(e);t&&(i=i?i+" "+t:t)}return i}(o,c.tags);if(h&&(l&&(l+=" "),l+=h,1==c.mode&&(n+=(n?" ":"")+h)),this.startSpan(Math.max(e,r),l),c.opaque)return;let u=t.tree&&t.tree.prop(wa.mounted);if(u&&u.overlay){let s=t.node.enter(u.overlay[0].from+r,1),c=this.highlighters.filter(t=>!t.scope||t.scope(u.tree.type)),h=t.firstChild();for(let d=0,f=r;;d++){let p=d<u.overlay.length?u.overlay[d]:null,m=p?p.from+r:a,g=Math.max(e,f),v=Math.min(i,m);if(g<v&&h)for(;t.from<v&&(this.highlightRange(t,g,v,n,o),this.startSpan(Math.min(v,t.to),l),!(t.to>=m)&&t.nextSibling()););if(!p||m>i)break;f=p.to+r,f>e&&(this.highlightRange(s.cursor(),Math.max(e,p.from+r),Math.min(i,f),"",c),this.startSpan(Math.min(i,f),l))}h&&t.parent()}else if(t.firstChild()){u&&(n="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,o),this.startSpan(Math.min(i,t.to),l)}}while(t.nextSibling());t.parent()}}}const Dl=kl.define,Rl=Dl(),Il=Dl(),Ll=Dl(Il),Nl=Dl(Il),jl=Dl(),zl=Dl(jl),Bl=Dl(jl),Zl=Dl(),Wl=Dl(Zl),Fl=Dl(),Xl=Dl(),ql=Dl(),Hl=Dl(ql),Vl=Dl(),Yl={comment:Rl,lineComment:Dl(Rl),blockComment:Dl(Rl),docComment:Dl(Rl),name:Il,variableName:Dl(Il),typeName:Ll,tagName:Dl(Ll),propertyName:Nl,attributeName:Dl(Nl),className:Dl(Il),labelName:Dl(Il),namespace:Dl(Il),macroName:Dl(Il),literal:jl,string:zl,docString:Dl(zl),character:Dl(zl),attributeValue:Dl(zl),number:Bl,integer:Dl(Bl),float:Dl(Bl),bool:Dl(jl),regexp:Dl(jl),escape:Dl(jl),color:Dl(jl),url:Dl(jl),keyword:Fl,self:Dl(Fl),null:Dl(Fl),atom:Dl(Fl),unit:Dl(Fl),modifier:Dl(Fl),operatorKeyword:Dl(Fl),controlKeyword:Dl(Fl),definitionKeyword:Dl(Fl),moduleKeyword:Dl(Fl),operator:Xl,derefOperator:Dl(Xl),arithmeticOperator:Dl(Xl),logicOperator:Dl(Xl),bitwiseOperator:Dl(Xl),compareOperator:Dl(Xl),updateOperator:Dl(Xl),definitionOperator:Dl(Xl),typeOperator:Dl(Xl),controlOperator:Dl(Xl),punctuation:ql,separator:Dl(ql),bracket:Hl,angleBracket:Dl(Hl),squareBracket:Dl(Hl),paren:Dl(Hl),brace:Dl(Hl),content:Zl,heading:Wl,heading1:Dl(Wl),heading2:Dl(Wl),heading3:Dl(Wl),heading4:Dl(Wl),heading5:Dl(Wl),heading6:Dl(Wl),contentSeparator:Dl(Zl),list:Dl(Zl),quote:Dl(Zl),emphasis:Dl(Zl),strong:Dl(Zl),link:Dl(Zl),monospace:Dl(Zl),strikethrough:Dl(Zl),inserted:Dl(),deleted:Dl(),changed:Dl(),invalid:Dl(),meta:Vl,documentMeta:Dl(Vl),annotation:Dl(Vl),processingInstruction:Dl(Vl),definition:kl.defineModifier("definition"),constant:kl.defineModifier("constant"),function:kl.defineModifier("function"),standard:kl.defineModifier("standard"),local:kl.defineModifier("local"),special:kl.defineModifier("special")};for(let t in Yl){let e=Yl[t];e instanceof kl&&(e.name=t)}Al([{tag:Yl.link,class:"tok-link"},{tag:Yl.heading,class:"tok-heading"},{tag:Yl.emphasis,class:"tok-emphasis"},{tag:Yl.strong,class:"tok-strong"},{tag:Yl.keyword,class:"tok-keyword"},{tag:Yl.atom,class:"tok-atom"},{tag:Yl.bool,class:"tok-bool"},{tag:Yl.url,class:"tok-url"},{tag:Yl.labelName,class:"tok-labelName"},{tag:Yl.inserted,class:"tok-inserted"},{tag:Yl.deleted,class:"tok-deleted"},{tag:Yl.literal,class:"tok-literal"},{tag:Yl.string,class:"tok-string"},{tag:Yl.number,class:"tok-number"},{tag:[Yl.regexp,Yl.escape,Yl.special(Yl.string)],class:"tok-string2"},{tag:Yl.variableName,class:"tok-variableName"},{tag:Yl.local(Yl.variableName),class:"tok-variableName tok-local"},{tag:Yl.definition(Yl.variableName),class:"tok-variableName tok-definition"},{tag:Yl.special(Yl.variableName),class:"tok-variableName2"},{tag:Yl.definition(Yl.propertyName),class:"tok-propertyName tok-definition"},{tag:Yl.typeName,class:"tok-typeName"},{tag:Yl.namespace,class:"tok-namespace"},{tag:Yl.className,class:"tok-className"},{tag:Yl.macroName,class:"tok-macroName"},{tag:Yl.propertyName,class:"tok-propertyName"},{tag:Yl.operator,class:"tok-operator"},{tag:Yl.comment,class:"tok-comment"},{tag:Yl.meta,class:"tok-meta"},{tag:Yl.invalid,class:"tok-invalid"},{tag:Yl.punctuation,class:"tok-punctuation"}]);const Ul=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Gl=new class{constructor(t){this.start=t.start,this.shift=t.shift||bl,this.reduce=t.reduce||bl,this.reuse=t.reuse||bl,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}({start:!1,shift:(t,e)=>5==e||6==e||320==e?t:321==e,strict:!1}),Kl=new ll((t,e)=>{let{next:i}=t;(125==i||-1==i||e.context)&&t.acceptToken(318)},{contextual:!0,fallback:!0}),Jl=new ll((t,e)=>{let i,{next:n}=t;Ul.indexOf(n)>-1||(47!=n||47!=(i=t.peek(1))&&42!=i)&&(125==n||59==n||-1==n||e.context||t.acceptToken(316))},{contextual:!0}),tc=new ll((t,e)=>{91!=t.next||e.context||t.acceptToken(317)},{contextual:!0}),ec=new ll((t,e)=>{let{next:i}=t;if(43==i||45==i){if(t.advance(),i==t.next){t.advance();let i=!e.context&&e.canShift(1);t.acceptToken(i?1:2)}}else 63==i&&46==t.peek(1)&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(3))},{contextual:!0});function ic(t,e){return t>=65&&t<=90||t>=97&&t<=122||95==t||t>=192||!e&&t>=48&&t<=57}const nc=new ll((t,e)=>{if(60!=t.next||!e.dialectEnabled(0))return;if(t.advance(),47==t.next)return;let i=0;for(;Ul.indexOf(t.next)>-1;)t.advance(),i++;if(ic(t.next,!0)){for(t.advance(),i++;ic(t.next,!1);)t.advance(),i++;for(;Ul.indexOf(t.next)>-1;)t.advance(),i++;if(44==t.next)return;for(let e=0;;e++){if(7==e){if(!ic(t.next,!0))return;break}if(t.next!="extends".charCodeAt(e))break;t.advance(),i++}}t.acceptToken(4,-i)}),oc=Cl({"get set async static":Yl.modifier,"for while do if else switch try catch finally return throw break continue default case defer":Yl.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":Yl.operatorKeyword,"let var const using function class extends":Yl.definitionKeyword,"import export from":Yl.moduleKeyword,"with debugger new":Yl.keyword,TemplateString:Yl.special(Yl.string),super:Yl.atom,BooleanLiteral:Yl.bool,this:Yl.self,null:Yl.null,Star:Yl.modifier,VariableName:Yl.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Yl.function(Yl.variableName),VariableDefinition:Yl.definition(Yl.variableName),Label:Yl.labelName,PropertyName:Yl.propertyName,PrivatePropertyName:Yl.special(Yl.propertyName),"CallExpression/MemberExpression/PropertyName":Yl.function(Yl.propertyName),"FunctionDeclaration/VariableDefinition":Yl.function(Yl.definition(Yl.variableName)),"ClassDeclaration/VariableDefinition":Yl.definition(Yl.className),"NewExpression/VariableName":Yl.className,PropertyDefinition:Yl.definition(Yl.propertyName),PrivatePropertyDefinition:Yl.definition(Yl.special(Yl.propertyName)),UpdateOp:Yl.updateOperator,"LineComment Hashbang":Yl.lineComment,BlockComment:Yl.blockComment,Number:Yl.number,String:Yl.string,Escape:Yl.escape,ArithOp:Yl.arithmeticOperator,LogicOp:Yl.logicOperator,BitOp:Yl.bitwiseOperator,CompareOp:Yl.compareOperator,RegExp:Yl.regexp,Equals:Yl.definitionOperator,Arrow:Yl.function(Yl.punctuation),": Spread":Yl.punctuation,"( )":Yl.paren,"[ ]":Yl.squareBracket,"{ }":Yl.brace,"InterpolationStart InterpolationEnd":Yl.special(Yl.brace),".":Yl.derefOperator,", ;":Yl.separator,"@":Yl.meta,TypeName:Yl.typeName,TypeDefinition:Yl.definition(Yl.typeName),"type enum interface implements namespace module declare":Yl.definitionKeyword,"abstract global Privacy readonly override":Yl.modifier,"is keyof unique infer asserts":Yl.operatorKeyword,JSXAttributeValue:Yl.attributeValue,JSXText:Yl.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Yl.angleBracket,"JSXIdentifier JSXNameSpacedName":Yl.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Yl.attributeName,"JSXBuiltin/JSXIdentifier":Yl.standard(Yl.tagName)}),sc={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},rc={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},ac={__proto__:null,"<":193},lc=xl.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0L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x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:Gl,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[oc],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}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term:327,get:t=>sc[t]||-1},{term:343,get:t=>rc[t]||-1},{term:95,get:t=>ac[t]||-1}],tokenPrec:15201});let cc=[],hc=[];function uc(t){if(t<768)return!1;for(let e=0,i=cc.length;;){let n=e+i>>1;if(t<cc[n])i=n;else{if(!(t>=hc[n]))return!0;e=n+1}if(e==i)return!1}}function dc(t){return t>=127462&&t<=127487}(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let e=0,i=0;e<t.length;e++)(e%2?hc:cc).push(i+=t[e])})();function fc(t,e,i=!0,n=!0){return(i?pc:mc)(t,e,n)}function pc(t,e,i){if(e==t.length)return e;e&&vc(t.charCodeAt(e))&&yc(t.charCodeAt(e-1))&&e--;let n=gc(t,e);for(e+=Oc(n);e<t.length;){let o=gc(t,e);if(8205==n||8205==o||i&&uc(o))e+=Oc(o),n=o;else{if(!dc(o))break;{let i=0,n=e-2;for(;n>=0&&dc(gc(t,n));)i++,n-=2;if(i%2==0)break;e+=2}}}return e}function mc(t,e,i){for(;e>0;){let n=pc(t,e-2,i);if(n<e)return n;e--}return 0}function gc(t,e){let i=t.charCodeAt(e);if(!yc(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return vc(n)?n-56320+(i-55296<<10)+65536:i}function vc(t){return t>=56320&&t<57344}function yc(t){return t>=55296&&t<56320}function Oc(t){return t<65536?1:2}class bc{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Pc(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),wc.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Pc(this,t,e);let i=[];return this.decompose(t,e,i,0),wc.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new kc(this),o=new kc(t);for(let t=e,s=e;;){if(n.next(t),o.next(t),t=0,n.lineBreak!=o.lineBreak||n.done!=o.done||n.value!=o.value)return!1;if(s+=n.value.length,n.done||s>=i)return!0}}iter(t=1){return new kc(this,t)}iterRange(t,e=this.length){return new $c(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Tc(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new xc(t):wc.from(xc.split(t,[])):bc.empty}}class xc extends bc{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let o=0;;o++){let s=this.text[o],r=n+s.length;if((e?i:r)>=t)return new Cc(n,r,i,s);n=r+1,i++}}decompose(t,e,i,n){let o=t<=0&&e>=this.length?this:new xc(Sc(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&n){let t=i.pop(),e=_c(o.text,t.text.slice(),0,o.length);if(e.length<=32)i.push(new xc(e,t.length+o.length));else{let t=e.length>>1;i.push(new xc(e.slice(0,t)),new xc(e.slice(t)))}}else i.push(o)}replace(t,e,i){if(!(i instanceof xc))return super.replace(t,e,i);[t,e]=Pc(this,t,e);let n=_c(this.text,_c(i.text,Sc(this.text,0,t)),e),o=this.length+i.length-(e-t);return n.length<=32?new xc(n,o):wc.from(xc.split(n,[]),o)}sliceString(t,e=this.length,i="\n"){[t,e]=Pc(this,t,e);let n="";for(let o=0,s=0;o<=e&&s<this.text.length;s++){let r=this.text[s],a=o+r.length;o>t&&s&&(n+=i),t<a&&e>o&&(n+=r.slice(Math.max(0,t-o),e-o)),o=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let o of t)i.push(o),n+=o.length+1,32==i.length&&(e.push(new xc(i,n)),i=[],n=-1);return n>-1&&e.push(new xc(i,n)),e}}class wc extends bc{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,i,n){for(let o=0;;o++){let s=this.children[o],r=n+s.length,a=i+s.lines-1;if((e?a:r)>=t)return s.lineInner(t,e,i,n);n=r+1,i=a+1}}decompose(t,e,i,n){for(let o=0,s=0;s<=e&&o<this.children.length;o++){let r=this.children[o],a=s+r.length;if(t<=a&&e>=s){let o=n&((s<=t?1:0)|(a>=e?2:0));s>=t&&a<=e&&!o?i.push(r):r.decompose(t-s,e-s,i,o)}s=a+1}}replace(t,e,i){if([t,e]=Pc(this,t,e),i.lines<this.lines)for(let n=0,o=0;n<this.children.length;n++){let s=this.children[n],r=o+s.length;if(t>=o&&e<=r){let a=s.replace(t-o,e-o,i),l=this.lines-s.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let o=this.children.slice();return o[n]=a,new wc(o,this.length-(e-t)+i.length)}return super.replace(o,r,a)}o=r+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=Pc(this,t,e);let n="";for(let o=0,s=0;o<this.children.length&&s<=e;o++){let r=this.children[o],a=s+r.length;s>t&&o&&(n+=i),t<a&&e>s&&(n+=r.sliceString(t-s,e-s,i)),s=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof wc))return 0;let i=0,[n,o,s,r]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,o+=e){if(n==s||o==r)return i;let a=this.children[n],l=t.children[o];if(a!=l)return i+a.scanIdentical(l,e);i+=a.length+1}}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new xc(i,e)}let n=Math.max(32,i>>5),o=n<<1,s=n>>1,r=[],a=0,l=-1,c=[];function h(t){let e;if(t.lines>o&&t instanceof wc)for(let e of t.children)h(e);else t.lines>s&&(a>s||!a)?(u(),r.push(t)):t instanceof xc&&a&&(e=c[c.length-1])instanceof xc&&t.lines+e.lines<=32?(a+=t.lines,l+=t.length+1,c[c.length-1]=new xc(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>n&&u(),a+=t.lines,l+=t.length+1,c.push(t))}function u(){0!=a&&(r.push(1==c.length?c[0]:wc.from(c,l)),l=-1,a=c.length=0)}for(let e of t)h(e);return u(),1==r.length?r[0]:new wc(r,e)}}function _c(t,e,i=0,n=1e9){for(let o=0,s=0,r=!0;s<t.length&&o<=n;s++){let a=t[s],l=o+a.length;l>=i&&(l>n&&(a=a.slice(0,n-o)),o<i&&(a=a.slice(i-o)),r?(e[e.length-1]+=a,r=!1):e.push(a)),o=l+1}return e}function Sc(t,e,i){return _c(t,[""],e,i)}bc.empty=new xc([""],0);class kc{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof xc?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],o=this.offsets[i],s=o>>1,r=n instanceof xc?n.text.length:n.children.length;if(s==(e>0?r:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(n instanceof xc){let o=n.text[s+(e<0?-1:0)];if(this.offsets[i]+=e,o.length>Math.max(0,t))return this.value=0==t?o:e>0?o.slice(t):o.slice(0,o.length-t),this;t-=o.length}else{let o=n.children[s+(e<0?-1:0)];t>o.length?(t-=o.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(o),this.offsets.push(e>0?1:(o instanceof xc?o.text.length:o.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class $c{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new kc(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Tc{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(bc.prototype[Symbol.iterator]=function(){return this.iter()},kc.prototype[Symbol.iterator]=$c.prototype[Symbol.iterator]=Tc.prototype[Symbol.iterator]=function(){return this});class Cc{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function Pc(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}function Ec(t,e,i=!0,n=!0){return fc(t,e,i,n)}function Ac(t,e){let i=t.charCodeAt(e);if(!(n=i,n>=55296&&n<56320&&e+1!=t.length))return i;var n;let o=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344}(o)?o-56320+(i-55296<<10)+65536:i}function Mc(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function Qc(t){return t<65536?1:2}const Dc=/\r\n?|\n/;var Rc=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Rc||(Rc={}));class Ic{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,n=0;e<this.sections.length;){let o=this.sections[e++],s=this.sections[e++];s<0?(t(i,n,o),n+=o):n+=s,i+=o}}iterChangedRanges(t,e=!1){zc(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];n<0?t.push(i,n):t.push(n,i)}return new Ic(t)}composeDesc(t){return this.empty?t:t.empty?this:Zc(this,t)}mapDesc(t,e=!1){return t.empty?this:Bc(this,t,e)}mapPos(t,e=-1,i=Rc.Simple){let n=0,o=0;for(let s=0;s<this.sections.length;){let r=this.sections[s++],a=this.sections[s++],l=n+r;if(a<0){if(l>t)return o+(t-n);o+=r}else{if(i!=Rc.Simple&&l>=t&&(i==Rc.TrackDel&&n<t&&l>t||i==Rc.TrackBefore&&n<t||i==Rc.TrackAfter&&l>t))return null;if(l>t||l==t&&e<0&&!r)return t==n||e<0?o:o+a;o+=a}n=l}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return o}touchesRange(t,e=t){for(let i=0,n=0;i<this.sections.length&&n<=e;){let o=n+this.sections[i++];if(this.sections[i++]>=0&&n<=e&&o>=t)return!(n<t&&o>e)||"cover";n=o}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];t+=(t?" ":"")+i+(n>=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(t=>"number"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ic(t)}static create(t){return new Ic(t)}}class Lc extends Ic{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return zc(this,(e,i,n,o,s)=>t=t.replace(n,n+(i-e),s),!1),t}mapDesc(t,e=!1){return Bc(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,o=0;n<e.length;n+=2){let s=e[n],r=e[n+1];if(r>=0){e[n]=r,e[n+1]=s;let a=n>>1;for(;i.length<a;)i.push(bc.empty);i.push(s?t.slice(o,o+s):bc.empty)}o+=s}return new Lc(e,i)}compose(t){return this.empty?t:t.empty?this:Zc(this,t,!0)}map(t,e=!1){return t.empty?this:Bc(this,t,e,!0)}iterChanges(t,e=!1){zc(this,t,e)}get desc(){return Ic.create(this.sections)}filter(t){let e=[],i=[],n=[],o=new Wc(this);t:for(let s=0,r=0;;){let a=s==t.length?1e9:t[s++];for(;r<a||r==a&&0==o.len;){if(o.done)break t;let t=Math.min(o.len,a-r);Nc(n,t,-1);let s=-1==o.ins?-1:0==o.off?o.ins:0;Nc(e,t,s),s>0&&jc(i,e,o.text),o.forward(t),r+=t}let l=t[s++];for(;r<l;){if(o.done)break t;let t=Math.min(o.len,l-r);Nc(e,t,-1),Nc(n,t,-1==o.ins?-1:0==o.off?o.ins:0),o.forward(t),r+=t}}return{changes:new Lc(e,i),filtered:Ic.create(n)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e],n=this.sections[e+1];n<0?t.push(i):0==n?t.push([i]):t.push([i].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,i){let n=[],o=[],s=0,r=null;function a(t=!1){if(!t&&!n.length)return;s<e&&Nc(n,e-s,-1);let i=new Lc(n,o);r=r?r.compose(i.map(r)):i,n=[],o=[],s=0}return function t(l){if(Array.isArray(l))for(let e of l)t(e);else if(l instanceof Lc){if(l.length!=e)throw new RangeError(`Mismatched change set length (got ${l.length}, expected ${e})`);a(),r=r?r.compose(l.map(r)):l}else{let{from:t,to:r=t,insert:c}=l;if(t>r||t<0||r>e)throw new RangeError(`Invalid change range ${t} to ${r} (in doc of length ${e})`);let h=c?"string"==typeof c?bc.of(c.split(i||Dc)):c:bc.empty,u=h.length;if(t==r&&0==u)return;t<s&&a(),t>s&&Nc(n,t-s,-1),Nc(n,r-t,u),jc(o,n,h),s=r}}(t),a(!r),r}static empty(t){return new Lc(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;n<t.length;n++){let o=t[n];if("number"==typeof o)e.push(o,-1);else{if(!Array.isArray(o)||"number"!=typeof o[0]||o.some((t,e)=>e&&"string"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)e.push(o[0],0);else{for(;i.length<n;)i.push(bc.empty);i[n]=bc.of(o.slice(1)),e.push(o[0],i[n].length)}}}return new Lc(e,i)}static createSet(t,e){return new Lc(t,e)}}function Nc(t,e,i,n=!1){if(0==e&&i<=0)return;let o=t.length-2;o>=0&&i<=0&&i==t[o+1]?t[o]+=e:o>=0&&0==e&&0==t[o]?t[o+1]+=i:n?(t[o]+=e,t[o+1]+=i):t.push(e,i)}function jc(t,e,i){if(0==i.length)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<n;)t.push(bc.empty);t.push(i)}}function zc(t,e,i){let n=t.inserted;for(let o=0,s=0,r=0;r<t.sections.length;){let a=t.sections[r++],l=t.sections[r++];if(l<0)o+=a,s+=a;else{let c=o,h=s,u=bc.empty;for(;c+=a,h+=l,l&&n&&(u=u.append(n[r-2>>1])),!(i||r==t.sections.length||t.sections[r+1]<0);)a=t.sections[r++],l=t.sections[r++];e(o,c,s,h,u),o=c,s=h}}}function Bc(t,e,i,n=!1){let o=[],s=n?[]:null,r=new Wc(t),a=new Wc(e);for(let t=-1;;){if(r.done&&a.len||a.done&&r.len)throw new Error("Mismatched change set lengths");if(-1==r.ins&&-1==a.ins){let t=Math.min(r.len,a.len);Nc(o,t,-1),r.forward(t),a.forward(t)}else if(a.ins>=0&&(r.ins<0||t==r.i||0==r.off&&(a.len<r.len||a.len==r.len&&!i))){let e=a.len;for(Nc(o,a.ins,-1);e;){let i=Math.min(r.len,e);r.ins>=0&&t<r.i&&r.len<=i&&(Nc(o,0,r.ins),s&&jc(s,o,r.text),t=r.i),r.forward(i),e-=i}a.next()}else{if(!(r.ins>=0)){if(r.done&&a.done)return s?Lc.createSet(o,s):Ic.create(o);throw new Error("Mismatched change set lengths")}{let e=0,i=r.len;for(;i;)if(-1==a.ins){let t=Math.min(i,a.len);e+=t,i-=t,a.forward(t)}else{if(!(0==a.ins&&a.len<i))break;i-=a.len,a.next()}Nc(o,e,t<r.i?r.ins:0),s&&t<r.i&&jc(s,o,r.text),t=r.i,r.forward(r.len-i)}}}}function Zc(t,e,i=!1){let n=[],o=i?[]:null,s=new Wc(t),r=new Wc(e);for(let t=!1;;){if(s.done&&r.done)return o?Lc.createSet(n,o):Ic.create(n);if(0==s.ins)Nc(n,s.len,0,t),s.next();else if(0!=r.len||r.done){if(s.done||r.done)throw new Error("Mismatched change set lengths");{let e=Math.min(s.len2,r.len),i=n.length;if(-1==s.ins){let i=-1==r.ins?-1:r.off?0:r.ins;Nc(n,e,i,t),o&&i&&jc(o,n,r.text)}else-1==r.ins?(Nc(n,s.off?0:s.len,e,t),o&&jc(o,n,s.textBit(e))):(Nc(n,s.off?0:s.len,r.off?0:r.ins,t),o&&!r.off&&jc(o,n,r.text));t=(s.ins>e||r.ins>=0&&r.len>e)&&(t||n.length>i),s.forward2(e),r.forward(e)}}else Nc(n,0,r.ins,t),o&&jc(o,n,r.text),r.next()}}class Wc{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?bc.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?bc.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class Fc{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new Fc(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return Xc.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return Xc.range(this.anchor,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Xc.range(t.anchor,t.head)}static create(t,e,i){return new Fc(t,e,i)}}class Xc{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:Xc.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new Xc([this.main],0)}addRange(t,e=!0){return Xc.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let i=this.ranges.slice();return i[e]=t,Xc.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Xc(t.ranges.map(t=>Fc.fromJSON(t)),t.main)}static single(t,e=t){return new Xc([Xc.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<t.length;n++){let o=t[n];if(o.empty?o.from<=i:o.from<i)return Xc.normalized(t.slice(),e);i=o.to}return new Xc(t,e)}static cursor(t,e=0,i,n){return Fc.create(t,t,(0==e?0:e<0?8:16)|(null==i?7:Math.min(6,i))|(null!=n?n:16777215)<<6)}static range(t,e,i,n){let o=(null!=i?i:16777215)<<6|(null==n?7:Math.min(6,n));return e<t?Fc.create(e,t,48|o):Fc.create(t,e,(e>t?8:0)|o)}static normalized(t,e=0){let i=t[e];t.sort((t,e)=>t.from-e.from),e=t.indexOf(i);for(let i=1;i<t.length;i++){let n=t[i],o=t[i-1];if(n.empty?n.from<=o.to:n.from<o.to){let s=o.from,r=Math.max(n.to,o.to);i<=e&&e--,t.splice(--i,2,n.anchor>n.head?Xc.range(r,s):Xc.range(s,r))}}return new Xc(t,e)}}function qc(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let Hc=0;class Vc{constructor(t,e,i,n,o){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=Hc++,this.default=t([]),this.extensions="function"==typeof o?o(this):o}get reader(){return this}static define(t={}){return new Vc(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:Yc),!!t.static,t.enables)}of(t){return new Uc([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Uc(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Uc(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],i=>e(i.field(t)))}}function Yc(t,e){return t==e||t.length==e.length&&t.every((t,i)=>t===e[i])}class Uc{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=Hc++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,o=this.id,s=t[o]>>1,r=2==this.type,a=!1,l=!1,c=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||c.push(t[i.id]);return{create:t=>(t.values[s]=i(t),1),update(t,e){if(a&&e.docChanged||l&&(e.docChanged||e.selection)||Kc(t,c)){let e=i(t);if(r?!Gc(e,t.values[s],n):!n(e,t.values[s]))return t.values[s]=e,1}return 0},reconfigure:(t,e)=>{let a,l=e.config.address[o];if(null!=l){let o=fh(e,l);if(this.dependencies.every(i=>i instanceof Vc?e.facet(i)===t.facet(i):!(i instanceof eh)||e.field(i,!1)==t.field(i,!1))||(r?Gc(a=i(t),o,n):n(a=i(t),o)))return t.values[s]=o,0}else a=i(t);return t.values[s]=a,1}}}}function Gc(t,e,i){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!i(t[n],e[n]))return!1;return!0}function Kc(t,e){let i=!1;for(let n of e)1&dh(t,n)&&(i=!0);return i}function Jc(t,e,i){let n=i.map(e=>t[e.id]),o=i.map(t=>t.type),s=n.filter(t=>!(1&t)),r=t[e.id]>>1;function a(t){let i=[];for(let e=0;e<n.length;e++){let s=fh(t,n[e]);if(2==o[e])for(let t of s)i.push(t);else i.push(s)}return e.combine(i)}return{create(t){for(let e of n)dh(t,e);return t.values[r]=a(t),1},update(t,i){if(!Kc(t,s))return 0;let n=a(t);return e.compare(n,t.values[r])?0:(t.values[r]=n,1)},reconfigure(t,o){let s=Kc(t,n),l=o.config.facets[e.id],c=o.facet(e);if(l&&!s&&Yc(i,l))return t.values[r]=c,0;let h=a(t);return e.compare(h,c)?(t.values[r]=c,0):(t.values[r]=h,1)}}}const th=Vc.define({static:!0});class eh{constructor(t,e,i,n,o){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=o,this.provides=void 0}static define(t){let e=new eh(Hc++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(th).find(t=>t.field==this);return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let n=t.values[e],o=this.updateF(n,i);return this.compareF(n,o)?0:(t.values[e]=o,1)},reconfigure:(t,i)=>{let n,o=t.facet(th),s=i.facet(th);return(n=o.find(t=>t.field==this))&&n!=s.find(t=>t.field==this)?(t.values[e]=n.create(t),1):null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}}init(t){return[this,th.of({field:this,create:t})]}get extension(){return this}}const ih=4,nh=3,oh=2,sh=1;function rh(t){return e=>new lh(e,t)}const ah={highest:rh(0),high:rh(sh),default:rh(oh),low:rh(nh),lowest:rh(ih)};class lh{constructor(t,e){this.inner=t,this.prec=e}}class ch{of(t){return new hh(this,t)}reconfigure(t){return ch.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class hh{constructor(t,e){this.compartment=t,this.inner=e}}class uh{constructor(t,e,i,n,o,s){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,i){let n=[],o=Object.create(null),s=new Map;for(let i of function(t,e,i){let n=[[],[],[],[],[]],o=new Map;function s(t,r){let a=o.get(t);if(null!=a){if(a<=r)return;let e=n[a].indexOf(t);e>-1&&n[a].splice(e,1),t instanceof hh&&i.delete(t.compartment)}if(o.set(t,r),Array.isArray(t))for(let e of t)s(e,r);else if(t instanceof hh){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=e.get(t.compartment)||t.inner;i.set(t.compartment,n),s(n,r)}else if(t instanceof lh)s(t.inner,t.prec);else if(t instanceof eh)n[r].push(t),t.provides&&s(t.provides,r);else if(t instanceof Uc)n[r].push(t),t.facet.extensions&&s(t.facet.extensions,oh);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(e,r)}}return s(t,oh),n.reduce((t,e)=>t.concat(e))}(t,e,s))i instanceof eh?n.push(i):(o[i.facet.id]||(o[i.facet.id]=[])).push(i);let r=Object.create(null),a=[],l=[];for(let t of n)r[t.id]=l.length<<1,l.push(e=>t.slot(e));let c=null==i?void 0:i.config.facets;for(let t in o){let e=o[t],n=e[0].facet,s=c&&c[t]||[];if(e.every(t=>0==t.type))if(r[n.id]=a.length<<1|1,Yc(s,e))a.push(i.facet(n));else{let t=n.combine(e.map(t=>t.value));a.push(i&&n.compare(t,i.facet(n))?i.facet(n):t)}else{for(let t of e)0==t.type?(r[t.id]=a.length<<1|1,a.push(t.value)):(r[t.id]=l.length<<1,l.push(e=>t.dynamicSlot(e)));r[n.id]=l.length<<1,l.push(t=>Jc(t,n,e))}}let h=l.map(t=>t(r));return new uh(t,s,h,r,a,o)}}function dh(t,e){if(1&e)return 2;let i=e>>1,n=t.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;t.status[i]=4;let o=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|o}function fh(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const ph=Vc.define(),mh=Vc.define({combine:t=>t.some(t=>t),static:!0}),gh=Vc.define({combine:t=>t.length?t[0]:void 0,static:!0}),vh=Vc.define(),yh=Vc.define(),Oh=Vc.define(),bh=Vc.define({combine:t=>!!t.length&&t[0]});class xh{constructor(t,e){this.type=t,this.value=e}static define(){return new wh}}class wh{of(t){return new xh(this,t)}}class _h{constructor(t){this.map=t}of(t){return new Sh(this,t)}}class Sh{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new Sh(this.type,e)}is(t){return this.type==t}static define(t={}){return new _h(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let t=n.map(e);t&&i.push(t)}return i}}Sh.reconfigure=Sh.define(),Sh.appendConfig=Sh.define();class kh{constructor(t,e,i,n,o,s){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,i&&qc(i,e.newLength),o.some(t=>t.type==kh.time)||(this.annotations=o.concat(kh.time.of(Date.now())))}static create(t,e,i,n,o,s){return new kh(t,e,i,n,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(kh.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function $h(t,e){let i=[];for(let n=0,o=0;;){let s,r;if(n<t.length&&(o==e.length||e[o]>=t[n]))s=t[n++],r=t[n++];else{if(!(o<e.length))return i;s=e[o++],r=e[o++]}!i.length||i[i.length-1]<s?i.push(s,r):i[i.length-1]<r&&(i[i.length-1]=r)}}function Th(t,e,i){var n;let o,s,r;return i?(o=e.changes,s=Lc.empty(e.changes.length),r=t.changes.compose(e.changes)):(o=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),r=t.changes.compose(o)),{changes:r,selection:e.selection?e.selection.map(s):null===(n=t.selection)||void 0===n?void 0:n.map(o),effects:Sh.mapEffects(t.effects,o).concat(Sh.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Ch(t,e,i){let n=e.selection,o=Ah(e.annotations);return e.userEvent&&(o=o.concat(kh.userEvent.of(e.userEvent))),{changes:e.changes instanceof Lc?e.changes:Lc.of(e.changes||[],i,t.facet(gh)),selection:n&&(n instanceof Xc?n:Xc.single(n.anchor,n.head)),effects:Ah(e.effects),annotations:o,scrollIntoView:!!e.scrollIntoView}}function Ph(t,e,i){let n=Ch(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(i=!1);for(let o=1;o<e.length;o++){!1===e[o].filter&&(i=!1);let s=!!e[o].sequential;n=Th(n,Ch(t,e[o],s?n.changes.newLength:t.doc.length),s)}let o=kh.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return function(t){let e=t.startState,i=e.facet(Oh),n=t;for(let o=i.length-1;o>=0;o--){let s=i[o](t);s&&Object.keys(s).length&&(n=Th(n,Ch(e,s,t.changes.newLength),!0))}return n==t?t:kh.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(t){let e=t.startState,i=!0;for(let n of e.facet(vh)){let e=n(t);if(!1===e){i=!1;break}Array.isArray(e)&&(i=!0===i?e:$h(i,e))}if(!0!==i){let n,o;if(!1===i)o=t.changes.invertedDesc,n=Lc.empty(e.doc.length);else{let e=t.changes.filter(i);n=e.changes,o=e.filtered.mapDesc(e.changes).invertedDesc}t=kh.create(e,n,t.selection&&t.selection.map(o),Sh.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let n=e.facet(yh);for(let i=n.length-1;i>=0;i--){let o=n[i](t);t=o instanceof kh?o:Array.isArray(o)&&1==o.length&&o[0]instanceof kh?o[0]:Ph(e,Ah(o),!1)}return t}(o):o)}kh.time=xh.define(),kh.userEvent=xh.define(),kh.addToHistory=xh.define(),kh.remote=xh.define();const Eh=[];function Ah(t){return null==t?Eh:Array.isArray(t)?t:[t]}var Mh=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Mh||(Mh={}));const Qh=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Dh;try{Dh=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}function Rh(t){return e=>{if(!/\S/.test(e))return Mh.Space;if(function(t){if(Dh)return Dh.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>"€"&&(i.toUpperCase()!=i.toLowerCase()||Qh.test(i)))return!0}return!1}(e))return Mh.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return Mh.Word;return Mh.Other}}class Ih{constructor(t,e,i,n,o,s){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)dh(this,t<<1);this.computeSlot=null}field(t,e=!0){let i=this.config.address[t.id];if(null!=i)return dh(this,i),fh(this,i);if(e)throw new RangeError("Field is not present in this state")}update(...t){return Ph(this,t,!0)}applyTransaction(t){let e,i=this.config,{base:n,compartments:o}=i;for(let e of t.effects)e.is(ch.reconfigure)?(i&&(o=new Map,i.compartments.forEach((t,e)=>o.set(e,t)),i=null),o.set(e.value.compartment,e.value.extension)):e.is(Sh.reconfigure)?(i=null,n=e.value):e.is(Sh.appendConfig)&&(i=null,n=Ah(n).concat(e.value));if(i)e=t.startState.values.slice();else{i=uh.resolve(n,o,this),e=new Ih(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(t,e)=>e.reconfigure(t,this),null).values}let s=t.startState.facet(mh)?t.newSelection:t.newSelection.asSingle();new Ih(i,t.newDoc,s,e,(e,i)=>i.update(e,t),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:Xc.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),o=[i.range],s=Ah(i.effects);for(let i=1;i<e.ranges.length;i++){let r=t(e.ranges[i]),a=this.changes(r.changes),l=a.map(n);for(let t=0;t<i;t++)o[t]=o[t].map(l);let c=n.mapDesc(a,!0);o.push(r.range.map(c)),n=n.compose(l),s=Sh.mapEffects(s,l).concat(Sh.mapEffects(Ah(r.effects),c))}return{changes:n,selection:Xc.create(o,e.mainIndex),effects:s}}changes(t=[]){return t instanceof Lc?t:Lc.of(t,this.doc.length,this.facet(Ih.lineSeparator))}toText(t){return bc.of(t.split(this.facet(Ih.lineSeparator)||Dc))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(dh(this,e),fh(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let n=t[i];n instanceof eh&&null!=this.config.address[n.id]&&(e[i]=n.spec.toJSON(this.field(t[i]),this))}return e}static fromJSON(t,e={},i){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i)for(let e in i)if(Object.prototype.hasOwnProperty.call(t,e)){let o=i[e],s=t[e];n.push(o.init(t=>o.spec.fromJSON(s,t)))}return Ih.create({doc:t.doc,selection:Xc.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=uh.resolve(t.extensions||[],new Map),i=t.doc instanceof bc?t.doc:bc.of((t.doc||"").split(e.staticFacet(Ih.lineSeparator)||Dc)),n=t.selection?t.selection instanceof Xc?t.selection:Xc.single(t.selection.anchor,t.selection.head):Xc.single(0);return qc(n,i.length),e.staticFacet(mh)||(n=n.asSingle()),new Ih(e,i,n,e.dynamicSlots.map(()=>null),(t,e)=>e.create(t),null)}get tabSize(){return this.facet(Ih.tabSize)}get lineBreak(){return this.facet(Ih.lineSeparator)||"\n"}get readOnly(){return this.facet(bh)}phrase(t,...e){for(let e of this.facet(Ih.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(t,i)=>{if("$"==i)return"$";let n=+(i||1);return!n||n>e.length?t:e[n-1]})),t}languageDataAt(t,e,i=-1){let n=[];for(let o of this.facet(ph))for(let s of o(this,e,i))Object.prototype.hasOwnProperty.call(s,t)&&n.push(s[t]);return n}charCategorizer(t){return Rh(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),o=this.charCategorizer(t),s=t-i,r=t-i;for(;s>0;){let t=Ec(e,s,!1);if(o(e.slice(t,s))!=Mh.Word)break;s=t}for(;r<n;){let t=Ec(e,r);if(o(e.slice(r,t))!=Mh.Word)break;r=t}return s==r?null:Xc.range(s+i,r+i)}}function Lh(t,e,i={}){let n={};for(let e of t)for(let t of Object.keys(e)){let o=e[t],s=n[t];if(void 0===s)n[t]=o;else if(s===o||void 0===o);else{if(!Object.hasOwnProperty.call(i,t))throw new Error("Config merge conflict for field "+t);n[t]=i[t](s,o)}}for(let t in e)void 0===n[t]&&(n[t]=e[t]);return n}Ih.allowMultipleSelections=mh,Ih.tabSize=Vc.define({combine:t=>t.length?t[0]:4}),Ih.lineSeparator=gh,Ih.readOnly=bh,Ih.phrases=Vc.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(i=>t[i]==e[i])}}),Ih.languageData=ph,Ih.changeFilter=vh,Ih.transactionFilter=yh,Ih.transactionExtender=Oh,ch.reconfigure=Sh.define();class Nh{eq(t){return this==t}range(t,e=t){return jh.create(t,e,this)}}Nh.prototype.startSide=Nh.prototype.endSide=0,Nh.prototype.point=!1,Nh.prototype.mapMode=Rc.TrackDel;class jh{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new jh(t,e,i)}}function zh(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Bh{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let o=i?this.to:this.from;for(let s=n,r=o.length;;){if(s==r)return s;let n=s+r>>1,a=o[n]-t||(i?this.value[n].endSide:this.value[n].startSide)-e;if(n==s)return a>=0?s:r;a>=0?r=n:s=n+1}}between(t,e,i,n){for(let o=this.findIndex(e,-1e9,!0),s=this.findIndex(i,1e9,!1,o);o<s;o++)if(!1===n(this.from[o]+t,this.to[o]+t,this.value[o]))return!1}map(t,e){let i=[],n=[],o=[],s=-1,r=-1;for(let a=0;a<this.value.length;a++){let l,c,h=this.value[a],u=this.from[a]+t,d=this.to[a]+t;if(u==d){let t=e.mapPos(u,h.startSide,h.mapMode);if(null==t)continue;if(l=c=t,h.startSide!=h.endSide&&(c=e.mapPos(u,h.endSide),c<l))continue}else if(l=e.mapPos(u,h.startSide),c=e.mapPos(d,h.endSide),l>c||l==c&&h.startSide>0&&h.endSide<=0)continue;(c-l||h.endSide-h.startSide)<0||(s<0&&(s=l),h.point&&(r=Math.max(r,c-l)),i.push(h),n.push(l-s),o.push(c-s))}return{mapped:i.length?new Bh(n,o,i,r):null,pos:s}}}class Zh{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new Zh(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:o=this.length}=t,s=t.filter;if(0==e.length&&!s)return this;if(i&&(e=e.slice().sort(zh)),this.isEmpty)return e.length?Zh.of(e):this;let r=new Xh(this,null,-1).goto(0),a=0,l=[],c=new Wh;for(;r.value||a<e.length;)if(a<e.length&&(r.from-e[a].from||r.startSide-e[a].value.startSide)>=0){let t=e[a++];c.addInner(t.from,t.to,t.value)||l.push(t)}else 1==r.rangeIndex&&r.chunkIndex<this.chunk.length&&(a==e.length||this.chunkEnd(r.chunkIndex)<e[a].from)&&(!s||n>this.chunkEnd(r.chunkIndex)||o<this.chunkPos[r.chunkIndex])&&c.addChunk(this.chunkPos[r.chunkIndex],this.chunk[r.chunkIndex])?r.nextChunk():((!s||n>r.to||o<r.from||s(r.from,r.to,r.value))&&(c.addInner(r.from,r.to,r.value)||l.push(jh.create(r.from,r.to,r.value))),r.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?Zh.empty:this.nextLayer.update({add:l,filter:s,filterFrom:n,filterTo:o}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],i=[],n=-1;for(let o=0;o<this.chunk.length;o++){let s=this.chunkPos[o],r=this.chunk[o],a=t.touchesRange(s,s+r.length);if(!1===a)n=Math.max(n,r.maxPoint),e.push(r),i.push(t.mapPos(s));else if(!0===a){let{mapped:o,pos:a}=r.map(s,t);o&&(n=Math.max(n,o.maxPoint),e.push(o),i.push(a))}}let o=this.nextLayer.map(t);return 0==e.length?o:new Zh(i,e,o||Zh.empty,n)}between(t,e,i){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let o=this.chunkPos[n],s=this.chunk[n];if(e>=o&&t<=o+s.length&&!1===s.between(o,t-o,e-o,i))return}this.nextLayer.between(t,e,i)}}iter(t=0){return qh.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return qh.from(t).goto(e)}static compare(t,e,i,n,o=-1){let s=t.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=o),r=e.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=o),a=Fh(s,r,i),l=new Vh(s,a,o),c=new Vh(r,a,o);i.iterGaps((t,e,i)=>Yh(l,t,c,e,i,n)),i.empty&&0==i.length&&Yh(l,0,c,0,0,n)}static eq(t,e,i=0,n){null==n&&(n=999999999);let o=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0),s=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let r=Fh(o,s),a=new Vh(o,r,0).goto(i),l=new Vh(s,r,0).goto(i);for(;;){if(a.to!=l.to||!Uh(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>n)return!0;a.next(),l.next()}}static spans(t,e,i,n,o=-1){let s=new Vh(t,null,o).goto(e),r=e,a=s.openStart;for(;;){let t=Math.min(s.to,i);if(s.point){let i=s.activeForPoint(s.to),o=s.pointFrom<e?i.length+1:s.point.startSide<0?i.length:Math.min(i.length,a);n.point(r,t,s.point,i,o,s.pointRank),a=Math.min(s.openEnd(t),i.length)}else t>r&&(n.span(r,t,s.active,a),a=s.openEnd(t));if(s.to>i)return a+(s.point&&s.to>i?1:0);r=s.to,s.next()}}static of(t,e=!1){let i=new Wh;for(let n of t instanceof jh?[t]:e?function(t){if(t.length>1)for(let e=t[0],i=1;i<t.length;i++){let n=t[i];if(zh(e,n)>0)return t.slice().sort(zh);e=n}return t}(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return Zh.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=Zh.empty;n=n.nextLayer)e=new Zh(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}Zh.empty=new Zh([],[],null,-1),Zh.empty.nextLayer=Zh.empty;class Wh{finishChunk(t){this.chunks.push(new Bh(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Wh)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(Zh.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=Zh.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Fh(t,e,i){let n=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&n.set(e.chunk[t],e.chunkPos[t]);let o=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let s=n.get(t.chunk[e]);null==s||(i?i.mapPos(s):s)!=t.chunkPos[e]||(null==i?void 0:i.touchesRange(s,s+t.chunk[e].length))||o.add(t.chunk[e])}return o}class Xh{constructor(t,e,i,n=0){this.layer=t,this.skip=e,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let n=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<n)&&this.setRangeIndex(n)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],i=t+e.from[this.rangeIndex];if(this.from=i,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class qh{constructor(t){this.heap=t}static from(t,e=null,i=-1){let n=[];for(let o=0;o<t.length;o++)for(let s=t[o];!s.isEmpty;s=s.nextLayer)s.maxPoint>=i&&n.push(new Xh(s,e,i,o));return 1==n.length?n[0]:new qh(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Hh(this.heap,t);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Hh(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Hh(this.heap,0)}}}function Hh(t,e){for(let i=t[e];;){let n=1+(e<<1);if(n>=t.length)break;let o=t[n];if(n+1<t.length&&o.compare(t[n+1])>=0&&(o=t[n+1],n++),i.compare(o)<0)break;t[n]=i,t[e]=o,e=n}}class Vh{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=qh.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Gh(this.active,t),Gh(this.activeTo,t),Gh(this.activeRank,t),this.minActive=Jh(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:o}=this.cursor;for(;e<this.activeRank.length&&(o-this.activeRank[e]||n-this.activeTo[e])>0;)e++;Kh(this.active,e,i),Kh(this.activeTo,e,n),Kh(this.activeRank,e,o),t&&Kh(t,e,this.cursor.from),this.minActive=Jh(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Gh(i,n)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(i),this.cursor.next()}}}if(i){this.openStart=0;for(let e=i.length-1;e>=0&&i[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function Yh(t,e,i,n,o,s){t.goto(e),i.goto(n);let r=n+o,a=n,l=n-e;for(;;){let e=t.to+l-i.to,n=e||t.endSide-i.endSide,o=n<0?t.to+l:i.to,c=Math.min(o,r);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&Uh(t.activeForPoint(t.to),i.activeForPoint(i.to))||s.comparePoint(a,c,t.point,i.point):c>a&&!Uh(t.active,i.active)&&s.compareRange(a,c,t.active,i.active),o>r)break;(e||t.openEnd!=i.openEnd)&&s.boundChange&&s.boundChange(o),a=o,n<=0&&t.next(),n>=0&&i.next()}}function Uh(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!=e[i]&&!t[i].eq(e[i]))return!1;return!0}function Gh(t,e){for(let i=e,n=t.length-1;i<n;i++)t[i]=t[i+1];t.pop()}function Kh(t,e,i){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=i}function Jh(t,e){let i=-1,n=1e9;for(let o=0;o<e.length;o++)(e[o]-n||t[o].endSide-t[i].endSide)<0&&(i=o,n=e[o]);return i}function tu(t,e,i=t.length){let n=0;for(let o=0;o<i&&o<t.length;)9==t.charCodeAt(o)?(n+=e-n%e,o++):(n++,o=Ec(t,o));return n}function eu(t,e,i,n){for(let n=0,o=0;;){if(o>=e)return n;if(n==t.length)break;o+=9==t.charCodeAt(n)?i-o%i:1,n=Ec(t,n)}return!0===n?-1:t.length}const iu="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),nu="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),ou="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class su{constructor(t,e){this.rules=[];let{finish:i}=e||{};function n(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function o(t,e,s,r){let a=[],l=/^@(\w+)\b/.exec(t[0]),c=l&&"keyframes"==l[1];if(l&&null==e)return s.push(t[0]+";");for(let i in e){let r=e[i];if(/&/.test(i))o(i.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((t,e)=>t.concat(e)),r,s);else if(r&&"object"==typeof r){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");o(n(i),r,a,c)}else null!=r&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+r+";")}(a.length||c)&&s.push((!i||l||r?t:t.map(i)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)o(n(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=ou[iu]||1;return ou[iu]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let n=t[nu],o=i&&i.nonce;n?o&&n.setNonce(o):n=new au(t,o),n.mount(Array.isArray(e)?e:[e],t)}}let ru=new Map;class au{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let e=ru.get(i);if(e)return t[nu]=e;this.sheet=new n.CSSStyleSheet,ru.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[nu]=this}mount(t,e){let i=this.sheet,n=0,o=0;for(let e=0;e<t.length;e++){let s=t[e],r=this.modules.indexOf(s);if(r<o&&r>-1&&(this.modules.splice(r,1),o--,r=-1),-1==r){if(this.modules.splice(o++,0,s),i)for(let t=0;t<s.rules.length;t++)i.insertRule(s.rules[t],n++)}else{for(;o<r;)n+=this.modules[o++].rules.length;n+=s.rules.length,o++}}if(i)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets]);else{let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t;let i=e.head||e;this.styleTag.parentNode!=i&&i.insertBefore(this.styleTag,i.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}for(var lu={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:"'"},cu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},hu="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),uu="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),du=0;du<10;du++)lu[48+du]=lu[96+du]=String(du);for(du=1;du<=24;du++)lu[du+111]="F"+du;for(du=65;du<=90;du++)lu[du]=String.fromCharCode(du+32),cu[du]=String.fromCharCode(du);for(var fu in lu)cu.hasOwnProperty(fu)||(cu[fu]=lu[fu]);let pu="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},mu="undefined"!=typeof document?document:{documentElement:{style:{}}};const gu=/Edge\/(\d+)/.exec(pu.userAgent),vu=/MSIE \d/.test(pu.userAgent),yu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pu.userAgent),Ou=!!(vu||yu||gu),bu=!Ou&&/gecko\/(\d+)/i.test(pu.userAgent),xu=!Ou&&/Chrome\/(\d+)/.exec(pu.userAgent),wu="webkitFontSmoothing"in mu.documentElement.style,_u=!Ou&&/Apple Computer/.test(pu.vendor),Su=_u&&(/Mobile\/\w+/.test(pu.userAgent)||pu.maxTouchPoints>2);var ku={mac:Su||/Mac/.test(pu.platform),windows:/Win/.test(pu.platform),linux:/Linux|X11/.test(pu.platform),ie:Ou,ie_version:vu?mu.documentMode||6:yu?+yu[1]:gu?+gu[1]:0,gecko:bu,gecko_version:bu?+(/Firefox\/(\d+)/.exec(pu.userAgent)||[0,0])[1]:0,chrome:!!xu,chrome_version:xu?+xu[1]:0,ios:Su,android:/Android\b/.test(pu.userAgent),webkit:wu,webkit_version:wu?+(/\bAppleWebKit\/(\d+)/.exec(pu.userAgent)||[0,0])[1]:0,safari:_u,safari_version:_u?+(/\bVersion\/(\d+(\.\d+)?)/.exec(pu.userAgent)||[0,0])[1]:0,tabSize:null!=mu.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function $u(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function Tu(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function Cu(t,e){if(!e.anchorNode)return!1;try{return Tu(t,e.anchorNode)}catch(t){return!1}}function Pu(t){return 3==t.nodeType?Zu(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function Eu(t,e,i,n){return!!i&&(Qu(t,e,i,n,-1)||Qu(t,e,i,n,1))}function Au(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function Mu(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Qu(t,e,i,n,o){for(;;){if(t==i&&e==n)return!0;if(e==(o<0?0:Du(t))){if("DIV"==t.nodeName)return!1;let i=t.parentNode;if(!i||1!=i.nodeType)return!1;e=Au(t)+(o<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(o<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=o<0?Du(t):0}}}function Du(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ru(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function Iu(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Lu(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}class Nu{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?Du(e):0),i,Math.min(t.focusOffset,i?Du(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let ju,zu=null;function Bu(t){if(t.setActive)return t.setActive();if(zu)return t.focus(zu);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==zu?{get preventScroll(){return zu={preventScroll:!0},!0}}:void 0),!zu){zu=!1;for(let t=0;t<e.length;){let i=e[t++],n=e[t++],o=e[t++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=o&&(i.scrollLeft=o)}}}function Zu(t,e,i=e){let n=ju||(ju=document.createRange());return n.setEnd(t,i),n.setStart(t,e),n}function Wu(t,e,i,n){let o={key:e,code:e,keyCode:i,which:i,cancelable:!0};n&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=n);let s=new KeyboardEvent("keydown",o);s.synthetic=!0,t.dispatchEvent(s);let r=new KeyboardEvent("keyup",o);return r.synthetic=!0,t.dispatchEvent(r),s.defaultPrevented||r.defaultPrevented}function Fu(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function Xu(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function qu(t,e){for(let i=t,n=e;;){if(3==i.nodeType&&n>0)return{node:i,offset:n};if(1==i.nodeType&&n>0){if("false"==i.contentEditable)return null;i=i.childNodes[n-1],n=Du(i)}else{if(!i.parentNode||Mu(i))return null;n=Au(i),i=i.parentNode}}}function Hu(t,e){for(let i=t,n=e;;){if(3==i.nodeType&&n<i.nodeValue.length)return{node:i,offset:n};if(1==i.nodeType&&n<i.childNodes.length){if("false"==i.contentEditable)return null;i=i.childNodes[n],n=0}else{if(!i.parentNode||Mu(i))return null;n=Au(i)+1,i=i.parentNode}}}ku.safari&&ku.safari_version>=26&&(zu=!1);class Vu{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new Vu(t.parentNode,Au(t),e)}static after(t,e){return new Vu(t.parentNode,Au(t)+1,e)}}const Yu=[];class Uu{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(t){let e=this.posAtStart;for(let i of this.children){if(i==t)return e;e+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(2&this.flags){let i,n=this.dom,o=null;for(let s of this.children){if(7&s.flags){if(!s.dom&&(i=o?o.nextSibling:n.firstChild)){let t=Uu.get(i);(!t||!t.parent&&t.canReuseDOM(s))&&s.reuseDOM(i)}s.sync(t,e),s.flags&=-8}if(i=o?o.nextSibling:n.firstChild,e&&!e.written&&e.node==n&&i!=s.dom&&(e.written=!0),s.dom.parentNode==n)for(;i&&i!=s.dom;)i=Gu(i);else n.insertBefore(s.dom,i);o=s.dom}for(i=o?o.nextSibling:n.firstChild,i&&e&&e.node==n&&(e.written=!0);i;)i=Gu(i)}else if(1&this.flags)for(let i of this.children)7&i.flags&&(i.sync(t,e),i.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let i;if(t==this.dom)i=this.dom.childNodes[e];else{let n=0==Du(t)?0:0==e?-1:1;for(;;){let e=t.parentNode;if(e==this.dom)break;0==n&&e.firstChild!=e.lastChild&&(n=t==e.firstChild?-1:1),t=e}i=n<0?t:t.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Uu.get(i);)i=i.nextSibling;if(!i)return this.length;for(let t=0,e=0;;t++){let n=this.children[t];if(n.dom==i)return e;e+=n.length+n.breakAfter}}domBoundsAround(t,e,i=0){let n=-1,o=-1,s=-1,r=-1;for(let a=0,l=i,c=i;a<this.children.length;a++){let i=this.children[a],h=l+i.length;if(l<t&&h>e)return i.domBoundsAround(t,e,l);if(h>=t&&-1==n&&(n=a,o=l),l>e&&i.dom.parentNode==this.dom){s=a,r=c;break}c=h,l=h+i.breakAfter}return{from:o,to:r<0?i+this.length:r,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(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),1&e.flags)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=Yu){this.markDirty();for(let n=t;n<e;n++){let t=this.children[n];t.parent==this&&i.indexOf(t)<0&&t.destroy()}i.length<250?this.children.splice(t,e-t,...i):this.children=[].concat(this.children.slice(0,t),i,this.children.slice(e));for(let t=0;t<i.length;t++)i[t].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new Ku(this.children,t,this.children.length)}childPos(t,e=1){return this.childCursor().findPos(t,e)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,e,i,n,o,s){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!(8&(this.flags|t.flags))}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}}function Gu(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}Uu.prototype.breakAfter=0;class Ku{constructor(t,e,i){this.children=t,this.pos=e,this.i=i,this.off=0}findPos(t,e=1){for(;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ju(t,e,i,n,o,s,r,a,l){let{children:c}=t,h=c.length?c[e]:null,u=s.length?s[s.length-1]:null,d=u?u.breakAfter:r;if(!(e==n&&h&&!r&&!d&&s.length<2&&h.merge(i,o,s.length?u:null,0==i,a,l))){if(n<c.length){let t=c[n];t&&(o<t.length||t.breakAfter&&(null==u?void 0:u.breakAfter))?(e==n&&(t=t.split(o),o=0),!d&&u&&t.merge(0,o,u,!0,0,l)?s[s.length-1]=t:((o||t.children.length&&!t.children[0].length)&&t.merge(0,o,null,!1,0,l),s.push(t))):(null==t?void 0:t.breakAfter)&&(u?u.breakAfter=1:r=1),n++}for(h&&(h.breakAfter=r,i>0&&(!r&&s.length&&h.merge(i,h.length,s[0],!1,a,0)?h.breakAfter=s.shift().breakAfter:(i<h.length||h.children.length&&0==h.children[h.children.length-1].length)&&h.merge(i,h.length,null,!1,a,0),e++));e<n&&s.length;)if(c[n-1].become(s[s.length-1]))n--,s.pop(),l=s.length?0:a;else{if(!c[e].become(s[0]))break;e++,s.shift(),a=s.length?0:l}!s.length&&e&&n<c.length&&!c[e-1].breakAfter&&c[n].merge(0,0,c[e-1],!1,a,l)&&e--,(e<n||s.length)&&t.replaceChildren(e,n,s)}}function td(t,e,i,n,o,s){let r=t.childCursor(),{i:a,off:l}=r.findPos(i,1),{i:c,off:h}=r.findPos(e,-1),u=e-i;for(let t of n)u+=t.length;t.length+=u,Ju(t,c,h,a,l,n,0,o,s)}class ed extends Uu{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,i){return!(8&this.flags||i&&(!(i instanceof ed)||this.length-(e-t)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new ed(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new Vu(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return function(t,e,i){let n=t.nodeValue.length;e>n&&(e=n);let o=e,s=e,r=0;0==e&&i<0||e==n&&i>=0?ku.chrome||ku.gecko||(e?(o--,r=1):s<n&&(s++,r=-1)):i<0?o--:s<n&&s++;let a=Zu(t,o,s).getClientRects();if(!a.length)return null;let l=a[(r?r<0:i>=0)?0:a.length-1];ku.safari&&!r&&0==l.width&&(l=Array.prototype.find.call(a,t=>t.width)||l);return r?Ru(l,r<0):l||null}(this.dom,t,e)}}class id extends Uu{constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let t of e)t.setParent(this)}setAttrs(t){if(Fu(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!(8&(this.flags|t.flags))}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,o,s){return(!i||!(!(i instanceof id&&i.mark.eq(this.mark))||t&&o<=0||e<this.length&&s<=0))&&(td(this,t,e,i?i.children.slice():[],o-1,s-1),this.markDirty(),!0)}split(t){let e=[],i=0,n=-1,o=0;for(let s of this.children){let r=i+s.length;r>t&&e.push(i<t?s.split(t-i):s),n<0&&i>=t&&(n=o),i=r,o++}let s=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new id(this.mark,e,s)}domAtPos(t){return sd(this,t)}coordsAt(t,e){return ad(this,t,e)}}class nd extends Uu{static create(t,e,i){return new nd(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=nd.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,o,s){return!(i&&(!(i instanceof nd&&this.widget.compare(i.widget))||t>0&&o<=0||e<this.length&&s<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0)}become(t){return t instanceof nd&&t.side==this.side&&this.widget.constructor==t.widget.constructor&&(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0)}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(0==this.length)return bc.empty;let t=this;for(;t.parent;)t=t.parent;let{view:e}=t,i=e&&e.state.doc,n=this.posAtStart;return i?i.slice(n,n+this.length):bc.empty}domAtPos(t){return(this.length?0==t:this.side>0)?Vu.before(this.dom):Vu.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),o=null;if(!n.length)return null;let s=this.side?this.side<0:t>0;for(let e=s?n.length-1:0;o=n[e],!(t>0?0==e:e==n.length-1||o.top<o.bottom);e+=s?-1:1);return Ru(o,!s)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class od extends Uu{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof od&&t.side==this.side}split(){return new od(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?Vu.before(this.dom):Vu.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return bc.empty}get isHidden(){return!0}}function sd(t,e){let i=t.dom,{children:n}=t,o=0;for(let t=0;o<n.length;o++){let s=n[o],r=t+s.length;if(!(r==t&&s.getSide()<=0)){if(e>t&&e<r&&s.dom.parentNode==i)return s.domAtPos(e-t);if(e<=t)break;t=r}}for(let t=o;t>0;t--){let e=n[t-1];if(e.dom.parentNode==i)return e.domAtPos(e.length)}for(let t=o;t<n.length;t++){let e=n[t];if(e.dom.parentNode==i)return e.domAtPos(0)}return new Vu(i,0)}function rd(t,e,i){let n,{children:o}=t;i>0&&e instanceof id&&o.length&&(n=o[o.length-1])instanceof id&&n.mark.eq(e.mark)?rd(n,e.children[0],i-1):(o.push(e),e.setParent(t)),t.length+=e.length}function ad(t,e,i){let n=null,o=-1,s=null,r=-1;!function t(e,a){for(let l=0,c=0;l<e.children.length&&c<=a;l++){let h=e.children[l],u=c+h.length;u>=a&&(h.children.length?t(h,a-c):(!s||s.isHidden&&(i>0||ld(s,h)))&&(u>a||c==u&&h.getSide()>0)?(s=h,r=a-c):(c<a||c==u&&h.getSide()<0&&!h.isHidden)&&(n=h,o=a-c)),c=u}}(t,e);let a=(i<0?n:s)||n||s;return a?a.coordsAt(Math.max(0,a==n?o:r),i):function(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=Pu(e);return i[i.length-1]||null}(t)}function ld(t,e){let i=t.coordsAt(0,1),n=e.coordsAt(0,1);return i&&n&&n.top<i.bottom}function cd(t,e){for(let i in t)"class"==i&&e.class?e.class+=" "+t.class:"style"==i&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}ed.prototype.children=nd.prototype.children=od.prototype.children=Yu;const hd=Object.create(null);function ud(t,e,i){if(t==e)return!0;t||(t=hd),e||(e=hd);let n=Object.keys(t),o=Object.keys(e);if(n.length-(i&&n.indexOf(i)>-1?1:0)!=o.length-(i&&o.indexOf(i)>-1?1:0))return!1;for(let s of n)if(s!=i&&(-1==o.indexOf(s)||t[s]!==e[s]))return!1;return!0}function dd(t,e,i){let n=!1;if(e)for(let o in e)i&&o in i||(n=!0,"style"==o?t.style.cssText="":t.removeAttribute(o));if(i)for(let o in i)e&&e[o]==i[o]||(n=!0,"style"==o?t.style.cssText=i[o]:t.setAttribute(o,i[o]));return n}function fd(t){let e=Object.create(null);for(let i=0;i<t.attributes.length;i++){let n=t.attributes[i];e[n.name]=n.value}return e}class pd{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var md=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(md||(md={}));class gd extends Nh{constructor(t,e,i,n){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(t){return new vd(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new Od(t,e,e,i,t.widget||null,!1)}static replace(t){let e,i,n=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{let{start:o,end:s}=bd(t,n);e=(o?n?-3e8:-1:5e8)-1,i=1+(s?n?2e8:1:-6e8)}return new Od(t,e,i,n,t.widget||null,!0)}static line(t){return new yd(t)}static set(t,e=!1){return Zh.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}gd.none=Zh.empty;class vd extends gd{constructor(t){let{start:e,end:i}=bd(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof vd&&this.tagName==t.tagName&&(this.class||(null===(e=this.attrs)||void 0===e?void 0:e.class))==(t.class||(null===(i=t.attrs)||void 0===i?void 0:i.class))&&ud(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}vd.prototype.point=!1;class yd extends gd{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof yd&&this.spec.class==t.spec.class&&ud(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}yd.prototype.mapMode=Rc.TrackBefore,yd.prototype.point=!0;class Od extends gd{constructor(t,e,i,n,o,s){super(e,i,o,t),this.block=n,this.isReplace=s,this.mapMode=n?e<=0?Rc.TrackBefore:Rc.TrackAfter:Rc.TrackDel}get type(){return this.startSide!=this.endSide?md.WidgetRange:this.startSide<=0?md.WidgetBefore:md.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Od&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function bd(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return null==i&&(i=t.inclusive),null==n&&(n=t.inclusive),{start:null!=i?i:e,end:null!=n?n:e}}function xd(t,e,i,n=0){let o=i.length-1;o>=0&&i[o]+n>=t?i[o]=Math.max(i[o],e):i.push(t,e)}Od.prototype.point=!0;class wd extends Uu{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,o,s){if(i){if(!(i instanceof wd))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),td(this,t,e,i?i.children.slice():[],o,s),!0}split(t){let e=new wd;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let t=i;t<this.children.length;t++)e.append(this.children[t],0);for(;i>0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){ud(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){rd(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=cd(e,this.attrs||{})),i&&(this.attrs=cd({class:i},this.attrs||{}))}domAtPos(t){return sd(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?4&this.flags&&(Fu(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(dd(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&Uu.get(n)instanceof id;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(i=Uu.get(n))||void 0===i?void 0:i.isEditable)||ku.ios&&this.children.some(t=>t instanceof ed)))){let t=document.createElement("BR");t.cmIgnore=!0,this.dom.appendChild(t)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t,e=0;for(let i of this.children){if(!(i instanceof ed)||/[^ -~]/.test(i.text))return null;let n=Pu(i.dom);if(1!=n.length)return null;e+=n[0].width,t=n[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(t,e){let i=ad(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=i.bottom-i.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight<e){let n=(e-t.textHeight)/2;return{top:i.top+n,bottom:i.bottom-n,left:i.left,right:i.left}}}return i}become(t){return t instanceof wd&&0==this.children.length&&0==t.children.length&&ud(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter}covers(){return!0}static find(t,e){for(let i=0,n=0;i<t.children.length;i++){let o=t.children[i],s=n+o.length;if(s>=e){if(o instanceof wd)return o;if(s>e)break}n=s+o.breakAfter}return null}}class _d extends Uu{constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,o,s){return!(i&&(!(i instanceof _d&&this.widget.compare(i.widget))||t>0&&o<=0||e<this.length&&s<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0)}domAtPos(t){return 0==t?Vu.before(this.dom):Vu.after(this.dom,t==this.length)}split(t){let e=this.length-t;this.length=t;let i=new _d(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return Yu}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):bc.empty}domBoundsAround(){return null}become(t){return t instanceof _d&&t.widget.constructor==this.widget.constructor&&(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);return i||(this.widget instanceof Sd?null:Ru(this.dom.getBoundingClientRect(),this.length?0==t:e<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:e,endSide:i}=this.deco;return e!=i&&(t<0?e<0:i>0)}}class Sd extends pd{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class kd{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof _d&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new wd),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($d(new od(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof _d||this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:e,lineBreak:i,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw new Error("Ran out of text content when drawing inline views");if(i){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}this.text=e,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t),o=Math.min(n,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append($d(new ed(this.text.slice(this.textOff,this.textOff+o)),e),i),this.atCursorPos=!0,this.textOff+=o,t-=o,i=n<=o?0:e.length}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,o,s){if(this.disallowBlockEffectsFor[s]&&i instanceof Od){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let r=e-t;if(i instanceof Od)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new _d(i.widget||Td.block,r,i));else{let s=nd.create(i.widget||Td.inline,r,r?0:i.startSide),a=this.atCursorPos&&!s.isEditable&&o<=n.length&&(t<e||i.startSide>0),l=!s.isEditable&&(t<e||o>n.length||i.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||s.isEditable||(this.pendingBuffer=0),this.flushBuffer(n),a&&(c.append($d(new od(1),n),o),o=n.length+Math.max(0,o-n.length)),c.append($d(s,n),o),this.atCursorPos=l,this.pendingBuffer=l?t<e||o>n.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);r&&(this.textOff+r<=this.text.length?this.textOff+=r:(this.skip+=r-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=o)}static build(t,e,i,n,o){let s=new kd(t,e,i,o);return s.openEnd=Zh.spans(n,e,i,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function $d(t,e){for(let i of e)t=new id(i,[t],t.length);return t}class Td extends pd{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Td.inline=new Td("span"),Td.block=new Td("div");var Cd=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(Cd||(Cd={}));const Pd=Cd.LTR,Ed=Cd.RTL;function Ad(t){let e=[];for(let i=0;i<t.length;i++)e.push(1<<+t[i]);return e}const Md=Ad("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Qd=Ad("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Dd=Object.create(null),Rd=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),i=t.charCodeAt(1);Dd[e]=i,Dd[i]=-e}function Id(t){return t<=247?Md[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Qd[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Ld=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Nd{get dir(){return this.level%2?Ed:Pd}constructor(t,e,i){this.from=t,this.to=e,this.level=i}side(t,e){return this.dir==e==t?this.to:this.from}forward(t,e){return t==(this.dir==e)}static find(t,e,i,n){let o=-1;for(let s=0;s<t.length;s++){let r=t[s];if(r.from<=e&&r.to>=e){if(r.level==i)return s;(o<0||(0!=n?n<0?r.from<e:r.to>e:t[o].level>r.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function jd(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],o=e[i];if(n.from!=o.from||n.to!=o.to||n.direction!=o.direction||!jd(n.inner,o.inner))return!1}return!0}const zd=[];function Bd(t,e,i,n,o,s,r){let a=n%2?2:1;if(n%2==o%2)for(let l=e,c=0;l<i;){let e=!0,h=!1;if(c==s.length||l<s[c].from){let t=zd[l];t!=a&&(e=!1,h=16==t)}let u=e||1!=a?null:[],d=e?n:n+1,f=l;t:for(;;)if(c<s.length&&f==s[c].from){if(h)break t;let p=s[c];if(!e)for(let t=p.to,e=c+1;;){if(t==i)break t;if(!(e<s.length&&s[e].from==t)){if(zd[t]==a)break t;break}t=s[e++].to}if(c++,u)u.push(p);else{p.from>l&&r.push(new Nd(l,p.from,d)),Zd(t,p.direction==Pd!=!(d%2)?n+1:n,o,p.inner,p.from,p.to,r),l=p.to}f=p.to}else{if(f==i||(e?zd[f]!=a:zd[f]==a))break;f++}u?Bd(t,l,f,n+1,o,u,r):l<f&&r.push(new Nd(l,f,d)),l=f}else for(let l=i,c=s.length;l>e;){let i=!0,h=!1;if(!c||l>s[c-1].to){let t=zd[l-1];t!=a&&(i=!1,h=16==t)}let u=i||1!=a?null:[],d=i?n:n+1,f=l;t:for(;;)if(c&&f==s[c-1].to){if(h)break t;let p=s[--c];if(!i)for(let t=p.from,i=c;;){if(t==e)break t;if(!i||s[i-1].to!=t){if(zd[t-1]==a)break t;break}t=s[--i].from}if(u)u.push(p);else{p.to<l&&r.push(new Nd(p.to,l,d)),Zd(t,p.direction==Pd!=!(d%2)?n+1:n,o,p.inner,p.from,p.to,r),l=p.from}f=p.from}else{if(f==e||(i?zd[f-1]!=a:zd[f-1]==a))break;f--}u?Bd(t,f,l,n+1,o,u,r):f<l&&r.push(new Nd(f,l,d)),l=f}}function Zd(t,e,i,n,o,s,r){let a=e%2?2:1;!function(t,e,i,n,o){for(let s=0;s<=n.length;s++){let r=s?n[s-1].to:e,a=s<n.length?n[s].from:i,l=s?256:o;for(let e=r,i=l,n=l;e<a;e++){let o=Id(t.charCodeAt(e));512==o?o=i:8==o&&4==n&&(o=16),zd[e]=4==o?2:o,7&o&&(n=o),i=o}for(let t=r,e=l,n=l;t<a;t++){let o=zd[t];if(128==o)t<a-1&&e==zd[t+1]&&24&e?o=zd[t]=e:zd[t]=256;else if(64==o){let o=t+1;for(;o<a&&64==zd[o];)o++;let s=t&&8==e||o<i&&8==zd[o]?1==n?1:8:256;for(let e=t;e<o;e++)zd[e]=s;t=o-1}else 8==o&&1==n&&(zd[t]=1);e=o,7&o&&(n=o)}}}(t,o,s,n,a),function(t,e,i,n,o){let s=1==o?2:1;for(let r=0,a=0,l=0;r<=n.length;r++){let c=r?n[r-1].to:e,h=r<n.length?n[r].from:i;for(let e,i,n,r=c;r<h;r++)if(i=Dd[e=t.charCodeAt(r)])if(i<0){for(let t=a-3;t>=0;t-=3)if(Rd[t+1]==-i){let e=Rd[t+2],i=2&e?o:4&e?1&e?s:o:0;i&&(zd[r]=zd[Rd[t]]=i),a=t;break}}else{if(189==Rd.length)break;Rd[a++]=r,Rd[a++]=e,Rd[a++]=l}else if(2==(n=zd[r])||1==n){let t=n==o;l=t?0:1;for(let e=a-3;e>=0;e-=3){let i=Rd[e+2];if(2&i)break;if(t)Rd[e+2]|=2;else{if(4&i)break;Rd[e+2]|=4}}}}}(t,o,s,n,a),function(t,e,i,n){for(let o=0,s=n;o<=i.length;o++){let r=o?i[o-1].to:t,a=o<i.length?i[o].from:e;for(let l=r;l<a;){let r=zd[l];if(256==r){let r=l+1;for(;;)if(r==a){if(o==i.length)break;r=i[o++].to,a=o<i.length?i[o].from:e}else{if(256!=zd[r])break;r++}let c=1==s,h=c==(1==(r<e?zd[r]:n))?c?1:2:n;for(let e=r,n=o,s=n?i[n-1].to:t;e>l;)e==s&&(e=i[--n].from,s=n?i[n-1].to:t),zd[--e]=h;l=r}else s=r,l++}}}(o,s,n,a),Bd(t,o,s,e,i,n,r)}function Wd(t,e,i){if(!t)return[new Nd(0,0,e==Ed?1:0)];if(e==Pd&&!i.length&&!Ld.test(t))return Fd(t.length);if(i.length)for(;t.length>zd.length;)zd[zd.length]=256;let n=[],o=e==Pd?0:1;return Zd(t,o,o,i,0,t.length,n),n}function Fd(t){return[new Nd(0,t,0)]}let Xd="";function qd(t,e,i,n,o){var s;let r=n.head-t.from,a=Nd.find(e,r,null!==(s=n.bidiLevel)&&void 0!==s?s:-1,n.assoc),l=e[a],c=l.side(o,i);if(r==c){let t=a+=o?1:-1;if(t<0||t>=e.length)return null;l=e[a=t],r=l.side(!o,i),c=l.side(o,i)}let h=Ec(t.text,r,l.forward(o,i));(h<l.from||h>l.to)&&(h=c),Xd=t.text.slice(Math.min(r,h),Math.max(r,h));let u=a==(o?e.length-1:0)?null:e[a+(o?1:-1)];return u&&h==c&&u.level+(o?0:1)<l.level?Xc.cursor(u.side(!o,i)+t.from,u.forward(o,i)?1:-1,u.level):Xc.cursor(h+t.from,l.forward(o,i)?-1:1,l.level)}function Hd(t,e,i){for(let n=e;n<i;n++){let e=Id(t.charCodeAt(n));if(1==e)return Pd;if(2==e||4==e)return Ed}return Pd}const Vd=Vc.define(),Yd=Vc.define(),Ud=Vc.define(),Gd=Vc.define(),Kd=Vc.define(),Jd=Vc.define(),tf=Vc.define(),ef=Vc.define(),nf=Vc.define(),of=Vc.define({combine:t=>t.some(t=>t)}),sf=Vc.define({combine:t=>t.some(t=>t)}),rf=Vc.define();class af{constructor(t,e="nearest",i="nearest",n=5,o=5,s=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=o,this.isSnapshot=s}map(t){return t.empty?this:new af(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new af(Xc.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const lf=Sh.define({map:(t,e)=>t.map(e)}),cf=Sh.define();function hf(t,e,i){let n=t.facet(Gd);n.length?n[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const uf=Vc.define({combine:t=>!t.length||t[0]});let df=0;const ff=Vc.define({combine:t=>t.filter((e,i)=>{for(let n=0;n<i;n++)if(t[n].plugin==e.plugin)return!1;return!0})});class pf{constructor(t,e,i,n,o){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(ff.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(ff.of({plugin:this,arg:t}))}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:o,decorations:s}=e||{};return new pf(df++,t,i,n,t=>{let e=[];return s&&e.push(yf.of(e=>{let i=e.plugin(t);return i?s(i):gd.none})),o&&e.push(o(t)),e})}static fromClass(t,e){return pf.define((e,i)=>new t(e,i),e)}}class mf{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(hf(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(e){hf(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){hf(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const gf=Vc.define(),vf=Vc.define(),yf=Vc.define(),Of=Vc.define(),bf=Vc.define(),xf=Vc.define();function wf(t,e){let i=t.state.facet(xf);if(!i.length)return i;let n=i.map(e=>e instanceof Function?e(t):e),o=[];return Zh.spans(n,e.from,e.to,{point(){},span(t,i,n,s){let r=t-e.from,a=i-e.from,l=o;for(let t=n.length-1;t>=0;t--,s--){let i,o=n[t].spec.bidiIsolate;if(null==o&&(o=Hd(e.text,r,a)),s>0&&l.length&&(i=l[l.length-1]).to==r&&i.direction==o)i.to=a,l=i.inner;else{let t={from:r,to:a,direction:o,inner:[]};l.push(t),l=t.inner}}}}),o}const _f=Vc.define();function Sf(t){let e=0,i=0,n=0,o=0;for(let s of t.state.facet(_f)){let r=s(t);r&&(null!=r.left&&(e=Math.max(e,r.left)),null!=r.right&&(i=Math.max(i,r.right)),null!=r.top&&(n=Math.max(n,r.top)),null!=r.bottom&&(o=Math.max(o,r.bottom)))}return{left:e,right:i,top:n,bottom:o}}const kf=Vc.define();class $f{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new $f(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toA<i.fromA)break;i=i.join(n),t.splice(e-1,1)}}return t.splice(e,0,i),t}static extendWithRanges(t,e){if(0==e.length)return t;let i=[];for(let n=0,o=0,s=0,r=0;;n++){let a=n==t.length?null:t[n],l=s-r,c=a?a.fromB:1e9;for(;o<e.length&&e[o]<c;){let t=e[o],n=e[o+1],s=Math.max(r,t),a=Math.min(c,n);if(s<=a&&new $f(s+l,a+l,s,a).addToSet(i),n>c)break;o+=2}if(!a)return i;new $f(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),s=a.toA,r=a.toB}}}class Tf{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=Lc.empty(this.startState.doc.length);for(let t of i)this.changes=this.changes.compose(t.changes);let n=[];this.changes.iterChangedRanges((t,e,i,o)=>n.push(new $f(t,e,i,o))),this.changedRanges=n}static create(t,e,i){return new Tf(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}class Cf extends Uu{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=gd.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new wd],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new $f(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:t,toA:e})=>e<this.minWidthFrom||t>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?n=this.domChanged.newSel.head:function(t,e){let i=!1;e&&t.iterChangedRanges((t,n)=>{t<e.to&&n>e.from&&(i=!0)});return i}(t.changes,this.hasComposition)||t.selectionSet||(n=t.state.selection.main.head));let o=n>-1?function(t,e,i){let n=Pf(t,i);if(!n)return null;let{node:o,from:s,to:r}=n,a=o.nodeValue;if(/[\n\r]/.test(a))return null;if(t.state.doc.sliceString(n.from,n.to)!=a)return null;let l=e.invertedDesc,c=new $f(l.mapPos(s),l.mapPos(r),s,r),h=[];for(let e=o.parentNode;;e=e.parentNode){let i=Uu.get(e);if(i instanceof id)h.push({node:e,deco:i.mark});else{if(i instanceof wd||"DIV"==e.nodeName&&e.parentNode==t.contentDOM)return{range:c,text:o,marks:h,line:e};if(e==t.contentDOM)return null;h.push({node:e,deco:new vd({inclusive:!0,attributes:fd(e),tagName:e.tagName.toLowerCase()})})}}}(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:e,to:n}=this.hasComposition;i=new $f(e,n,t.changes.mapPos(e,-1),t.changes.mapPos(n,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(ku.ie||ku.chrome)&&!o&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let s=function(t,e,i){let n=new Ef;return Zh.compare(t,e,i,n),n.changes}(this.decorations,this.updateDeco(),t.changes);return i=$f.extendWithRanges(i,s),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,t.startState.doc.length,o),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=ku.chrome||ku.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,t),this.flags&=-8,t&&(t.written||n.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(t=>t.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let t of this.children)t instanceof _d&&t.widget instanceof Sd&&o.push(t.dom);n.updateGaps(o)}updateChildren(t,e,i){let n=i?i.range.addToSet(t.slice()):t,o=this.childCursor(e);for(let t=n.length-1;;t--){let e=t>=0?n[t]:null;if(!e)break;let s,r,a,l,{fromA:c,toA:h,fromB:u,toB:d}=e;if(i&&i.range.fromB<d&&i.range.toB>u){let t=kd.build(this.view.state.doc,u,i.range.fromB,this.decorations,this.dynamicDecorationMap),e=kd.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);r=t.breakAtStart,a=t.openStart,l=e.openEnd;let n=this.compositionView(i);e.breakAtStart?n.breakAfter=1:e.content.length&&n.merge(n.length,n.length,e.content[0],!1,e.openStart,0)&&(n.breakAfter=e.content[0].breakAfter,e.content.shift()),t.content.length&&n.merge(0,0,t.content[t.content.length-1],!0,0,t.openEnd)&&t.content.pop(),s=t.content.concat(n).concat(e.content)}else({content:s,breakAtStart:r,openStart:a,openEnd:l}=kd.build(this.view.state.doc,u,d,this.decorations,this.dynamicDecorationMap));let{i:f,off:p}=o.findPos(h,1),{i:m,off:g}=o.findPos(c,-1);Ju(this,m,g,f,p,s,r,a,l)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let t of e.effects)t.is(cf)&&(this.editContextFormatting=t.value)}compositionView(t){let e=new ed(t.text.nodeValue);e.flags|=8;for(let{deco:i}of t.marks)e=new id(i,[e],e.length);let i=new wd;return i.append(e,0),i}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some(t=>7&t.flags)?1:0),this.markedForComposition.add(e);let i=Uu.get(t);i&&i!=e&&(i.dom=null),e.setDOM(t)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let o=t.marks.length-1;o>=-1;o--)i=n.childPos(i.off,1),n=n.children[i.i],e(o>=0?t.marks[o].node:t.text,n)}updateSelection(t=!1,e=!1){!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,o=!n&&!(this.view.state.facet(uf)||this.dom.tabIndex>-1)&&Cu(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||o))return;let s=this.forceSelection;this.forceSelection=!1;let r=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(r.anchor)),l=r.empty?a:this.moveToLine(this.domAtPos(r.head));if(ku.gecko&&r.empty&&!this.hasComposition&&(1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable))){let t=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(t,a.node.childNodes[a.offset]||null)),a=l=new Vu(t,0),s=!0}var c;let h=this.view.observer.selectionRange;!s&&h.focusNode&&(Eu(a.node,a.offset,h.anchorNode,h.anchorOffset)&&Eu(l.node,l.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,r))||(this.view.observer.ignore(()=>{ku.android&&ku.chrome&&this.dom.contains(h.focusNode)&&function(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=$u(this.view.root);if(t)if(r.empty){if(ku.gecko){let t=(e=a.node,n=a.offset,1!=e.nodeType?0:(n&&"false"==e.childNodes[n-1].contentEditable?1:0)|(n<e.childNodes.length&&"false"==e.childNodes[n].contentEditable?2:0));if(t&&3!=t){let e=(1==t?qu:Hu)(a.node,a.offset);e&&(a=new Vu(e.node,e.offset))}}t.collapse(a.node,a.offset),null!=r.bidiLevel&&void 0!==t.caretBidiLevel&&(t.caretBidiLevel=r.bidiLevel)}else if(t.extend){t.collapse(a.node,a.offset);try{t.extend(l.node,l.offset)}catch(t){}}else{let e=document.createRange();r.anchor>r.head&&([a,l]=[l,a]),e.setEnd(l.node,l.offset),e.setStart(a.node,a.offset),t.removeAllRanges(),t.addRange(e)}else;var e,n;o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new Vu(h.anchorNode,h.anchorOffset),this.impreciseHead=l.precise?null:new Vu(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&Eu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=$u(t.root),{anchorNode:n,anchorOffset:o}=t.observer.selectionRange;if(!(i&&e.empty&&e.assoc&&i.modify))return;let s=wd.find(this,e.head);if(!s)return;let r=s.posAtStart;if(e.head==r||e.head==r+s.length)return;let a=this.coordsAt(e.head,-1),l=this.coordsAt(e.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(e.head+e.assoc);i.collapse(c.node,c.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let h=t.observer.selectionRange;t.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=e.from&&i.collapse(n,o)}moveToLine(t){let e,i=this.dom;if(t.node!=i)return t;for(let n=t.offset;!e&&n<i.childNodes.length;n++){let t=Uu.get(i.childNodes[n]);t instanceof wd&&(e=t.domAtPos(0))}for(let n=t.offset-1;!e&&n>=0;n--){let t=Uu.get(i.childNodes[n]);t instanceof wd&&(e=t.domAtPos(t.length))}return e?new Vu(e.node,e.offset,!0):t}nearest(t){for(let e=t;e;){let t=Uu.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e<this.children.length-1;){let t=this.children[e];if(i<t.length||t instanceof wd)break;e++,i=0}return this.children[e].domAtPos(i)}coordsAt(t,e){let i=null,n=0;for(let o=this.length,s=this.children.length-1;s>=0;s--){let r=this.children[s],a=o-r.breakAfter,l=a-r.length;if(a<t)break;if(l<=t&&(l<t||r.covers(-1))&&(a>t||r.covers(1))&&(!i||r instanceof wd&&!(i instanceof wd&&e>=0)))i=r,n=l;else if(i&&l==t&&a==t&&r instanceof _d&&Math.abs(e)<2){if(r.deco.startSide<0)break;s&&(i=null)}o=l}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof wd))return null;for(;n.children.length;){let{i:t,off:e}=n.childPos(i,1);for(;;t++){if(t==n.children.length)return null;if((n=n.children[t]).length)break}i=e}if(!(n instanceof ed))return null;let o=Ec(n.text,i);if(o==i)return null;let s=Zu(n.dom,i,o).getClientRects();for(let t=0;t<s.length;t++){let e=s[t];if(t==s.length-1||e.top<e.bottom&&e.left<e.right)return e}return null}measureVisibleLineHeights(t){let e=[],{from:i,to:n}=t,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,r=-1,a=this.view.textDirection==Cd.LTR;for(let t=0,l=0;l<this.children.length;l++){let c=this.children[l],h=t+c.length;if(h>n)break;if(t>=i){let i=c.dom.getBoundingClientRect();if(e.push(i.height),s){let e=c.dom.lastChild,n=e?Pu(e):[];if(n.length){let e=n[n.length-1],s=a?e.right-i.left:i.right-e.left;s>r&&(r=s,this.minWidth=o,this.minWidthFrom=t,this.minWidthTo=h)}}}t=h+c.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?Cd.RTL:Cd.LTR}measureTextSize(){for(let t of this.children)if(t instanceof wd){let e=t.measureTextSize();if(e)return e}let t,e,i,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(n);let o=Pu(n.firstChild)[0];t=n.getBoundingClientRect().height,e=o?o.width/27:7,i=o?o.height:t,n.remove()}),{lineHeight:t,charWidth:e,textHeight:i}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new Ku(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let o=n==e.viewports.length?null:e.viewports[n],s=o?o.from-1:this.length;if(s>i){let n=(e.lineBlockAt(s).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(gd.replace({widget:new Sd(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,s))}if(!o)break;i=o.to+1}return gd.set(t)}updateDeco(){let t=1,e=this.view.state.facet(yf).map(e=>(this.dynamicDecorationMap[t++]="function"==typeof e)?e(this.view):e),i=!1,n=this.view.state.facet(Of).map((t,e)=>{let n="function"==typeof t;return n&&(i=!0),n?t(this.view):t});for(n.length&&(this.dynamicDecorationMap[t++]=i,e.push(Zh.join(n))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations}scrollIntoView(t){if(t.isSnapshot){let e=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=e.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin)}for(let e of this.view.state.facet(rf))try{if(e(this.view,t.range,t))return!0}catch(t){hf(this.view.state,t,"scroll handler")}let e,{range:i}=t,n=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1);if(!n)return;!i.empty&&(e=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,e.left),top:Math.min(n.top,e.top),right:Math.max(n.right,e.right),bottom:Math.max(n.bottom,e.bottom)});let o=Sf(this.view),s={left:n.left-o.left,top:n.top-o.top,right:n.right+o.right,bottom:n.bottom+o.bottom},{offsetWidth:r,offsetHeight:a}=this.view.scrollDOM;!function(t,e,i,n,o,s,r,a){let l=t.ownerDocument,c=l.defaultView||window;for(let h=t,u=!1;h&&!u;)if(1==h.nodeType){let t,d=h==l.body,f=1,p=1;if(d)t=Iu(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(u=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let e=h.getBoundingClientRect();({scaleX:f,scaleY:p}=Lu(h,e)),t={left:e.left,right:e.left+h.clientWidth*f,top:e.top,bottom:e.top+h.clientHeight*p}}let m=0,g=0;if("nearest"==o)e.top<t.top?(g=e.top-(t.top+r),i>0&&e.bottom>t.bottom+g&&(g=e.bottom-t.bottom+r)):e.bottom>t.bottom&&(g=e.bottom-t.bottom+r,i<0&&e.top-g<t.top&&(g=e.top-(t.top+r)));else{let n=e.bottom-e.top,s=t.bottom-t.top;g=("center"==o&&n<=s?e.top+n/2-s/2:"start"==o||"center"==o&&i<0?e.top-r:e.bottom-s+r)-t.top}if("nearest"==n?e.left<t.left?(m=e.left-(t.left+s),i>0&&e.right>t.right+m&&(m=e.right-t.right+s)):e.right>t.right&&(m=e.right-t.right+s,i<0&&e.left<t.left+m&&(m=e.left-(t.left+s))):m=("center"==n?e.left+(e.right-e.left)/2-(t.right-t.left)/2:"start"==n==a?e.left-s:e.right-(t.right-t.left)+s)-t.left,m||g)if(d)c.scrollBy(m,g);else{let t=0,i=0;if(g){let t=h.scrollTop;h.scrollTop+=g/p,i=(h.scrollTop-t)*p}if(m){let e=h.scrollLeft;h.scrollLeft+=m/f,t=(h.scrollLeft-e)*f}e={left:e.left-t,top:e.top-i,right:e.right-t,bottom:e.bottom-i},t&&Math.abs(t-m)<1&&(n="nearest"),i&&Math.abs(i-g)<1&&(o="nearest")}if(d)break;(e.top<t.top||e.bottom>t.bottom||e.left<t.left||e.right>t.right)&&(e={left:Math.max(e.left,t.left),right:Math.min(e.right,t.right),top:Math.max(e.top,t.top),bottom:Math.min(e.bottom,t.bottom)}),h=h.assignedSlot||h.parentNode}else{if(11!=h.nodeType)break;h=h.host}}(this.view.scrollDOM,s,i.head<i.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,r),-r),Math.max(Math.min(t.yMargin,a),-a),this.view.textDirection==Cd.LTR)}}function Pf(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let n=qu(i.focusNode,i.focusOffset),o=Hu(i.focusNode,i.focusOffset),s=n||o;if(o&&n&&o.node!=n.node){let e=Uu.get(o.node);if(!e||e instanceof ed&&e.text!=o.node.nodeValue)s=o;else if(t.docView.lastCompositionAfterCursor){let t=Uu.get(n.node);!t||t instanceof ed&&t.text!=n.node.nodeValue||(s=o)}}if(t.docView.lastCompositionAfterCursor=s!=n,!s)return null;let r=e-s.offset;return{from:r,to:r+s.node.nodeValue.length,node:s.node}}let Ef=class{constructor(){this.changes=[]}compareRange(t,e){xd(t,e,this.changes)}comparePoint(t,e){xd(t,e,this.changes)}boundChange(t){xd(t,t,this.changes)}};function Af(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function Mf(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Qf(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function Df(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function Rf(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function If(t,e,i){let n,o,s,r,a,l,c,h,u=!1;for(let d=t.firstChild;d;d=d.nextSibling){let t=Pu(d);for(let f=0;f<t.length;f++){let p=t[f];o&&Qf(o,p)&&(p=Df(Rf(p,o.bottom),o.top));let m=Af(e,p),g=Mf(i,p);if(0==m&&0==g)return 3==d.nodeType?Lf(d,e,i):If(d,e,i);(!n||r>g||r==g&&s>m)&&(n=d,o=p,s=m,r=g,u=!m||(e<p.left?f>0:f<t.length-1)),0==m?i>p.bottom&&(!c||c.bottom<p.bottom)?(a=d,c=p):i<p.top&&(!h||h.top>p.top)&&(l=d,h=p):c&&Qf(c,p)?c=Rf(c,p.bottom):h&&Qf(h,p)&&(h=Df(h,p.top))}}if(c&&c.bottom>=i?(n=a,o=c):h&&h.top<=i&&(n=l,o=h),!n)return{node:t,offset:0};let d=Math.max(o.left,Math.min(o.right,e));return 3==n.nodeType?Lf(n,d,i):u&&"false"!=n.contentEditable?If(n,d,i):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,n)+(e>=(o.left+o.right)/2?1:0)}}function Lf(t,e,i){let n=t.nodeValue.length,o=-1,s=1e9,r=0;for(let a=0;a<n;a++){let n=Zu(t,a,a+1).getClientRects();for(let l=0;l<n.length;l++){let c=n[l];if(c.top==c.bottom)continue;r||(r=e-c.left);let h=(c.top>i?c.top-i:i-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&h<s){let i=e>=(c.left+c.right)/2,n=i;if(ku.chrome||ku.gecko){Zu(t,a).getBoundingClientRect().left==c.right&&(n=!i)}if(h<=0)return{node:t,offset:a+(n?1:0)};o=a+(n?1:0),s=h}}}return{node:t,offset:o>-1?o:r>0?t.nodeValue.length:0}}function Nf(t,e,i,n=-1){var o,s;let r,a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,{docHeight:c}=t.viewState,{x:h,y:u}=e,d=u-l;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let e=t.viewState.heightOracle.textHeight/2,o=!1;r=t.elementAtHeight(d),r.type!=md.Text;)for(;d=n>0?r.bottom+e:r.top-e,!(d>=0&&d<=c);){if(o)return i?null:0;o=!0,n=-n}u=l+d;let f=r.from;if(f<t.viewport.from)return 0==t.viewport.from?0:i?null:jf(t,a,r,h,u);if(f>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:jf(t,a,r,h,u);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(h,u);g&&!t.contentDOM.contains(g)&&(g=null),g||(h=Math.max(a.left+1,Math.min(a.right-1,h)),g=m.elementFromPoint(h,u),g&&!t.contentDOM.contains(g)&&(g=null));let v,y=-1;if(g&&0!=(null===(o=t.docView.nearest(g))||void 0===o?void 0:o.isEditable)){if(p.caretPositionFromPoint){let t=p.caretPositionFromPoint(h,u);t&&({offsetNode:v,offset:y}=t)}else if(p.caretRangeFromPoint){let t=p.caretRangeFromPoint(h,u);t&&({startContainer:v,startOffset:y}=t)}v&&(!t.contentDOM.contains(v)||ku.safari&&function(t,e,i){return zf(t,e,i)}(v,y,h)||ku.chrome&&function(t,e,i){if(0!=e)return zf(t,e,i);for(let e=t;;){let t=e.parentNode;if(!t||1!=t.nodeType||t.firstChild!=e)return!1;if(t.classList.contains("cm-line"))break;e=t}let n=1==t.nodeType?t.getBoundingClientRect():Zu(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-n.left>5}(v,y,h))&&(v=void 0),v&&(y=Math.min(Du(v),y))}if(!v||!t.docView.dom.contains(v)){let e=wd.find(t.docView,f);if(!e)return d>r.top+r.height/2?r.to:r.from;({node:v,offset:y}=If(e.dom,h,u))}let O=t.docView.nearest(v);if(!O)return null;if(O.isWidget&&1==(null===(s=O.dom)||void 0===s?void 0:s.nodeType)){let t=O.dom.getBoundingClientRect();return e.y<t.top||e.y<=t.bottom&&e.x<=(t.left+t.right)/2?O.posAtStart:O.posAtEnd}return O.localPosFromDOM(v,y)+O.posAtStart}function jf(t,e,i,n,o){let s=Math.round((n-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;s+=Math.floor((o-i.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let r=t.state.sliceDoc(i.from,i.to);return i.from+eu(r,s,t.state.tabSize)}function zf(t,e,i){let n,o=t;if(3!=t.nodeType||e!=(n=t.nodeValue.length))return!1;for(;;){let t=o.nextSibling;if(t){if("BR"==t.nodeName)break;return!1}{let t=o.parentNode;if(!t||"DIV"==t.nodeName)break;o=t}}return Zu(t,n-1,n).getBoundingClientRect().right>i}function Bf(t,e,i){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let t;for(let o of n.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;t&&(o.type!=md.Text||t.type==o.type&&!(i<0?o.from<e:o.to>e))||(t=o)}}return t||n}return n}function Zf(t,e,i,n){let o=t.state.doc.lineAt(e.head),s=t.bidiSpans(o),r=t.textDirectionAt(o.from);for(let a=e,l=null;;){let e=qd(o,s,r,a,i),c=Xd;if(!e){if(o.number==(i?t.state.doc.lines:1))return a;c="\n",o=t.state.doc.line(o.number+(i?1:-1)),s=t.bidiSpans(o),e=t.visualLineSide(o,!i)}if(l){if(!l(c))return a}else{if(!n)return e;l=n(c)}a=e}}function Wf(t,e,i){for(;;){let n=0;for(let o of t)o.between(e-1,e+1,(t,o,s)=>{if(e>t&&e<o){let s=n||i||(e-t<o-e?-1:1);e=s<0?t:o,n=s}});if(!n)return e}}function Ff(t,e){let i=null;for(let n=0;n<e.ranges.length;n++){let o=e.ranges[n],s=null;if(o.empty){let e=Wf(t,o.from,0);e!=o.from&&(s=Xc.cursor(e,-1))}else{let e=Wf(t,o.from,-1),i=Wf(t,o.to,1);e==o.from&&i==o.to||(s=Xc.range(o.from==o.anchor?e:i,o.from==o.head?e:i))}s&&(i||(i=e.ranges.slice()),i[n]=s)}return i?Xc.create(i,e.mainIndex):e}function Xf(t,e,i){let n=Wf(t.state.facet(bf).map(e=>e(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:Xc.cursor(n,n<i.from?1:-1)}const qf="￿";class Hf{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(Ih.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=qf}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let n=t;;){this.findPointBefore(i,n);let t=this.text.length;this.readNode(n);let o=n.nextSibling;if(o==e)break;let s=Uu.get(n),r=Uu.get(o);(s&&r?s.breakAfter:(s?s.breakAfter:Mu(n))||Mu(o)&&("BR"!=n.nodeName||n.cmIgnore)&&this.text.length>t)&&!Yf(o,e)&&this.lineBreak(),n=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let o,s=-1,r=1;if(this.lineSeparator?(s=e.indexOf(this.lineSeparator,i),r=this.lineSeparator.length):(o=n.exec(e))&&(s=o.index,r=o[0].length),this.append(e.slice(i,s<0?e.length:s)),s<0)break;if(this.lineBreak(),r>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=r-1);i=s+r}}readNode(t){if(t.cmIgnore)return;let e=Uu.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let t=i.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(Vf(t,i.node,i.offset)?e:0))}}function Vf(t,e,i){for(;;){if(!e||i<Du(e))return!1;if(e==t)return!0;i=Au(e)+1,e=e.parentNode}}function Yf(t,e){let i;for(;t!=e&&t;t=t.nextSibling){let e=Uu.get(t);if(!(null==e?void 0:e.isWidget)&&!t.cmIgnore)return!1;e&&(i||(i=[])).push(e)}if(i)for(let t of i){let e=t.overrideDOMText;if(null==e?void 0:e.length)return!1}return!0}class Uf{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class Gf{constructor(t,e,i,n){this.typeOver=n,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:o,impreciseAnchor:s}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let e=o||s?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:o,focusOffset:s}=t.observer.selectionRange;i&&(e.push(new Uf(i,n)),o==i&&s==n||e.push(new Uf(o,s)));return e}(t),i=new Hf(e,t.state);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,n=2==t.length?t[1].pos:i;return i>-1&&n>-1?Xc.single(i+e,n+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,i=o&&o.node==e.focusNode&&o.offset==e.focusOffset||!Tu(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),n=s&&s.node==e.anchorNode&&s.offset==e.anchorOffset||!Tu(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),r=t.viewport;if((ku.ios||ku.chrome)&&t.state.selection.main.empty&&i!=n&&(r.from>0||r.to<t.state.doc.length)){let e=Math.min(i,n),o=Math.max(i,n),s=r.from-e,a=r.to-o;0!=s&&1!=s&&0!=e||0!=a&&-1!=a&&o!=t.state.doc.length||(i=0,n=t.state.doc.length)}this.newSel=Xc.single(n,i)}}}function Kf(t,e){let i,{newSel:n}=e,o=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:n,to:r}=e.bounds,a=o.from,l=null;(8===s||ku.android&&e.text.length<r-n)&&(a=o.to,l="end");let c=tp(t.state.doc.sliceString(n,r,qf),e.text,a-n,l);c&&(ku.chrome&&13==s&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==qf+qf&&c.toB--,i={from:n+c.from,to:n+c.toA,insert:bc.of(e.text.slice(c.from,c.toB).split(qf))})}else n&&(!t.hasFocus&&t.state.facet(uf)||n.main.eq(o))&&(n=null);if(!i&&!n)return!1;if(!i&&e.typeOver&&!o.empty&&n&&n.main.empty?i={from:o.from,to:o.to,insert:t.state.doc.slice(o.from,o.to)}:(ku.mac||ku.android)&&i&&i.from==i.to&&i.from==o.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(n&&2==i.insert.length&&(n=Xc.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:bc.of([i.insert.toString().replace("."," ")])}):i&&i.from>=o.from&&i.to<=o.to&&(i.from!=o.from||i.to!=o.to)&&o.to-o.from-(i.to-i.from)<=4?i={from:o.from,to:o.to,insert:t.state.doc.slice(o.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,o.to))}:ku.chrome&&i&&i.from==i.to&&i.from==o.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(n&&(n=Xc.single(n.main.anchor-1,n.main.head-1)),i={from:o.from,to:o.to,insert:bc.of([" "])}),i)return Jf(t,i,n,s);if(n&&!n.main.eq(o)){let e=!1,i="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),i=t.inputState.lastSelectionOrigin,"select.pointer"==i&&(n=Ff(t.state.facet(bf).map(e=>e(t)),n))),t.dispatch({selection:n,scrollIntoView:e,userEvent:i}),!0}return!1}function Jf(t,e,i,n=-1){if(ku.ios&&t.inputState.flushIOSKey(e))return!0;let o=t.state.selection.main;if(ku.android&&(e.to==o.to&&(e.from==o.from||e.from==o.from-1&&" "==t.state.sliceDoc(e.from,o.from))&&1==e.insert.length&&2==e.insert.lines&&Wu(t.contentDOM,"Enter",13)||(e.from==o.from-1&&e.to==o.to&&0==e.insert.length||8==n&&e.insert.length<e.to-e.from&&e.to>o.head)&&Wu(t.contentDOM,"Backspace",8)||e.from==o.from&&e.to==o.to+1&&0==e.insert.length&&Wu(t.contentDOM,"Delete",46)))return!0;let s,r=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a=()=>s||(s=function(t,e,i){let n,o=t.state,s=o.selection.main,r=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let i=e.from<s.from?-1:1,n=i<0?s.from:s.to,a=Wf(o.facet(bf).map(e=>e(t)),n,i);e.from==a&&(r=a)}if(r>-1)n={changes:e,selection:Xc.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let i=s.from<e.from?o.sliceDoc(s.from,e.from):"",r=s.to>e.to?o.sliceDoc(e.to,s.to):"";n=o.replaceSelection(t.state.toText(i+e.insert.sliceString(0,void 0,t.state.lineBreak)+r))}else{let r=o.changes(e),a=i&&i.main.to<=r.newLength?i.main:void 0;if(o.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let l,c=t.state.sliceDoc(e.from,e.to),h=i&&Pf(t,i.main.head);if(h){let t=e.insert.length-(e.to-e.from);l={from:h.from,to:h.to-t}}else l=t.state.doc.lineAt(s.head);let u=s.to-e.to,d=s.to-s.from;n=o.changeByRange(i=>{if(i.from==s.from&&i.to==s.to)return{changes:r,range:a||i.map(r)};let n=i.to-u,h=n-c.length;if(i.to-i.from!=d||t.state.sliceDoc(h,n)!=c||i.to>=l.from&&i.from<=l.to)return{range:i};let f=o.changes({from:h,to:n,insert:e.insert}),p=i.to-s.to;return{changes:f,range:a?Xc.range(Math.max(0,a.anchor+p),Math.max(0,a.head+p)):i.map(f)}})}else n={changes:r,selection:a&&o.selection.replaceRange(a)}}let a="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1));return o.update(n,{userEvent:a,scrollIntoView:!0})}(t,e,i));return t.state.facet(Jd).some(i=>i(t,e.from,e.to,r,a))||t.dispatch(a()),!0}function tp(t,e,i,n){let o=Math.min(t.length,e.length),s=0;for(;s<o&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==o&&t.length==e.length)return null;let r=t.length,a=e.length;for(;r>0&&a>0&&t.charCodeAt(r-1)==e.charCodeAt(a-1);)r--,a--;if("end"==n){i-=r+Math.max(0,s-Math.min(r,a))-s}if(r<s&&t.length<e.length){s-=i<=s&&i>=r?s-i:0,a=s+(a-r),r=s}else if(a<s){s-=i<=s&&i>=a?s-i:0,r=s+(r-a),a=s}return{from:s,toA:r,toB:a}}class ep{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,ku.safari&&t.contentDOM.addEventListener("input",()=>null),ku.gecko&&function(t){Cp.has(t)||(Cp.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i,n=e.target;n!=t.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=Uu.get(n))&&i.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t)))}runHandlers(t,e){let i=this.handlers[t];if(i){for(let t of i.observers)t(this.view,e);for(let t of i.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=np(t),i=this.handlers,n=this.view.contentDOM;for(let t in e)if("scroll"!=t){let o=!e[t].handlers.length,s=i[t];s&&o!=!s.handlers.length&&(n.removeEventListener(t,this.handleEvent),s=null),s||n.addEventListener(t,this.handleEvent,{passive:o})}for(let t in i)"scroll"==t||e[t]||n.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&rp.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),ku.android&&ku.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return!ku.ios||t.synthetic||t.altKey||t.metaKey||!((e=op.find(e=>e.keyCode==t.keyCode))&&!t.ctrlKey||sp.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(!("Enter"==e.key&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString()))&&(this.pendingIOSKey=void 0,Wu(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0)))}ignoreDuringComposition(t){return!(!/^key/.test(t.type)||t.synthetic)&&(this.composing>0||!!(ku.safari&&!ku.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ip(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(t){hf(i.state,t)}}}function np(t){let e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec,n=t&&t.plugin.domEventHandlers,o=t&&t.plugin.domEventObservers;if(n)for(let t in n){let o=n[t];o&&i(t).handlers.push(ip(e.value,o))}if(o)for(let t in o){let n=o[t];n&&i(t).observers.push(ip(e.value,n))}}for(let t in cp)i(t).handlers.push(cp[t]);for(let t in hp)i(t).observers.push(hp[t]);return e}const op=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],sp="dthko",rp=[16,17,18,20,91,92,224,225];function ap(t){return.7*Math.max(0,t)+8}class lp{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){let e,i,n=t.ownerDocument;for(let o=t.parentNode;o&&!(o==n.body||e&&i);)if(1==o.nodeType)!i&&o.scrollHeight>o.clientHeight&&(i=o),!e&&o.scrollWidth>o.clientWidth&&(e=o),o=o.assignedSlot||o.parentNode;else{if(11!=o.nodeType)break;o=o.host}return{x:e,y:i}}(t.contentDOM),this.atoms=t.state.facet(bf).map(e=>e(t));let o=t.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(Ih.allowMultipleSelections)&&function(t,e){let i=t.state.facet(Vd);return i.length?i[0](e):ku.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=$u(t.root);if(!n||0==n.rangeCount)return!0;let o=n.getRangeAt(0).getClientRects();for(let t=0;t<o.length;t++){let i=o[t];if(i.left<=e.clientX&&i.right>=e.clientX&&i.top<=e.clientY&&i.bottom>=e.clientY)return!0}return!1}(t,e)||1!=wp(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(e=this.startEvent,i=t,Math.max(Math.abs(e.clientX-i.clientX),Math.abs(e.clientY-i.clientY))<10))return;var e,i;this.select(this.lastEvent=t);let n=0,o=0,s=0,r=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Sf(this.view);t.clientX-c.left<=s+6?n=-ap(s-t.clientX):t.clientX+c.right>=a-6&&(n=ap(t.clientX-a)),t.clientY-c.top<=r+6?o=-ap(r-t.clientY):t.clientY+c.bottom>=l-6&&(o=ap(t.clientY-l)),this.setScrollSpeed(n,o)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent)}select(t){let{view:e}=this,i=Ff(this.atoms,this.style.get(t,this.extend,this.multiple));!this.mustSelect&&i.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}const cp=Object.create(null),hp=Object.create(null),up=ku.ie&&ku.ie_version<15||ku.ios&&ku.webkit_version<604;function dp(t,e,i){for(let n of t.facet(e))i=n(i,t);return i}function fp(t,e){e=dp(t.state,ef,e);let i,{state:n}=t,o=1,s=n.toText(e),r=s.lines==n.selection.ranges.length;if(null!=Sp&&n.selection.ranges.every(t=>t.empty)&&Sp==s.toString()){let t=-1;i=n.changeByRange(i=>{let a=n.doc.lineAt(i.from);if(a.from==t)return{range:i};t=a.from;let l=n.toText((r?s.line(o++).text:e)+n.lineBreak);return{changes:{from:a.from,insert:l},range:Xc.cursor(i.from+l.length)}})}else i=r?n.changeByRange(t=>{let e=s.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:Xc.cursor(t.from+e.length)}}):n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function pp(t,e,i,n){if(1==n)return Xc.cursor(e,i);if(2==n)return function(t,e,i=1){let n=t.charCategorizer(e),o=t.doc.lineAt(e),s=e-o.from;if(0==o.length)return Xc.cursor(e);0==s?i=1:s==o.length&&(i=-1);let r=s,a=s;i<0?r=Ec(o.text,s,!1):a=Ec(o.text,s);let l=n(o.text.slice(r,a));for(;r>0;){let t=Ec(o.text,r,!1);if(n(o.text.slice(t,r))!=l)break;r=t}for(;a<o.length;){let t=Ec(o.text,a);if(n(o.text.slice(a,t))!=l)break;a=t}return Xc.range(r+o.from,a+o.from)}(t.state,e,i);{let i=wd.find(t.docView,e),n=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:n.from,s=i?i.posAtEnd:n.to;return s<t.state.doc.length&&s==n.to&&s++,Xc.range(o,s)}}hp.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},cp.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),hp.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},hp.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},cp.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(Ud))if(i=n(t,e),i)break;if(i||0!=e.button||(i=function(t,e){let i=vp(t,e),n=wp(e),o=t.state.selection;return{update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),o=o.map(t.changes))},get(e,s,r){let a,l=vp(t,e),c=pp(t,l.pos,l.bias,n);if(i.pos!=l.pos&&!s){let e=pp(t,i.pos,i.bias,n),o=Math.min(e.from,c.from),s=Math.max(e.to,c.to);c=o<c.from?Xc.range(o,s):Xc.range(s,o)}return s?o.replaceRange(o.main.extend(c.from,c.to)):r&&1==n&&o.ranges.length>1&&(a=function(t,e){for(let i=0;i<t.ranges.length;i++){let{from:n,to:o}=t.ranges[i];if(n<=e&&o>=e)return Xc.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}(o,l.pos))?a:r?o.addRange(c):Xc.create([c])}}}(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new lp(t,e,i,n)),n&&t.observer.ignore(()=>{Bu(t.contentDOM);let e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur()});let o=t.inputState.mouseSelection;if(o)return o.start(e),!1===o.dragging}else t.inputState.setSelectionOrigin("select.pointer");return!1};let mp=(t,e,i)=>e>=i.top&&e<=i.bottom&&t>=i.left&&t<=i.right;function gp(t,e,i,n){let o=wd.find(t.docView,e);if(!o)return 1;let s=e-o.posAtStart;if(0==s)return 1;if(s==o.length)return-1;let r=o.coordsAt(s,-1);if(r&&mp(i,n,r))return-1;let a=o.coordsAt(s,1);return a&&mp(i,n,a)?1:r&&r.bottom>=n?-1:1}function vp(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:gp(t,i,e.clientX,e.clientY)}}const yp=ku.ie&&ku.ie_version<=11;let Op=null,bp=0,xp=0;function wp(t){if(!yp)return t.detail;let e=Op,i=xp;return Op=t,xp=Date.now(),bp=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(bp+1)%3:1}function _p(t,e,i,n){if(!(i=dp(t.state,ef,i)))return;let o=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,r=n&&s&&function(t,e){let i=t.state.facet(Yd);return i.length?i[0](e):ku.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:s.from,to:s.to}:null,a={from:o,insert:i},l=t.state.changes(r?[r,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(o,-1),head:l.mapPos(o,1)},userEvent:r?"move.drop":"input.drop"}),t.inputState.draggedContent=null}cp.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let n=t.docView.nearest(e.target);if(n&&n.isWidget){let t=n.posAtStart,e=t+n.length;(t>=i.to||e<=i.from)&&(i=Xc.range(t,e))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",dp(t.state,nf,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1},cp.dragend=t=>(t.inputState.draggedContent=null,!1),cp.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),o=0,s=()=>{++o==i.length&&_p(t,e,n.filter(t=>null!=t).join(t.state.lineBreak),!1)};for(let t=0;t<i.length;t++){let e=new FileReader;e.onerror=s,e.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(n[t]=e.result),s()},e.readAsText(i[t])}return!0}{let i=e.dataTransfer.getData("Text");if(i)return _p(t,e,i,!0),!0}return!1},cp.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=up?null:e.clipboardData;return i?(fp(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),fp(t,i.value)},50)}(t),!1)};let Sp=null;cp.copy=cp.cut=(t,e)=>{let{text:i,ranges:n,linewise:o}=function(t){let e=[],i=[],n=!1;for(let n of t.selection.ranges)n.empty||(e.push(t.sliceDoc(n.from,n.to)),i.push(n));if(!e.length){let o=-1;for(let{from:n}of t.selection.ranges){let s=t.doc.lineAt(n);s.number>o&&(e.push(s.text),i.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),o=s.number}n=!0}return{text:dp(t,nf,e.join(t.lineBreak)),ranges:i,linewise:n}}(t.state);if(!i&&!o)return!1;Sp=o?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=up?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",i),!0):(function(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}(t,i),!1)};const kp=xh.define();function $p(t,e){let i=[];for(let n of t.facet(tf)){let o=n(t,e);o&&i.push(o)}return i.length?t.update({effects:i,annotations:kp.of(!0)}):null}function Tp(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=$p(t.state,e);i?t.dispatch(i):t.update([])}},10)}hp.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Tp(t)},hp.blur=t=>{t.observer.clearSelectionRange(),Tp(t)},hp.compositionstart=hp.compositionupdate=t=>{t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},hp.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,ku.chrome&&ku.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},hp.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},cp.beforeinput=(t,e)=>{var i,n;if("insertReplacementText"==e.inputType&&t.observer.editContext){let n=null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),o=e.getTargetRanges();if(n&&o.length){let e=o[0],i=t.posAtDOM(e.startContainer,e.startOffset),s=t.posAtDOM(e.endContainer,e.endOffset);return Jf(t,{from:i,to:s,insert:t.state.toText(n)},null),!0}}let o;if(ku.chrome&&ku.android&&(o=op.find(t=>t.inputType==e.inputType))&&(t.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let e=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout(()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ku.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),ku.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout(()=>hp.compositionend(t,e),20),!1};const Cp=new Set;const Pp=["pre-wrap","normal","pre-line","break-spaces"];let Ep=!1;function Ap(){Ep=!1}class Mp{constructor(t){this.lineWrapping=t,this.doc=bc.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Pp.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i<t.length;i++){let n=t[i];n<0?i++:this.heightSamples[Math.floor(10*n)]||(e=!0,this.heightSamples[Math.floor(10*n)]=!0)}return e}refresh(t,e,i,n,o,s){let r=Pp.indexOf(t)>-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=r;if(this.lineWrapping=r,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=o,a){this.heightSamples={};for(let t=0;t<s.length;t++){let e=s[t];e<0?t++:this.heightSamples[Math.floor(10*e)]=!0}}return a}}class Qp{constructor(t,e){this.from=t,this.heights=e,this.index=0}get more(){return this.index<this.heights.length}}class Dp{constructor(t,e,i,n,o){this.from=t,this.length=e,this.top=i,this.height=n,this._content=o}get type(){return"number"==typeof this._content?md.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Od?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(t){let e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new Dp(this.from,this.length+t.length,this.top,this.height+t.height,e)}}var Rp=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(Rp||(Rp={}));const Ip=.001;class Lp{constructor(t,e,i=2){this.length=t,this.height=e,this.flags=i}get outdated(){return(2&this.flags)>0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>Ip&&(Ep=!0),this.height=t)}replace(t,e,i){return Lp.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let o=this,s=i.doc;for(let r=n.length-1;r>=0;r--){let{fromA:a,toA:l,fromB:c,toB:h}=n[r],u=o.lineAt(a,Rp.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=l?u:o.lineAt(l,Rp.ByPosNoHeight,i,0,0);for(h+=d.to-l,l=d.to;r>0&&u.from<=n[r-1].toA;)a=n[r-1].fromA,c=n[r-1].fromB,r--,a<u.from&&(u=o.lineAt(a,Rp.ByPosNoHeight,i,0,0));c+=u.from-a,a=u.from;let f=Fp.build(i.setDoc(s),t,c,h);o=Np(o,o.replace(a,l,f))}return o.updateHeight(i,0)}static empty(){return new zp(0,0)}static of(t){if(1==t.length)return t[0];let e=0,i=t.length,n=0,o=0;for(;;)if(e==i)if(n>2*o){let o=t[e-1];o.break?t.splice(--e,1,o.left,null,o.right):t.splice(--e,1,o.left,o.right),i+=1+o.break,n-=o.size}else{if(!(o>2*n))break;{let e=t[i];e.break?t.splice(i,1,e.left,null,e.right):t.splice(i,1,e.left,e.right),i+=2+e.break,o-=e.size}}else if(n<o){let i=t[e++];i&&(n+=i.size)}else{let e=t[--i];e&&(o+=e.size)}let s=0;return null==t[e-1]?(s=1,e--):null==t[e]&&(s=1,i++),new Zp(Lp.of(t.slice(0,e)),s,Lp.of(t.slice(i)))}}function Np(t,e){return t==e?t:(t.constructor!=e.constructor&&(Ep=!0),e)}Lp.prototype.size=1;class jp extends Lp{constructor(t,e,i){super(t,e),this.deco=i}blockAt(t,e,i,n){return new Dp(n,this.length,i,this.height,this.deco||0)}lineAt(t,e,i,n,o){return this.blockAt(0,i,n,o)}forEachLine(t,e,i,n,o,s){t<=o+this.length&&e>=o&&s(this.blockAt(0,i,n,o))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class zp extends jp{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new Dp(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return 1==i.length&&(n instanceof zp||n instanceof Bp&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof Bp?n=new zp(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):Lp.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Bp extends Lp{constructor(t){super(t,0)}heightMetrics(t,e){let i,n=t.doc.lineAt(e).number,o=t.doc.lineAt(e+this.length).number,s=o-n+1,r=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*s);i=e/s,this.length>s+1&&(r=(this.height-e)/(this.length-s-1))}else i=this.height/s;return{firstLine:n,lastLine:o,perLine:i,perChar:r}}blockAt(t,e,i,n){let{firstLine:o,lastLine:s,perLine:r,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let o=n+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length)),s=e.doc.lineAt(o),l=r+s.length*a,c=Math.max(i,t-l/2);return new Dp(s.from,s.length,c,l,0)}{let n=Math.max(0,Math.min(s-o,Math.floor((t-i)/r))),{from:a,length:l}=e.doc.line(o+n);return new Dp(a,l,i+r*n,r,0)}}lineAt(t,e,i,n,o){if(e==Rp.ByHeight)return this.blockAt(t,i,n,o);if(e==Rp.ByPosNoHeight){let{from:e,to:n}=i.doc.lineAt(t);return new Dp(e,n-e,0,0,0)}let{firstLine:s,perLine:r,perChar:a}=this.heightMetrics(i,o),l=i.doc.lineAt(t),c=r+l.length*a,h=l.number-s,u=n+r*h+a*(l.from-o-h);return new Dp(l.from,l.length,Math.max(n,Math.min(u,n+this.height-c)),c,0)}forEachLine(t,e,i,n,o,s){t=Math.max(t,o),e=Math.min(e,o+this.length);let{firstLine:r,perLine:a,perChar:l}=this.heightMetrics(i,o);for(let c=t,h=n;c<=e;){let e=i.doc.lineAt(c);if(c==t){let i=e.number-r;h+=a*i+l*(t-o-i)}let n=a+l*e.length;s(new Dp(e.from,e.length,h,n,0)),h+=n,c=e.to+1}}replace(t,e,i){let n=this.length-e;if(n>0){let t=i[i.length-1];t instanceof Bp?i[i.length-1]=new Bp(t.length+n):i.push(null,new Bp(n-1))}if(t>0){let e=i[0];e instanceof Bp?i[0]=new Bp(t+e.length):i.unshift(new Bp(t-1),null)}return Lp.of(i)}decomposeLeft(t,e){e.push(new Bp(t-1),null)}decomposeRight(t,e){e.push(null,new Bp(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let o=e+this.length;if(n&&n.from<=e+this.length&&n.more){let i=[],s=Math.max(e,n.from),r=-1;for(n.from>e&&i.push(new Bp(n.from-e-1).updateHeight(t,e));s<=o&&n.more;){let e=t.doc.lineAt(s).length;i.length&&i.push(null);let o=n.heights[n.index++];-1==r?r=o:Math.abs(o-r)>=Ip&&(r=-2);let a=new zp(e,o);a.outdated=!1,i.push(a),s+=e+1}s<=o&&i.push(null,new Bp(o-s).updateHeight(t,s));let a=Lp.of(i);return(r<0||Math.abs(a.height-this.height)>=Ip||Math.abs(r-this.heightMetrics(t,e).perLine)>=Ip)&&(Ep=!0),Np(this,a)}return(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Zp extends Lp{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,n){let o=i+this.left.height;return t<o?this.left.blockAt(t,e,i,n):this.right.blockAt(t,e,o,n+this.left.length+this.break)}lineAt(t,e,i,n,o){let s=n+this.left.height,r=o+this.left.length+this.break,a=e==Rp.ByHeight?t<s:t<r,l=a?this.left.lineAt(t,e,i,n,o):this.right.lineAt(t,e,i,s,r);if(this.break||(a?l.to<r:l.from>r))return l;let c=e==Rp.ByPosNoHeight?Rp.ByPosNoHeight:Rp.ByPos;return a?l.join(this.right.lineAt(r,c,i,s,r)):this.left.lineAt(r,c,i,n,o).join(l)}forEachLine(t,e,i,n,o,s){let r=n+this.left.height,a=o+this.left.length+this.break;if(this.break)t<a&&this.left.forEachLine(t,e,i,n,o,s),e>=a&&this.right.forEachLine(t,e,i,r,a,s);else{let l=this.lineAt(a,Rp.ByPos,i,n,o);t<l.from&&this.left.forEachLine(t,l.from-1,i,n,o,s),l.to>=t&&l.from<=e&&s(l),e>l.to&&this.right.forEachLine(l.to+1,e,i,r,a,s)}}replace(t,e,i){let n=this.left.length+this.break;if(e<n)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let o=[];t>0&&this.decomposeLeft(t,o);let s=o.length;for(let t of i)o.push(t);if(t>0&&Wp(o,s-1),e<this.length){let t=o.length;this.decomposeRight(e,o),Wp(o,t)}return Lp.of(o)}decomposeLeft(t,e){let i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t<i&&this.left.decomposeRight(t,e),this.break&&t<n&&e.push(null),e.push(this.right)}balanced(t,e){return t.size>2*e.size||e.size>2*t.size?Lp.of(this.break?[t,null,e]:[t,e]):(this.left=Np(this.left,t),this.right=Np(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:o,right:s}=this,r=e+o.length+this.break,a=null;return n&&n.from<=e+o.length&&n.more?a=o=o.updateHeight(t,e,i,n):o.updateHeight(t,e,i),n&&n.from<=r+s.length&&n.more?a=s=s.updateHeight(t,r,i,n):s.updateHeight(t,r,i),a?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Wp(t,e){let i,n;null==t[e]&&(i=t[e-1])instanceof Bp&&(n=t[e+1])instanceof Bp&&t.splice(e-1,3,new Bp(i.length+1+n.length))}class Fp{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof zp?i.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new zp(t-this.pos,-1)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t<e||i.heightRelevant){let n=i.widget?i.widget.estimatedHeight:0,o=i.widget?i.widget.lineBreaks:0;n<0&&(n=this.oracle.lineHeight);let s=e-t;i.block?this.addBlock(new jp(s,n,i)):(s||o||n>=5)&&this.addLineDeco(n,o,s)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new zp(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new Bp(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof zp)return t;let e=new zp(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof zp||this.isCovered?(this.writtenTo<this.pos||null==e)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new zp(0,-1));let i=t;for(let t of this.nodes)t instanceof zp&&t.updateHeight(this.oracle,i),i+=t?t.length:1;return this.nodes}static build(t,e,i,n){let o=new Fp(i,t);return Zh.spans(e,i,n,o,0),o.finish(i)}}class Xp{constructor(){this.changes=[]}compareRange(){}comparePoint(t,e,i,n){(t<e||i&&i.heightRelevant||n&&n.heightRelevant)&&xd(t,e,this.changes,5)}}function qp(t,e){let i=t.getBoundingClientRect(),n=t.ownerDocument,o=n.defaultView||window,s=Math.max(0,i.left),r=Math.min(o.innerWidth,i.right),a=Math.max(0,i.top),l=Math.min(o.innerHeight,i.bottom);for(let e=t.parentNode;e&&e!=n.body;)if(1==e.nodeType){let i=e,n=window.getComputedStyle(i);if((i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth)&&"visible"!=n.overflow){let n=i.getBoundingClientRect();s=Math.max(s,n.left),r=Math.min(r,n.right),a=Math.max(a,n.top),l=Math.min(e==t.parentNode?o.innerHeight:l,n.bottom)}e="absolute"==n.position||"fixed"==n.position?i.offsetParent:i.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:s-i.left,right:Math.max(s,r)-i.left,top:a-(i.top+e),bottom:Math.max(a,l)-(i.top+e)}}function Hp(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class Vp{constructor(t,e,i,n){this.from=t,this.to=e,this.size=i,this.displaySize=n}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],o=e[i];if(n.from!=o.from||n.to!=o.to||n.size!=o.size)return!1}return!0}draw(t,e){return gd.replace({widget:new Yp(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to)}}class Yp extends pd{constructor(t,e){super(),this.size=t,this.vertical=e}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class Up{constructor(t){this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=tm,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Cd.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let e=t.facet(vf).some(t=>"function"!=typeof t&&"cm-lineWrapping"==t.class);this.heightOracle=new Mp(e),this.stateDeco=t.facet(yf).filter(t=>"function"!=typeof t),this.heightMap=Lp.empty().applyChanges(this.stateDeco,bc.empty,this.heightOracle.setDoc(t.doc),[new $f(0,0,0,t.doc.length)]);for(let t=0;t<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());t++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=gd.set(this.lineGaps.map(t=>t.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some(({from:t,to:e})=>n>=t&&n<=e)){let{from:e,to:i}=this.lineBlockAt(n);t.push(new Gp(e,i))}}return this.viewports=t.sort((t,e)=>t.from-e.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?tm:new em(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(im(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(yf).filter(t=>"function"!=typeof t);let n=t.changedRanges,o=$f.extendWithRanges(n,function(t,e,i){let n=new Xp;return Zh.compare(t,e,i,n,0),n.changes}(i,this.stateDeco,t?t.changes:Lc.empty(this.state.doc.length))),s=this.heightMap.height,r=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Ap(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||Ep)&&(t.flags|=2),r?(this.scrollAnchorPos=t.changes.mapPos(r.from,-1),this.scrollAnchorHeight=r.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let a=o.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<a.from||e.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(l||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(sf)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?Cd.RTL:Cd.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),r=e.getBoundingClientRect(),a=s||this.mustMeasureContent||this.contentDOMHeight!=r.height;this.contentDOMHeight=r.height,this.mustMeasureContent=!1;let l=0,c=0;if(r.width&&r.height){let{scaleX:t,scaleY:i}=Lu(e,r);(t>.005&&Math.abs(this.scaleX-t)>.005||i>.005&&Math.abs(this.scaleY-i)>.005)&&(this.scaleX=t,this.scaleY=i,l|=16,s=a=!0)}let h=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==h&&this.paddingBottom==u||(this.paddingTop=h,this.paddingBottom=u,l|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,l|=16);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Xu(t.scrollDOM);let f=(this.printing?Hp:qp)(e,this.paddingTop),p=f.top-this.pixelViewport.top,m=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget&&!function(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0}(t.dom))return 0;let v=r.width;if(this.contentDOMWidth==v&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=r.width,this.editorHeight=t.scrollDOM.clientHeight,l|=16),a){let e=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(e)&&(s=!0),s||n.lineWrapping&&Math.abs(v-this.contentDOMWidth)>n.charWidth){let{lineHeight:i,charWidth:r,textHeight:a}=t.docView.measureTextSize();s=i>0&&n.refresh(o,i,r,a,Math.max(5,v/r),e),s&&(t.docView.minWidth=0,l|=16)}p>0&&m>0?c=Math.max(p,m):p<0&&m<0&&(c=Math.min(p,m)),Ap();for(let i of this.viewports){let o=i.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(i);this.heightMap=(s?Lp.empty().applyChanges(this.stateDeco,bc.empty,this.heightOracle,[new $f(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,s,new Qp(i.from,o))}Ep&&(l|=2)}let y=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(2&l&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(2&l||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,t)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:r}=this,a=new Gp(n.lineAt(s-1e3*i,Rp.ByHeight,o,0,0).from,n.lineAt(r+1e3*(1-i),Rp.ByHeight,o,0,0).to);if(e){let{head:t}=e.range;if(t<a.from||t>a.to){let i,s=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),r=n.lineAt(t,Rp.ByPos,o,0,0);i="center"==e.y?(r.top+r.bottom)/2-s/2:"start"==e.y||"nearest"==e.y&&t<a.from?r.top:r.bottom-s,a=new Gp(n.lineAt(i-500,Rp.ByHeight,o,0,0).from,n.lineAt(i+s+500,Rp.ByHeight,o,0,0).to)}}return a}mapViewport(t,e){let i=e.mapPos(t.from,-1),n=e.mapPos(t.to,1);return new Gp(this.heightMap.lineAt(i,Rp.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(n,Rp.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){if(!this.inView)return!0;let{top:n}=this.heightMap.lineAt(t,Rp.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(e,Rp.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:r}=this;return(0==t||n<=s-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||o>=r+Math.max(10,Math.min(i,250)))&&n>s-2e3&&o<r+2e3}mapLineGaps(t,e){if(!t.length||e.empty)return t;let i=[];for(let n of t)e.touchesRange(n.from,n.to)||i.push(new Vp(e.mapPos(n.from),e.mapPos(n.to),n.size,n.displaySize));return i}ensureLineGaps(t,e){let i=this.heightOracle.lineWrapping,n=i?1e4:2e3,o=n>>1,s=n<<1;if(this.defaultTextDirection!=Cd.LTR&&!i)return[];let r=[],a=(n,s,l,c)=>{if(s-n<o)return;let h=this.state.selection.main,u=[h.from];h.empty||u.push(h.to);for(let t of u)if(t>n&&t<s)return a(n,t-10,l,c),void a(t+10,s,l,c);let d=function(t,e){for(let i of t)if(e(i))return i;return}(t,t=>t.from>=l.from&&t.to<=l.to&&Math.abs(t.from-n)<o&&Math.abs(t.to-s)<o&&!u.some(e=>t.from<e&&t.to>e));if(!d){if(s<l.to&&e&&i&&e.visibleRanges.some(t=>t.from<=s&&t.to>=s)){let t=e.moveToLineBoundary(Xc.cursor(s),!1,!0).head;t>n&&(s=t)}let t=this.gapSize(l,n,s,c);d=new Vp(n,s,t,i||t<2e6?t:2e6)}r.push(d)},l=e=>{if(e.length<s||e.type!=md.Text)return;let o=function(t,e,i){let n=[],o=t,s=0;Zh.spans(i,t,e,{span(){},point(t,e){t>o&&(n.push({from:o,to:t}),s+=t-o),o=e}},20),o<e&&(n.push({from:o,to:e}),s+=e-o);return{total:s,ranges:n}}(e.from,e.to,this.stateDeco);if(o.total<s)return;let r,l,c=this.scrollTarget?this.scrollTarget.range.head:null;if(i){let t,i,s=n/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=c){let n=Jp(o,c),r=((this.visibleBottom-this.visibleTop)/2+s)/e.height;t=n-r,i=n+r}else t=(this.visibleTop-e.top-s)/e.height,i=(this.visibleBottom-e.top+s)/e.height;r=Kp(o,t),l=Kp(o,i)}else{let i=o.total*this.heightOracle.charWidth,s=n*this.heightOracle.charWidth,a=0;if(i>2e6)for(let i of t)i.from>=e.from&&i.from<e.to&&i.size!=i.displaySize&&i.from*this.heightOracle.charWidth+a<this.pixelViewport.left&&(a=i.size-i.displaySize);let h,u,d=this.pixelViewport.left+a,f=this.pixelViewport.right+a;if(null!=c){let t=Jp(o,c),e=((f-d)/2+s)/i;h=t-e,u=t+e}else h=(d-s)/i,u=(f+s)/i;r=Kp(o,h),l=Kp(o,u)}r>e.from&&a(e.from,r,e,o),l<e.to&&a(l,e.to,e,o)};for(let t of this.viewportLines)Array.isArray(t.type)?t.type.forEach(l):l(t);return r}gapSize(t,e,i,n){let o=Jp(n,i)-Jp(n,e);return this.heightOracle.lineWrapping?t.height*o:n.total*this.heightOracle.charWidth*o}updateLineGaps(t){Vp.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=gd.set(t.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let i=[];Zh.spans(e,this.viewport.from,this.viewport.to,{span(t,e){i.push({from:t,to:e})},point(){}},20);let n=0;if(i.length!=this.visibleRanges.length)n=12;else for(let e=0;e<i.length&&!(8&n);e++){let o=this.visibleRanges[e],s=i[e];o.from==s.from&&o.to==s.to||(n|=4,t&&t.mapPos(o.from,-1)==s.from&&t.mapPos(o.to,1)==s.to||(n|=8))}return this.visibleRanges=i,n}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||im(this.heightMap.lineAt(t,Rp.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||im(this.heightMap.lineAt(this.scaler.fromDOM(t),Rp.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return im(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Gp{constructor(t,e){this.from=t,this.to=e}}function Kp({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let t=0;;t++){let{from:i,to:o}=e[t],s=o-i;if(n<=s)return i+n;n-=s}}function Jp(t,e){let i=0;for(let{from:n,to:o}of t.ranges){if(e<=o){i+=e-n;break}i+=o-n}return i/t.total}const tm={toDOM:t=>t,fromDOM:t=>t,scale:1,eq(t){return t==this}};class em{constructor(t,e,i){let n=0,o=0,s=0;this.viewports=i.map(({from:i,to:o})=>{let s=e.lineAt(i,Rp.ByPos,t,0,0).top,r=e.lineAt(o,Rp.ByPos,t,0,0).bottom;return n+=r-s,{from:i,to:o,top:s,bottom:r,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(e.height-n);for(let t of this.viewports)t.domTop=s+(t.top-o)*this.scale,s=t.domBottom=t.domTop+(t.bottom-t.top),o=t.bottom}toDOM(t){for(let e=0,i=0,n=0;;e++){let o=e<this.viewports.length?this.viewports[e]:null;if(!o||t<o.top)return n+(t-i)*this.scale;if(t<=o.bottom)return o.domTop+(t-o.top);i=o.bottom,n=o.domBottom}}fromDOM(t){for(let e=0,i=0,n=0;;e++){let o=e<this.viewports.length?this.viewports[e]:null;if(!o||t<o.domTop)return i+(t-n)/this.scale;if(t<=o.domBottom)return o.top+(t-o.domTop);i=o.bottom,n=o.domBottom}}eq(t){return t instanceof em&&(this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,i)=>e.from==t.viewports[i].from&&e.to==t.viewports[i].to))}}function im(t,e){if(1==e.scale)return t;let i=e.toDOM(t.top),n=e.toDOM(t.bottom);return new Dp(t.from,t.length,i,n-i,Array.isArray(t._content)?t._content.map(t=>im(t,e)):t._content)}const nm=Vc.define({combine:t=>t.join(" ")}),om=Vc.define({combine:t=>t.indexOf(!0)>-1}),sm=su.newName(),rm=su.newName(),am=su.newName(),lm={"&light":"."+rm,"&dark":"."+am};function cm(t,e,i){return new su(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,e=>{if("&"==e)return t;if(!i||!i[e])throw new RangeError(`Unsupported selector: ${e}`);return i[e]}):t+" "+e})}const hm=cm("."+sm,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lm),um={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},dm=ku.ie&&ku.ie_version<=11;class fm{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Nu,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let t of e)this.queue.push(t);(ku.ie&&ku.ie_version<=11||ku.ios&&t.composing)&&e.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!ku.android||!1===t.constructor.EDIT_CONTEXT||ku.chrome&&ku.chrome_version<126||(this.editContext=new gm(t),t.state.facet(uf)&&(t.contentDOM.editContext=this.editContext.editContext)),dm&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(uf)?i.root.activeElement!=this.dom:!Cu(this.dom,n))return;let o=n.anchorNode&&i.docView.nearest(n.anchorNode);o&&o.ignoreEvent(t)?e||(this.selectionChanged=!1):(ku.ie&&ku.ie_version<=11||ku.android&&ku.chrome)&&!i.state.selection.main.empty&&n.focusNode&&Eu(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=$u(t.root);if(!e)return!1;let i=ku.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return mm(t,i)}let i=null;function n(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),i?mm(t,i):null}(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let n=Cu(this.dom,i);return n&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&function(t,e){let i=e.focusNode,n=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=n)return!1;for(n=Math.min(n,Du(i));;)if(n){if(1!=i.nodeType)return!1;let t=i.childNodes[n-1];"false"==t.contentEditable?n--:(i=t,n=Du(i))}else{if(i==t)return!0;n=Au(i),i=i.parentNode}}(this.dom,i)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(i),n&&(this.selectionChanged=!0),!0)}setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,e=null;for(let i=this.dom;i;)if(1==i.nodeType)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==i?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(i),i=i.assignedSlot||i.parentNode;else{if(11!=i.nodeType)break;i=i.host}if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);for(let t of this.scrollTargets=e)t.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,um),dm&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),dm&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,e){var i;if(!this.delayedAndroidKey){let t=()=>{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&Wu(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(null===(i=this.delayedAndroidKey)||void 0===i?void 0:i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let o of t){let t=this.readMutation(o);t&&(t.typeOver&&(n=!0),-1==e?({from:e,to:i}=t):(e=Math.min(t.from,e),i=Math.max(t.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&Cu(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new Gf(this.view,t,e,i);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=Kf(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){let i=pm(e,t.previousSibling||t.target.previousSibling,-1),n=pm(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(uf)!=t.state.facet(uf)&&(t.view.contentDOM.editContext=t.state.facet(uf)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function pm(t,e,i){for(;e;){let n=Uu.get(e);if(n&&n.parent==t)return n;let o=e.parentNode;e=o!=t.dom?o:i>0?e.nextSibling:e.previousSibling}return null}function mm(t,e){let i=e.startContainer,n=e.startOffset,o=e.endContainer,s=e.endOffset,r=t.docView.domAtPos(t.state.selection.main.anchor);return Eu(r.node,r.offset,o,s)&&([i,n,o,s]=[o,s,i,n]),{anchorNode:i,anchorOffset:n,focusNode:o,focusOffset:s}}class gm{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let n=t.state.selection.main,{anchor:o,head:s}=n,r=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:r,drifted:!1});let l=a-r>i.text.length;r==this.from&&o<this.from?r=o:a==this.to&&o>this.to&&(a=o);let c=tp(t.state.sliceDoc(r,a),i.text,(l?n.from:n.to)-r,l?"end":null);if(!c){let e=Xc.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));return void(e.main.eq(n)||t.dispatch({selection:e,userEvent:"select"}))}let h={from:c.from+r,to:c.toA+r,insert:bc.of(i.text.slice(c.from,c.toB).split("\n"))};if((ku.mac||ku.android)&&h.from==s-1&&/^\. ?$/.test(i.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(h={from:r,to:a,insert:bc.of([i.text.replace("."," ")])}),this.pendingContextChange=h,!t.state.readOnly){let e=this.to-this.from+(h.to-h.from+h.insert.length);Jf(t,h,Xc.single(this.toEditorPos(i.selectionStart,e),this.toEditorPos(i.selectionEnd,e)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),h.from<h.to&&!h.insert.length&&t.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(e.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(e.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let n=[],o=null;for(let e=this.toEditorPos(i.rangeStart),s=this.toEditorPos(i.rangeEnd);e<s;e++){let i=t.coordsForChar(e);o=i&&new DOMRect(i.left,i.top,i.right-i.left,i.bottom-i.top)||o||new DOMRect,n.push(o)}e.updateCharacterBounds(i.rangeStart,n)},this.handlers.textformatupdate=e=>{let i=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,n=t.underlineThickness;if(!/none/i.test(e)&&!/none/i.test(n)){let o=this.toEditorPos(t.rangeStart),s=this.toEditorPos(t.rangeEnd);if(o<s){let t=`text-decoration: underline ${/^[a-z]/.test(e)?e+" ":"Dashed"==e?"dashed ":"Squiggle"==e?"wavy ":""}${/thin/i.test(n)?1:2}px`;i.push(gd.mark({attributes:{style:t}}).range(o,s))}}}t.dispatch({effects:cf.of(gd.set(i))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:e}=this.composing;this.composing=null,e&&this.reset(t.state)}};for(let t in this.handlers)e.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=$u(t.root);e&&e.rangeCount&&this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,n=this.pendingContextChange;return t.changes.iterChanges((o,s,r,a,l)=>{if(i)return;let c=l.length-(s-o);if(n&&s>=n.to){if(n.from==o&&n.to==s&&n.insert.eq(l))return n=this.pendingContextChange=null,e+=c,void(this.to+=c);n=null,this.revertPending(t.state)}if(o+=e,(s+=e)<=this.from)this.from+=c,this.to+=c;else if(o<this.to){if(o<this.from||s>this.to||this.to-this.from+l.length>3e4)return void(i=!0);this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),l.toString()),this.to+=c}e+=c}),n&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(t=>!t.isUserEvent("input.type")&&t.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),n=this.toContextPos(e.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==n||this.editContext.updateSelection(i,n)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>3e4)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class vm{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(t=>t.forEach(t=>i(t,this)))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new Up(t.state||Ih.create(t)),t.scrollTo&&t.scrollTo.is(lf)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ff).map(t=>new mf(t));for(let t of this.plugins)t.update(this);this.observer=new fm(this),this.inputState=new ep(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Cf(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let e=1==t.length&&t[0]instanceof kh?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,i=!1,n=!1,o=this.state;for(let e of t){if(e.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=e.state}if(this.destroyed)return void(this.viewState.state=o);let s=this.hasFocus,r=0,a=null;t.some(t=>t.annotation(kp))?(this.inputState.notifiedFocused=s,r=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,a=$p(o,s),a||(r=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(Ih.phrases)!=this.state.facet(Ih.phrases))return this.setState(o);e=Tf.create(this,o,t),e.flags|=r;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(h&&(h=h.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection;h=new af(t.empty?t:Xc.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)t.is(lf)&&(h=t.value.clip(this.state))}this.viewState.update(e,h),this.bidiCache=bm.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(kf)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some(t=>t.isUserEvent("select.pointer")))}finally{this.updateState=0}if(e.startState.facet(nm)!=e.state.facet(nm)&&(this.viewState.mustMeasureContent=!0),(i||n||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!e.empty)for(let t of this.state.facet(Kd))try{t(e)}catch(t){hf(this.state,t,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Kf(this,c)&&l.force&&Wu(this.contentDOM,l.key,l.keyCode)})}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new Up(t),this.plugins=t.facet(ff).map(t=>new mf(t)),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new Cf(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(ff),i=t.state.facet(ff);if(e!=i){let n=[];for(let o of i){let i=e.indexOf(o);if(i<0)n.push(new mf(o));else{let e=this.plugins[i];e.mustUpdate=t,n.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t<this.plugins.length;t++)this.plugins[t].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let e=t.value;if(e&&e.docViewUpdate)try{e.docViewUpdate(this)}catch(t){hf(this.state,t,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(s<0)if(Xu(i))o=-1,s=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(n);o=t.from,s=t.top}this.updateState=1;let r=this.viewState.measure(this);if(!r&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&r||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map(t=>{try{return t.read(this)}catch(t){return hf(this.state,t),Om}}),c=Tf.create(this,this.state,[]),h=!1;c.flags|=r,e?e.flags|=r:e=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),h=this.docView.update(c),h&&this.docViewUpdate());for(let t=0;t<a.length;t++)if(l[t]!=Om)try{let e=a[t];e.write&&e.write(l[t],this)}catch(t){hf(this.state,t)}if(h&&this.docView.updateSelection(!0),!c.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}{let t=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-s;if(t>1||t<-1){n+=t,i.scrollTop=n/this.scaleY,s=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(Kd))t(e)}get themeClasses(){return sm+" "+(this.state.facet(om)?am:rm)+" "+this.state.facet(nm)}updateAttrs(){let t=xm(this,gf,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(uf)?"true":"false",class:"cm-content",style:`${ku.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),xm(this,vf,e);let i=this.observer.ignore(()=>{let i=dd(this.contentDOM,this.contentAttrs,e),n=dd(this.dom,this.editorAttrs,t);return i||n});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let t of i.effects)if(t.is(vm.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(kf);let t=this.state.facet(vm.cspNonce);su.mount(this.root,this.styleModules.concat(hm).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key)return void(this.measureRequests[e]=t);this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(void 0===e||e&&e.plugin!=t)&&this.pluginMap.set(t,e=this.plugins.find(e=>e.plugin==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return Xf(this,t,Zf(this,t,e,i))}moveByGroup(t,e){return Xf(this,t,Zf(this,t,e,e=>function(t,e,i){let n=t.state.charCategorizer(e),o=n(i);return t=>{let e=n(t);return o==Mh.Space&&(o=e),o==e}}(this,t.head,e)))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),o=i[e?i.length-1:0];return Xc.cursor(o.side(e,n)+t.from,o.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return function(t,e,i,n){let o=Bf(t,e.head,e.assoc||-1),s=n&&o.type==md.Text&&(t.lineWrapping||o.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head):null;if(s){let e=t.dom.getBoundingClientRect(),n=t.textDirectionAt(o.from),r=t.posAtCoords({x:i==(n==Cd.LTR)?e.right-1:e.left+1,y:(s.top+s.bottom)/2});if(null!=r)return Xc.cursor(r,i?-1:1)}return Xc.cursor(i?o.to:o.from,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return Xf(this,t,function(t,e,i,n){let o=e.head,s=i?1:-1;if(o==(i?t.state.doc.length:0))return Xc.cursor(o,e.assoc);let r,a=e.goalColumn,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(o,e.assoc||-1),h=t.documentTop;if(c)null==a&&(a=c.left-l.left),r=s<0?c.top:c.bottom;else{let e=t.viewState.lineBlockAt(o);null==a&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(o-e.from))),r=(s<0?e.top:e.bottom)+h}let u=l.left+a,d=null!=n?n:t.viewState.heightOracle.textHeight>>1;for(let e=0;;e+=10){let i=r+(d+e)*s,n=Nf(t,{x:u,y:i},!1,s);if(i<l.top||i>l.bottom||(s<0?n<o:n>o)){let e=t.docView.coordsForChar(n),o=!e||i<e.top?-1:1;return Xc.cursor(n,o,void 0,a)}}}(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Nf(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(t),o=this.bidiSpans(n);return Ru(i,o[Nd.find(o,t-n.from,-1,e)].dir==Cd.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(of)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>ym)return Fd(t.length);let e,i=this.textDirectionAt(t.from);for(let n of this.bidiCache)if(n.from==t.from&&n.dir==i&&(n.fresh||jd(n.isolates,e=wf(this,t))))return n.order;e||(e=wf(this,t));let n=Wd(t.text,i,e);return this.bidiCache.push(new bm(t.from,t.to,i,e,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||ku.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Bu(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return lf.of(new af("number"==typeof t?Xc.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return lf.of(new af(Xc.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return pf.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return pf.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=su.newName(),n=[nm.of(i),kf.of(cm(`.${i}`,t))];return e&&e.dark&&n.push(om.of(!0)),n}static baseTheme(t){return ah.lowest(kf.of(cm("."+sm,t,lm)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&Uu.get(i)||Uu.get(t);return(null===(e=null==n?void 0:n.rootView)||void 0===e?void 0:e.view)||null}}vm.styleModule=kf,vm.inputHandler=Jd,vm.clipboardInputFilter=ef,vm.clipboardOutputFilter=nf,vm.scrollHandler=rf,vm.focusChangeEffect=tf,vm.perLineTextDirection=of,vm.exceptionSink=Gd,vm.updateListener=Kd,vm.editable=uf,vm.mouseSelectionStyle=Ud,vm.dragMovesSelection=Yd,vm.clickAddsSelectionRange=Vd,vm.decorations=yf,vm.outerDecorations=Of,vm.atomicRanges=bf,vm.bidiIsolatedRanges=xf,vm.scrollMargins=_f,vm.darkTheme=om,vm.cspNonce=Vc.define({combine:t=>t.length?t[0]:""}),vm.contentAttributes=vf,vm.editorAttributes=gf,vm.lineWrapping=vm.contentAttributes.of({class:"cm-lineWrapping"}),vm.announce=Sh.define();const ym=4096,Om={};class bm{constructor(t,e,i,n,o,s){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=o,this.order=s}static update(t,e){if(e.empty&&!t.some(t=>t.fresh))return t;let i=[],n=t.length?t[t.length-1].dir:Cd.LTR;for(let o=Math.max(0,t.length-10);o<t.length;o++){let s=t[o];s.dir!=n||e.touchesRange(s.from,s.to)||i.push(new bm(e.mapPos(s.from,1),e.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return i}}function xm(t,e,i){for(let n=t.state.facet(e),o=n.length-1;o>=0;o--){let e=n[o],s="function"==typeof e?e(t):e;s&&cd(s,i)}return i}const wm=ku.mac?"mac":ku.windows?"win":ku.linux?"linux":"key";function _m(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}const Sm=ah.default(vm.domEventHandlers({keydown:(t,e)=>Am(Tm(e.state),t,e,"editor")})),km=Vc.define({enables:Sm}),$m=new WeakMap;function Tm(t){let e=t.facet(km),i=$m.get(e);return i||$m.set(e,i=function(t,e=wm){let i=Object.create(null),n=Object.create(null),o=(t,e)=>{let i=n[t];if(null==i)n[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},s=(t,n,s,r,a)=>{var l,c;let h=i[t]||(i[t]=Object.create(null)),u=n.split(/ (?!$)/).map(t=>function(t,e){const i=t.split(/-(?!$)/);let n,o,s,r,a=i[i.length-1];"Space"==a&&(a=" ");for(let t=0;t<i.length-1;++t){const a=i[t];if(/^(cmd|meta|m)$/i.test(a))r=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))s=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==e?r=!0:o=!0}}return n&&(a="Alt-"+a),o&&(a="Ctrl-"+a),r&&(a="Meta-"+a),s&&(a="Shift-"+a),a}(t,e));for(let e=1;e<u.length;e++){let i=u.slice(0,e).join(" ");o(i,!0),h[i]||(h[i]={preventDefault:!0,stopPropagation:!1,run:[e=>{let n=Cm={view:e,prefix:i,scope:t};return setTimeout(()=>{Cm==n&&(Cm=null)},Pm),!0}]})}let d=u.join(" ");o(d,!1);let f=h[d]||(h[d]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=h._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});s&&f.run.push(s),r&&(f.preventDefault=!0),a&&(f.stopPropagation=!0)};for(let n of t){let t=n.scope?n.scope.split(" "):["editor"];if(n.any)for(let e of t){let t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:o}=n;for(let e in t)t[e].run.push(t=>o(t,Em))}let o=n[e]||n.key;if(o)for(let e of t)s(e,o,n.run,n.preventDefault,n.stopPropagation),n.shift&&s(e,"Shift-"+o,n.shift,n.preventDefault,n.stopPropagation)}return i}(e.reduce((t,e)=>t.concat(e),[]))),i}let Cm=null;const Pm=4e3;let Em=null;function Am(t,e,i,n){Em=e;let o=function(t){var e=!(hu&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||uu&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?cu:lu)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),s=Qc(Ac(o,0))==o.length&&" "!=o,r="",a=!1,l=!1,c=!1;Cm&&Cm.view==i&&Cm.scope==n&&(r=Cm.prefix+" ",rp.indexOf(e.keyCode)<0&&(l=!0,Cm=null));let h,u,d=new Set,f=t=>{if(t){for(let e of t.run)if(!d.has(e)&&(d.add(e),e(i)))return t.stopPropagation&&(c=!0),!0;t.preventDefault&&(t.stopPropagation&&(c=!0),l=!0)}return!1},p=t[n];return p&&(f(p[r+_m(o,e,!s)])?a=!0:!s||!(e.altKey||e.metaKey||e.ctrlKey)||ku.windows&&e.ctrlKey&&e.altKey||ku.mac&&e.altKey&&!e.ctrlKey&&!e.metaKey||!(h=lu[e.keyCode])||h==o?s&&e.shiftKey&&f(p[r+_m(o,e,!0)])&&(a=!0):(f(p[r+_m(h,e,!0)])||e.shiftKey&&(u=cu[e.keyCode])!=o&&u!=h&&f(p[r+_m(u,e,!1)]))&&(a=!0),!a&&f(p._any)&&(a=!0)),l&&(a=!0),a&&c&&e.stopPropagation(),Em=null,a}class Mm{constructor(t,e,i,n,o){this.className=t,this.left=e,this.top=i,this.width=n,this.height=o}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let o=Qm(t);return[new Mm(e,n.left-o.left,n.top-o.top,null,n.bottom-n.top)]}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),o=Math.min(i.to,t.viewport.to),s=t.textDirection==Cd.LTR,r=t.contentDOM,a=r.getBoundingClientRect(),l=Qm(t),c=r.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),u=a.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),d=a.right-(h?parseInt(h.paddingRight):0),f=Bf(t,n,1),p=Bf(t,o,-1),m=f.type==md.Text?f:null,g=p.type==md.Text?p:null;m&&(t.lineWrapping||f.widgetLineBreaks)&&(m=Dm(t,n,1,m));g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=Dm(t,o,-1,g));if(m&&g&&m.from==g.from&&m.to==g.to)return y(O(i.from,i.to,m));{let e=m?O(i.from,null,m):b(f,!1),n=g?O(null,i.to,g):b(p,!0),o=[];return(m||f).to<(g||p).from-(m&&g?1:0)||f.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2<n.top?o.push(v(u,e.bottom,d,n.top)):e.bottom<n.top&&t.elementAtHeight((e.bottom+n.top)/2).type==md.Text&&(e.bottom=n.top=(e.bottom+n.top)/2),y(e).concat(o).concat(y(n))}function v(t,i,n,o){return new Mm(e,t-l.left,i-l.top,n-t,o-i)}function y({top:t,bottom:e,horizontal:i}){let n=[];for(let o=0;o<i.length;o+=2)n.push(v(i[o],t,i[o+1],e));return n}function O(e,i,n){let o=1e9,r=-1e9,a=[];function l(e,i,l,c,h){let f=t.coordsAtPos(e,e==n.to?-2:2),p=t.coordsAtPos(l,l==n.from?2:-2);f&&p&&(o=Math.min(f.top,p.top,o),r=Math.max(f.bottom,p.bottom,r),h==Cd.LTR?a.push(s&&i?u:f.left,s&&c?d:p.right):a.push(!s&&c?u:p.left,!s&&i?d:f.right))}let c=null!=e?e:n.from,h=null!=i?i:n.to;for(let n of t.visibleRanges)if(n.to>c&&n.from<h)for(let o=Math.max(n.from,c),s=Math.min(n.to,h);;){let n=t.state.doc.lineAt(o);for(let r of t.bidiSpans(n)){let t=r.from+n.from,a=r.to+n.from;if(t>=s)break;a>o&&l(Math.max(t,o),null==e&&t<=c,Math.min(a,s),null==i&&a>=h,r.dir)}if(o=n.to+1,o>=s)break}return 0==a.length&&l(c,null==e,h,null==i,t.textDirection),{top:o,bottom:r,horizontal:a}}function b(t,e){let i=a.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}(t,e,i)}}function Qm(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Cd.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Dm(t,e,i,n){let o=t.coordsAtPos(e,2*i);if(!o)return n;let s=t.dom.getBoundingClientRect(),r=(o.top+o.bottom)/2,a=t.posAtCoords({x:s.left+1,y:r}),l=t.posAtCoords({x:s.right-1,y:r});return null==a||null==l?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}class Rm{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(Im)!=t.state.facet(Im)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(Im);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:e}=this.view;t==this.scaleX&&e==this.scaleY||(this.scaleX=t,this.scaleY=e,this.dom.style.transform=`scale(${1/t}, ${1/e})`)}draw(t){if(t.length!=this.drawn.length||t.some((t,e)=>{return i=t,n=this.drawn[e],!(i.constructor==n.constructor&&i.eq(n));var i,n})){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t,ku.safari&&ku.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Im=Vc.define();function Lm(t){return[pf.define(e=>new Rm(e,t)),Im.of(t)]}const Nm=Vc.define({combine:t=>Lh(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function jm(t={}){return[Nm.of(t),Bm,Wm,Fm,sf.of(!0)]}function zm(t){return t.startState.facet(Nm)!=t.state.facet(Nm)}const Bm=Lm({above:!0,markers(t){let{state:e}=t,i=e.facet(Nm),n=[];for(let o of e.selection.ranges){let s=o==e.selection.main;if(o.empty||i.drawRangeCursor){let e=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=o.empty?o:Xc.cursor(o.head,o.head>o.anchor?-1:1);for(let o of Mm.forRange(t,e,i))n.push(o)}}return n},update(t,e){t.transactions.some(t=>t.selection)&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let i=zm(t);return i&&Zm(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){Zm(e.state,t)},class:"cm-cursorLayer"});function Zm(t,e){e.style.animationDuration=t.facet(Nm).cursorBlinkRate+"ms"}const Wm=Lm({above:!1,markers:t=>t.state.selection.ranges.map(e=>e.empty?[]:Mm.forRange(t,"cm-selectionBackground",e)).reduce((t,e)=>t.concat(e)),update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||zm(t),class:"cm-selectionLayer"}),Fm=ah.highest(vm.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Xm=Sh.define({map:(t,e)=>null==t?null:e.mapPos(t)}),qm=eh.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce((t,e)=>e.is(Xm)?e.value:t,t))}),Hm=pf.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(qm);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(qm)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(qm),i=null!=e&&t.coordsAtPos(e);if(!i)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(qm)!=t&&this.view.dispatch({effects:Xm.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Vm(t,e,i,n,o){e.lastIndex=0;for(let s,r=t.iterRange(i,n),a=i;!r.next().done;a+=r.value.length)if(!r.lineBreak)for(;s=e.exec(r.value);)o(a+s.index,s)}class Ym{constructor(t){const{regexp:e,decoration:i,decorate:n,boundary:o,maxLength:s=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,n)this.addMatch=(t,e,i,o)=>n(o,i,i+t[0].length,t,e);else if("function"==typeof i)this.addMatch=(t,e,n,o)=>{let s=i(t,e,n);s&&o(n,n+t[0].length,s)};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,n,o)=>o(n,n+t[0].length,i)}this.boundary=o,this.maxLength=s}createDeco(t){let e=new Wh,i=e.add.bind(e);for(let{from:e,to:n}of function(t,e){let i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let n=[];for(let{from:o,to:s}of i)o=Math.max(t.state.doc.lineAt(o).from,o-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=o?n[n.length-1].to=s:n.push({from:o,to:s});return n}(t,this.maxLength))Vm(t.state.doc,this.regexp,e,n,(e,n)=>this.addMatch(n,t,e,i));return e.finish()}updateDeco(t,e){let i=1e9,n=-1;return t.docChanged&&t.changes.iterChanges((e,o,s,r)=>{r>=t.view.viewport.from&&s<=t.view.viewport.to&&(i=Math.min(s,i),n=Math.max(r,n))}),t.viewportMoved||n-i>1e3?this.createDeco(t.view):n>-1?this.updateRange(t.view,e.map(t.changes),i,n):e}updateRange(t,e,i,n){for(let o of t.visibleRanges){let s=Math.max(o.from,i),r=Math.min(o.to,n);if(r>=s){let i=t.state.doc.lineAt(s),n=i.to<r?t.state.doc.lineAt(r):i,a=Math.max(o.from,i.from),l=Math.min(o.to,n.to);if(this.boundary){for(;s>i.from;s--)if(this.boundary.test(i.text[s-1-i.from])){a=s;break}for(;r<n.to;r++)if(this.boundary.test(n.text[r-n.from])){l=r;break}}let c,h=[],u=(t,e,i)=>h.push(i.range(t,e));if(i==n)for(this.regexp.lastIndex=a-i.from;(c=this.regexp.exec(i.text))&&c.index<l-i.from;)this.addMatch(c,t,c.index+i.from,u);else Vm(t.state.doc,this.regexp,a,l,(e,i)=>this.addMatch(i,t,e,u));e=e.update({filterFrom:a,filterTo:l,filter:(t,e)=>t<a||e>l,add:h})}}return e}}const Um=null!=/x/.unicode?"gu":"g",Gm=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",Um),Km={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Jm=null;const tg=Vc.define({combine(t){let e=Lh(t,{render:null,specialChars:Gm,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==Jm&&"undefined"!=typeof document&&document.body){let e=document.body.style;Jm=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return Jm||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,Um)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Um)),e}});function eg(t={}){return[tg.of(t),ig||(ig=pf.fromClass(class{constructor(t){this.view=t,this.decorations=gd.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(tg)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Ym({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:o}=i.state,s=Ac(e[0],0);if(9==s){let t=o.lineAt(n),e=i.state.tabSize,s=tu(t.text,e,n-t.from);return gd.replace({widget:new og((e-s%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=gd.replace({widget:new ng(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(tg);t.startState.facet(tg)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}let ig=null;class ng extends pd{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),i=t.state.phrase("Control character")+" "+(Km[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,e);if(n)return n;let o=document.createElement("span");return o.textContent=e,o.title=i,o.setAttribute("aria-label",i),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class og extends pd{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const sg=gd.line({class:"cm-activeLine"}),rg=pf.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let n of t.state.selection.ranges){let o=t.lineBlockAt(n.head);o.from>e&&(i.push(sg.range(o.from)),e=o.from)}return gd.set(i)}},{decorations:t=>t.decorations});const ag=2e3;function lg(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(i),o=i-n.from,s=o>ag?-1:o==n.length?function(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):tu(n.text,t.state.tabSize,i-n.from);return{line:n.number,col:s,off:o}}function cg(t,e){let i=lg(t,e),n=t.state.selection;return i?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(i.line).from),o=t.state.doc.lineAt(e);i={line:o.number,col:i.col,off:Math.min(i.off,o.length)},n=n.map(t.changes)}},get(e,o,s){let r=lg(t,e);if(!r)return n;let a=function(t,e,i){let n=Math.min(e.line,i.line),o=Math.max(e.line,i.line),s=[];if(e.off>ag||i.off>ag||e.col<0||i.col<0){let r=Math.min(e.off,i.off),a=Math.max(e.off,i.off);for(let e=n;e<=o;e++){let i=t.doc.line(e);i.length<=a&&s.push(Xc.range(i.from+r,i.to+a))}}else{let r=Math.min(e.col,i.col),a=Math.max(e.col,i.col);for(let e=n;e<=o;e++){let i=t.doc.line(e),n=eu(i.text,r,t.tabSize,!0);if(n<0)s.push(Xc.cursor(i.to));else{let e=eu(i.text,a,t.tabSize);s.push(Xc.range(i.from+n,i.from+e))}}}return s}(t.state,i,r);return a.length?s?Xc.create(a.concat(n.ranges)):Xc.create(a):n}}:null}function hg(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return vm.mouseSelectionStyle.of((t,i)=>e(i)?cg(t,i):null)}const ug={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},dg={style:"cursor: crosshair"};function fg(t={}){let[e,i]=ug[t.key||"Alt"],n=pf.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventObservers:{keydown(t){this.set(t.keyCode==e||i(t))},keyup(t){t.keyCode!=e&&i(t)||this.set(!1)},mousemove(t){this.set(i(t))}}});return[n,vm.contentAttributes.of(t=>{var e;return(null===(e=t.plugin(n))||void 0===e?void 0:e.isDown)?dg:null})]}const pg="-10000px";class mg{constructor(t,e,i,n){this.facet=e,this.createTooltipView=i,this.removeTooltipView=n,this.input=t.state.facet(e),this.tooltips=this.input.filter(t=>t);let o=null;this.tooltipViews=this.tooltips.map(t=>o=i(t,o))}update(t,e){var i;let n=t.state.facet(this.facet),o=n.filter(t=>t);if(n===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let s=[],r=e?[]:null;for(let i=0;i<o.length;i++){let n=o[i],a=-1;if(n){for(let t=0;t<this.tooltips.length;t++){let e=this.tooltips[t];e&&e.create==n.create&&(a=t)}if(a<0)s[i]=this.createTooltipView(n,i?s[i-1]:null),r&&(r[i]=!!n.above);else{let n=s[i]=this.tooltipViews[a];r&&(r[i]=e[a]),n.update&&n.update(t)}}}for(let t of this.tooltipViews)s.indexOf(t)<0&&(this.removeTooltipView(t),null===(i=t.destroy)||void 0===i||i.call(t));return e&&(r.forEach((t,i)=>e[i]=t),e.length=r.length),this.input=n,this.tooltips=o,this.tooltipViews=s,!0}}function gg(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const vg=Vc.define({combine:t=>{var e,i,n;return{position:ku.ios?"absolute":(null===(e=t.find(t=>t.position))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(t=>t.parent))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=t.find(t=>t.tooltipSpace))||void 0===n?void 0:n.tooltipSpace)||gg}}}),yg=new WeakMap,Og=pf.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(vg);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new mg(t,_g,(t,e)=>this.createTooltip(t,e),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(vg);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),n=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",i.dom.appendChild(t)}return i.dom.style.position=this.position,i.dom.style.top=pg,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(ku.gecko)i=t.offsetParent!=this.container.ownerDocument.body;else if(t.style.top==pg&&"0px"==t.style.left){let e=t.getBoundingClientRect();i=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(i||"absolute"==this.position)if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),o=Sf(this.view);return{visible:{left:n.left+o.left,top:n.top+o.top,right:n.right-o.right,bottom:n.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)}),size:this.manager.tooltipViews.map(({dom:t})=>t.getBoundingClientRect()),space:this.view.state.facet(vg).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{visible:i,space:n,scaleX:o,scaleY:s}=t,r=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:h}=c,u=t.pos[a],d=t.size[a];if(!u||!1!==l.clip&&(u.bottom<=Math.max(i.top,n.top)||u.top>=Math.min(i.bottom,n.bottom)||u.right<Math.max(i.left,n.left)-.1||u.left>Math.min(i.right,n.right)+.1)){h.style.top=pg;continue}let f=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=f?7:0,m=d.right-d.left,g=null!==(e=yg.get(c))&&void 0!==e?e:d.bottom-d.top,v=c.offset||wg,y=this.view.textDirection==Cd.LTR,O=d.width>n.right-n.left?y?n.left:n.right-d.width:y?Math.max(n.left,Math.min(u.left-(f?14:0)+v.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-v.x),n.right-m),b=this.above[a];!l.strictSide&&(b?u.top-g-p-v.y<n.top:u.bottom+g+p+v.y>n.bottom)&&b==n.bottom-u.bottom>u.top-n.top&&(b=this.above[a]=!b);let x=(b?u.top-n.top:n.bottom-u.bottom)-p;if(x<g&&!1!==c.resize){if(x<this.view.defaultLineHeight){h.style.top=pg;continue}yg.set(c,g),h.style.height=(g=x)/s+"px"}else h.style.height&&(h.style.height="");let w=b?u.top-g-p-v.y:u.bottom+p+v.y,_=O+m;if(!0!==c.overlap)for(let t of r)t.left<_&&t.right>O&&t.top<w+g&&t.bottom>w&&(w=b?t.top-g-2-p:t.bottom+p+2);if("absolute"==this.position?(h.style.top=(w-t.parent.top)/s+"px",bg(h,(O-t.parent.left)/o)):(h.style.top=w/s+"px",bg(h,O/o)),f){let t=u.left+(y?v.x:-v.x)-(O+14-7);f.style.left=t/o+"px"}!0!==c.overlap&&r.push({left:O,top:w,right:_,bottom:w+g}),h.classList.toggle("cm-tooltip-above",b),h.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=pg}},{eventObservers:{scroll(){this.maybeMeasure()}}});function bg(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const xg=vm.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),wg={x:0,y:0},_g=Vc.define({enables:[Og,xg]}),Sg=Vc.define({combine:t=>t.reduce((t,e)=>t.concat(e),[])});class kg{static create(t){return new kg(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new mg(t,Sg,(t,e)=>this.createHostedView(t,e),t=>t.dom.remove())}createHostedView(t,e){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(t){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)null===(t=e.destroy)||void 0===t||t.call(e)}passProp(t){let e;for(let i of this.manager.tooltipViews){let n=i[t];if(void 0!==n)if(void 0===e)e=n;else if(e!==n)return}return e}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const $g=_g.compute([Sg],t=>{let e=t.facet(Sg);return 0===e.length?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var e;return null!==(e=t.end)&&void 0!==e?e:t.pos})),create:kg.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class Tg{constructor(t,e,i,n,o){this.view=t,this.source=e,this.field=i,this.setHover=n,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:e}=this,i=t.docView.nearest(e.target);if(!i)return;let n,o=1;if(i instanceof nd)n=i.posAtStart;else{if(n=t.posAtCoords(e),null==n)return;let i=t.coordsAtPos(n);if(!i||e.y<i.top||e.y>i.bottom||e.x<i.left-t.defaultCharacterWidth||e.x>i.right+t.defaultCharacterWidth)return;let s=t.bidiSpans(t.state.doc.lineAt(n)).find(t=>t.from<=n&&t.to>=n),r=s&&s.dir==Cd.RTL?-1:1;o=e.x<i.left?-r:r}let s=this.source(t,n,o);if(null==s?void 0:s.then){let e=this.pending={pos:n};s.then(i=>{this.pending==e&&(this.pending=null,!i||Array.isArray(i)&&!i.length||t.dispatch({effects:this.setHover.of(Array.isArray(i)?i:[i])}))},e=>hf(t.state,e,"hover tooltip"))}else!s||Array.isArray(s)&&!s.length||t.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let t=this.view.plugin(Og),e=t?t.manager.tooltips.findIndex(t=>t.create==kg.create):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:o}=this;if(n.length&&o&&!function(t,e){let i,{left:n,right:o,top:s,bottom:r}=t.getBoundingClientRect();if(i=t.querySelector(".cm-tooltip-arrow")){let t=i.getBoundingClientRect();s=Math.min(t.top,s),r=Math.max(t.bottom,r)}return e.clientX>=n-Cg&&e.clientX<=o+Cg&&e.clientY>=s-Cg&&e.clientY<=r+Cg}(o.dom,t)||this.pending){let{pos:o}=n[0]||this.pending,s=null!==(i=null===(e=n[0])||void 0===e?void 0:e.end)&&void 0!==i?i:o;(o==s?this.view.posAtCoords(this.lastMove)==o:function(t,e,i,n,o){let s=t.scrollDOM.getBoundingClientRect(),r=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>n||s.right<n||s.top>o||Math.min(s.bottom,r)<o)return!1;let a=t.posAtCoords({x:n,y:o},!1);return a>=e&&a<=i}(this.view,o,s,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:e}=this;if(e.length){let{tooltip:e}=this;e&&e.dom.contains(t.relatedTarget)?this.watchTooltipLeave(e.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let e=i=>{t.removeEventListener("mouseleave",e),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Cg=4;function Pg(t,e={}){let i=Sh.define(),n=eh.define({create:()=>[],update(t,n){if(t.length&&(e.hideOnChange&&(n.docChanged||n.selection)?t=[]:e.hideOn&&(t=t.filter(t=>!e.hideOn(n,t))),n.docChanged)){let e=[];for(let i of t){let t=n.changes.mapPos(i.pos,-1,Rc.TrackDel);if(null!=t){let o=Object.assign(Object.create(null),i);o.pos=t,null!=o.end&&(o.end=n.changes.mapPos(o.end)),e.push(o)}}t=e}for(let e of n.effects)e.is(i)&&(t=e.value),e.is(Ag)&&(t=[]);return t},provide:t=>Sg.from(t)});return{active:n,extension:[n,pf.define(o=>new Tg(o,t,n,i,e.hoverTime||300)),$g]}}function Eg(t,e){let i=t.plugin(Og);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}const Ag=Sh.define();const Mg=Vc.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}});function Qg(t,e){let i=t.plugin(Dg),n=i?i.specs.indexOf(e):-1;return n>-1?i.panels[n]:null}const Dg=pf.fromClass(class{constructor(t){this.input=t.state.facet(Lg),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(e=>e(t));let e=t.state.facet(Mg);this.top=new Rg(t,!0,e.topContainer),this.bottom=new Rg(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(Mg);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Rg(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Rg(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(Lg);if(i!=this.input){let e=i.filter(t=>t),n=[],o=[],s=[],r=[];for(let i of e){let e,a=this.specs.indexOf(i);a<0?(e=i(t.view),r.push(e)):(e=this.panels[a],e.update&&e.update(t)),n.push(e),(e.top?o:s).push(e)}this.specs=e,this.panels=n,this.top.sync(o),this.bottom.sync(s);for(let t of r)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>vm.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class Rg{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Ig(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Ig(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Ig(t){let e=t.nextSibling;return t.remove(),e}const Lg=Vc.define({enables:Dg});class Ng extends Nh{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Ng.prototype.elementClass="",Ng.prototype.toDOM=void 0,Ng.prototype.mapMode=Rc.TrackBefore,Ng.prototype.startSide=Ng.prototype.endSide=-1,Ng.prototype.point=!0;const jg=Vc.define(),zg=Vc.define(),Bg={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Zh.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Zg=Vc.define();function Wg(t){return[Xg(),Zg.of({...Bg,...t})]}const Fg=Vc.define({combine:t=>t.some(t=>t)});function Xg(t){let e=[qg];return t&&!1===t.fixed&&e.push(Fg.of(!0)),e}const qg=pf.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Zg).map(e=>new Ug(t,e)),this.fixed=!t.state.facet(Fg);for(let t of this.gutters)"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}if(t.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(Fg)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let i=Zh.iter(this.view.state.facet(jg),this.view.viewport.from),n=[],o=this.gutters.map(t=>new Yg(t,this.view.viewport,-this.view.documentPadding.top));for(let t of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(t.type)){let e=!0;for(let s of t.type)if(s.type==md.Text&&e){Vg(i,n,s.from);for(let t of o)t.line(this.view,s,n);e=!1}else if(s.widget)for(let t of o)t.widget(this.view,s)}else if(t.type==md.Text){Vg(i,n,t.from);for(let e of o)e.line(this.view,t,n)}else if(t.widget)for(let e of o)e.widget(this.view,t);for(let t of o)t.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Zg),i=t.state.facet(Zg),n=t.docChanged||t.heightChanged||t.viewportChanged||!Zh.eq(t.startState.facet(jg),t.state.facet(jg),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let e of this.gutters)e.update(t)&&(n=!0);else{n=!0;let o=[];for(let n of i){let i=e.indexOf(n);i<0?o.push(new Ug(this.view,n)):(this.gutters[i].update(t),o.push(this.gutters[i]))}for(let t of this.gutters)t.dom.remove(),o.indexOf(t)<0&&t.destroy();for(let t of o)"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.gutters=o}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>vm.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||0==i.gutters.length||!i.fixed)return null;let n=i.dom.offsetWidth*e.scaleX,o=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Cd.LTR?{left:n,right:o}:{right:n,left:o}})});function Hg(t){return Array.isArray(t)?t:[t]}function Vg(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class Yg{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Zh.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:n}=this,o=(e.top-this.height)/t.scaleY,s=e.height/t.scaleY;if(this.i==n.elements.length){let e=new Gg(t,s,o,i);n.elements.push(e),n.dom.appendChild(e.dom)}else n.elements[this.i].update(t,s,o,i);this.height=e.bottom,this.i++}line(t,e,i){let n=[];Vg(this.cursor,n,e.from),i.length&&(n=n.concat(i));let o=this.gutter.config.lineMarker(t,e,n);o&&n.unshift(o);let s=this.gutter;(0!=n.length||s.config.renderEmptyElements)&&this.addElement(t,e,n)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e),n=i?[i]:null;for(let i of t.state.facet(zg)){let o=i(t,e.widget,e);o&&(n||(n=[])).push(o)}n&&this.addElement(t,e,n)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Ug{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in e.domEventHandlers)this.dom.addEventListener(i,n=>{let o,s=n.target;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let t=s.getBoundingClientRect();o=(t.top+t.bottom)/2}else o=n.clientY;let r=t.lineBlockAtHeight(o-t.documentTop);e.domEventHandlers[i](t,r,n)&&n.preventDefault()});this.markers=Hg(e.markers(t)),e.initialSpacer&&(this.spacer=new Gg(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Hg(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let i=t.view.viewport;return!Zh.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class Gg{constructor(t,e,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,n)}update(t,e,i,n){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].compare(e[i]))return!1;return!0}(this.markers,n)||this.setMarkers(t,n)}setMarkers(t,e){let i="cm-gutterElement",n=this.dom.firstChild;for(let o=0,s=0;;){let r=s,a=o<e.length?e[o++]:null,l=!1;if(a){let t=a.elementClass;t&&(i+=" "+t);for(let t=s;t<this.markers.length;t++)if(this.markers[t].compare(a)){r=t,l=!0;break}}else r=this.markers.length;for(;s<r;){let t=this.markers[s++];if(t.toDOM){t.destroy(n);let e=n.nextSibling;n.remove(),n=e}}if(!a)break;a.toDOM&&(l?n=n.nextSibling:this.dom.insertBefore(a.toDOM(t),n)),l&&s++}this.dom.className=i,this.markers=e}destroy(){this.setMarkers(null,[])}}const Kg=Vc.define(),Jg=Vc.define(),tv=Vc.define({combine:t=>Lh(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let t in e){let n=i[t],o=e[t];i[t]=n?(t,e,i)=>n(t,e,i)||o(t,e,i):o}return i}})});class ev extends Ng{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function iv(t,e){return t.state.facet(tv).formatNumber(e,t.state)}const nv=Zg.compute([tv],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(Kg),lineMarker:(t,e,i)=>i.some(t=>t.toDOM)?null:new ev(iv(t,t.state.doc.lineAt(e.from).number)),widgetMarker:(t,e,i)=>{for(let n of t.state.facet(Jg)){let o=n(t,e,i);if(o)return o}return null},lineMarkerChange:t=>t.startState.facet(tv)!=t.state.facet(tv),initialSpacer:t=>new ev(iv(t,sv(t.state.doc.lines))),updateSpacer(t,e){let i=iv(e.view,sv(e.view.state.doc.lines));return i==t.number?t:new ev(i)},domEventHandlers:t.facet(tv).domEventHandlers,side:"before"}));function ov(t={}){return[tv.of(t),Xg(),nv]}function sv(t){let e=9;for(;e<t;)e=10*e+9;return e}const rv=new class extends Ng{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},av=jg.compute(["selection"],t=>{let e=[],i=-1;for(let n of t.selection.ranges){let o=t.doc.lineAt(n.head).from;o>i&&(i=o,e.push(rv.range(o)))}return Zh.of(e)});var lv;const cv=new wa;function hv(t){return Vc.define({combine:t?e=>e.concat(t):void 0})}const uv=new wa;class dv{constructor(t,e,i=[],n=""){this.data=t,this.name=n,Ih.prototype.hasOwnProperty("tree")||Object.defineProperty(Ih.prototype,"tree",{get(){return mv(this)}}),this.parser=e,this.extension=[Sv.of(this),Ih.languageData.of((t,e,i)=>{let n=fv(t,e,i),o=n.type.prop(cv);if(!o)return[];let s=t.facet(o),r=n.type.prop(uv);if(r){let o=n.resolve(e-n.from,i);for(let e of r)if(e.test(o,t)){let i=t.facet(e.facet);return"replace"==e.type?i:i.concat(s)}}return s})].concat(i)}isActiveAt(t,e,i=-1){return fv(t,e,i).type.prop(cv)==this.data}findRegions(t){let e=t.facet(Sv);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(t,e)=>{if(t.prop(cv)==this.data)return void i.push({from:e,to:e+t.length});let o=t.prop(wa.mounted);if(o){if(o.tree.prop(cv)==this.data){if(o.overlay)for(let t of o.overlay)i.push({from:t.from+e,to:t.to+e});else i.push({from:e,to:e+t.length});return}if(o.overlay){let t=i.length;if(n(o.tree,o.overlay[0].from+e),i.length>t)return}}for(let i=0;i<t.children.length;i++){let o=t.children[i];o instanceof Ea&&n(o,t.positions[i]+e)}};return n(mv(t),0),i}get allowsNesting(){return!0}}function fv(t,e,i){let n=t.facet(Sv),o=mv(t).topNode;if(!n||n.allowsNesting)for(let t=o;t;t=t.enter(e,i,Pa.ExcludeBuffers))t.type.isTop&&(o=t);return o}dv.setState=Sh.define();class pv extends dv{constructor(t,e,i){super(t,e,[],i),this.parser=e}static define(t){let e=hv(t.languageData);return new pv(e,t.parser.configure({props:[cv.add(t=>t.isTop?e:void 0)]}),t.name)}configure(t,e){return new pv(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function mv(t){let e=t.field(dv.state,!1);return e?e.tree:Ea.empty}class gv{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let vv=null;class yv{constructor(t,e,i=[],n,o,s,r,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=o,this.viewport=s,this.skipped=r,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new yv(t,e,[],Ea.empty,0,i,[],null)}startParse(){return this.parser.startParse(new gv(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=Ea.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(Ya.addTree(n,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(i=this.parse.stoppedAt)&&void 0!==i?i:this.state.doc.length,this.tree=n,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(Ya.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=vv;vv=this;try{return t()}finally{vv=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ov(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:o,viewport:s,skipped:r}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,i,n,o)=>e.push({fromA:t,toA:i,fromB:n,toB:o})),i=Ya.applyChanges(i,e),n=Ea.empty,o=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){r=[];for(let e of this.skipped){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);i<n&&r.push({from:i,to:n})}}}return new yv(this.parser,e,i,n,o,s,r,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:i,to:n}=this.skipped[e];i<t.to&&n>t.from&&(this.fragments=Ov(this.fragments,i,n),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends Ua{createParse(e,i,n){let o=n[0].from,s=n[n.length-1].to;return{parsedPos:o,advance(){let e=vv;if(e){for(let t of n)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=s,new Ea(ka.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return vv}}function Ov(t,e,i){return Ya.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class bv{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new bv(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=yv.create(t.facet(Sv).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new bv(i)}}dv.state=eh.define({create:bv.init,update(t,e){for(let t of e.effects)if(t.is(dv.setState))return t.value;return e.startState.facet(Sv)!=e.state.facet(Sv)?bv.init(e.state):t.apply(e)}});let xv=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(xv=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const wv="undefined"!=typeof navigator&&(null===(lv=navigator.scheduling)||void 0===lv?void 0:lv.isInputPending)?()=>navigator.scheduling.isInputPending():null,_v=pf.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(dv.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(dv.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=xv(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:n}}=this.view,o=i.field(dv.state);if(o.tree==o.context.tree&&o.context.isDone(n+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,t&&!wv?Math.max(25,t.timeRemaining()-5):1e9),r=o.context.treeLen<n&&i.doc.length>n+1e3,a=o.context.work(()=>wv&&wv()||Date.now()>s,n+(r?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:dv.setState.of(new bv(o.context))})),this.chunkBudget>0&&(!a||r)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(t=>hf(this.view.state,t)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Sv=Vc.define({combine:t=>t.length?t[0]:null,enables:t=>[dv.state,_v,vm.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class kv{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const $v=Vc.define(),Tv=Vc.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Cv(t){let e=t.facet(Tv);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function Pv(t,e){let i="",n=t.tabSize,o=t.facet(Tv)[0];if("\t"==o){for(;e>=n;)i+="\t",e-=n;o=" "}for(let t=0;t<e;t++)i+=o;return i}function Ev(t,e){t instanceof Ih&&(t=new Av(t));for(let i of t.state.facet($v)){let n=i(t,e);if(void 0!==n)return n}let i=mv(t.state);return i.length>=e?function(t,e,i){let n=e.resolveStack(i),o=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(o!=n.node){let t=[];for(let e=o;e&&!(e.from<n.node.from||e.to>n.node.to||e.from==n.node.from&&e.type==n.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)n={node:t[e],next:n}}return Qv(n,t,i)}(t,i,e):null}class Av{constructor(t,e={}){this.state=t,this.options=e,this.unit=Cv(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:o}=this.options;return null!=n&&n>=i.from&&n<=i.to?o&&n==t?{text:"",from:t}:(e<0?n<t:n<=t)?{text:i.text.slice(n-i.from),from:n}:{text:i.text.slice(0,n-i.from),from:i.from}:i}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:i,from:n}=this.lineAt(t,e);return i.slice(t-n,Math.min(i.length,t+100-n))}column(t,e=1){let{text:i,from:n}=this.lineAt(t,e),o=this.countColumn(i,t-n),s=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return s>-1&&(o+=s-this.countColumn(i,i.search(/\S|$/))),o}countColumn(t,e=t.length){return tu(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),o=this.options.overrideIndentation;if(o){let t=o(n);if(t>-1)return t}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Mv=new wa;function Qv(t,e,i){for(let n=t;n;n=n.next){let t=Dv(n.node);if(t)return t(Iv.create(e,i,n))}return 0}function Dv(t){let e=t.type.prop(Mv);if(e)return e;let i,n=t.firstChild;if(n&&(i=n.type.prop(wa.closedBy))){let e=t.lastChild,n=e&&i.indexOf(e.name)>-1;return t=>jv(t,!0,1,void 0,n&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?Rv:null}function Rv(){return 0}class Iv extends Av{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Iv(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Lv(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return Qv(this.context.next,this.base,this.pos)}}function Lv(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function Nv({closing:t,align:e=!0,units:i=1}){return n=>jv(n,e,i,t)}function jv(t,e,i,n,o){let s=t.textAfter,r=s.match(/^\s*/)[0].length,a=n&&s.slice(r,r+n.length)==n||o==t.pos+r,l=e?function(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let o=t.options.simulateBreak,s=t.state.doc.lineAt(i.from),r=null==o||o<=s.from?s.to:Math.min(s.to,o);for(let t=i.to;;){let o=e.childAfter(t);if(!o||o==n)return null;if(!o.type.isSkipped){if(o.from>=r)return null;let t=/^ */.exec(s.text.slice(i.to-s.from))[0].length;return{from:i.from,to:i.to+t}}t=o.to}}(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*i)}function zv({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}const Bv=Vc.define(),Zv=new wa;function Wv(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Fv(t,e,i){for(let n of t.facet(Bv)){let o=n(t,e,i);if(o)return o}return function(t,e,i){let n=mv(t);if(n.length<i)return null;let o=null;for(let s=n.resolveStack(i,1);s;s=s.next){let r=s.node;if(r.to<=i||r.from>i)continue;if(o&&r.from<e)break;let a=r.type.prop(Zv);if(a&&(r.to<n.length-50||n.length==t.doc.length||!Wv(r))){let n=a(r,t);n&&n.from<=i&&n.from>=e&&n.to>i&&(o=n)}}return o}(t,e,i)}function Xv(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const qv=Sh.define({map:Xv}),Hv=Sh.define({map:Xv});function Vv(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(t=>t.from<=i&&t.to>=i)||e.push(t.lineBlockAt(i));return e}const Yv=eh.define({create:()=>gd.none,update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((e,i)=>t=Uv(t,e,i)),t=t.map(e.changes);for(let i of e.effects)if(i.is(qv)&&!Kv(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(ny),o=n?gd.replace({widget:new ay(n(e.state,i.value))}):ry;t=t.update({add:[o.range(i.value.from,i.value.to)]})}else i.is(Hv)&&(t=t.update({filter:(t,e)=>i.value.from!=t||i.value.to!=e,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=Uv(t,e.selection.main.head)),t},provide:t=>vm.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(t,e)=>{i.push(t,e)}),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i<t.length;){let n=t[i++],o=t[i++];if("number"!=typeof n||"number"!=typeof o)throw new RangeError("Invalid JSON for fold state");e.push(ry.range(n,o))}return gd.set(e,!0)}});function Uv(t,e,i=e){let n=!1;return t.between(e,i,(t,o)=>{t<i&&o>e&&(n=!0)}),n?t.update({filterFrom:e,filterTo:i,filter:(t,n)=>t>=i||n<=e}):t}function Gv(t,e,i){var n;let o=null;return null===(n=t.field(Yv,!1))||void 0===n||n.between(e,i,(t,e)=>{(!o||o.from>t)&&(o={from:t,to:e})}),o}function Kv(t,e,i){let n=!1;return t.between(e,e,(t,o)=>{t==e&&o==i&&(n=!0)}),n}function Jv(t,e){return t.field(Yv,!1)?e:e.concat(Sh.appendConfig.of(oy()))}function ty(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,o=t.state.doc.lineAt(e.to).number;return vm.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${o}.`)}const ey=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of Vv(t)){let i=Fv(t.state,e.from,e.to);if(i)return t.dispatch({effects:Jv(t.state,[qv.of(i),ty(t,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(Yv,!1))return!1;let e=[];for(let i of Vv(t)){let n=Gv(t.state,i.from,i.to);n&&e.push(Hv.of(n),ty(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,i=[];for(let n=0;n<e.doc.length;){let o=t.lineBlockAt(n),s=Fv(e,o.from,o.to);s&&i.push(qv.of(s)),n=(s?t.lineBlockAt(s.to):o).to+1}return i.length&&t.dispatch({effects:Jv(t.state,i)}),!!i.length}},{key:"Ctrl-Alt-]",run:t=>{let e=t.state.field(Yv,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(t,e)=>{i.push(Hv.of({from:t,to:e}))}),t.dispatch({effects:i}),!0}}],iy={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ny=Vc.define({combine:t=>Lh(t,iy)});function oy(t){let e=[Yv,uy];return t&&e.push(ny.of(t)),e}function sy(t,e){let{state:i}=t,n=i.facet(ny),o=e=>{let i=t.lineBlockAt(t.posAtDOM(e.target)),n=Gv(t.state,i.from,i.to);n&&t.dispatch({effects:Hv.of(n)}),e.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,o,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",i.phrase("folded code")),s.title=i.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=o,s}const ry=gd.replace({widget:new class extends pd{toDOM(t){return sy(t,null)}}});class ay extends pd{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return sy(t,this.value)}}const ly={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class cy extends Ng{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function hy(t={}){let e={...ly,...t},i=new cy(e,!0),n=new cy(e,!1),o=pf.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Sv)!=t.state.facet(Sv)||t.startState.field(Yv,!1)!=t.state.field(Yv,!1)||mv(t.startState)!=mv(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new Wh;for(let o of t.viewportLineBlocks){let s=Gv(t.state,o.from,o.to)?n:Fv(t.state,o.from,o.to)?i:null;s&&e.add(o.from,o.from,s)}return e.finish()}}),{domEventHandlers:s}=e;return[o,Wg({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(o))||void 0===e?void 0:e.markers)||Zh.empty},initialSpacer:()=>new cy(e,!1),domEventHandlers:{...s,click:(t,e,i)=>{if(s.click&&s.click(t,e,i))return!0;let n=Gv(t.state,e.from,e.to);if(n)return t.dispatch({effects:Hv.of(n)}),!0;let o=Fv(t.state,e.from,e.to);return!!o&&(t.dispatch({effects:qv.of(o)}),!0)}}}),oy()]}const uy=vm.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 dy{constructor(t,e){let i;function n(t){let e=su.newName();return(i||(i=Object.create(null)))["."+e]=t,e}this.specs=t;const o="string"==typeof e.all?e.all:e.all?n(e.all):void 0,s=e.scope;this.scope=s instanceof dv?t=>t.prop(cv)==s.data:s?t=>t==s:void 0,this.style=Al(t.map(t=>({tag:t.tag,class:t.class||n(Object.assign({},t,{tag:null}))})),{all:o}).style,this.module=i?new su(i):null,this.themeType=e.themeType}static define(t,e){return new dy(t,e||{})}}const fy=Vc.define(),py=Vc.define({combine:t=>t.length?[t[0]]:null});function my(t){let e=t.facet(fy);return e.length?e:t.facet(py)}function gy(t,e){let i,n=[yy];return t instanceof dy&&(t.module&&n.push(vm.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?n.push(py.of(t)):i?n.push(fy.computeN([vm.darkTheme],e=>e.facet(vm.darkTheme)==("dark"==i)?[t]:[])):n.push(fy.of(t)),n}class vy{constructor(t){this.markCache=Object.create(null),this.tree=mv(t.state),this.decorations=this.buildDeco(t,my(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=mv(t.state),i=my(t.state),n=i!=my(t.startState),{viewport:o}=t.view,s=t.changes.mapPos(this.decoratedTo,1);e.length<o.to&&!n&&e.type==this.tree.type&&s>=o.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=o.to)}buildDeco(t,e){if(!e||!this.tree.length)return gd.none;let i=new Wh;for(let{from:n,to:o}of t.visibleRanges)Ml(this.tree,e,(t,e,n)=>{i.add(t,e,this.markCache[n]||(this.markCache[n]=gd.mark({class:n})))},n,o);return i.finish()}}const yy=ah.high(pf.fromClass(vy,{decorations:t=>t.decorations})),Oy=dy.define([{tag:Yl.meta,color:"#404740"},{tag:Yl.link,textDecoration:"underline"},{tag:Yl.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Yl.emphasis,fontStyle:"italic"},{tag:Yl.strong,fontWeight:"bold"},{tag:Yl.strikethrough,textDecoration:"line-through"},{tag:Yl.keyword,color:"#708"},{tag:[Yl.atom,Yl.bool,Yl.url,Yl.contentSeparator,Yl.labelName],color:"#219"},{tag:[Yl.literal,Yl.inserted],color:"#164"},{tag:[Yl.string,Yl.deleted],color:"#a11"},{tag:[Yl.regexp,Yl.escape,Yl.special(Yl.string)],color:"#e40"},{tag:Yl.definition(Yl.variableName),color:"#00f"},{tag:Yl.local(Yl.variableName),color:"#30a"},{tag:[Yl.typeName,Yl.namespace],color:"#085"},{tag:Yl.className,color:"#167"},{tag:[Yl.special(Yl.variableName),Yl.macroName],color:"#256"},{tag:Yl.definition(Yl.propertyName),color:"#00c"},{tag:Yl.comment,color:"#940"},{tag:Yl.invalid,color:"#f00"}]),by=vm.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),xy="()[]{}",wy=Vc.define({combine:t=>Lh(t,{afterCursor:!0,brackets:xy,maxScanDistance:1e4,renderMatch:ky})}),_y=gd.mark({class:"cm-matchingBracket"}),Sy=gd.mark({class:"cm-nonmatchingBracket"});function ky(t){let e=[],i=t.matched?_y:Sy;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}const $y=eh.define({create:()=>gd.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let i=[],n=e.state.facet(wy);for(let t of e.state.selection.ranges){if(!t.empty)continue;let o=My(e.state,t.head,-1,n)||t.head>0&&My(e.state,t.head-1,1,n)||n.afterCursor&&(My(e.state,t.head,1,n)||t.head<e.state.doc.length&&My(e.state,t.head+1,-1,n));o&&(i=i.concat(n.renderMatch(o,e.state)))}return gd.set(i,!0)},provide:t=>vm.decorations.from(t)}),Ty=[$y,by];function Cy(t={}){return[wy.of(t),Ty]}const Py=new wa;function Ey(t,e,i){let n=t.prop(e<0?wa.openedBy:wa.closedBy);if(n)return n;if(1==t.name.length){let n=i.indexOf(t.name);if(n>-1&&n%2==(e<0?1:0))return[i[n+e]]}return null}function Ay(t){let e=t.type.prop(Py);return e?e(t.node):t}function My(t,e,i,n={}){let o=n.maxScanDistance||1e4,s=n.brackets||xy,r=mv(t),a=r.resolveInner(e,i);for(let n=a;n;n=n.parent){let o=Ey(n.type,i,s);if(o&&n.from<n.to){let r=Ay(n);if(r&&(i>0?e>=r.from&&e<r.to:e>r.from&&e<=r.to))return Qy(t,e,i,n,r,o,s)}}return function(t,e,i,n,o,s,r){let a=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=r.indexOf(a);if(l<0||l%2==0!=i>0)return null;let c={from:i<0?e-1:e,to:i>0?e+1:e},h=t.doc.iterRange(e,i>0?t.doc.length:0),u=0;for(let t=0;!h.next().done&&t<=s;){let s=h.value;i<0&&(t+=s.length);let a=e+t*i;for(let t=i>0?0:s.length-1,e=i>0?s.length:-1;t!=e;t+=i){let e=r.indexOf(s[t]);if(!(e<0||n.resolveInner(a+t,1).type!=o))if(e%2==0==i>0)u++;else{if(1==u)return{start:c,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};u--}}i>0&&(t+=s.length)}return h.done?{start:c,matched:!1}:null}(t,e,i,r,a.type,o,s)}function Qy(t,e,i,n,o,s,r){let a=n.parent,l={from:o.from,to:o.to},c=0,h=null==a?void 0:a.cursor();if(h&&(i<0?h.childBefore(n.from):h.childAfter(n.to)))do{if(i<0?h.to<=n.from:h.from>=n.to){if(0==c&&s.indexOf(h.type.name)>-1&&h.from<h.to){let t=Ay(h);return{start:l,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Ey(h.type,i,r))c++;else if(Ey(h.type,-i,r)){if(0==c){let t=Ay(h);return{start:l,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}c--}}}while(i<0?h.prevSibling():h.nextSibling());return{start:l,matched:!1}}const Dy=Object.create(null),Ry=[ka.none],Iy=[],Ly=Object.create(null),Ny=Object.create(null);for(let[t,e]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"]])Ny[t]=zy(Dy,e);function jy(t,e){Iy.indexOf(t)>-1||(Iy.push(t),console.warn(e))}function zy(t,e){let i=[];for(let n of e.split(" ")){let e=[];for(let i of n.split(".")){let n=t[i]||Yl[i];n?"function"==typeof n?e.length?e=e.map(n):jy(i,`Modifier ${i} used at start of tag`):e.length?jy(i,`Tag ${i} used as modifier`):e=Array.isArray(n)?n:[n]:jy(i,`Unknown highlighting tag ${i}`)}for(let t of e)i.push(t)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),o=n+" "+i.map(t=>t.id),s=Ly[o];if(s)return s.id;let r=Ly[o]=ka.define({id:Ry.length,name:n,props:[Cl({[n]:i})]});return Ry.push(r),r.id}Cd.RTL,Cd.LTR;class By{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=mv(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),o=n.search(qy(t,!1));return o<0?null:{from:i+o,to:this.pos,text:n.slice(o)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,i){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Zy(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Wy(t){let e=t.map(t=>"string"==typeof t?{label:t}:t),[i,n]=e.every(t=>/^\w+$/.test(t.label))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),i=Object.create(null);for(let{label:n}of t){e[n[0]]=!0;for(let t=1;t<n.length;t++)i[n[t]]=!0}let n=Zy(e)+Zy(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}(e);return t=>{let o=t.matchBefore(n);return o||t.explicit?{from:o?o.from:t.pos,options:e,validFor:i}:null}}class Fy{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function Xy(t){return t.selection.main.from}function qy(t,e){var i;let{source:n}=t,o=e&&"^"!=n[0],s="$"!=n[n.length-1];return o||s?new RegExp(`${o?"^":""}(?:${n})${s?"$":""}`,null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t}const Hy=xh.define();function Vy(t,e,i,n){let{main:o}=t.selection,s=i-o.from,r=n-o.from;return{...t.changeByRange(a=>{if(a!=o&&i!=n&&t.sliceDoc(a.from+s,a.from+r)!=t.sliceDoc(i,n))return{range:a};let l=t.toText(e);return{changes:{from:a.from+s,to:n==o.from?a.to:a.from+r,insert:l},range:Xc.cursor(a.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Yy=new WeakMap;function Uy(t){if(!Array.isArray(t))return t;let e=Yy.get(t);return e||Yy.set(t,e=Wy(t)),e}const Gy=Sh.define(),Ky=Sh.define();class Jy{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let i=Ac(t,e),n=Qc(i);this.chars.push(i);let o=t.slice(e,e+n),s=o.toUpperCase();this.folded.push(Ac(s==o?o.toLowerCase():s,0)),e+=n}this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(0==this.pattern.length)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:i,any:n,precise:o,byWord:s}=this;if(1==e.length){let n=Ac(t,0),o=Qc(n),s=o==t.length?0:-100;if(n==e[0]);else{if(n!=i[0])return null;s+=-200}return this.ret(s,[0,o])}let r=t.indexOf(this.pattern);if(0==r)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=e.length,l=0;if(r<0){for(let o=0,s=Math.min(t.length,200);o<s&&l<a;){let s=Ac(t,o);s!=e[l]&&s!=i[l]||(n[l++]=o),o+=Qc(s)}if(l<a)return null}let c=0,h=0,u=!1,d=0,f=-1,p=-1,m=/[a-z]/.test(t),g=!0;for(let n=0,l=Math.min(t.length,200),v=0;n<l&&h<a;){let l=Ac(t,n);r<0&&(c<a&&l==e[c]&&(o[c++]=n),d<a&&(l==e[d]||l==i[d]?(0==d&&(f=n),p=n+1,d++):d=0));let y,O=l<255?l>=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(y=Mc(l))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!n||1==O&&m||0==v&&0!=O)&&(e[h]==l||i[h]==l&&(u=!0)?s[h++]=n:s.length&&(g=!1)),v=O,n+=Qc(l)}return h==a&&0==s[0]&&g?this.result((u?-200:0)-100,s,t):d==a&&0==f?this.ret(-200-t.length+(p==t.length?0:-100),[0,p]):r>-1?this.ret(-700-t.length,[r,r+this.pattern.length]):d==a?this.ret(-900-t.length,[f,p]):h==a?this.result((u?-200:0)-100-700+(g?0:-1100),s,t):2==e.length?null:this.result((n[0]?-700:0)-200-1100,n,t)}result(t,e,i){let n=[],o=0;for(let t of e){let e=t+(this.astral?Qc(Ac(i,t)):1);o&&n[o-1]==t?n[o-1]=e:(n[o++]=t,n[o++]=e)}return this.ret(t-i.length,n)}}class tO{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),i=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return null==i?null:(this.matched=[0,e.length],this.score=i+(t.length==this.pattern.length?0:-100),this)}}const eO=Vc.define({combine:t=>Lh(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:nO,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>iO(t(i),e(i)),optionClass:(t,e)=>i=>iO(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function iO(t,e){return t?e?t+" "+e:t:e}function nO(t,e,i,n,o,s){let r,a,l=t.textDirection==Cd.RTL,c=l,h=!1,u="top",d=e.left-o.left,f=o.right-e.right,p=n.right-n.left,m=n.bottom-n.top;if(c&&d<Math.min(p,f)?c=!1:!c&&f<Math.min(p,d)&&(c=!0),p<=(c?d:f))r=Math.max(o.top,Math.min(i.top,o.bottom-m))-e.top,a=Math.min(400,c?d:f);else{h=!0,a=Math.min(400,(l?e.right:o.right-e.left)-30);let t=o.bottom-e.bottom;t>=m||t>e.top?r=i.bottom-e.top:(u="bottom",r=e.bottom-i.top)}return{style:`${u}: ${r/((e.bottom-e.top)/s.offsetHeight)}px; max-width: ${a/((e.right-e.left)/s.offsetWidth)}px`,class:"cm-completionInfo-"+(h?l?"left-narrow":"right-narrow":c?"left":"right")}}function oO(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/i);return{from:t*i,to:(t+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class sO{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:o,selected:s}=n.open,r=t.state.facet(eO);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map(t=>"cm-completionIcon-"+t)),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,i,n){let o=document.createElement("span");o.className="cm-completionLabel";let s=t.displayLabel||t.label,r=0;for(let t=0;t<n.length;){let e=n[t++],i=n[t++];e>r&&o.appendChild(document.createTextNode(s.slice(r,e)));let a=o.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(s.slice(e,i))),a.className="cm-completionMatchedText",r=i}return r<s.length&&o.appendChild(document.createTextNode(s.slice(r))),o},position:50},{render(t){if(!t.detail)return null;let e=document.createElement("span");return e.className="cm-completionDetail",e.textContent=t.detail,e},position:80}),e.sort((t,e)=>t.position-e.position).map(t=>t.render)}(r),this.optionClass=r.optionClass,this.tooltipClass=r.tooltipClass,this.range=oO(o.length,s,r.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",i=>{let{options:n}=t.state.field(e).open;for(let e,o=i.target;o&&o!=this.dom;o=o.parentNode)if("LI"==o.nodeName&&(e=/-(\d+)$/.exec(o.id))&&+e[1]<n.length)return this.applyCompletion(t,n[+e[1]]),void i.preventDefault()}),this.dom.addEventListener("focusout",e=>{let i=t.state.field(this.stateField,!1);i&&i.tooltip&&t.state.facet(eO).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Ky.of(null)})}),this.showOptions(o,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:o,selected:s,disabled:r}=i.open;n.open&&n.open.options==o||(this.range=oO(o.length,s,t.state.facet(eO).maxRenderedOptions),this.showOptions(o,i.id)),this.updateSel(),r!=(null===(e=n.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!r)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;(e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=oO(e.options.length,e.selected,this.view.state.facet(eO).maxRenderedOptions),this.showOptions(e.options,t.id));let i=this.updateSelectedOption(e.selected);if(i){this.destroyInfo();let{completion:n}=e.options[e.selected],{info:o}=n;if(!o)return;let s="string"==typeof o?document.createTextNode(o):o(n);if(!s)return;"then"in s?s.then(e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,n)}).catch(t=>hf(this.view.state,t,"completion info")):(this.addInfoPane(s,n),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:n}=t;i.appendChild(e),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby")):n--;return e&&function(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),o=i.height/t.offsetHeight;n.top<i.top?t.scrollTop-=(i.top-n.top)/o:n.bottom>i.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/o)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),o=this.space;if(!o){let t=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:t.clientWidth,bottom:t.clientHeight}}return n.top>Math.min(o.bottom,e.bottom)-10||n.bottom<Math.max(o.top,e.top)+10?null:this.view.state.facet(eO).positionInfo(this.view,e,n,i,o,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,i){const n=document.createElement("ul");n.id=e,n.setAttribute("role","listbox"),n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label",this.view.state.phrase("Completions")),n.addEventListener("mousedown",t=>{t.target==n&&t.preventDefault()});let o=null;for(let s=i.from;s<i.to;s++){let{completion:r,match:a}=t[s],{section:l}=r;if(l){let t="string"==typeof l?l:l.name;if(t!=o&&(s>i.from||0==i.from))if(o=t,"string"!=typeof l&&l.header)n.appendChild(l.header(l));else{n.appendChild(document.createElement("completion-section")).textContent=t}}const c=n.appendChild(document.createElement("li"));c.id=e+"-"+s,c.setAttribute("role","option");let h=this.optionClass(r);h&&(c.className=h);for(let t of this.optionContent){let e=t(r,this.view.state,this.view,a);e&&c.appendChild(e)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.to<t.length&&n.classList.add("cm-completionListIncompleteBottom"),n}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function rO(t,e){return i=>new sO(i,t,e)}function aO(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class lO{constructor(t,e,i,n,o,s){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=o,this.disabled=s}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new lO(this.options,dO(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,o,s){if(n&&!s&&t.some(t=>t.isPending))return n.setDisabled();let r=function(t,e){let i=[],n=null,o=null,s=t=>{i.push(t);let{section:e}=t.completion;if(e){n||(n=[]);let t="string"==typeof e?e:e.name;n.some(e=>e.name==t)||n.push("string"==typeof e?{name:t}:e)}},r=e.facet(eO);for(let n of t)if(n.hasResult()){let t=n.result.getMatch;if(!1===n.result.filter)for(let e of n.result.options)s(new Fy(e,n.source,t?t(e):[],1e9-i.length));else{let i,a=e.sliceDoc(n.from,n.to),l=r.filterStrict?new tO(a):new Jy(a);for(let e of n.result.options)if(i=l.match(e.label)){let r=e.displayLabel?t?t(e,i.matched):[]:i.matched,a=i.score+(e.boost||0);if(s(new Fy(e,n.source,r,a)),"object"==typeof e.section&&"dynamic"===e.section.rank){let{name:t}=e.section;o||(o=Object.create(null)),o[t]=Math.max(a,o[t]||-1e9)}}}}if(n){let t=Object.create(null),e=0,s=(t,e)=>("dynamic"===t.rank&&"dynamic"===e.rank?o[e.name]-o[t.name]:0)||("number"==typeof t.rank?t.rank:1e9)-("number"==typeof e.rank?e.rank:1e9)||(t.name<e.name?-1:1);for(let i of n.sort(s))e-=1e5,t[i.name]=e;for(let e of i){let{section:i}=e.completion;i&&(e.score+=t["string"==typeof i?i:i.name])}}let a=[],l=null,c=r.compareCompletions;for(let t of i.sort((t,e)=>e.score-t.score||c(t.completion,e.completion))){let e=t.completion;!l||l.label!=e.label||l.detail!=e.detail||null!=l.type&&null!=e.type&&l.type!=e.type||l.apply!=e.apply||l.boost!=e.boost?a.push(t):aO(t.completion)>aO(l)&&(a[a.length-1]=t),l=t.completion}return a}(t,e);if(!r.length)return n&&t.some(t=>t.isPending)?n.setDisabled():null;let a=e.facet(eO).selectOnOpen?0:-1;if(n&&n.selected!=a&&-1!=n.selected){let t=n.options[n.selected].completion;for(let e=0;e<r.length;e++)if(r[e].completion==t){a=e;break}}return new lO(r,dO(i,a),{pos:t.reduce((t,e)=>e.hasResult()?Math.min(t,e.from):t,1e8),create:xO,above:o.aboveCursor},n?n.timestamp:Date.now(),a,!1)}map(t){return new lO(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new lO(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class cO{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new cO(fO,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,i=e.facet(eO),n=(i.override||e.languageDataAt("autocomplete",Xy(e)).map(Uy)).map(e=>(this.active.find(t=>t.source==e)||new mO(e,this.active.some(t=>0!=t.state)?1:0)).update(t,i));n.length==this.active.length&&n.every((t,e)=>t==this.active[e])&&(n=this.active);let o=this.open,s=t.effects.some(t=>t.is(vO));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||n.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!function(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i<t.length&&!t[i].hasResult();)i++;for(;n<e.length&&!e[n].hasResult();)n++;let o=i==t.length,s=n==e.length;if(o||s)return o==s;if(t[i++].result!=e[n++].result)return!1}}(n,this.active)||s?o=lO.build(n,e,this.id,o,i,s):o&&o.disabled&&!n.some(t=>t.isPending)&&(o=null),!o&&n.every(t=>!t.isPending)&&n.some(t=>t.hasResult())&&(n=n.map(t=>t.hasResult()?new mO(t.source,0):t));for(let e of t.effects)e.is(yO)&&(o=o&&o.setSelected(e.value,this.id));return n==this.active&&o==this.open?this:new cO(n,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?hO:uO}}const hO={"aria-autocomplete":"list"},uO={};function dO(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const fO=[];function pO(t,e){if(t.isUserEvent("input.complete")){let i=t.annotation(Hy);if(i&&e.activateOnCompletion(i))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class mO{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return 1==this.state}update(t,e){let i=pO(t,e),n=this;(8&i||16&i&&this.touches(t))&&(n=new mO(n.source,0)),4&i&&0==n.state&&(n=new mO(this.source,1)),n=n.updateFor(t,i);for(let e of t.effects)if(e.is(Gy))n=new mO(n.source,1,e.value);else if(e.is(Ky))n=new mO(n.source,0);else if(e.is(vO))for(let t of e.value)t.source==n.source&&(n=t);return n}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Xy(t.state))}}class gO extends mO{constructor(t,e,i,n,o,s){super(t,3,e),this.limit=i,this.result=n,this.from=o,this.to=s}hasResult(){return!0}updateFor(t,e){var i;if(!(3&e))return this.map(t.changes);let n=this.result;n.map&&!t.changes.empty&&(n=n.map(n,t.changes));let o=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),r=Xy(t.state);if(r>s||!n||2&e&&(Xy(t.startState)==this.from||r<this.limit))return new mO(this.source,4&e?1:0);let a=t.changes.mapPos(this.limit);return function(t,e,i,n){if(!t)return!1;let o=e.sliceDoc(i,n);return"function"==typeof t?t(o,i,n,e):qy(t,!0).test(o)}(n.validFor,t.state,o,s)?new gO(this.source,this.explicit,a,n,o,s):n.update&&(n=n.update(n,o,s,new By(t.state,r,!1)))?new gO(this.source,this.explicit,a,n,n.from,null!==(i=n.to)&&void 0!==i?i:Xy(t.state)):new mO(this.source,1,this.explicit)}map(t){if(t.empty)return this;return(this.result.map?this.result.map(this.result,t):this.result)?new gO(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new mO(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}const vO=Sh.define({map:(t,e)=>t.map(t=>t.map(e))}),yO=Sh.define(),OO=eh.define({create:()=>cO.start(),update:(t,e)=>t.update(e),provide:t=>[_g.from(t,t=>t.tooltip),vm.contentAttributes.from(t,t=>t.attrs)]});function bO(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(OO).active.find(t=>t.source==e.source);return n instanceof gO&&("string"==typeof i?t.dispatch({...Vy(t.state,i,n.from,n.to),annotations:Hy.of(e.completion)}):i(t,e.completion,n.from,n.to),!0)}const xO=rO(OO,bO);function wO(t,e="option"){return i=>{let n=i.state.field(OO,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(eO).interactionDelay)return!1;let o,s=1;"page"==e&&(o=Eg(i,n.open.tooltip))&&(s=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:r}=n.open.options,a=n.open.selected>-1?n.open.selected+s*(t?1:-1):t?0:r-1;return a<0?a="page"==e?0:r-1:a>=r&&(a="page"==e?r-1:0),i.dispatch({effects:yO.of(a)}),!0}}const _O=t=>!!t.state.field(OO,!1)&&(t.dispatch({effects:Gy.of(!0)}),!0);class SO{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const kO=pf.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(OO).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(OO),i=t.state.facet(eO);if(!t.selectionSet&&!t.docChanged&&t.startState.field(OO)==e)return;let n=t.transactions.some(t=>{let e=pO(t,i);return 8&e||(t.selection||t.docChanged)&&!(3&e)});for(let e=0;e<this.running.length;e++){let i=this.running[e];if(n||i.context.abortOnDocChange&&t.docChanged||i.updates.length+t.transactions.length>50&&Date.now()-i.time>1e3){for(let t of i.context.abortListeners)try{t()}catch(t){hf(this.view.state,t)}i.context.abortListeners=null,this.running.splice(e--,1)}else i.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(t=>t.effects.some(t=>t.is(Gy)))&&(this.pendingStart=!0);let o=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(t=>t.isPending&&!this.running.some(e=>e.active.source==t.source))?setTimeout(()=>this.startUpdate(),o):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(OO);for(let t of e.active)t.isPending&&!this.running.some(e=>e.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(eO).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=Xy(e),n=new By(e,i,t.explicit,this.view),o=new SO(t,n);this.running.push(o),Promise.resolve(t.source(n)).then(t=>{o.context.aborted||(o.done=t||null,this.scheduleAccept())},t=>{this.view.dispatch({effects:Ky.of(null)}),hf(this.view.state,t)})}scheduleAccept(){this.running.every(t=>void 0!==t.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(eO).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(eO),n=this.view.state.field(OO);for(let o=0;o<this.running.length;o++){let s=this.running[o];if(void 0===s.done)continue;if(this.running.splice(o--,1),s.done){let n=Xy(s.updates.length?s.updates[0].startState:this.view.state),o=Math.min(n,s.done.from+(s.active.explicit?0:1)),r=new gO(s.active.source,s.active.explicit,o,s.done,s.done.from,null!==(t=s.done.to)&&void 0!==t?t:n);for(let t of s.updates)r=r.update(t,i);if(r.hasResult()){e.push(r);continue}}let r=n.active.find(t=>t.source==s.active.source);if(r&&r.isPending)if(null==s.done){let t=new mO(s.active.source,0);for(let e of s.updates)t=t.update(e,i);t.isPending||e.push(t)}else this.startQuery(r)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:vO.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(OO,!1);if(e&&e.tooltip&&this.view.state.facet(eO).closeOnBlur){let i=e.open&&Eg(this.view,e.open.tooltip);i&&i.dom.contains(t.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:Ky.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:Gy.of(!1)}),20),this.composing=0}}}),$O="object"==typeof navigator&&/Win/.test(navigator.platform),TO=ah.highest(vm.domEventHandlers({keydown(t,e){let i=e.state.field(OO,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&(!$O||!t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],o=i.active.find(t=>t.source==n.source),s=n.completion.commitCharacters||o.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&bO(e,n),!1}})),CO=vm.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class PO{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class EO{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,Rc.TrackDel),i=t.mapPos(this.to,1,Rc.TrackDel);return null==e||null==i?null:new EO(this.field,e,i)}}class AO{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],o=t.doc.lineAt(e),s=/^\s*/.exec(o.text)[0];for(let o of this.lines){if(i.length){let i=s,r=/^\t*/.exec(o)[0].length;for(let e=0;e<r;e++)i+=t.facet(Tv);n.push(e+i.length-r),o=i+o.slice(r)}i.push(o),e+=o.length+1}let r=this.fieldPositions.map(t=>new EO(t.field,n[t.line]+t.from,n[t.line]+t.to));return{text:i,ranges:r}}static parse(t){let e,i=[],n=[],o=[];for(let s of t.split(/\r\n?|\n/)){for(;e=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(s);){let t=e[1]?+e[1]:null,r=e[2]||e[3]||"",a=-1,l=r.replace(/\\[{}]/g,t=>t[1]);for(let e=0;e<i.length;e++)(null!=t?i[e].seq==t:l&&i[e].name==l)&&(a=e);if(a<0){let e=0;for(;e<i.length&&(null==t||null!=i[e].seq&&i[e].seq<t);)e++;i.splice(e,0,{seq:t,name:l}),a=e;for(let t of o)t.field>=a&&t.field++}for(let t of o)if(t.line==n.length&&t.from>e.index){let i=e[2]?3+(e[1]||"").length:2;t.from-=i,t.to-=i}o.push(new PO(a,n.length,e.index,e.index+l.length)),s=s.slice(0,e.index)+r+s.slice(e.index+e[0].length)}s=s.replace(/\\([{}])/g,(t,e,i)=>{for(let t of o)t.line==n.length&&t.from>i&&(t.from--,t.to--);return e}),n.push(s)}return new AO(n,o)}}let MO=gd.widget({widget:new class extends pd{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),QO=gd.mark({class:"cm-snippetField"});class DO{constructor(t,e){this.ranges=t,this.active=e,this.deco=gd.set(t.map(t=>(t.from==t.to?MO:QO).range(t.from,t.to)),!0)}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new DO(e,this.active)}selectionInsideField(t){return t.ranges.every(t=>this.ranges.some(e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))}}const RO=Sh.define({map:(t,e)=>t&&t.map(e)}),IO=Sh.define(),LO=eh.define({create:()=>null,update(t,e){for(let i of e.effects){if(i.is(RO))return i.value;if(i.is(IO)&&t)return new DO(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>vm.decorations.from(t,t=>t?t.deco:gd.none)});function NO(t,e){return Xc.create(t.filter(t=>t.field==e).map(t=>Xc.range(t.from,t.to)))}function jO(t){let e=AO.parse(t);return(t,i,n,o)=>{let{text:s,ranges:r}=e.instantiate(t.state,n),{main:a}=t.state.selection,l={changes:{from:n,to:o==a.from?a.to:o,insert:bc.of(s)},scrollIntoView:!0,annotations:i?[Hy.of(i),kh.userEvent.of("input.complete")]:void 0};if(r.length&&(l.selection=NO(r,0)),r.some(t=>t.field>0)){let e=new DO(r,0),i=l.effects=[RO.of(e)];void 0===t.state.field(LO,!1)&&i.push(Sh.appendConfig.of([LO,WO,XO,CO]))}t.dispatch(t.state.update(l))}}function zO(t){return({state:e,dispatch:i})=>{let n=e.field(LO,!1);if(!n||t<0&&0==n.active)return!1;let o=n.active+t,s=t>0&&!n.ranges.some(e=>e.field==o+t);return i(e.update({selection:NO(n.ranges,o),effects:RO.of(s?null:new DO(n.ranges,o)),scrollIntoView:!0})),!0}}const BO=[{key:"Tab",run:zO(1),shift:zO(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(LO,!1)&&(e(t.update({effects:RO.of(null)})),!0)}],ZO=Vc.define({combine:t=>t.length?t[0]:BO}),WO=ah.highest(km.compute([ZO],t=>t.facet(ZO)));function FO(t,e){return{...e,apply:jO(t)}}const XO=vm.domEventHandlers({mousedown(t,e){let i,n=e.state.field(LO,!1);if(!n||null==(i=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let o=n.ranges.find(t=>t.from<=i&&t.to>=i);return!(!o||o.field==n.active)&&(e.dispatch({selection:NO(n.ranges,o.field),effects:RO.of(n.ranges.some(t=>t.field>o.field)?new DO(n.ranges,o.field):null),scrollIntoView:!0}),!0)}});const qO={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},HO=Sh.define({map(t,e){let i=e.mapPos(t,-1,Rc.TrackAfter);return null==i?void 0:i}}),VO=new class extends Nh{};VO.startSide=1,VO.endSide=-1;const YO=eh.define({create:()=>Zh.empty,update(t,e){if(t=t.map(e.changes),e.selection){let i=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=i.from&&t<=i.to})}for(let i of e.effects)i.is(HO)&&(t=t.update({add:[VO.range(i.value,i.value+1)]}));return t}});const UO="()[]{}<>«»»«[]{}";function GO(t){for(let e=0;e<16;e+=2)if(UO.charCodeAt(e)==t)return UO.charAt(e+1);return Mc(t<128?t:t+1)}function KO(t,e){return t.languageDataAt("closeBrackets",e)[0]||qO}const JO="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),tb=vm.inputHandler.of((t,e,i,n)=>{if((JO?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let o=t.state.selection.main;if(n.length>2||2==n.length&&1==Qc(Ac(n,0))||e!=o.from||i!=o.to)return!1;let s=function(t,e){let i=KO(t,t.selection.main.head),n=i.brackets||qO.brackets;for(let o of n){let s=GO(Ac(o,0));if(e==o)return s==o?rb(t,o,n.indexOf(o+o+o)>-1,i):ob(t,o,s,i.before||qO.before);if(e==s&&ib(t,t.selection.main.from))return sb(t,o,s)}return null}(t.state,n);return!!s&&(t.dispatch(s),!0)}),eb=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=KO(t,t.selection.main.head).brackets||qO.brackets,n=null,o=t.changeByRange(e=>{if(e.empty){let n=function(t,e){let i=t.sliceString(e-2,e);return Qc(Ac(i,0))==i.length?i:i.slice(1)}(t.doc,e.head);for(let o of i)if(o==n&&nb(t.doc,e.head)==GO(Ac(o,0)))return{changes:{from:e.head-o.length,to:e.head+o.length},range:Xc.cursor(e.head-o.length)}}return{range:n=e}});return n||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!n}}];function ib(t,e){let i=!1;return t.field(YO).between(0,t.doc.length,t=>{t==e&&(i=!0)}),i}function nb(t,e){let i=t.sliceString(e,e+2);return i.slice(0,Qc(Ac(i,0)))}function ob(t,e,i,n){let o=null,s=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:i,from:s.to}],effects:HO.of(s.to+e.length),range:Xc.range(s.anchor+e.length,s.head+e.length)};let r=nb(t.doc,s.head);return!r||/\s/.test(r)||n.indexOf(r)>-1?{changes:{insert:e+i,from:s.head},effects:HO.of(s.head+e.length),range:Xc.cursor(s.head+e.length)}:{range:o=s}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function sb(t,e,i){let n=null,o=t.changeByRange(e=>e.empty&&nb(t.doc,e.head)==i?{changes:{from:e.head,to:e.head+i.length,insert:i},range:Xc.cursor(e.head+i.length)}:n={range:e});return n?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function rb(t,e,i,n){let o=n.stringPrefixes||qO.stringPrefixes,s=null,r=t.changeByRange(n=>{if(!n.empty)return{changes:[{insert:e,from:n.from},{insert:e,from:n.to}],effects:HO.of(n.to+e.length),range:Xc.range(n.anchor+e.length,n.head+e.length)};let r,a=n.head,l=nb(t.doc,a);if(l==e){if(ab(t,a))return{changes:{insert:e+e,from:a},effects:HO.of(a+e.length),range:Xc.cursor(a+e.length)};if(ib(t,a)){let n=i&&t.sliceDoc(a,a+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+n.length,insert:n},range:Xc.cursor(a+n.length)}}}else{if(i&&t.sliceDoc(a-2*e.length,a)==e+e&&(r=lb(t,a-2*e.length,o))>-1&&ab(t,r))return{changes:{insert:e+e+e+e,from:a},effects:HO.of(a+e.length),range:Xc.cursor(a+e.length)};if(t.charCategorizer(a)(l)!=Mh.Word&&lb(t,a,o)>-1&&!function(t,e,i,n){let o=mv(t).resolveInner(e,-1),s=n.reduce((t,e)=>Math.max(t,e.length),0);for(let r=0;r<5;r++){let r=t.sliceDoc(o.from,Math.min(o.to,o.from+i.length+s)),a=r.indexOf(i);if(!a||a>-1&&n.indexOf(r.slice(0,a))>-1){let e=o.firstChild;for(;e&&e.from==o.from&&e.to-e.from>i.length+a;){if(t.sliceDoc(e.to-i.length,e.to)==i)return!1;e=e.firstChild}return!0}let l=o.to==e&&o.parent;if(!l)break;o=l}return!1}(t,a,e,o))return{changes:{insert:e+e,from:a},effects:HO.of(a+e.length),range:Xc.cursor(a+e.length)}}return{range:s=n}});return s?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function ab(t,e){let i=mv(t).resolveInner(e+1);return i.parent&&i.from==e}function lb(t,e,i){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=Mh.Word)return e;for(let o of i){let i=e-o.length;if(t.sliceDoc(i,e)==o&&n(t.sliceDoc(i-1,i))!=Mh.Word)return i}return-1}function cb(t={}){return[TO,OO,eO.of(t),kO,ub,CO]}const hb=[{key:"Ctrl-Space",run:_O},{mac:"Alt-`",run:_O},{mac:"Alt-i",run:_O},{key:"Escape",run:t=>{let e=t.state.field(OO,!1);return!(!e||!e.active.some(t=>0!=t.state))&&(t.dispatch({effects:Ky.of(null)}),!0)}},{key:"ArrowDown",run:wO(!0)},{key:"ArrowUp",run:wO(!1)},{key:"PageDown",run:wO(!0,"page")},{key:"PageUp",run:wO(!1,"page")},{key:"Enter",run:t=>{let e=t.state.field(OO,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(eO).interactionDelay)&&bO(t,e.open.options[e.open.selected])}}],ub=ah.highest(km.computeN([eO],t=>t.facet(eO).defaultKeymap?[hb]:[]));const db=[FO("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),FO("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),FO("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),FO("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),FO("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),FO("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),FO("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),FO("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),FO("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),FO('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),FO('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],fb=db.concat([FO("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),FO("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),FO("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),pb=new Va,mb=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function gb(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const vb=["FunctionDeclaration"],yb={FunctionDeclaration:gb("function"),ClassDeclaration:gb("class"),ClassExpression:()=>!0,EnumDeclaration:gb("constant"),TypeAliasDeclaration:gb("type"),NamespaceDeclaration:gb("namespace"),VariableDefinition(t,e){t.matchContext(vb)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function Ob(t,e){let i=pb.get(e);if(i)return i;let n=[],o=!0;function s(e,i){let o=t.sliceString(e.from,e.to);n.push({label:o,type:i})}return e.cursor(Pa.IncludeAnonymous).iterate(e=>{if(o)o=!1;else if(e.name){let t=yb[e.name];if(t&&t(e,s)||mb.has(e.name))return!1}else if(e.to-e.from>8192){for(let i of Ob(t,e.node))n.push(i);return!1}}),pb.set(e,n),n}const bb=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,xb=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function wb(t){let e=mv(t.state).resolveInner(t.pos,-1);if(xb.indexOf(e.name)>-1)return null;let i="VariableName"==e.name||e.to-e.from<20&&bb.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)mb.has(i.name)&&(n=n.concat(Ob(t.state.doc,i)));return{options:n,from:i?e.from:t.pos,validFor:bb}}const _b=pv.define({name:"javascript",parser:lc.configure({props:[Mv.add({IfStatement:zv({except:/^\s*({|else\b)/}),TryStatement:zv({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:t=>t.baseIndent,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:Nv({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":zv({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),Zv.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":function(t){let e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null},BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Sb={test:t=>/^JSX/.test(t.name),facet:hv({commentTokens:{block:{open:"{/*",close:"*/}"}}})},kb=_b.configure({dialect:"ts"},"typescript"),$b=_b.configure({dialect:"jsx",props:[uv.add(t=>t.isTop?[Sb]:void 0)]}),Tb=_b.configure({dialect:"jsx ts",props:[uv.add(t=>t.isTop?[Sb]:void 0)]},"typescript");let Cb=t=>({label:t,type:"keyword"});const Pb="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Cb),Eb=Pb.concat(["declare","implements","private","protected","public"].map(Cb));function Ab(t={}){let e=t.jsx?t.typescript?Tb:$b:t.typescript?kb:_b,i=t.typescript?fb.concat(Eb):db.concat(Pb);return new kv(e,[_b.data.of({autocomplete:(n=xb,o=Wy(i),t=>{for(let e=mv(t.state).resolveInner(t.pos,-1);e;e=e.parent){if(n.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return o(t)})}),_b.data.of({autocomplete:wb}),t.jsx?Db:[]]);var n,o}function Mb(t,e,i=t.length){for(let n=null==e?void 0:e.firstChild;n;n=n.nextSibling)if("JSXIdentifier"==n.name||"JSXBuiltin"==n.name||"JSXNamespacedName"==n.name||"JSXMemberExpression"==n.name)return t.sliceString(n.from,Math.min(n.to,i));return""}const Qb="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Db=vm.inputHandler.of((t,e,i,n,o)=>{if((Qb?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||">"!=n&&"/"!=n||!_b.isActiveAt(t.state,e,-1))return!1;let s=o(),{state:r}=s,a=r.changeByRange(t=>{var e;let i,{head:o}=t,s=mv(r).resolveInner(o-1,-1);if("JSXStartTag"==s.name&&(s=s.parent),r.doc.sliceString(o-1,o)!=n||"JSXAttributeValue"==s.name&&s.to>o);else{if(">"==n&&"JSXFragmentTag"==s.name)return{range:t,changes:{from:o,insert:"</>"}};if("/"==n&&"JSXStartCloseTag"==s.name){let t=s.parent,n=t.parent;if(n&&t.from==o-2&&((i=Mb(r.doc,n.firstChild,o))||"JSXFragmentTag"==(null===(e=n.firstChild)||void 0===e?void 0:e.name))){let t=`${i}>`;return{range:Xc.cursor(o+t.length,-1),changes:{from:o,insert:t}}}}else if(">"==n){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(s);if(e&&"JSXOpenTag"==e.name&&!/^\/?>|^<\//.test(r.doc.sliceString(o,o+2))&&(i=Mb(r.doc,e,o)))return{range:t,changes:{from:o,insert:`</${i}>`}}}}return{range:t}});return!a.changes.empty&&(t.dispatch([s,r.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function Rb(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let o=t(e,i);return!!o&&(n(i.update(o)),!0)}}const Ib=Rb(Zb,0),Lb=Rb(Bb,0),Nb=Rb((t,e)=>Bb(t,e,function(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),o=i.to<=n.to?n:t.doc.lineAt(i.to);o.from>n.from&&o.from==i.to&&(o=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=o.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:o.to})}return e}(e)),0);function jb(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const zb=50;function Bb(t,e,i=e.selection.ranges){let n=i.map(t=>jb(e,t.from).block);if(!n.every(t=>t))return null;let o=i.map((t,i)=>function(t,{open:e,close:i},n,o){let s,r,a=t.sliceDoc(n-zb,n),l=t.sliceDoc(o,o+zb),c=/\s*$/.exec(a)[0].length,h=/^\s*/.exec(l)[0].length,u=a.length-c;if(a.slice(u-e.length,u)==e&&l.slice(h,h+i.length)==i)return{open:{pos:n-c,margin:c&&1},close:{pos:o+h,margin:h&&1}};o-n<=2*zb?s=r=t.sliceDoc(n,o):(s=t.sliceDoc(n,n+zb),r=t.sliceDoc(o-zb,o));let d=/^\s*/.exec(s)[0].length,f=/\s*$/.exec(r)[0].length,p=r.length-f-i.length;return s.slice(d,d+e.length)==e&&r.slice(p,p+i.length)==i?{open:{pos:n+d+e.length,margin:/\s/.test(s.charAt(d+e.length))?1:0},close:{pos:o-f-i.length,margin:/\s/.test(r.charAt(p-1))?1:0}}:null}(e,n[i],t.from,t.to));if(2!=t&&!o.every(t=>t))return{changes:e.changes(i.map((t,e)=>o[e]?[]:[{from:t.from,insert:n[e].open+" "},{from:t.to,insert:" "+n[e].close}]))};if(1!=t&&o.some(t=>t)){let t=[];for(let e,i=0;i<o.length;i++)if(e=o[i]){let o=n[i],{open:s,close:r}=e;t.push({from:s.pos-o.open.length,to:s.pos+s.margin},{from:r.pos-r.margin,to:r.pos+o.close.length})}return{changes:t}}return null}function Zb(t,e,i=e.selection.ranges){let n=[],o=-1;for(let{from:t,to:s}of i){let i=n.length,r=1e9,a=jb(e,t).line;if(a){for(let i=t;i<=s;){let l=e.doc.lineAt(i);if(l.from>o&&(t==s||s>l.from)){o=l.from;let t=/^\s*/.exec(l.text)[0].length,e=t==l.length,i=l.text.slice(t,t+a.length)==a?t:-1;t<l.text.length&&t<r&&(r=t),n.push({line:l,comment:i,token:a,indent:t,empty:e,single:!1})}i=l.to+1}if(r<1e9)for(let t=i;t<n.length;t++)n[t].indent<n[t].line.text.length&&(n[t].indent=r);n.length==i+1&&(n[i].single=!0)}}if(2!=t&&n.some(t=>t.comment<0&&(!t.empty||t.single))){let t=[];for(let{line:e,token:i,indent:o,empty:s,single:r}of n)!r&&s||t.push({from:e.from+o,insert:i+" "});let i=e.changes(t);return{changes:i,selection:e.selection.map(i,1)}}if(1!=t&&n.some(t=>t.comment>=0)){let t=[];for(let{line:e,comment:i,token:o}of n)if(i>=0){let n=e.from+i,s=n+o.length;" "==e.text[s-e.from]&&s++,t.push({from:n,to:s})}return{changes:t}}return null}const Wb=xh.define(),Fb=xh.define(),Xb=Vc.define(),qb=Vc.define({combine:t=>Lh(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})}),Hb=eh.define({create:()=>hx.empty,update(t,e){let i=e.state.facet(qb),n=e.annotation(Wb);if(n){let o=tx.fromTransaction(e,n.selection),s=n.side,r=0==s?t.undone:t.done;return r=o?ex(r,r.length,i.minDepth,o):sx(r,e.startState.selection),new hx(0==s?n.rest:r,0==s?r:n.rest)}let o=e.annotation(Fb);if("full"!=o&&"before"!=o||(t=t.isolate()),!1===e.annotation(kh.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let s=tx.fromTransaction(e),r=e.annotation(kh.time),a=e.annotation(kh.userEvent);return s?t=t.addChanges(s,r,a,i,e):e.selection&&(t=t.addSelection(e.startState.selection,r,a,i.newGroupDelay)),"full"!=o&&"after"!=o||(t=t.isolate()),t},toJSON:t=>({done:t.done.map(t=>t.toJSON()),undone:t.undone.map(t=>t.toJSON())}),fromJSON:t=>new hx(t.done.map(tx.fromJSON),t.undone.map(tx.fromJSON))});function Vb(t={}){return[Hb,qb.of(t),vm.domEventHandlers({beforeinput(t,e){let i="historyUndo"==t.inputType?Ub:"historyRedo"==t.inputType?Gb:null;return!!i&&(t.preventDefault(),i(e))}})]}function Yb(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let o=i.field(Hb,!1);if(!o)return!1;let s=o.pop(t,i,e);return!!s&&(n(s),!0)}}const Ub=Yb(0,!1),Gb=Yb(1,!1),Kb=Yb(0,!0),Jb=Yb(1,!0);class tx{constructor(t,e,i,n,o){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=o}setSelAfter(t){return new tx(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(t=>t.toJSON())}}static fromJSON(t){return new tx(t.changes&&Lc.fromJSON(t.changes),[],t.mapped&&Ic.fromJSON(t.mapped),t.startSelection&&Xc.fromJSON(t.startSelection),t.selectionsAfter.map(Xc.fromJSON))}static fromTransaction(t,e){let i=nx;for(let e of t.startState.facet(Xb)){let n=e(t);n.length&&(i=i.concat(n))}return!i.length&&t.changes.empty?null:new tx(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,nx)}static selection(t){return new tx(void 0,nx,void 0,void 0,t)}}function ex(t,e,i,n){let o=e+1>i+20?e-i-1:0,s=t.slice(o,e);return s.push(n),s}function ix(t,e){return t.length?e.length?t.concat(e):t:e}const nx=[],ox=200;function sx(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-ox));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),ex(t,t.length-1,1e9,i.setSelAfter(n)))}return[tx.selection([e])]}function rx(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function ax(t,e){if(!t.length)return t;let i=t.length,n=nx;for(;i;){let o=lx(t[i-1],e,n);if(o.changes&&!o.changes.empty||o.effects.length){let e=t.slice(0,i);return e[i-1]=o,e}e=o.mapped,i--,n=o.selectionsAfter}return n.length?[tx.selection(n)]:nx}function lx(t,e,i){let n=ix(t.selectionsAfter.length?t.selectionsAfter.map(t=>t.map(e)):nx,i);if(!t.changes)return tx.selection(n);let o=t.changes.map(e),s=e.mapDesc(t.changes,!0),r=t.mapped?t.mapped.composeDesc(s):s;return new tx(o,Sh.mapEffects(t.effects,e),r,t.startSelection.map(s),n)}const cx=/^(input\.type|delete)($|\.)/;class hx{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new hx(this.done,this.undone):this}addChanges(t,e,i,n,o){let s=this.done,r=s[s.length-1];return s=r&&r.changes&&!r.changes.empty&&t.changes&&(!i||cx.test(i))&&(!r.selectionsAfter.length&&e-this.prevTime<n.newGroupDelay&&n.joinToEvent(o,function(t,e){let i=[],n=!1;return t.iterChangedRanges((t,e)=>i.push(t,e)),e.iterChangedRanges((t,e,o,s)=>{for(let t=0;t<i.length;){let e=i[t++],r=i[t++];s>=e&&o<=r&&(n=!0)}}),n}(r.changes,t.changes))||"input.type.compose"==i)?ex(s,s.length-1,n.minDepth,new tx(t.changes.compose(r.changes),ix(Sh.mapEffects(t.effects,r.changes),r.effects),r.mapped,r.startSelection,nx)):ex(s,s.length,n.minDepth,t),new hx(s,nx,e,i)}addSelection(t,e,i,n){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:nx;return o.length>0&&e-this.prevTime<n&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&(s=o[o.length-1],r=t,s.ranges.length==r.ranges.length&&0===s.ranges.filter((t,e)=>t.empty!=r.ranges[e].empty).length)?this:new hx(sx(this.done,t),this.undone,e,i);var s,r}addMapping(t){return new hx(ax(this.done,t),ax(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let n=0==t?this.done:this.undone;if(0==n.length)return null;let o=n[n.length-1],s=o.selectionsAfter[0]||e.selection;if(i&&o.selectionsAfter.length)return e.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:Wb.of({side:t,rest:rx(n),selection:s}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let i=1==n.length?nx:n.slice(0,n.length-1);return o.mapped&&(i=ax(i,o.mapped)),e.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:Wb.of({side:t,rest:i,selection:s}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}hx.empty=new hx(nx,nx);const ux=[{key:"Mod-z",run:Ub,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Gb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Gb,preventDefault:!0},{key:"Mod-u",run:Kb,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Jb,preventDefault:!0}];function dx(t,e){return Xc.create(t.ranges.map(e),t.mainIndex)}function fx(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function px({state:t,dispatch:e},i){let n=dx(t.selection,i);return!n.eq(t.selection,!0)&&(e(fx(t,n)),!0)}function mx(t,e){return Xc.cursor(e?t.to:t.from)}function gx(t,e){return px(t,i=>i.empty?t.moveByChar(i,e):mx(i,e))}function vx(t){return t.textDirectionAt(t.state.selection.main.head)==Cd.LTR}const yx=t=>gx(t,!vx(t)),Ox=t=>gx(t,vx(t));function bx(t,e){return px(t,i=>i.empty?t.moveByGroup(i,e):mx(i,e))}"undefined"!=typeof Intl&&Intl.Segmenter;function xx(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function wx(t,e,i){let n,o,s=mv(t).resolveInner(e.head),r=i?wa.closedBy:wa.openedBy;for(let n=e.head;;){let e=i?s.childAfter(n):s.childBefore(n);if(!e)break;xx(t,e,r)?s=e:n=i?e.to:e.from}return o=s.type.prop(r)&&(n=i?My(t,s.from,1):My(t,s.to,-1))&&n.matched?i?n.end.to:n.end.from:i?s.to:s.from,Xc.cursor(o,i?-1:1)}function _x(t,e){return px(t,i=>{if(!i.empty)return mx(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)})}const Sx=t=>_x(t,!1),kx=t=>_x(t,!0);function $x(t){let e,i=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,o=0;if(i){for(let e of t.state.facet(vm.scrollMargins)){let i=e(t);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(o=Math.max(null==i?void 0:i.bottom,o))}e=t.scrollDOM.clientHeight-n-o}else e=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:o,selfScroll:i,height:Math.max(t.defaultLineHeight,e-5)}}function Tx(t,e){let i,n=$x(t),{state:o}=t,s=dx(o.selection,i=>i.empty?t.moveVertically(i,e,n.height):mx(i,e));if(s.eq(o.selection))return!1;if(n.selfScroll){let e=t.coordsAtPos(o.selection.main.head),r=t.scrollDOM.getBoundingClientRect(),a=r.top+n.marginTop,l=r.bottom-n.marginBottom;e&&e.top>a&&e.bottom<l&&(i=vm.scrollIntoView(s.main.head,{y:"start",yMargin:e.top-a}))}return t.dispatch(fx(o,s),{effects:i}),!0}const Cx=t=>Tx(t,!1),Px=t=>Tx(t,!0);function Ex(t,e,i){let n=t.lineBlockAt(e.head),o=t.moveToLineBoundary(e,i);if(o.head==e.head&&o.head!=(i?n.to:n.from)&&(o=t.moveToLineBoundary(e,i,!1)),!i&&o.head==n.from&&n.length){let i=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&e.head!=n.from+i&&(o=Xc.cursor(n.from+i))}return o}function Ax(t,e,i){let n=!1,o=dx(t.selection,e=>{let o=My(t,e.head,-1)||My(t,e.head,1)||e.head>0&&My(t,e.head-1,1)||e.head<t.doc.length&&My(t,e.head+1,-1);if(!o||!o.end)return e;n=!0;let s=o.start.from==e.head?o.end.to:o.end.from;return i?Xc.range(e.anchor,s):Xc.cursor(s)});return!!n&&(e(fx(t,o)),!0)}function Mx(t,e){let i=dx(t.state.selection,t=>{let i=e(t);return Xc.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return!i.eq(t.state.selection)&&(t.dispatch(fx(t.state,i)),!0)}function Qx(t,e){return Mx(t,i=>t.moveByChar(i,e))}const Dx=t=>Qx(t,!vx(t)),Rx=t=>Qx(t,vx(t));function Ix(t,e){return Mx(t,i=>t.moveByGroup(i,e))}function Lx(t,e){return Mx(t,i=>t.moveVertically(i,e))}const Nx=t=>Lx(t,!1),jx=t=>Lx(t,!0);function zx(t,e){return Mx(t,i=>t.moveVertically(i,e,$x(t).height))}const Bx=t=>zx(t,!1),Zx=t=>zx(t,!0),Wx=({state:t,dispatch:e})=>(e(fx(t,{anchor:0})),!0),Fx=({state:t,dispatch:e})=>(e(fx(t,{anchor:t.doc.length})),!0),Xx=({state:t,dispatch:e})=>(e(fx(t,{anchor:t.selection.main.anchor,head:0})),!0),qx=({state:t,dispatch:e})=>(e(fx(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function Hx(t,e){let{state:i}=t,n=i.selection,o=i.selection.ranges.slice();for(let n of i.selection.ranges){let s=i.doc.lineAt(n.head);if(e?s.to<t.state.doc.length:s.from>0)for(let i=n;;){let n=t.moveVertically(i,e);if(n.head<s.from||n.head>s.to){o.some(t=>t.head==n.head)||o.push(n);break}if(n.head==i.head)break;i=n}}return o.length!=n.ranges.length&&(t.dispatch(fx(i,Xc.create(o,o.length-1))),!0)}function Vx(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,o=n.changeByRange(n=>{let{from:o,to:s}=n;if(o==s){let r=e(n);r<o?(i="delete.backward",r=Yx(t,r,!1)):r>o&&(i="delete.forward",r=Yx(t,r,!0)),o=Math.min(o,r),s=Math.max(s,r)}else o=Yx(t,o,!1),s=Yx(t,s,!0);return o==s?{range:n}:{changes:{from:o,to:s},range:Xc.cursor(o,o<n.head?-1:1)}});return!o.changes.empty&&(t.dispatch(n.update(o,{scrollIntoView:!0,userEvent:i,effects:"delete.selection"==i?vm.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function Yx(t,e,i){if(t instanceof vm)for(let n of t.state.facet(vm.atomicRanges).map(e=>e(t)))n.between(e,e,(t,n)=>{t<e&&n>e&&(e=i?n:t)});return e}const Ux=(t,e,i)=>Vx(t,n=>{let o,s,r=n.from,{state:a}=t,l=a.doc.lineAt(r);if(i&&!e&&r>l.from&&r<l.from+200&&!/[^ \t]/.test(o=l.text.slice(0,r-l.from))){if("\t"==o[o.length-1])return r-1;let t=tu(o,a.tabSize)%Cv(a)||Cv(a);for(let e=0;e<t&&" "==o[o.length-1-e];e++)r--;s=r}else s=Ec(l.text,r-l.from,e,e)+l.from,s==r&&l.number!=(e?a.doc.lines:1)?s+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(s-l.from,r-l.from))&&(s=Ec(l.text,s-l.from,!1,!1)+l.from);return s}),Gx=t=>Ux(t,!1,!0),Kx=t=>Ux(t,!0,!1),Jx=(t,e)=>Vx(t,i=>{let n=i.head,{state:o}=t,s=o.doc.lineAt(n),r=o.charCategorizer(n);for(let t=null;;){if(n==(e?s.to:s.from)){n==i.head&&s.number!=(e?o.doc.lines:1)&&(n+=e?1:-1);break}let a=Ec(s.text,n-s.from,e)+s.from,l=s.text.slice(Math.min(n,a)-s.from,Math.max(n,a)-s.from),c=r(l);if(null!=t&&c!=t)break;" "==l&&n==i.head||(t=c),n=a}return n}),tw=t=>Jx(t,!1);function ew(t){let e=[],i=-1;for(let n of t.selection.ranges){let o=t.doc.lineAt(n.from),s=t.doc.lineAt(n.to);if(n.empty||n.to!=s.from||(s=t.doc.lineAt(n.to-1)),i>=o.number){let t=e[e.length-1];t.to=s.to,t.ranges.push(n)}else e.push({from:o.from,to:s.to,ranges:[n]});i=s.number+1}return e}function iw(t,e,i){if(t.readOnly)return!1;let n=[],o=[];for(let e of ew(t)){if(i?e.to==t.doc.length:0==e.from)continue;let s=t.doc.lineAt(i?e.to+1:e.from-1),r=s.length+1;if(i){n.push({from:e.to,to:s.to},{from:e.from,insert:s.text+t.lineBreak});for(let i of e.ranges)o.push(Xc.range(Math.min(t.doc.length,i.anchor+r),Math.min(t.doc.length,i.head+r)))}else{n.push({from:s.from,to:e.from},{from:e.to,insert:t.lineBreak+s.text});for(let t of e.ranges)o.push(Xc.range(t.anchor-r,t.head-r))}}return!!n.length&&(e(t.update({changes:n,scrollIntoView:!0,selection:Xc.create(o,t.selection.mainIndex),userEvent:"move.line"})),!0)}function nw(t,e,i){if(t.readOnly)return!1;let n=[];for(let e of ew(t))i?n.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):n.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});return e(t.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ow=sw(!1);function sw(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:n,to:o}=i,s=e.doc.lineAt(n),r=!t&&n==o&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i,n=mv(t).resolveInner(e),o=n.childBefore(e),s=n.childAfter(e);return o&&s&&o.to<=e&&s.from>=e&&(i=o.type.prop(wa.closedBy))&&i.indexOf(s.name)>-1&&t.doc.lineAt(o.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(o.to,s.from))?{from:o.to,to:s.from}:null}(e,n);t&&(n=o=(o<=s.to?s:e.doc.lineAt(o)).to);let a=new Av(e,{simulateBreak:n,simulateDoubleBreak:!!r}),l=Ev(a,n);for(null==l&&(l=tu(/^\s*/.exec(e.doc.lineAt(n).text)[0],e.tabSize));o<s.to&&/\s/.test(s.text[o-s.from]);)o++;r?({from:n,to:o}=r):n>s.from&&n<s.from+100&&!/\S/.test(s.text.slice(0,n))&&(n=s.from);let c=["",Pv(e,l)];return r&&c.push(Pv(e,a.lineIndent(s.from,-1))),{changes:{from:n,to:o,insert:bc.of(c)},range:Xc.cursor(n+1+c[1].length)}});return i(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function rw(t,e){let i=-1;return t.changeByRange(n=>{let o=[];for(let s=n.from;s<=n.to;){let r=t.doc.lineAt(s);r.number>i&&(n.empty||n.to>r.from)&&(e(r,o,n),i=r.number),s=r.to+1}let s=t.changes(o);return{changes:o,range:Xc.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}const aw=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(rw(t,(e,i)=>{i.push({from:e.from,insert:t.facet(Tv)})}),{userEvent:"input.indent"})),!0),lw=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(rw(t,(e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let o=tu(n,t.tabSize),s=0,r=Pv(t,Math.max(0,o-Cv(t)));for(;s<n.length&&s<r.length&&n.charCodeAt(s)==r.charCodeAt(s);)s++;i.push({from:e.from+s,to:e.from+n.length,insert:r.slice(s)})}),{userEvent:"delete.dedent"})),!0),cw=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:t=>px(t,e=>wx(t.state,e,!vx(t))),shift:t=>Mx(t,e=>wx(t.state,e,!vx(t)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>px(t,e=>wx(t.state,e,vx(t))),shift:t=>Mx(t,e=>wx(t.state,e,vx(t)))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>iw(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>nw(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>iw(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>nw(t,e,!0)},{key:"Mod-Alt-ArrowUp",run:t=>Hx(t,!1)},{key:"Mod-Alt-ArrowDown",run:t=>Hx(t,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let i=t.selection,n=null;return i.ranges.length>1?n=Xc.create([i.main]):i.main.empty||(n=Xc.create([Xc.cursor(i.main.head)])),!!n&&(e(fx(t,n)),!0)}},{key:"Mod-Enter",run:sw(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let i=ew(t).map(({from:e,to:i})=>Xc.range(e,Math.min(i+1,t.doc.length)));return e(t.update({selection:Xc.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let i=dx(t.selection,e=>{let i=mv(t),n=i.resolveStack(e.from,1);if(e.empty){let t=i.resolveStack(e.from,-1);t.node.from>=n.node.from&&t.node.to<=n.node.to&&(n=t)}for(let t=n;t;t=t.next){let{node:i}=t;if((i.from<e.from&&i.to>=e.to||i.to>e.to&&i.from<=e.from)&&t.next)return Xc.range(i.to,i.from)}return e});return!i.eq(t.selection)&&(e(fx(t,i)),!0)},preventDefault:!0},{key:"Mod-[",run:lw},{key:"Mod-]",run:aw},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),n=new Av(t,{overrideIndentation:t=>{let e=i[t];return null==e?-1:e}}),o=rw(t,(e,o,s)=>{let r=Ev(n,e.from);if(null==r)return;/\S/.test(e.text)||(r=0);let a=/^\s*/.exec(e.text)[0],l=Pv(t,r);(a!=l||s.from<e.from+a.length)&&(i[e.from]=r,o.push({from:e.from,to:e.from+a.length,insert:l}))});return o.changes.empty||e(t.update(o,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:t=>{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(ew(e).map(({from:t,to:i})=>(t>0?t--:i<e.doc.length&&i++,{from:t,to:i}))),n=dx(e.selection,e=>{let i;if(t.lineWrapping){let n=t.lineBlockAt(e.head),o=t.coordsAtPos(e.head,e.assoc||1);o&&(i=n.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,i)}).map(i);return t.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>Ax(t,e,!1)},{key:"Mod-/",run:t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=jb(t.state,i.from);return n.line?Ib(t):!!n.block&&Nb(t)}},{key:"Alt-A",run:Lb},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:yx,shift:Dx,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>bx(t,!vx(t)),shift:t=>Ix(t,!vx(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>px(t,e=>Ex(t,e,!vx(t))),shift:t=>Mx(t,e=>Ex(t,e,!vx(t))),preventDefault:!0},{key:"ArrowRight",run:Ox,shift:Rx,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>bx(t,vx(t)),shift:t=>Ix(t,vx(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>px(t,e=>Ex(t,e,vx(t))),shift:t=>Mx(t,e=>Ex(t,e,vx(t))),preventDefault:!0},{key:"ArrowUp",run:Sx,shift:Nx,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Wx,shift:Xx},{mac:"Ctrl-ArrowUp",run:Cx,shift:Bx},{key:"ArrowDown",run:kx,shift:jx,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Fx,shift:qx},{mac:"Ctrl-ArrowDown",run:Px,shift:Zx},{key:"PageUp",run:Cx,shift:Bx},{key:"PageDown",run:Px,shift:Zx},{key:"Home",run:t=>px(t,e=>Ex(t,e,!1)),shift:t=>Mx(t,e=>Ex(t,e,!1)),preventDefault:!0},{key:"Mod-Home",run:Wx,shift:Xx},{key:"End",run:t=>px(t,e=>Ex(t,e,!0)),shift:t=>Mx(t,e=>Ex(t,e,!0)),preventDefault:!0},{key:"Mod-End",run:Fx,shift:qx},{key:"Enter",run:ow,shift:ow},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Gx,shift:Gx,preventDefault:!0},{key:"Delete",run:Kx,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:tw,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>Jx(t,!0),preventDefault:!0},{mac:"Mod-Backspace",run:t=>Vx(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:t=>Vx(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),preventDefault:!0}].concat([{key:"Ctrl-b",run:yx,shift:Dx,preventDefault:!0},{key:"Ctrl-f",run:Ox,shift:Rx},{key:"Ctrl-p",run:Sx,shift:Nx},{key:"Ctrl-n",run:kx,shift:jx},{key:"Ctrl-a",run:t=>px(t,e=>Xc.cursor(t.lineBlockAt(e.head).from,1)),shift:t=>Mx(t,e=>Xc.cursor(t.lineBlockAt(e.head).from))},{key:"Ctrl-e",run:t=>px(t,e=>Xc.cursor(t.lineBlockAt(e.head).to,-1)),shift:t=>Mx(t,e=>Xc.cursor(t.lineBlockAt(e.head).to))},{key:"Ctrl-d",run:Kx},{key:"Ctrl-h",run:Gx},{key:"Ctrl-k",run:t=>Vx(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)})},{key:"Ctrl-Alt-h",run:tw},{key:"Ctrl-o",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:bc.of(["",""])},range:Xc.cursor(t.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let i=e.from,n=t.doc.lineAt(i),o=i==n.from?i-1:Ec(n.text,i-n.from,!1)+n.from,s=i==n.to?i+1:Ec(n.text,i-n.from,!0)+n.from;return{changes:{from:o,to:s,insert:t.doc.slice(i,s).append(t.doc.slice(o,i))},range:Xc.cursor(s)}});return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Px}].map(t=>({mac:t.key,run:t.run,shift:t.shift}))));function hw(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var o=i[n];"string"==typeof o?t.setAttribute(n,o):null!=o&&(t[n]=o)}e++}for(;e<arguments.length;e++)uw(t,arguments[e]);return t}function uw(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var i=0;i<e.length;i++)uw(t,e[i])}}const dw="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class fw{constructor(t,e,i=0,n=t.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=o?t=>o(dw(t)):dw,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ac(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=Mc(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Qc(t);let n=this.normalize(e);if(n.length)for(let t=0,o=i;;t++){let s=n.charCodeAt(t),r=this.match(s,o,this.bufferPos+this.bufferStart);if(t==n.length-1){if(r)return this.value=r,this;break}o==i&&t<e.length&&e.charCodeAt(t)==s&&o++}}}match(t,e,i){let n=null;for(let e=0;e<this.matches.length;e+=2){let o=this.matches[e],s=!1;this.query.charCodeAt(o)==t&&(o==this.query.length-1?n={from:this.matches[e+1],to:i}:(this.matches[e]++,s=!0)),s||(this.matches.splice(e,2),e-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?n={from:e,to:i}:this.matches.push(1,e)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferStart)&&(n=null),n}}"undefined"!=typeof Symbol&&(fw.prototype[Symbol.iterator]=function(){return this});const pw={from:-1,to:-1,match:/.*/.exec("")},mw="gm"+(null==/x/.unicode?"":"u");class gw{constructor(t,e,i,n=0,o=t.length){if(this.text=t,this.to=o,this.curLine="",this.done=!1,this.value=pw,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new Ow(t,e,i,n,o);this.re=new RegExp(e,mw+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.iter=t.iter();let s=t.lineAt(n);this.curLineStart=s.from,this.matchPos=bw(t,n),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=bw(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<n||i>this.value.to)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),t=0}}}}const vw=new WeakMap;class yw{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,i){let n=vw.get(t);if(!n||n.from>=i||n.to<=e){let n=new yw(e,t.sliceString(e,i));return vw.set(t,n),n}if(n.from==e&&n.to==i)return n;let{text:o,from:s}=n;return s>e&&(o=t.sliceString(e,s)+o,s=e),n.to<i&&(o+=t.sliceString(n.to,i)),vw.set(t,new yw(s,o)),new yw(e,o.slice(e-s,i-s))}}class Ow{constructor(t,e,i,n,o){this.text=t,this.to=o,this.done=!1,this.value=pw,this.matchPos=bw(t,n),this.re=new RegExp(e,mw+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.flat=yw.get(t,n,this.chunkEnd(n+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,i=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,i,e)))return this.value={from:t,to:i,match:e},this.matchPos=bw(this.text,i+(t==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=yw.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function bw(t,e){if(e>=t.length)return e;let i,n=t.lineAt(e);for(;e<n.to&&(i=n.text.charCodeAt(e-n.from))>=56320&&i<57344;)e++;return e}function xw(t){let e=hw("input",{class:"cm-textfield",name:"line",value:String(t.state.doc.lineAt(t.state.selection.main.head).number)});function i(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!i)return;let{state:n}=t,o=n.doc.lineAt(n.selection.main.head),[,s,r,a,l]=i,c=a?+a.slice(1):0,h=r?+r:o.number;if(r&&l){let t=h/100;s&&(t=t*("-"==s?-1:1)+o.number/n.doc.lines),h=Math.round(n.doc.lines*t)}else r&&s&&(h=h*("-"==s?-1:1)+o.number);let u=n.doc.line(Math.max(1,Math.min(n.doc.lines,h))),d=Xc.cursor(u.from+Math.max(0,Math.min(c,u.length)));t.dispatch({effects:[ww.of(!1),vm.scrollIntoView(d.from,{y:"center"})],selection:d}),t.focus()}return{dom:hw("form",{class:"cm-gotoLine",onkeydown:e=>{27==e.keyCode?(e.preventDefault(),t.dispatch({effects:ww.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),i())},onsubmit:t=>{t.preventDefault(),i()}},hw("label",t.state.phrase("Go to line"),": ",e)," ",hw("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),hw("button",{name:"close",onclick:()=>{t.dispatch({effects:ww.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]))}}"undefined"!=typeof Symbol&&(gw.prototype[Symbol.iterator]=Ow.prototype[Symbol.iterator]=function(){return this});const ww=Sh.define(),_w=eh.define({create:()=>!0,update(t,e){for(let i of e.effects)i.is(ww)&&(t=i.value);return t},provide:t=>Lg.from(t,t=>t?xw:null)}),Sw=vm.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),kw={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},$w=Vc.define({combine:t=>Lh(t,kw,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});function Tw(t){let e=[Mw,Aw];return t&&e.push($w.of(t)),e}const Cw=gd.mark({class:"cm-selectionMatch"}),Pw=gd.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ew(t,e,i,n){return!(0!=i&&t(e.sliceDoc(i-1,i))==Mh.Word||n!=e.doc.length&&t(e.sliceDoc(n,n+1))==Mh.Word)}const Aw=pf.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet($w),{state:i}=t,n=i.selection;if(n.ranges.length>1)return gd.none;let o,s=n.main,r=null;if(s.empty){if(!e.highlightWordAroundCursor)return gd.none;let t=i.wordAt(s.head);if(!t)return gd.none;r=i.charCategorizer(s.head),o=i.sliceDoc(t.from,t.to)}else{let t=s.to-s.from;if(t<e.minSelectionLength||t>200)return gd.none;if(e.wholeWords){if(o=i.sliceDoc(s.from,s.to),r=i.charCategorizer(s.head),!Ew(r,i,s.from,s.to)||!function(t,e,i,n){return t(e.sliceDoc(i,i+1))==Mh.Word&&t(e.sliceDoc(n-1,n))==Mh.Word}(r,i,s.from,s.to))return gd.none}else if(o=i.sliceDoc(s.from,s.to),!o)return gd.none}let a=[];for(let n of t.visibleRanges){let t=new fw(i.doc,o,n.from,n.to);for(;!t.next().done;){let{from:n,to:o}=t.value;if((!r||Ew(r,i,n,o))&&(s.empty&&n<=s.from&&o>=s.to?a.push(Pw.range(n,o)):(n>=s.to||o<=s.from)&&a.push(Cw.range(n,o)),a.length>e.maxMatches))return gd.none}}return gd.set(a)}},{decorations:t=>t.decorations}),Mw=vm.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const Qw=Vc.define({combine:t=>Lh(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new l_(t),scrollToMatch:t=>vm.scrollIntoView(t)})});class Dw{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,mw),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new Bw(this):new Lw(this)}getCursor(t,e=0,i){let n=t.doc?t:Ih.create({doc:t});return null==i&&(i=n.doc.length),this.regexp?Nw(this,n,e,i):Iw(this,n,e,i)}}class Rw{constructor(t){this.spec=t}}function Iw(t,e,i,n){return new fw(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:t=>t.toLowerCase(),t.wholeWord?function(t,e){return(i,n,o,s)=>((s>i||s+o.length<n)&&(s=Math.max(0,i-2),o=t.sliceString(s,Math.min(t.length,n+2))),!(e(jw(o,i-s))==Mh.Word&&e(zw(o,i-s))==Mh.Word||e(zw(o,n-s))==Mh.Word&&e(jw(o,n-s))==Mh.Word))}(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}class Lw extends Rw{constructor(t){super(t)}nextMatch(t,e,i){let n=Iw(this.spec,t,i,t.doc.length).nextOverlapping();if(n.done){let i=Math.min(t.doc.length,e+this.spec.unquoted.length);n=Iw(this.spec,t,0,i).nextOverlapping()}return n.done||n.value.from==e&&n.value.to==i?null:n.value}prevMatchInRange(t,e,i){for(let n=i;;){let i=Math.max(e,n-1e4-this.spec.unquoted.length),o=Iw(this.spec,t,i,n),s=null;for(;!o.nextOverlapping().done;)s=o.value;if(s)return s;if(i==e)return null;n-=1e4}}prevMatch(t,e,i){let n=this.prevMatchInRange(t,0,e);return n||(n=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),!n||n.from==e&&n.to==i?null:n}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=Iw(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let o=Iw(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!o.next().done;)n(o.value.from,o.value.to)}}function Nw(t,e,i,n){return new gw(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(o=e.charCategorizer(e.selection.main.head),(t,e,i)=>!i[0].length||(o(jw(i.input,i.index))!=Mh.Word||o(zw(i.input,i.index))!=Mh.Word)&&(o(zw(i.input,i.index+i[0].length))!=Mh.Word||o(jw(i.input,i.index+i[0].length))!=Mh.Word)):void 0},i,n);var o}function jw(t,e){return t.slice(Ec(t,e,!1),e)}function zw(t,e){return t.slice(e,Ec(t,e))}class Bw extends Rw{nextMatch(t,e,i){let n=Nw(this.spec,t,i,t.doc.length).next();return n.done&&(n=Nw(this.spec,t,0,e).next()),n.done?null:n.value}prevMatchInRange(t,e,i){for(let n=1;;n++){let o=Math.max(e,i-1e4*n),s=Nw(this.spec,t,o,i),r=null;for(;!s.next().done;)r=s.value;if(r&&(o==e||r.from>o+10))return r;if(o==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(e,i)=>{if("&"==i)return t.match[0];if("$"==i)return"$";for(let e=i.length;e>0;e--){let n=+i.slice(0,e);if(n>0&&n<t.match.length)return t.match[n]+i.slice(e)}return e})}matchAll(t,e){let i=Nw(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let o=Nw(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!o.next().done;)n(o.value.from,o.value.to)}}const Zw=Sh.define(),Ww=Sh.define(),Fw=eh.define({create:t=>new Xw(i_(t).create(),null),update(t,e){for(let i of e.effects)i.is(Zw)?t=new Xw(i.value.create(),t.panel):i.is(Ww)&&(t=new Xw(t.query,i.value?e_:null));return t},provide:t=>Lg.from(t,t=>t.panel)});class Xw{constructor(t,e){this.query=t,this.panel=e}}const qw=gd.mark({class:"cm-searchMatch"}),Hw=gd.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Vw=pf.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Fw))}update(t){let e=t.state.field(Fw);(e!=t.startState.field(Fw)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return gd.none;let{view:i}=this,n=new Wh;for(let e=0,o=i.visibleRanges,s=o.length;e<s;e++){let{from:r,to:a}=o[e];for(;e<s-1&&a>o[e+1].from-500;)a=o[++e].to;t.highlight(i.state,r,a,(t,e)=>{let o=i.state.selection.ranges.some(i=>i.from==t&&i.to==e);n.add(t,e,o?Hw:qw)})}return n.finish()}},{decorations:t=>t.decorations});function Yw(t){return e=>{let i=e.state.field(Fw,!1);return i&&i.query.spec.valid?t(e,i):s_(e)}}const Uw=Yw((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let o=Xc.single(n.from,n.to),s=t.state.facet(Qw);return t.dispatch({selection:o,effects:[d_(t,n),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),o_(t),!0}),Gw=Yw((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,o=e.prevMatch(i,n,n);if(!o)return!1;let s=Xc.single(o.from,o.to),r=t.state.facet(Qw);return t.dispatch({selection:s,effects:[d_(t,o),r.scrollToMatch(s.main,t)],userEvent:"select.search"}),o_(t),!0}),Kw=Yw((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!(!i||!i.length)&&(t.dispatch({selection:Xc.create(i.map(t=>Xc.range(t.from,t.to))),userEvent:"select.search.matches"}),!0)}),Jw=Yw((t,{query:e})=>{let{state:i}=t,{from:n,to:o}=i.selection.main;if(i.readOnly)return!1;let s=e.nextMatch(i,n,n);if(!s)return!1;let r,a,l=s,c=[],h=[];l.from==n&&l.to==o&&(a=i.toText(e.getReplacement(l)),c.push({from:l.from,to:l.to,insert:a}),l=e.nextMatch(i,l.from,l.to),h.push(vm.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+".")));let u=t.state.changes(c);return l&&(r=Xc.single(l.from,l.to).map(u),h.push(d_(t,l)),h.push(i.facet(Qw).scrollToMatch(r.main,t))),t.dispatch({changes:u,selection:r,effects:h,userEvent:"input.replace"}),!0}),t_=Yw((t,{query:e})=>{if(t.state.readOnly)return!1;let i=e.matchAll(t.state,1e9).map(t=>{let{from:i,to:n}=t;return{from:i,to:n,insert:e.getReplacement(t)}});if(!i.length)return!1;let n=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:vm.announce.of(n),userEvent:"input.replace.all"}),!0});function e_(t){return t.state.facet(Qw).createPanel(t)}function i_(t,e){var i,n,o,s,r;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(Qw);return new Dw({search:(null!==(i=null==e?void 0:e.literal)&&void 0!==i?i:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(n=null==e?void 0:e.caseSensitive)&&void 0!==n?n:c.caseSensitive,literal:null!==(o=null==e?void 0:e.literal)&&void 0!==o?o:c.literal,regexp:null!==(s=null==e?void 0:e.regexp)&&void 0!==s?s:c.regexp,wholeWord:null!==(r=null==e?void 0:e.wholeWord)&&void 0!==r?r:c.wholeWord})}function n_(t){let e=Qg(t,e_);return e&&e.dom.querySelector("[main-field]")}function o_(t){let e=n_(t);e&&e==t.root.activeElement&&e.select()}const s_=t=>{let e=t.state.field(Fw,!1);if(e&&e.panel){let i=n_(t);if(i&&i!=t.root.activeElement){let n=i_(t.state,e.query.spec);n.valid&&t.dispatch({effects:Zw.of(n)}),i.focus(),i.select()}}else t.dispatch({effects:[Ww.of(!0),e?Zw.of(i_(t.state,e.query.spec)):Sh.appendConfig.of(p_)]});return!0},r_=t=>{let e=t.state.field(Fw,!1);if(!e||!e.panel)return!1;let i=Qg(t,e_);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Ww.of(!1)}),!0},a_=[{key:"Mod-f",run:s_,scope:"editor search-panel"},{key:"F3",run:Uw,shift:Gw,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Uw,shift:Gw,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:r_,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:o}=i.main,s=[],r=0;for(let e=new fw(t.doc,t.sliceDoc(n,o));!e.next().done;){if(s.length>1e3)return!1;e.value.from==n&&(r=s.length),s.push(Xc.range(e.value.from,e.value.to))}return e(t.update({selection:Xc.create(s,r),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:t=>{let e=Qg(t,xw);if(!e){let i=[ww.of(!0)];null==t.state.field(_w,!1)&&i.push(Sh.appendConfig.of([_w,Sw])),t.dispatch({effects:i}),e=Qg(t,xw)}return e&&e.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(t=>t.from===t.to))return(({state:t,dispatch:e})=>{let{selection:i}=t,n=Xc.create(i.ranges.map(e=>t.wordAt(e.head)||Xc.cursor(e.head)),i.mainIndex);return!n.eq(i)&&(e(t.update({selection:n})),!0)})({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(e=>t.sliceDoc(e.from,e.to)!=n))return!1;let o=function(t,e){let{main:i,ranges:n}=t.selection,o=t.wordAt(i.head),s=o&&o.from==i.from&&o.to==i.to;for(let i=!1,o=new fw(t.doc,e,n[n.length-1].to);;){if(o.next(),!o.done){if(i&&n.some(t=>t.from==o.value.from))continue;if(s){let e=t.wordAt(o.value.from);if(!e||e.from!=o.value.from||e.to!=o.value.to)continue}return o.value}if(i)return null;o=new fw(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),i=!0}}(t,n);return!!o&&(e(t.update({selection:t.selection.addRange(Xc.range(o.from,o.to),!1),effects:vm.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class l_{constructor(t){this.view=t;let e=this.query=t.state.field(Fw).query.spec;function i(t,e,i){return hw("button",{class:"cm-button",name:t,onclick:e,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=hw("input",{value:e.search,placeholder:c_(t,"Find"),"aria-label":c_(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=hw("input",{value:e.replace,placeholder:c_(t,"Replace"),"aria-label":c_(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=hw("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=hw("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=hw("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=hw("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,i("next",()=>Uw(t),[c_(t,"next")]),i("prev",()=>Gw(t),[c_(t,"previous")]),i("select",()=>Kw(t),[c_(t,"all")]),hw("label",null,[this.caseField,c_(t,"match case")]),hw("label",null,[this.reField,c_(t,"regexp")]),hw("label",null,[this.wordField,c_(t,"by word")]),...t.state.readOnly?[]:[hw("br"),this.replaceField,i("replace",()=>Jw(t),[c_(t,"replace")]),i("replaceAll",()=>t_(t),[c_(t,"replace all")])],hw("button",{name:"close",onclick:()=>r_(t),"aria-label":c_(t,"close"),type:"button"},["×"])])}commit(){let t=new Dw({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Zw.of(t)}))}keydown(t){var e,i,n;e=this.view,i=t,n="search-panel",Am(Tm(e.state),i,e,n)?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Gw:Uw)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),Jw(this.view))}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(Zw)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Qw).top}}function c_(t,e){return t.state.phrase(e)}const h_=30,u_=/[\s\.,:;?!]/;function d_(t,{from:e,to:i}){let n=t.state.doc.lineAt(e),o=t.state.doc.lineAt(i).to,s=Math.max(n.from,e-h_),r=Math.min(o,i+h_),a=t.state.sliceDoc(s,r);if(s!=n.from)for(let t=0;t<h_;t++)if(!u_.test(a[t+1])&&u_.test(a[t])){a=a.slice(t);break}if(r!=o)for(let t=a.length-1;t>a.length-h_;t--)if(!u_.test(a[t-1])&&u_.test(a[t])){a=a.slice(0,t);break}return vm.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${n.number}.`)}const f_=vm.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),p_=[Fw,ah.low(Vw),f_];class m_{constructor(t,e,i){this.from=t,this.to=e,this.diagnostic=i}}class g_{constructor(t,e,i){this.diagnostics=t,this.panel=e,this.selected=i}static init(t,e,i){let n=i.facet(P_).markerFilter;n&&(t=n(t,i));let o=t.slice().sort((t,e)=>t.from-e.from||t.to-e.to),s=new Wh,r=[],a=0,l=i.doc.iter(),c=0,h=i.doc.length;for(let t=0;;){let e,i,n=t==o.length?null:o[t];if(!n&&!r.length)break;if(r.length)e=a,i=r.reduce((t,e)=>Math.min(t,e.to),n&&n.from>e?n.from:1e8);else{if(e=n.from,e>h)break;i=n.to,r.push(n),t++}for(;t<o.length;){let n=o[t];if(n.from!=e||!(n.to>n.from||n.to==e)){i=Math.min(n.from,i);break}r.push(n),t++,i=Math.min(n.to,i)}i=Math.min(i,h);let u=!1;if(r.some(t=>t.from==e&&(t.to==i||i==h))&&(u=e==i,!u&&i-e<10)){let t=e-(c+l.value.length);t>0&&(l.next(t),c=e);for(let t=e;;){if(t>=i){u=!0;break}if(!l.lineBreak&&c+l.value.length>t)break;t=c+l.value.length,c+=l.value.length,l.next()}}let d=z_(r);if(u)s.add(e,e,gd.widget({widget:new Q_(d),diagnostics:r.slice()}));else{let t=r.reduce((t,e)=>e.markClass?t+" "+e.markClass:t,"");s.add(e,i,gd.mark({class:"cm-lintRange cm-lintRange-"+d+t,diagnostics:r.slice(),inclusiveEnd:r.some(t=>t.to>i)}))}if(a=i,a==h)break;for(let t=0;t<r.length;t++)r[t].to<=a&&r.splice(t--,1)}let u=s.finish();return new g_(u,e,v_(u))}}function v_(t,e=null,i=0){let n=null;return t.between(i,1e9,(t,i,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(n){if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new m_(n.from,i,n.diagnostic)}else n=new m_(t,i,e||o.diagnostics[0])}),n}function y_(t,e){let i=e.pos,n=e.end||i,o=t.state.facet(P_).hideOn(t,i,n);if(null!=o)return o;let s=t.startState.doc.lineAt(e.pos);return!(!t.effects.some(t=>t.is(b_))&&!t.changes.touchesRange(s.from,Math.max(s.to,n)))}function O_(t,e){return t.field(__,!1)?e:e.concat(Sh.appendConfig.of(B_))}const b_=Sh.define(),x_=Sh.define(),w_=Sh.define(),__=eh.define({create:()=>new g_(gd.none,null,null),update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),n=null,o=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);n=v_(i,t.selected.diagnostic,o)||v_(i,null,o)}!i.size&&o&&e.state.facet(P_).autoPanel&&(o=null),t=new g_(i,o,n)}for(let i of e.effects)if(i.is(b_)){let n=e.state.facet(P_).autoPanel?i.value.length?R_.open:null:t.panel;t=g_.init(i.value,n,e.state)}else i.is(x_)?t=new g_(t.diagnostics,i.value?R_.open:null,t.selected):i.is(w_)&&(t=new g_(t.diagnostics,t.panel,i.value));return t},provide:t=>[Lg.from(t,t=>t.panel),vm.decorations.from(t,t=>t.diagnostics)]});const S_=gd.mark({class:"cm-lintRange cm-lintRange-active"});function k_(t,e,i){let n,{diagnostics:o}=t.state.field(__),s=-1,r=-1;o.between(e-(i<0?1:0),e+(i>0?1:0),(t,o,{spec:a})=>{if(e>=t&&e<=o&&(t==o||(e>t||i>0)&&(e<o||i<0)))return n=a.diagnostics,s=t,r=o,!1});let a=t.state.facet(P_).tooltipFilter;return n&&a&&(n=a(n,t.state)),n?{pos:s,end:r,above:t.state.doc.lineAt(s).to<r,create:()=>({dom:$_(t,n)})}:null}function $_(t,e){return hw("ul",{class:"cm-tooltip-lint"},e.map(e=>M_(t,e,!1)))}const T_=t=>{let e=t.state.field(__,!1);return!(!e||!e.panel)&&(t.dispatch({effects:x_.of(!1)}),!0)},C_=[{key:"Mod-Shift-m",run:t=>{let e=t.state.field(__,!1);e&&e.panel||t.dispatch({effects:O_(t.state,[x_.of(!0)])});let i=Qg(t,R_.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(__,!1);if(!e)return!1;let i=t.state.selection.main,n=e.diagnostics.iter(i.to+1);return!(!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==i.from&&n.to==i.to))&&(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)}}];const P_=Vc.define({combine:t=>({sources:t.map(t=>t.source).filter(t=>null!=t),...Lh(t.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:E_,tooltipFilter:E_,needsRefresh:(t,e)=>t?e?i=>t(i)||e(i):t:e,hideOn:(t,e)=>t?e?(i,n,o)=>t(i,n,o)||e(i,n,o):t:e,autoPanel:(t,e)=>t||e})})});function E_(t,e){return t?e?(i,n)=>e(t(i,n),n):t:e}function A_(t){let e=[];if(t)t:for(let{name:i}of t){for(let t=0;t<i.length;t++){let n=i[t];if(/[a-zA-Z]/.test(n)&&!e.some(t=>t.toLowerCase()==n.toLowerCase())){e.push(n);continue t}}e.push("")}return e}function M_(t,e,i){var n;let o=i?A_(e.actions):[];return hw("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},hw("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(n=e.actions)||void 0===n?void 0:n.map((i,n)=>{let s=!1,r=n=>{if(n.preventDefault(),s)return;s=!0;let o=v_(t.state.field(__).diagnostics,e);o&&i.apply(t,o.from,o.to)},{name:a}=i,l=o[n]?a.indexOf(o[n]):-1,c=l<0?a:[a.slice(0,l),hw("u",a.slice(l,l+1)),a.slice(l+1)];return hw("button",{type:"button",class:"cm-diagnosticAction"+(i.markClass?" "+i.markClass:""),onclick:r,onmousedown:r,"aria-label":` Action: ${a}${l<0?"":` (access key "${o[n]})"`}.`},c)}),e.source&&hw("div",{class:"cm-diagnosticSource"},e.source))}class Q_ extends pd{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return hw("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class D_{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=M_(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class R_{constructor(t){this.view=t,this.items=[];this.list=hw("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e=>{if(27==e.keyCode)T_(this.view),this.view.focus();else if(38==e.keyCode||33==e.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==e.keyCode||34==e.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==e.keyCode)this.moveSelection(0);else if(35==e.keyCode)this.moveSelection(this.items.length-1);else if(13==e.keyCode)this.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:i}=this.items[this.selectedIndex],n=A_(i.actions);for(let o=0;o<n.length;o++)if(n[o].toUpperCase().charCodeAt(0)==e.keyCode){let e=v_(this.view.state.field(__).diagnostics,i);e&&i.actions[o].apply(t,e.from,e.to)}}}e.preventDefault()},onclick:t=>{for(let e=0;e<this.items.length;e++)this.items[e].dom.contains(t.target)&&this.moveSelection(e)}}),this.dom=hw("div",{class:"cm-panel-lint"},this.list,hw("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>T_(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(__).selected;if(!t)return-1;for(let e=0;e<this.items.length;e++)if(this.items[e].diagnostic==t.diagnostic)return e;return-1}update(){let{diagnostics:t,selected:e}=this.view.state.field(__),i=0,n=!1,o=null,s=new Set;for(t.between(0,this.view.state.doc.length,(t,r,{spec:a})=>{for(let t of a.diagnostics){if(s.has(t))continue;s.add(t);let r,a=-1;for(let e=i;e<this.items.length;e++)if(this.items[e].diagnostic==t){a=e;break}a<0?(r=new D_(this.view,t),this.items.splice(i,0,r),n=!0):(r=this.items[a],a>i&&(this.items.splice(i,a-i),n=!0)),e&&r.diagnostic==e.diagnostic?r.dom.hasAttribute("aria-selected")||(r.dom.setAttribute("aria-selected","true"),o=r):r.dom.hasAttribute("aria-selected")&&r.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)n=!0,this.items.pop();0==this.items.length&&(this.items.push(new D_(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),n=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:t,panel:e})=>{let i=e.height/this.list.offsetHeight;t.top<e.top?this.list.scrollTop-=(e.top-t.top)/i:t.bottom>e.bottom&&(this.list.scrollTop+=(t.bottom-e.bottom)/i)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let t=this.list.firstChild;function e(){let e=t;t=e.nextSibling,e.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)e();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=v_(this.view.state.field(__).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:w_.of(e)})}static open(t){return new R_(t)}}function I_(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function L_(t){return I_(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const N_=vm.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:L_("#d11")},".cm-lintRange-warning":{backgroundImage:L_("orange")},".cm-lintRange-info":{backgroundImage:L_("#999")},".cm-lintRange-hint":{backgroundImage:L_("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function j_(t){return"error"==t?4:"warning"==t?3:"info"==t?2:1}function z_(t){let e="hint",i=1;for(let n of t){let t=j_(n.severity);t>i&&(i=t,e=n.severity)}return e}const B_=[__,vm.decorations.compute([__],t=>{let{selected:e,panel:i}=t.field(__);return e&&i&&e.from!=e.to?gd.set([S_.range(e.from,e.to)]):gd.none}),Pg(k_,{hideOn:y_}),N_];const Z_=(()=>[ov(),av,eg(),Vb(),hy(),jm(),[qm,Hm],Ih.allowMultipleSelections.of(!0),Ih.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,o=i.lineAt(n);if(n>o.from+200)return t;let s=i.sliceString(o.from,n);if(!e.some(t=>t.test(s)))return t;let{state:r}=t,a=-1,l=[];for(let{head:t}of r.selection.ranges){let e=r.doc.lineAt(t);if(e.from==a)continue;a=e.from;let i=Ev(r,e.from);if(null==i)continue;let n=/^\s*/.exec(e.text)[0],o=Pv(r,i);n!=o&&l.push({from:e.from,to:e.from+n.length,insert:o})}return l.length?[t,{changes:l,sequential:!0}]:t}),gy(Oy,{fallback:!0}),Cy(),[tb,YO],cb(),hg(),fg(),rg,Tw(),km.of([...eb,...cw,...a_,...ux,...ey,...hb,...C_])])();function W_(t,e){const i=vm.theme({"&":{height:.6*e+"px"}}),n=new vm({doc:t.value,extensions:[Z_,Ab(),gy(Oy),i]});return t.parentNode.insertBefore(n.dom,t),t.style.display="none",n}function F_(t){return!t||window.confirm("There is a change that has not been saved. If you proceed now, you will lose it.")}var X_=i(2628),q_=i.n(X_);function H_(t,e){t.element.classList.remove("textae-editor__load-dialog__overlay-dropzone--maximized"),t.element.style.zIndex=e}class V_{#Us;get template(){return'\n<div class="textae-editor__load-dialog__row">\n <label>\n Local\n </label>\n <form class="dropzone textae-editor__load-dialog__dropzone">\n <div class="dz-message">\n Drop a file here or click to select\n </div>\n </form>\n <div class="textae-editor__load-dialog__dz-file-preview">\n <div class="dz-filename"><span data-dz-name>No file selected</span></div>\n </div>\n <input\n type="button"\n class="textae-editor__load-dialog__local-button"\n disabled="disabled"\n value="Open">\n</div>\n'}bind(t,e){c()(t,".textae-editor__load-dialog__local-button","click",()=>e(this.#Us))}intiializeDropzone(t){const e={url:"nothing",previewsContainer:".textae-editor__load-dialog__dz-file-preview",previewTemplate:t.querySelector(".textae-editor__load-dialog__dz-file-preview").innerHTML},i=new(q_())("body > div.ui-widget-overlay.ui-front",{...e,clickable:!1}),n=i.element.style.zIndex;i.on("dragenter",()=>function(t){const{element:e}=t;e.classList.add("textae-editor__load-dialog__overlay-dropzone--maximized"),e.style.zIndex=parseInt(e.style.zIndex)+1}(i)).on("dragleave",()=>H_(i,n)).on("addedfile",e=>{H_(i,n),this.#Gs(t,e)});new(q_())(".textae-editor__load-dialog__dropzone",e).on("addedfile",e=>{this.#Gs(t,e)})}#Gs(t,e){t.querySelector(".textae-editor__load-dialog__dz-file-preview").firstElementChild.remove(),t.querySelector(".textae-editor__load-dialog__dz-file-preview > div").setAttribute("title",e.name),this.#Us=e,Xs(t.querySelector(".textae-editor__load-dialog__local-button"),!0)}}class Y_{#Ks;constructor(t){this.#Ks=t}get template(){return st`
1038
+ <div class="textae-editor__load-dialog__row">
1039
+ <label>
1040
+ URL
1041
+ </label>
1042
+ <input
1043
+ type="text"
1044
+ value="${this.#Ks}"
1045
+ class="textae-editor__load-dialog__url-text">
1046
+ <input
1047
+ type="button"
1048
+ class="textae-editor__load-dialog__url-button"
1049
+ ${this.#Ks?"":'disabled="disabled"'}
1050
+ value="Open">
1051
+ </div>
1052
+ `}bind(t,e){c()(t,".textae-editor__load-dialog__url-text","input",t=>{Xs(t.target.nextElementSibling,t.target.value)}),c()(t,".textae-editor__load-dialog__url-button","click",t=>e(t.target.previousElementSibling.value))}}class U_ extends p{#Js;constructor(t,e,i,n,o,s){const r=new Y_(e),a=new V_;super(t,function(t){const{url:e,local:i}=t;return`\n<div class="textae-editor__load-dialog__container">\n ${e}\n ${i}\n <div class="textae-editor__load-dialog__row">\n <div class="textae-editor__load-dialog__format">\n <label class="textae-editor__load-dialog__format-button">\n <input type="radio" name="format" value="json" checked>JSON\n </label>\n <label class="textae-editor__load-dialog__format-button">\n <input type="radio" name="format" value="inline">Text\n </label>\n </div>\n <textarea class="textae-editor__load-dialog__textarea"></textarea>\n <input type="button" value="Edit" class="edit" disabled="disabled">\n <input type="button" value="Open" class="instant" disabled="disabled">\n </div>\n</div>`}({url:r.template,local:a.template})),this.#Js=a,r.bind(super.el,t=>{F_(s)&&i(t),super.close()}),this.#Js.bind(super.el,t=>{F_(s)&&n(t),super.close()}),c()(super.el,".textae-editor__load-dialog__textarea","input",t=>{Xs(super.el.querySelector('[type="button"].instant'),t.target.value),Xs(super.el.querySelector('[type="button"].edit'),t.target.value)});let l=null;c()(super.el,'[type="button"].instant',"click",()=>{const t=l?l.state.doc.toString():super.el.querySelector(".textae-editor__load-dialog__textarea").value,e=this.#tr();F_(s)&&o(t,e),super.close()}),c()(super.el,'[type="button"].edit',"click",()=>{this.#er();const t=super.el.querySelector(".textae-editor__load-dialog__textarea"),e=this.#tr();"json"===e&&dn(t.value)&&(t.value=JSON.stringify(JSON.parse(t.value),null,2));const i=super.el.closest(".textae-editor__dialog").clientHeight;l="json"===e?W_(t,i):function(t,e){const i=vm.theme({"&":{height:.6*e+"px"}}),n=new vm({doc:t.value,extensions:[Z_,gy(Oy),i]});return t.parentNode.insertBefore(n.dom,t),t.style.display="none",n}(t,i);const n=super.el.querySelectorAll('.textae-editor__load-dialog__format-button input[type="radio"]');for(const t of n)t.disabled=!0;super.el.querySelector('[type="button"].edit').disabled=!0})}open(){super.open(),this.#Js.intiializeDropzone(super.el)}#er(){super.el.closest(".textae-editor__dialog").classList.add("textae-editor__load-dialog--expanded")}#tr(){return super.el.querySelector('input[name="format"]:checked').value}}class G_ extends p{#Js;constructor(t,e,i,n,o,s){const r=new Y_(e),a=new V_;super(t,function(t){const{url:e,local:i}=t;return`\n<div class="textae-editor__load-dialog__container">\n ${e}\n ${i}\n <div class="textae-editor__load-dialog__row json">\n <label>\n JSON\n </label>\n <textarea class="textae-editor__load-dialog__textarea"></textarea>\n <input type="button" value="Edit" class="edit" disabled="disabled">\n <input type="button" value="Open" class="instant" disabled="disabled">\n </div>\n</div>`}({url:r.template,local:a.template})),this.#Js=a,r.bind(super.el,t=>{F_(s)&&i(t),super.close()}),this.#Js.bind(super.el,t=>{F_(s)&&n(t),super.close()}),c()(super.el,".textae-editor__load-dialog__textarea","input",t=>{Xs(super.el.querySelector('[type="button"].instant'),t.target.value),Xs(super.el.querySelector('[type="button"].edit'),t.target.value)});let l=null;c()(super.el,'[type="button"].instant',"click",()=>{const t=l?l.state.doc.toString():super.el.querySelector(".textae-editor__load-dialog__textarea").value;F_(s)&&o(t),super.close()}),c()(super.el,'[type="button"].edit',"click",()=>{this.#er();const t=super.el.querySelector(".textae-editor__load-dialog__textarea");dn(t.value)&&(t.value=JSON.stringify(JSON.parse(t.value),null,2));const e=super.el.closest(".textae-editor__dialog").clientHeight;l=W_(t,e),super.el.querySelector('[type="button"].edit').disabled=!0})}open(){super.open(),this.#Js.intiializeDropzone(super.el)}#er(){super.el.closest(".textae-editor__dialog").classList.add("textae-editor__load-dialog--expanded")}}function K_(t){const e=new Blob([JSON.stringify(t)],{type:"application/json"});return URL.createObjectURL(e)}function J_(t,e){if("json"===e)return K_(t);if("inline"===e){const e=un.generate(t),i=new Blob([e],{type:"text/plain;charset=utf-8"});return URL.createObjectURL(i)}}function tS(t,e,i,n){t.preventDefault();!function(t,e){const i=document.createElement("a");i.setAttribute("href",t),i.setAttribute("download",e),document.body.appendChild(i),i.click(),document.body.removeChild(i)}(J_(e,i),t.target.previousElementSibling.value),n.emit("textae-event.resource.annotation.save",e)}function eS(t,e,i,o,s,r){c()(e,".textae-editor__save-dialog__url-text","input",t=>{Xs(t.target.nextElementSibling,t.target.value)}),c()(e,".textae-editor__save-dialog__url-text","keyup",t=>{if(13===t.keyCode){const e=r();s(t.target.value,e),o()}}),c()(e,".textae-editor__save-dialog__url-button","click",t=>{const e=r();s(t.target.previousElementSibling.value,e),o()}),c()(e,".textae-editor__save-dialog__download-link","click",e=>{const s=r();try{tS(e,i,s,t)}catch(t){n().error(`Failed to download the source as ${s} format.`)}finally{o()}}),c()(e,".textae-editor__save-dialog__viewsource-link","click",()=>{const e=r();try{!function(t,e,i){const n=J_(t,e);window.open(n,"_blank"),i.emit("textae-event.resource.annotation.save",t)}(i,e,t)}catch(t){n().error(`Failed to view the source as ${e} format.`)}finally{o()}})}class iS extends p{constructor(t,e,i,n,o){super("Save Annotations",function(t){const{url:e,filename:i}=t;return`\n<div class="textae-editor__save-dialog__container">\n <div class="textae-editor__save-dialog__row">\n <span>Format</span>\n <div class="textae-editor__save-dialog__format">\n <label class="textae-editor__save-dialog__format-button">\n <input type="radio" name="format" value="json" checked>JSON\n </label>\n <label class="textae-editor__save-dialog__format-button">\n <input type="radio" name="format" value="inline">Text\n </label>\n </div>\n </div>\n <div class="textae-editor__save-dialog__row">\n <label>URL</label>\n <input\n type="text"\n value="${e}"\n class="textae-editor__save-dialog__url-text">\n <input\n type="button"\n class="textae-editor__save-dialog__url-button"\n ${e?"":'disabled="disabled"'}\n value="Save">\n </div>\n <div class="textae-editor__save-dialog__row">\n <label>Local</label>\n <input\n type="text"\n value="${i||""}"\n >\n <a class="textae-editor__save-dialog__download-link" href="#">Download</a>\n </div>\n <div class="textae-editor__save-dialog__row">\n <a class="textae-editor__save-dialog__viewsource-link" href="#">Click to see the source in a new window.</a>\n </div>\n</div>\n`}({filename:i,url:e})),eS(t,super.el,n,()=>super.close(),o,()=>super.el.querySelector('input[name="format"]:checked').value)}}const nS=class{format(t,e){const i={};this.prepareContext(i);const n=i;return this.recurse(n,t,e),this.finalize(n)}prepareContext(t){t.buffer=[],t.out=function(...t){if(!this.buffer)throw new Error("context buffer is not initialized");this.buffer.push(...t)}}typeFormattterNotFound(t,e){throw new Error(`cannot format delta type: ${e}`)}typeFormattterErrorFormatter(t,e,i,n,o,s,r){}finalize({buffer:t}){return Array.isArray(t)?t.join(""):""}recurse(t,e,i,n,o,s,r){const a=e&&s?s.value:i;if(void 0===e&&void 0===n)return;const l=this.getDeltaType(e,s),c="node"===l?"a"===e._t?"array":"object":"";let h;void 0!==n?this.nodeBegin(t,n,o,l,c,null!=r&&r):this.rootBegin(t,l,c);try{h="unknown"!==l?this[`format_${l}`]:this.typeFormattterNotFound(t,l),h.call(this,t,e,a,n,o,s)}catch(i){this.typeFormattterErrorFormatter(t,i,e,a,n,o,s),"undefined"!=typeof console&&console.error&&console.error(i.stack)}void 0!==n?this.nodeEnd(t,n,o,l,c,null!=r&&r):this.rootEnd(t,l,c)}formatDeltaChildren(t,e,i){this.forEachDeltaKey(e,i,(n,o,s,r)=>{this.recurse(t,e[n],i?i[o]:void 0,n,o,s,r)})}forEachDeltaKey(t,e,i){const n=[];if(!("a"===t._t)){const o=Object.keys(t);"object"==typeof e&&null!==e&&n.push(...Object.keys(e));for(const t of o)n.indexOf(t)>=0||n.push(t);for(let t=0;t<n.length;t++){const e=n[t];if(void 0===e)continue;const o=t===n.length-1;i(e,e,void 0,o)}return}const o={};for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const i=t[e];if(Array.isArray(i)&&3===i[2]){o[i[1]]=Number.parseInt(e.substring(1))}}const s=t;let r=0,a=0;const l=Array.isArray(e)?e:void 0,c=l?l.length:Object.keys(s).reduce((t,e)=>{if("_t"===e)return t;if("_"===e.substring(0,1)){const i=s[e],n=Number.parseInt(e.substring(1)),o=Array.isArray(i)&&i.length>=3&&3===i[2]?i[1]:void 0,r=Math.max(n,null!=o?o:0);return r>t?r:t}const i=Number.parseInt(e),n=o[i],r=Math.max(null!=n?n:0,null!=i?i:0);return r>t?r:t},0)+1;let h,u=c;const d=(...t)=>{h&&i(...h),h=t};for(;r<c||a<u||`${a}`in s;){let t=!1;const e=`_${r}`,i=`${a}`,n=a in o?o[a]:void 0;if(e in s){t=!0;const i=s[e];d(e,null!=n?n:r,n?{key:`_${n}`,value:l?l[n]:void 0}:void 0,!1),Array.isArray(i)?0===i[2]?(u--,r++):(i[2],r++):r++}if(i in s){t=!0;const e=s[i],o=Array.isArray(e)&&1===e.length;d(i,null!=n?n:r,n?{key:`_${n}`,value:l?l[n]:void 0}:void 0,!1),o?(u++,a++):void 0===n?(r++,a++):a++}t||((l&&void 0===n||!1!==this.includeMoveDestinations)&&d(i,null!=n?n:r,n?{key:`_${n}`,value:l?l[n]:void 0}:void 0,!1),void 0!==n||r++,a++)}h&&i(h[0],h[1],h[2],!0)}getDeltaType(t,e){if(void 0===t)return void 0!==e?"movedestination":"unchanged";if(Array.isArray(t)){if(1===t.length)return"added";if(2===t.length)return"modified";if(3===t.length&&0===t[2])return"deleted";if(3===t.length&&2===t[2])return"textdiff";if(3===t.length&&3===t[2])return"moved"}else if("object"==typeof t)return"node";return"unknown"}parseTextDiff(t){var e;const i=[],n=t.split("\n@@ ");for(const t of n){const n={pieces:[]},o=null===(e=/^(?:@@ )?[-+]?(\d+),(\d+)/.exec(t))||void 0===e?void 0:e.slice(1);if(!o)throw new Error("invalid text diff format");Ve(o),n.location={line:o[0],chr:o[1]};const s=t.split("\n").slice(1);for(let t=0,e=s.length;t<e;t++){const e=s[t];if(void 0===e||!e.length)continue;const i={type:"context"};"+"===e.substring(0,1)?i.type="added":"-"===e.substring(0,1)&&(i.type="deleted"),i.text=e.slice(1),n.pieces.push(i)}i.push(n)}return i}};class oS extends nS{typeFormattterErrorFormatter(t,e){const i="object"==typeof e&&null!==e&&"message"in e&&"string"==typeof e.message?e.message:String(e);t.out(`<pre class="jsondiffpatch-error">${sS(i)}</pre>`)}formatValue(t,e){const i=void 0===e?"undefined":sS(JSON.stringify(e,null,2));t.out(`<pre>${i}</pre>`)}formatTextDiffString(t,e){const i=this.parseTextDiff(e);t.out('<ul class="jsondiffpatch-textdiff">');for(let e=0,n=i.length;e<n;e++){const n=i[e];if(void 0===n)return;t.out(`<li><div class="jsondiffpatch-textdiff-location"><span class="jsondiffpatch-textdiff-line-number">${n.location.line}</span><span class="jsondiffpatch-textdiff-char">${n.location.chr}</span></div><div class="jsondiffpatch-textdiff-line">`);const o=n.pieces;for(let e=0,i=o.length;e<i;e++){const i=o[e];if(void 0===i)return;t.out(`<span class="jsondiffpatch-textdiff-${i.type}">${sS(decodeURI(i.text))}</span>`)}t.out("</div></li>")}t.out("</ul>")}rootBegin(t,e,i){const n=`jsondiffpatch-${e}${i?` jsondiffpatch-child-node-type-${i}`:""}`;t.out(`<div class="jsondiffpatch-delta ${n}">`)}rootEnd(t){t.out("</div>"+(t.hasArrows?`<script type="text/javascript">setTimeout(${rS.toString()},10);<\/script>`:""))}nodeBegin(t,e,i,n,o){const s=`jsondiffpatch-${n}${o?` jsondiffpatch-child-node-type-${o}`:""}`,r="number"==typeof i&&"_"===e.substring(0,1)?e.substring(1):e;t.out(`<li class="${s}" data-key="${sS(e)}"><div class="jsondiffpatch-property-name">${sS(r)}</div>`)}nodeEnd(t){t.out("</li>")}format_unchanged(t,e,i){void 0!==i&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,i),t.out("</div>"))}format_movedestination(t,e,i){void 0!==i&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,i),t.out("</div>"))}format_node(t,e,i){const n="a"===e._t?"array":"object";t.out(`<ul class="jsondiffpatch-node jsondiffpatch-node-type-${n}">`),this.formatDeltaChildren(t,e,i),t.out("</ul>")}format_added(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out("</div>")}format_modified(t,e){t.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">'),this.formatValue(t,e[0]),t.out('</div><div class="jsondiffpatch-value jsondiffpatch-right-value">'),this.formatValue(t,e[1]),t.out("</div>")}format_deleted(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out("</div>")}format_moved(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out(`</div><div class="jsondiffpatch-moved-destination">${e[1]}</div>`),t.out('<div class="jsondiffpatch-arrow" style="position: relative; left: -34px;">\n <svg width="30" height="60" style="position: absolute; display: none;">\n <defs>\n <marker id="markerArrow" markerWidth="8" markerHeight="8"\n refx="2" refy="4" stroke="#88f"\n orient="auto" markerUnits="userSpaceOnUse">\n <path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />\n </marker>\n </defs>\n <path d="M30,0 Q-10,25 26,50"\n style="stroke: #88f; stroke-width: 2px; fill: none; stroke-opacity: 0.5; marker-end: url(#markerArrow);"\n ></path>\n </svg>\n </div>'),t.hasArrows=!0}format_textdiff(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatTextDiffString(t,e[0]),t.out("</div>")}}function sS(t){if("number"==typeof t)return t;let e=String(t);const i=[[/&/g,"&amp;"],[/</g,"&lt;"],[/>/g,"&gt;"],[/'/g,"&apos;"],[/"/g,"&quot;"]];for(const t of i)e=e.replace(t[0],t[1]);return e}const rS=function(t){const e=t||document;((t,e,i)=>{const n=t.querySelectorAll(e);for(let t=0,e=n.length;t<e;t++)i(n[t])})(e,".jsondiffpatch-arrow",({parentNode:t,children:e,style:i})=>{const n=t,o=e[0],s=o.children[1];o.style.display="none";const r=n.querySelector(".jsondiffpatch-moved-destination");if(!(r instanceof HTMLElement))return;const a=(({textContent:t,innerText:e})=>t||e)(r),l=n.parentNode;if(!l)return;let c;if((({children:t},e)=>{for(let i=0,n=t.length;i<n;i++){const n=t[i];n&&e(n,i)}})(l,t=>{t.getAttribute("data-key")===a&&(c=t)}),c)try{const t=c.offsetTop-n.offsetTop;o.setAttribute("height",`${Math.abs(t)+6}`),i.top=`${-8+(t>0?0:t)}px`;const e=t>0?`M30,0 Q-10,${Math.round(t/2)} 26,${t-4}`:`M30,${-t} Q-10,${Math.round(-t/2)} 26,4`;s.setAttribute("d",e),o.style.display=""}catch(t){console.debug(`[jsondiffpatch] error adjusting arrows: ${t}`)}})},aS=(t,e)=>((t,e,i)=>{const n=e||document.body,o="jsondiffpatch-unchanged-",s={showing:`${o}showing`,hiding:`${o}hiding`,visible:`${o}visible`,hidden:`${o}hidden`},r=n.classList;if(!r)return;if(!i)return r.remove(s.showing),r.remove(s.hiding),r.remove(s.visible),r.remove(s.hidden),void(!1===t&&r.add(s.hidden));!1===t?(r.remove(s.showing),r.add(s.visible),setTimeout(()=>{r.add(s.hiding)},10)):(r.remove(s.hiding),r.add(s.showing),r.remove(s.hidden));const a=setInterval(()=>{rS(n)},100);setTimeout(()=>{r.remove(s.showing),r.remove(s.hiding),!1===t?(r.add(s.hidden),r.remove(s.visible)):(r.add(s.visible),r.remove(s.hidden)),setTimeout(()=>{r.remove(s.visible),clearInterval(a)},i+400)},i)})(!1,t,e);let lS;const cS=new Ti({objectHash:(t,e)=>t.id||`$$index:${e}`});function hS(t,e){return function(t,e){return lS||(lS=new oS),lS.format(t,e)}(cS.diff(t,e),t)}class uS extends p{constructor(t,e,i,n,o,s){super("Save Configurations",function(t){const{url:e,filename:i,diff:n}=t;return`\n<div class="textae-editor__save-dialog__container">\n <div class="textae-editor__save-dialog__row">\n <label>URL</label>\n <input\n type="text" value="${e}"\n class="textae-editor__save-dialog__url-text">\n <input\n type="button"\n class="textae-editor__save-dialog__url-button"\n ${e?"":'disabled="disabled"'}\n value="Save">\n </div>\n <div class="textae-editor__save-dialog__row">\n <label>Local</label>\n <input\n type="text" value="${i||""}"\n >\n <a class="textae-editor__save-dialog__download-link" href="#">Download</a>\n </div>\n <div class="textae-editor__save-dialog__row">\n <div class="textae-editor__save-dialog__diff-title">\n Configuration differences\n <span class="textae-editor__save-dialog__diff-add-legend">added</span>\n <span class="textae-editor__save-dialog__diff-remove-legend">removed</span>\n </div>\n <div class="textae-editor__save-dialog__diff-viewer">${n}</div>\n </div>\n</div>\n`}({filename:i,url:e,diff:hS(n,o)||"nothing."}),{maxWidth:550}),this._$dialog.on("dialogopen",()=>aS()),function(t,e,i,n,o){c()(e,".textae-editor__save-dialog__url-text","input",t=>{Xs(t.target.nextElementSibling,t.target.value)}),c()(e,".textae-editor__save-dialog__url-text","keyup",t=>{13===t.keyCode&&(o(t.target.value),n())}),c()(e,".textae-editor__save-dialog__url-button","click",t=>{o(t.target.previousElementSibling.value),n()}),c()(e,".textae-editor__save-dialog__download-link","click",e=>{const o=e.target,s=K_(i);o.setAttribute("href",s),o.setAttribute("download",o.previousElementSibling.value),t.emit("textae-event.resource.configuration.save",i),n()})}(t,super.el,o,()=>super.close(),s)}}class dS{#Si;#Vs;constructor(t){t.on("textae-event.original-data.annotation.reset",t=>{t.resourceType===Di.LOCAL_FILE&&(this.#Si=t.id)}).on("textae-event.original-data.configuration.reset",t=>{t.resourceType===Di.LOCAL_FILE&&(this.#Vs=t.id)})}get annotation(){return this.#Si}get configuration(){return this.#Vs}}class fS{#Si;#Vs;constructor(t){t.on("textae-event.original-data.annotation.reset",t=>{t.resourceType===Di.REMOTE_URL&&(this.#Si=t.id)}).on("textae-event.original-data.configuration.reset",t=>{t.resourceType===Di.REMOTE_URL&&(this.#Vs=t.id)})}get annotation(){return this.#Si||""}get configuration(){return this.#Vs||""}}async function pS(t){return new Promise(e=>{const i=new FileReader;i.onload=t=>e(t),i.readAsText(t)})}async function mS(t,e){const i=(await pS(t)).target.result;if(o=t.name,".txt"===Rn().extname(o)){const o=function(t){try{return un.parse(t)}catch{return null}}(i);if(!o){const e=Ri.createFileSource(t.name);return void n().error(`Failed to load annotation from ${e.displayName}.`)}if(o.text)return void e.emit("textae-event.resource.annotation.load.success",Ri.createFileSource(t.name,o))}var o;if(dn(i)){const n=JSON.parse(i);if(n.text)return void e.emit("textae-event.resource.annotation.load.success",Ri.createFileSource(t.name,n))}e.emit("textae-event.resource.annotation.format.error",Ri.createFileSource(t.name))}class gS{#l;#ir;#W;#nr;#or;#sr;#Ws;#Ii;#rr;#ar;constructor(t,e,i,n,o,s,r,a){this.#l=t,this.#ir=e,this.#W=i,this.#nr=n,this.#or=o,this.#sr=s,this.#Ws=r,this.#Ii=a,this.#rr=new fS(t),this.#ar=new dS(t),t.on("textae-event.pallet.import-button.click",()=>this.importConfiguration()).on("textae-event.pallet.upload-button.click",()=>this.uploadConfiguration())}importAnnotation(){new U_("Load Annotations",this.#rr.annotation,t=>this.#ir.loadAnnotation(t),t=>mS(t,this.#l),(t,e)=>function(t,e,i){if("json"===i)dn(e)?Ii(t,JSON.parse(e)):t.emit("textae-event.resource.annotation.format.error",Ri.createInstantSource());else if("inline"===i)try{Ii(t,un.parse(e))}catch{const t=Ri.createInstantSource();n().error(`Failed to load annotation from ${t.displayName}.`)}}(this.#l,t,e),this.#Ws.hasChange).open()}uploadAnnotation(){const t=this.#sr||this.#rr.annotation||"https://pubannotatoin.org/annotations.json";new iS(this.#l,t,this.#ar.annotation,this.#lr,(t,e)=>this.#ir.saveAnnotation(t,this.#lr,e)).open()}saveAnnotation(){this.#ir.saveAnnotation(this.#sr||this.#rr.annotation,this.#lr,"json")}importConfiguration(){new G_("Load Configurations",this.#rr.configuration,t=>this.#ir.loadConfiguration(t),t=>function(t,e){pS(t).then(({target:i})=>{dn(i.result)?e.emit("textae-event.resource.configuration.load.success",Ri.createFileSource(t.name,JSON.parse(i.result))):e.emit("textae-event.resource.configuration.format.error",Ri.createFileSource(t.name))})}(t,this.#l),t=>{dn(t)?this.#l.emit("textae-event.resource.configuration.load.success",Ri.createInstantSource(JSON.parse(t))):this.#l.emit("textae-event.resource.configuration.format.error",Ri.createInstantSource())},this.#Ii.diffOfConfiguration).open()}uploadConfiguration(){const t={...this.#or(),...this.#W.typeDictionary.config};new uS(this.#l,this.#rr.configuration,this.#ar.configuration,this.#or(),t,e=>this.#ir.saveConfiguration(e,t)).open()}get#lr(){const t={...this.#nr(),...this.#W.externalFormat,config:this.#W.typeDictionary.config};return delete t.tracks,t}}class vS{static escape(t){return t.replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}static decode(t){return t.replace(/\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\r/g,"\r")}}function yS(t,e){const i=t.querySelector(`.textae-editor__setting-dialog__${e}-character-add-input`),o=i.value;if(!function(t,e){return e.includes(t)?(n().warning(`${t} is already added.`),!1):!(vS.decode(t).length>1&&(n().warning("Only one character is allowed."),1))}(o,Array.from(t.querySelectorAll(`.textae-editor__setting-dialog__${e}-character`)).map(t=>t.textContent)))return;const s=st`
1053
+ <tr class="textae-editor__setting-dialog__${e}-character-row">
1054
+ <td>
1055
+ <span class="textae-editor__setting-dialog__${e}-character">${o}</span>
1056
+ </td>
1057
+ <td><button class="textae-editor__setting-dialog__${e}-character-delete-button">&times;</button></td>
1058
+ </tr>`;t.querySelector(`.textae-editor__setting-dialog__${e}-character-add-row`).insertAdjacentHTML("afterend",s),i.value=""}function OS(t,e){c()(t,".textae-editor__setting-dialog__line-height-text","change",xs(t=>{e.lineHeight=t.target.value,function(){const t=new Event("resize");window.dispatchEvent(t)}()}))}function bS(t,e,i,n,o,s){!function(t,e,i){c()(t,".textae-editor__setting-dialog__type-gap-text","change",xs(n=>{e.value=Number(n.target.value),t.querySelector(".textae-editor__setting-dialog__line-height-text").value=i.lineHeight}))}(t,i,o),OS(t,o),function(t,e){c()(t,".textae-editor__setting-dialog__lock-config-text","change",xs(t=>{t.target.checked?e.lockEdit():e.unlockEdit()}))}(t,n),function(t,e,i){c()(t,".textae-editor__setting-dialog__function-availability-checkbox","change",xs(({target:t})=>{const n=t.closest(".textae-editor__setting-dialog__function-availability-label").textContent.trim();t.checked?(i.enable(n),e.emit("textae-event.configuration.reset")):(i.disable(n),e.emit("textae-event.configuration.reset"))}))}(t,e,s)}const xS=new(so())({verbose:!0});ao()(xS,["uri-reference","regex"]);const wS=xS.compile(lo);function _S(t){wS(t)||console.warn(wS.errors)}function SS(t){const e=vS.escape(t);return ot()(e)}function kS(t){const{typeGap:e,typeGapDisabled:i,lineHeight:n,autocompletionWs:o,typeDictionaryLocked:s,delimiterCharacters:r,blankCharacters:a,functionAvailability:l,version:c}=t;return st`
1059
+ <div class="textae-editor__setting-dialog__container">
1060
+ <div class="textae-editor__setting-dialog__row">
1061
+ <label>Type Gap</label>
1062
+ <input
1063
+ type="number"
1064
+ class="textae-editor__setting-dialog__type-gap-text"
1065
+ step="1"
1066
+ min="0"
1067
+ max="5"
1068
+ value="${e}" ${i?'disabled="disabled"':""}>
1069
+ </div>
1070
+ <div class="textae-editor__setting-dialog__row">
1071
+ <label>Line Height(px)</label>
1072
+ <input
1073
+ type="number" class="textae-editor__setting-dialog__line-height-text"
1074
+ step="1"
1075
+ min="50"
1076
+ max="500"
1077
+ value="${n}">
1078
+ </div>
1079
+ <div class="textae-editor__setting-dialog__row">
1080
+ <label>Autocompletion_ws</label>
1081
+ <input
1082
+ type="text"
1083
+ class="textae-editor__setting-dialog__autocompletion_ws-text"
1084
+ value="${o}">
1085
+ </div>
1086
+ <div class="textae-editor__setting-dialog__details">
1087
+ <details>
1088
+ <summary>Delimiter Characters</summary>
1089
+ <table>
1090
+ <tr class="textae-editor__setting-dialog__delimiter-character-add-row">
1091
+ <td><input class="textae-editor__setting-dialog__delimiter-character-add-input" type="text"></td>
1092
+ <td><button class="textae-editor__setting-dialog__delimiter-character-add-button">+</button></td>
1093
+ </tr>
1094
+ ${()=>r.slice().reverse().map(t=>function(t){return`\n<tr class="textae-editor__setting-dialog__delimiter-character-row">\n <td>\n <span class="textae-editor__setting-dialog__delimiter-character">${SS(t)}</span>\n </td>\n <td><button class="textae-editor__setting-dialog__delimiter-character-delete-button">&times;</button></td>\n</tr>`}(t)).join("")}
1095
+ </table>
1096
+ </details>
1097
+ </div>
1098
+ <div class="textae-editor__setting-dialog__details">
1099
+ <details>
1100
+ <summary>Non-edge Characters</summary>
1101
+ <table>
1102
+ <tr class="textae-editor__setting-dialog__blank-character-add-row">
1103
+ <td><input class="textae-editor__setting-dialog__blank-character-add-input" type="text"></td>
1104
+ <td><button class="textae-editor__setting-dialog__blank-character-add-button">+</button></td>
1105
+ </tr>
1106
+ ${()=>a.slice().reverse().map(t=>function(t){return`\n<tr class="textae-editor__setting-dialog__blank-character-row">\n <td>\n <span class="textae-editor__setting-dialog__blank-character">${SS(t)}</span>\n </td>\n <td><button class="textae-editor__setting-dialog__blank-character-delete-button">&times;</button></td>\n</tr>`}(t)).join("")}
1107
+ </table>
1108
+ </details>
1109
+ </div>
1110
+ <div class="textae-editor__setting-dialog__details">
1111
+ <details>
1112
+ <summary>Function Availability</summary>
1113
+ <div class="textae-editor__setting-dialog__function-availability-list">
1114
+ ${()=>l.names.map(t=>function(t,e){return`\n<label class="textae-editor__setting-dialog__function-availability-label">\n <input\n type="checkbox"\n class="textae-editor__setting-dialog__function-availability-checkbox"\n ${t.isAvailable(e)?'checked="checked"':""}>\n ${e}\n</label>`}(l,t)).join("")}
1115
+ </div>
1116
+ </details>
1117
+ </div>
1118
+ <div class="textae-editor__setting-dialog__row">
1119
+ <label>
1120
+ <input
1121
+ type="checkbox"
1122
+ class="textae-editor__setting-dialog__lock-config-text"
1123
+ ${s?'checked="checked"':""}>
1124
+ Lock Edit Config
1125
+ </label>
1126
+ </div>
1127
+ <div class="textae-editor__setting-dialog__row">
1128
+ <label>Version ${c}</label>
1129
+ </div>
1130
+ </div>
1131
+ `}class $S extends p{constructor(e,i,n,o,s,r){super("Setting",kS({typeGapDisabled:!n.show,typeGap:n.value,lineHeight:o.lineHeight,autocompletionWs:i.autocompletionWs,typeDictionaryLocked:i.isLock,delimiterCharacters:s.delimiterCharacters,blankCharacters:s.blankCharacters,functionAvailability:r,version:t})),bS(super.el,e,n,i,o,r),c()(super.el,".textae-editor__dialog","keyup",t=>{13===t.keyCode&&super.close()}),function(t){c()(t,".textae-editor__setting-dialog__delimiter-character-add-button","click",()=>yS(t,"delimiter")),c()(t,".textae-editor__setting-dialog__blank-character-add-button","click",()=>yS(t,"blank"))}(super.el),function(t){c()(t,".textae-editor__setting-dialog__delimiter-character-delete-button","click",({target:t})=>{t.closest(".textae-editor__setting-dialog__delimiter-character-row").remove()}),c()(t,".textae-editor__setting-dialog__blank-character-delete-button","click",({target:t})=>{t.closest(".textae-editor__setting-dialog__blank-character-row").remove()})}(super.el),f()(this.el).on("dialogclose",()=>{!function(t,e){const i=t.querySelector(".textae-editor__setting-dialog__autocompletion_ws-text").value;_S({autocompletion_ws:i}),e.autocompletionWs=i}(super.el,i),function(t,e){const i=t.querySelectorAll(".textae-editor__setting-dialog__delimiter-character"),n=Array.from(i).map(t=>vS.decode(t.textContent)).reverse(),o=t.querySelectorAll(".textae-editor__setting-dialog__blank-character"),s=Array.from(o).map(t=>vS.decode(t.textContent)).reverse(),r={"delimiter characters":Array.from(n),"non-edge characters":Array.from(s)};_S(r),e.set(r)}(super.el,s)})}}class TS{constructor(t,e){this._editorHTMLElement=t,this._selectionModel=e}left(t){const e=this._searchLeft(".textae-editor__span");if(e)return void(t?this._selectionModel.add("span",[e.id]):this._selectionModel.selectSpan(e.id));const i=this._searchLeft(".textae-editor__grid .textae-editor__signboard");i&&(t?this._selectionModel.add("entity",[i.dataset.id]):this._selectionModel.selectEntity(i.dataset.id))}right(t){const e=this._searchRight(".textae-editor__span");if(e)return void(t?this._selectionModel.add("span",[e.id]):this._selectionModel.selectSpan(e.id));const i=this._searchRight(".textae-editor__grid .textae-editor__signboard");i&&(t?this._selectionModel.add("entity",[i.dataset.id]):this._selectionModel.selectEntity(i.dataset.id))}_searchLeft(t){const e=this._editorHTMLElement.querySelectorAll(t),i=[...e].findIndex(t=>t.classList.contains("ui-selected")||t.classList.contains("textae-editor__signboard--selected"));if(i>0)return e[i-1]}_searchRight(t){const e=this._editorHTMLElement.querySelectorAll(t),i=[...e].reverse().findIndex(t=>t.classList.contains("ui-selected")||t.classList.contains("textae-editor__signboard--selected"));if(e.length-i>0)return e[e.length-i]}}class CS{constructor(t,e){this._editorHTMLElement=t,this._selectionModel=e}up(){if(this._selectionModel.span.single){const t=this._selectionModel.span.single.gridElement.querySelector(".textae-editor__signboard");this._selectionModel.selectEntity(t.dataset.id)}}down(){const t=this._editorHTMLElement.querySelector(".textae-editor__signboard--selected");if(t){const e=t.closest(".textae-editor__grid").id.substring(1);this._selectionModel.selectSpan(e)}}}class PS{#Z;#l;#Ji;#tn;#W;#Ii;#Eo;#ps;#As;#cr;#hr;#ur;#dr;constructor(t,e,i,n,o,s,r,a,l,c){e.on("textae-event.edit-mode.transition",()=>{i.entityInstanceContainer.declarifyLabelOfAll(),n.removeAll(),jr(t.querySelector(".textae-editor__text-box")),e.emit("textae-event.editor.selected-text.change")}),this.#Z=t,this.#l=e,this.#Ji=o,this.#tn=n,this.#W=i,this.#Ii=l,this.#Eo=s,this.#ps=r,this.#As=a,this.#cr=new TS(t,n),this.#hr=new CS(t,n),this.#ur=!1,this.#dr=c,L(this,()=>this.#As,["copyEntitiesToLocalClipboard","copyEntitiesToSystemClipboard","cutEntitiesToLocalClipboard","cutEntitiesToSystemClipboard","pasteEntitiesFromLocalClipboard","pasteEntitiesFromSystemClipboard"]),L(this,()=>this.#Ii,["toggleButton"])}removeSelectedElements(){const t=this.#Ji.factory.removeSelectedCommand();this.#cr.right(null),this.#Ji.invoke(t)}createEntity(){const t=this.#Ji.factory.createDefaultTypeEntityToSelectedSpansCommand(this.#W.typeDictionary.denotation.defaultType);t.isEmpty||this.#Ji.invoke(t)}replicate(){const t=Dr(this.#Ii,this.#Eo);this.#tn.span.single?this.#Ji.invoke(this.#Ji.factory.replicateSpanCommand(this.#tn.span.single,this.#tn.span.single.entities.map(t=>t.typeValues),t)):n().warning("You can replicate span annotation when there is only span selected.")}cancelSelect(){this.#dr.hidePallet(),this.#tn.removeAll(),this.#Z.focus()}showSettingDialog(){new $S(this.#l,this.#W.typeDictionary,this.#W.typeGap,this.#W.textBox,this.#Eo,this.#ps).open()}get isActive(){return this.#ur}activate(){this.#Z.classList.add("textae-editor--active"),this.#ur=!0}deactivate(){this.#Z.classList.remove("textae-editor--active"),this.#l.emit("textae-event.editor.unselect"),this.#ur=!1}selectLeft(t){this.#dr.isTypeValuesPalletShown?this.#dr.selectLeftAttributeTab():this.#cr.left(t)}selectRight(t){this.#dr.isTypeValuesPalletShown?this.#dr.selectRightAttributeTab():this.#cr.right(t)}selectUp(){this.#dr.isEditDenotation&&this.#hr.up()}selectDown(){this.#dr.isEditDenotation&&this.#hr.down()}applyTextSelectionWithTouchDevice(){this.#ur&&this.#dr.applyTextSelectionWithTouchDevice()}}const ES={"delimiter characters":[" ",".","!","?",",",":",";","-","/","&","(",")","{","}","[","]","+","*","\\",'"',"'","\n","–"],"non-edge characters":[" ","\n"]};class AS{#fr;#pr;constructor(){this.#fr=[],this.#pr=[]}get delimiterCharacters(){return this.#fr}get blankCharacters(){return this.#pr}set(t){const e={...ES,...t};return this.#fr=e["delimiter characters"],this.#pr=e["non-edge characters"],t}isDelimiter(t){return this.#fr.indexOf("ANY")>=0?1:this.#fr.indexOf(t)>=0}isBlankCharacter(t){return this.#pr.indexOf(t)>=0}removeBlankCharacters(t){for(const e of this.#pr)t=t.replaceAll(e,"");return t}}class MS{#mr;#W;#Cn;#Qn;#gr;constructor(t,e,i,o,s,r,a){this.#W=s;const l=new AS,c=new bs(t,e,o,s,a),h=new mo(o,c,a,s.denotationDefinitionContainer,s.attributeDefinitionContainer,s.typeDictionary),u=new ya(o,t,r.statusBar),d=new xn(o,u,s),f=new Vr,p=new Wr(s.relationInstanceContainer,o,f);this.#Cn=p;const m=new ma(o,a,h,d,u,s.typeDictionary,f,p),g=Zr.createTermEditMode(t,o,s,a,l,c,m,i),v=Zr.createBlockEditMode(t,o,s,a,l,c,m,i),y=Zr.createRelationEditMode(t,o,s,a,c,m,i),O=Zr.createTextEditMode(t,s,l,m,c),b=Zr.createViewMode(t,o,s,l,m);this.#Qn=b;const x=new ws(p,g,v,y,O,b,o),w=new Fr(r,p,s.relationInstanceContainer,()=>x.hidePallet());o.on("textae-event.annotation-data.all.change",t=>{r.isEditMode&&t&&n().success("track annotations have been merged to root annotations."),w.reset()}),this.#gr=w;const _=new PS(t,o,s,a,c,l,f,h,m,x),S=new Xn(o),k=new gS(o,S,s,()=>u.annotation,()=>u.configuration,r.saveTo,d,m);new qn(o,m,k,r.saveTo,d),new qr(t,o,s,g,v,y,O),function(t,e,i,o,s,r,a,l){t.on("textae-event.resource.annotation.load.success",c=>{if(!c.data.config&&e.config)i.loadConfiguration(e.config,c);else{if(po(c.data),c.data.config&&"object"!=typeof c.data.config)return void n().error("configuration in annotation file is invalid.");const i=fo(c.data,c.data.config);if(i){if(Hn(t,i,o,s,r,c.data,a),e.isFocusFirstDenotation){const t=r.spanInstanceContainer.allDenotationSpans.at(0);t&&t.focus()}l.annotation=c}}}).on("textae-event.resource.configuration.load.success",(e,i=null)=>{if("object"!=typeof e.data)return void n().error(`${e.displayName} is not a configuration file or its format is invalid.`);i&&po(i.data);const c=i&&i.data||{...l.annotation,...r.externalFormat},h=fo(c,e.data);h&&(Hn(t,h,o,s,r,c,a),i&&(l.annotation=i),l.configuration=e)})}(o,r,S,m,l,s,f,u);const $=new Yr(c,_,k,m,s,x,w),T=new Mn(o,m,$).el;switch(t.insertBefore(T,t.childNodes[0]),r.control){case"hidden":t.classList.add("textae-editor--control-hidden");break;case"visible":t.classList.add("textae-editor--control-visible");break;default:r.isEditMode||t.classList.add("textae-editor--control-hidden")}s.toolBarHeight=T.getBoundingClientRect().height,function(t,e,i,o,s,r,a,l){switch(a.resourceType){case Di.QUERY_PARAMETER:{const c=a.annotation();c?Ur(t,Ri.createParameterSource(c),a.config,o,s,e,i,l,r):n().error("failed to load annotation from query parameter.");break}case Di.INLINE:{const c=a.annotation();c?Ur(t,Ri.createInlineSource(c),a.config,o,s,e,i,l,r):n().error("failed to load annotation from directly included in the div element.");break}case Di.REMOTE_URL:o.loadAnnotation(a.annotationURL);break;default:a.config?o.loadConfiguration(a.config):Hn(t,r.defaultConfiguration,s,e,i,r.defaultAnnotation,l)}}(o,l,s,S,m,u,r,f);const C=new $n(t,m,$);t.appendChild(C.el),t.addEventListener("keyup",t=>{C.hide(),_.isActive&&new Gr(c,_,k,f,x,w).handle(t)}),L(this,()=>_,["copyEntitiesToSystemClipboard","cutEntitiesToSystemClipboard","pasteEntitiesFromSystemClipboard","activate","deactivate","applyTextSelectionWithTouchDevice"]),this.#mr=C}showContextMenu(t){this.#mr.show(t)}hideContextMenu(){this.#mr.hide()}focusDenotation(t){this.#gr.toTermEditMode(),this.#W.focusDenotation(t)}getSelectedText(){return this.#Cn.currentState===gn?this.#Qn.selectedText:{status:"unselected"}}}class QS{#rt;#W;#l;#vr;#yr;#Or;#br;constructor(t,e,i,o,s){t.tabIndex=-1,Qi()&&t.classList.add("textae-editor--android"),function(t){t.addEventListener("mousedown",t=>{t.shiftKey&&t.preventDefault()}),c()(t,".textae-editor__signboard","mousedown",t=>t.preventDefault())}(t);const r=new _.EventEmitter;!function(t){t.on("textae-event.resource.annotation.format.error",({displayName:t})=>n().error(`${t} is not a annotation file or its format is invalid.`)).on("textae-event.resource.configuration.format.error",({displayName:t})=>n().error(`${t} is not a configuration file or its format is invalid.!`)).on("textae-event.annotation-data.all.change",(t,e)=>{e.some(t=>t.hasError)&&new Hi(e).open()}).on("textae-event.annotation-data.events-observer.unsaved-change",t=>{window.onbeforeunload=Qi()||t?()=>!0:null}),t.on("textae-event.clip-board.change",(t,e)=>{for(const e of t)e.startCut();for(const t of e)t.cancelCut()}),t.on("textae-event.commander.attributes.change",t=>{for(const e of t.reduce((t,e)=>t.add(e.subjectInstance),new Set))e.updateElement()})}(r);const a=new Xe(t);!function(t,e){t.on("textae-event.resource.startLoad",()=>e.startWait()).on("textae-event.resource.endLoad",()=>e.endWait()).on("textae-event.resource.startSave",()=>e.startWait()).on("textae-event.resource.endSave",()=>e.endWait())}(r,a);const l=new pn(t),h=new We(e,t,r,a,o,s,"true"===l.configLock,l.additionalPaddingTop);this.#rt=t,this.#W=h,this.#l=r;const u=new Ui(r,h);if(this.#br=new MS(t,e,i,r,h,l,u),l.inspect){const t=t=>{const e=document.querySelector(`#${l.inspect}`);e&&(e.textContent=JSON.stringify(t,null,2))};this.#xr(t)}this.#Or=this.#wr(h,t),L(this,()=>this.#br,["copyEntitiesToSystemClipboard","cutEntitiesToSystemClipboard","pasteEntitiesFromSystemClipboard","activate","deactivate","applyTextSelectionWithTouchDevice","showContextMenu","hideContextMenu","focusDenotation"]),L(this,()=>u,["selectDenotation"]),L(this,()=>h,["drawGridsInSight","reLayout"])}updateDenotationEntitiesWidth(){for(const t of this.#W.spanInstanceContainer.allDenotationSpans)t.updateDenotationEntitiesWidth()}load(t){Ii(this.#l,t)}setInspector(t){this.#vr&&(this.#vr.dispose(),this.#vr=null),"function"==typeof t&&(this.#vr=this.#xr(t))}setLastSelectedDenotationIDCallback(t){this.#yr&&(this.#yr.dispose(),this.#yr=null),"function"==typeof t&&(this.#yr=new qe(this.#l,["textae-event.selection-model.last-selected-denotation-id.change"],t))}setAutocompletionFunction(t){if("function"!=typeof t)throw new TypeError("autocompletionFunction must be a function");this.#W.autocompletionFunction=t}get HTMLElementID(){return this.#rt.id}dispose(){for(const t of this.#Or)t.dispose()}focusDenotation(t){if(!this.#W.denotations.has(t))throw new Error(`Denotation ${t} not found`);this.#br.focusDenotation(t)}#wr(t,e){const i=new Set,n=()=>t.drawGridsInSight(),o=new Fe(e,"scroll",n);i.add(o);const s=e.closest(".textae-container");if(s){const t=new Fe(s,"scroll",n);i.add(t)}return i}#xr(t){const e=function(t){let e=t;return function(t,i){Mi(e,t)&&(e=t,i(t))}}(this.#_r);return new qe(this.#l,["textae-event.annotation-data.events-observer.change","textae-event.editor.selected-text.change"],()=>e(this.#_r,t))}get#_r(){return{...this.#W.externalFormat,selectedText:this.#br.getSelectedText()}}}function DS(t,e){const i=function(t,e){return new QS(t,e.nextID,e.mousePoint,()=>{for(const t of document.querySelectorAll(".ui-dialog"))t.classList.add("textae-editor--wait");for(const t of document.querySelectorAll(".ui-widget-overlay"))t.classList.add("textae-editor--wait")},()=>{for(const t of document.querySelectorAll(".ui-dialog"))t.classList.remove("textae-editor--wait");for(const t of document.querySelectorAll(".ui-widget-overlay"))t.classList.remove("textae-editor--wait")})}(e,t);return t.registerEditor(e,i),e.dataset.textaeInitialized=!0,i}const RS=new class{#Sr;#kr;#uo;constructor(){this.#Sr=new O,this.#kr=new w,this.#uo=b,window.addEventListener("load",()=>{return t=this.#Sr,document.body.addEventListener("focus",e=>{const i=e.target.closest(".textae-editor");i&&(t.selected&&t.selected!==i&&(t.selected=null),t.selected=i)},!0),document.body.addEventListener("click",e=>{null===e.target.closest(".textae-editor__dialog")&&null===e.target.closest(".ui-autocomplete")&&null===e.target.closest(".ui-widget-overlay")&&null===e.target.closest(".textae-editor__pallet__content")&&(t.has(e.target.closest(".textae-editor"))||t.selected&&(t.selected=null))}),void new MutationObserver(e=>{for(const i of e)if("childList"===i.type)for(const e of i.removedNodes)if(e instanceof HTMLElement){e.classList.contains("textae-editor")&&t.remove(e);for(const i of e.querySelectorAll(".textae-editor"))t.remove(i)}}).observe(document.body,{childList:!0,subtree:!0});var t}),window.addEventListener("resize",r()(()=>{this.#Sr.reLayout(),this.#Sr.drawGridsInSight(),this.#Sr.updateDenotationEntitiesWidth()},500))}get nextID(){return this.#Sr.nextID}get mousePoint(){return this.#uo}registerEditor(t,e){this.#kr.setObserver(t),this.#Sr.set(t,e)}};function IS(){return n().set("notifier","position","top-right"),Array.from(document.querySelectorAll(".textae-editor")).filter(t=>!t.dataset.textaeInitialized).map(t=>DS(RS,t)).map(t=>new o(t))}document.addEventListener("DOMContentLoaded",IS),window.initializeTextAEEditor=IS,console.log(`TextAE Version ${t} loaded.`)})()})();